Skip to content

Commit

Permalink
Add missing virtual calls to UIList methods (#80)
Browse files Browse the repository at this point in the history
* Add missing virtual calls to UIList methods

* Add missing virtual call in UICheckBox::Draw
  • Loading branch information
pryon authored Nov 12, 2023
1 parent d6b7fec commit 6442923
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/uilib/uicheckbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ UICheckBox::UICheckBox()

void UICheckBox::Draw()
{
UpdateData();

if (!m_depressed)
{
Draw3DBox(0.0f, 0.0f, m_frame.size.width, m_frame.size.height, 0, m_border_color, m_local_alpha);
Expand Down
7 changes: 7 additions & 0 deletions code/uilib/uilist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ void UIList::Draw
)

{
UpdateUIElement();

// draw the item text
if (m_currentItem)
{
Expand Down Expand Up @@ -197,11 +199,14 @@ void UIList::Pressed
float mouse_ypos = ev->GetFloat(2);
int buttons = ev->GetInteger(3); // unused

FrameInitialized();

// previous arrow is clicked
if (m_prev_arrow_region->contains(mouse_xpos, mouse_ypos))
{
m_prev_arrow_depressed = qtrue;
ScrollPrev();
UpdateData();
return;
}

Expand All @@ -210,6 +215,7 @@ void UIList::Pressed
{
m_next_arrow_depressed = qtrue;
ScrollNext();
UpdateData();
}
}

Expand Down Expand Up @@ -305,6 +311,7 @@ void UIList::UpdateUIElement
if (!cvarstring)
{
m_currentItem = 1;
UpdateData();
return;
}

Expand Down

0 comments on commit 6442923

Please sign in to comment.