diff options
author | rubidium <rubidium@openttd.org> | 2008-05-10 13:46:36 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-10 13:46:36 +0000 |
commit | 2ac412375c68db4d037cd5de243eb7e9d1f504b7 (patch) | |
tree | 03bcd6a5e6e6fd5771fa462f05a599c97c6a9661 /src/osk_gui.cpp | |
parent | f7108760378c98077b1c664939d0e2c32a21624f (diff) | |
download | openttd-2ac412375c68db4d037cd5de243eb7e9d1f504b7.tar.xz |
(svn r13029) -Codechange: more work in the road to getting the WP macros and byte[WINDOW_CUSTOM_SIZE] removed. This step changes the event handling to work directly on the Window class instead of via a function pointer and big switches while keeping backward compatability while we're rewriting the Windows to the new scheme.
Diffstat (limited to 'src/osk_gui.cpp')
-rw-r--r-- | src/osk_gui.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index 681762e08..f92bb16b0 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -157,11 +157,7 @@ static void OskWndProc(Window *w, WindowEvent *e) if (qs->orig == NULL || strcmp(qs->text.buf, qs->orig) != 0) { /* pass information by simulating a button press on parent window */ if (WP(w, osk_d).ok_btn != 0) { - Window *parent = w->parent; - WindowEvent e; - e.event = WE_CLICK; - e.we.click.widget = WP(w, osk_d).ok_btn; - parent->HandleWindowEvent(&e); + w->parent->OnClick(e->we.click.pt, WP(w, osk_d).ok_btn); } } delete w; @@ -169,11 +165,7 @@ static void OskWndProc(Window *w, WindowEvent *e) case OSK_WIDGET_CANCEL: if (WP(w, osk_d).cancel_btn != 0) { // pass a cancel event to the parent window - Window *parent = w->parent; - WindowEvent e; - e.event = WE_CLICK; - e.we.click.widget = WP(w, osk_d).cancel_btn; - parent->HandleWindowEvent(&e); + w->parent->OnClick(e->we.click.pt, WP(w, osk_d).cancel_btn); } else { // or reset to original string strcpy(qs->text.buf, WP(w, osk_d).orig); UpdateTextBufferSize(&qs->text); |