Skip to content

Commit

Permalink
Enable wheel scrolling in multiline edit GUI controls
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue committed Jan 25, 2025
1 parent e43be4b commit 4205d82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIMultiLineEditCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,17 @@ void pfGUIMultiLineEditCtrl::HandleMouseHover(hsPoint3& mousePt, uint8_t modi
}
}

//// HandleMouseWheel /////////////////////////////////////////////////////////

void pfGUIMultiLineEditCtrl::HandleMouseWheel(hsPoint3& mousePt, uint8_t modifiers)
{
hsPoint3 mouseXY(mousePt.fX, mousePt.fY, 0.f);
if (IHandleMouse(mouseXY)) {
float delta = -1 * (mousePt.fZ / 120);
SetScrollPosition(int32_t(fScrollPos + delta));
}
}

//// IGetDesiredCursor /////////////////////////////////////////////////////////

uint32_t pfGUIMultiLineEditCtrl::IGetDesiredCursor() const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class pfGUIMultiLineEditCtrl : public pfGUIControlMod
void HandleMouseUp(hsPoint3 &mousePt, uint8_t modifiers) override;
void HandleMouseDrag(hsPoint3 &mousePt, uint8_t modifiers) override;
void HandleMouseHover(hsPoint3& mousePt, uint8_t modifiers) override;
void HandleMouseWheel(hsPoint3& mousePt, uint8_t modifiers) override;

bool HandleKeyPress(wchar_t key, uint8_t modifiers) override;
bool HandleKeyEvent(pfGameGUIMgr::EventType event, plKeyDef key, uint8_t modifiers) override;
Expand Down

0 comments on commit 4205d82

Please sign in to comment.