added scrollbar to NativeLookEditor

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@223 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-03-21 23:40:17 +00:00
parent 0c6068d6a2
commit 3f0c284a50
24 changed files with 204 additions and 96 deletions
+8 -4
View File
@@ -307,18 +307,19 @@ void DropDownList::onMotion(wxMouseEvent& ev) {
// ----------------------------------------------------------------------------- : DropDownList : Parent events
void DropDownList::onMouseInParent(wxMouseEvent& ev, bool open_in_place) {
bool DropDownList::onMouseInParent(wxMouseEvent& ev, bool open_in_place) {
if (IsShown()) hide(false);
else show(open_in_place, wxPoint(ev.GetX(), ev.GetY()));
return true;
}
void DropDownList::onCharInParent(wxKeyEvent& ev) {
bool DropDownList::onCharInParent(wxKeyEvent& ev) {
// keyboard codes
int k = ev.GetKeyCode();
if (IsShown()) {
if (open_sub_menu) {
// sub menu always takes keys
open_sub_menu->onCharInParent(ev);
return open_sub_menu->onCharInParent(ev);
} else {
switch (k) {
case WXK_UP:
@@ -356,15 +357,18 @@ void DropDownList::onCharInParent(wxKeyEvent& ev) {
selected_item = index;
showSubMenu();
Refresh(false);
return;
return true;
}
}
}
}
return true;
} else if (k==WXK_SPACE || k==WXK_RETURN || k==WXK_DOWN) {
// drop down list is not shown yet, show it now
show(false, wxPoint(0,0));
return true;
}
return false;
}
// ----------------------------------------------------------------------------- : DropDownList : Event table