diff options
Diffstat (limited to 'plugingui')
-rw-r--r-- | plugingui/eventhandler.cc | 6 | ||||
-rw-r--r-- | plugingui/filebrowser.h | 2 | ||||
-rw-r--r-- | plugingui/listbox.cc | 53 | ||||
-rw-r--r-- | plugingui/nativewindow_win32.cc | 2 |
4 files changed, 28 insertions, 35 deletions
diff --git a/plugingui/eventhandler.cc b/plugingui/eventhandler.cc index 017434e..1953da2 100644 --- a/plugingui/eventhandler.cc +++ b/plugingui/eventhandler.cc @@ -64,9 +64,6 @@ extern GUI::Window *gwindow; #include "window.h" LRESULT CALLBACK dialogProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { - static int last_x = 0; - static int last_y = 0; - GUI::EventHandler *handler = (GUI::EventHandler *) GetWindowLong(hwnd, GWL_USERDATA); @@ -119,9 +116,6 @@ LRESULT CALLBACK dialogProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) e->x = (int)(short) LOWORD(lp); e->y = (int)(short) HIWORD(lp); handler->event = e; - - last_x = e->x; - last_y = e->y; } break; diff --git a/plugingui/filebrowser.h b/plugingui/filebrowser.h index 2402c23..4cd5799 100644 --- a/plugingui/filebrowser.h +++ b/plugingui/filebrowser.h @@ -68,8 +68,8 @@ private: #ifdef WIN32 // Only used on win32 - GUI::Label lbl_drive; GUI::ComboBox drv; + GUI::Label lbl_drive; #endif }; diff --git a/plugingui/listbox.cc b/plugingui/listbox.cc index 40f8a2a..45ea5f5 100644 --- a/plugingui/listbox.cc +++ b/plugingui/listbox.cc @@ -84,7 +84,7 @@ void GUI::ListBox::addItem(std::string name, std::string value) } } - if(selected == -1) setSelection(items.size() - 1); + if(selected == -1) setSelection((int)items.size() - 1); } void GUI::ListBox::clear() @@ -180,8 +180,8 @@ void GUI::ListBox::scrollEvent(ScrollEvent *e) { scroll_offset += e->delta; if(scroll_offset < 0) scroll_offset = 0; - if(scroll_offset > (items.size() - 1)) - scroll_offset = (items.size() - 1); + if(scroll_offset > ((int)items.size() - 1)) + scroll_offset = ((int)items.size() - 1); repaintEvent(NULL); } @@ -207,12 +207,12 @@ void GUI::ListBox::keyEvent(GUI::KeyEvent *e) int numitems = height() / (font.textHeight() + padding); marked++; - if(marked > (items.size() - 1)) marked = items.size() - 1; + if(marked > ((int)items.size() - 1)) marked = (int)items.size() - 1; if(marked > (scroll_offset + numitems - 1)) { scroll_offset = marked - numitems + 1; - if(scroll_offset > (items.size() - 1)) - scroll_offset = (items.size() - 1); + if(scroll_offset > ((int)items.size() - 1)) + scroll_offset = ((int)items.size() - 1); } } break; @@ -228,11 +228,11 @@ void GUI::ListBox::keyEvent(GUI::KeyEvent *e) // Number of items that can be displayed at a time. int numitems = height() / (font.textHeight() + padding); - marked = items.size() - 1; + marked = (int)items.size() - 1; if(marked > (scroll_offset + numitems - 1)) { scroll_offset = marked - numitems + 1; - if(scroll_offset > (items.size() - 1)) - scroll_offset = (items.size() - 1); + if(scroll_offset > ((int)items.size() - 1)) + scroll_offset = ((int)items.size() - 1); } } break; @@ -255,25 +255,24 @@ void GUI::ListBox::keyEvent(GUI::KeyEvent *e) void GUI::ListBox::buttonEvent(ButtonEvent *e) { - if(e->x > (width() - btn_size) && e->y < (width() - 1)) { - if(e->y > 0 && e->y < btn_size) { - if(e->direction == -1) return; - scroll_offset--; - if(scroll_offset < 0) scroll_offset = 0; - repaintEvent(NULL); - return; - } - - if(e->y > (height() - btn_size) && e->y < (height() - 1)) { - if(e->direction == -1) return; - scroll_offset++; - if(scroll_offset > (items.size() - 1)) - scroll_offset = (items.size() - 1); - repaintEvent(NULL); - return; - } + if(e->x > ((int)width() - btn_size) && e->y < ((int)width() - 1)) { + if(e->y > 0 && e->y < btn_size) { + if(e->direction == -1) return; + scroll_offset--; + if(scroll_offset < 0) scroll_offset = 0; + repaintEvent(NULL); + return; } - + + if(e->y > ((int)height() - btn_size) && e->y < ((int)height() - 1)) { + if(e->direction == -1) return; + scroll_offset++; + if(scroll_offset > ((int)items.size() - 1)) + scroll_offset = ((int)items.size() - 1); + repaintEvent(NULL); + return; + } + } if(e->direction == -1) { int skip = scroll_offset; diff --git a/plugingui/nativewindow_win32.cc b/plugingui/nativewindow_win32.cc index 8a0b912..34e18fa 100644 --- a/plugingui/nativewindow_win32.cc +++ b/plugingui/nativewindow_win32.cc @@ -79,7 +79,7 @@ GUI::NativeWindowWin32::NativeWindowWin32(GlobalContext *gctx, wndId = 0; // } - gctx->m_hwnd = CreateWindowEx(NULL/*ex_style*/, gctx->m_className, + gctx->m_hwnd = CreateWindowEx(0/*ex_style*/, gctx->m_className, "DGBasisWidget", (WS_OVERLAPPEDWINDOW | WS_VISIBLE), window->x(), window->y(), |