mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Scroll wheel in native look editor now scrolls window under cursor
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@226 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -131,10 +131,16 @@ void NativeLookEditor::onScroll(wxScrollWinEvent& ev) {
|
||||
}
|
||||
}
|
||||
void NativeLookEditor::onMouseWheel(wxMouseEvent& ev) {
|
||||
if (current_editor) {
|
||||
bool scrolled = current_editor->onMouseWheel(mousePoint(ev), ev);
|
||||
if (scrolled) return;
|
||||
// send scroll event to field under cursor
|
||||
RealPoint pos = mousePoint(ev);
|
||||
FOR_EACH_EDITOR_REVERSE { // find high z index fields first
|
||||
if (v->containsPoint(pos) && v->getField()->editable) {
|
||||
bool scrolled = e->onMouseWheel(mousePoint(ev), ev);
|
||||
if (scrolled) return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// scroll entire window
|
||||
int toScroll = 10 * ev.GetWheelRotation() * ev.GetLinesPerAction() / ev.GetWheelDelta(); // note: up is positive
|
||||
int y = GetScrollPos(wxVERTICAL);
|
||||
scrollTo(wxVERTICAL, y - toScroll);
|
||||
|
||||
@@ -45,6 +45,8 @@ void SetInfoPanel::initUI(wxToolBar* tb, wxMenuBar* mb) {
|
||||
menuFormat->Append(ID_FORMAT_SYMBOL, _("symbol"), _MENU_("symbols"), _HELP_("symbols"), wxITEM_CHECK);
|
||||
menuFormat->Append(ID_FORMAT_REMINDER, _("reminder"), _MENU_("reminder text"), _HELP_("reminder text"), wxITEM_CHECK);
|
||||
mb->Insert(2, menuFormat, _MENU_("format"));
|
||||
// focus on editor
|
||||
editor->SetFocus();
|
||||
}
|
||||
|
||||
void SetInfoPanel::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
|
||||
|
||||
Reference in New Issue
Block a user