implement more functionality

* update TODO
* rework UISpinBox
* restore move of stackable items and with horizontal scrollbar
* implement classic control look
This commit is contained in:
Eduardo Bart
2012-03-29 10:45:40 -03:00
parent 15fce6d4cf
commit 47e7eef716
16 changed files with 142 additions and 152 deletions

View File

@@ -484,6 +484,7 @@ void Application::registerLuaFunctions()
g_lua.bindClassStaticFunction("g_window", "getMousePosition", std::bind(&PlatformWindow::getMousePosition, &g_window));
g_lua.bindClassStaticFunction("g_window", "getKeyboardModifiers", std::bind(&PlatformWindow::getKeyboardModifiers, &g_window));
g_lua.bindClassStaticFunction("g_window", "isKeyPressed", std::bind(&PlatformWindow::isKeyPressed, &g_window, _1));
g_lua.bindClassStaticFunction("g_window", "isMouseButtonPressed", std::bind(&PlatformWindow::isMouseButtonPressed, &g_window, _1));
g_lua.bindClassStaticFunction("g_window", "isVisible", std::bind(&PlatformWindow::isVisible, &g_window));
g_lua.bindClassStaticFunction("g_window", "isFullscreen", std::bind(&PlatformWindow::isFullscreen, &g_window));
g_lua.bindClassStaticFunction("g_window", "isMaximized", std::bind(&PlatformWindow::isMaximized, &g_window));

View File

@@ -104,6 +104,9 @@ void PlatformWindow::releaseAllKeys()
processKeyUp(keyCode);
}
for(int i=0;i<4;++i)
m_mouseButtonStates[i] = false;
}
void PlatformWindow::fireKeysPress()
@@ -133,3 +136,4 @@ void PlatformWindow::fireKeysPress()
}
}
}

View File

@@ -77,8 +77,9 @@ public:
int getY() { return m_position.y; }
Point getMousePosition() { return m_inputEvent.mousePos; }
int getKeyboardModifiers() { return m_inputEvent.keyboardModifiers; }
bool isKeyPressed(Fw::Key keyCode) { return m_keysState[keyCode]; }
bool isKeyPressed(Fw::Key keyCode) { return m_keysState[keyCode]; }
bool isMouseButtonPressed(Fw::MouseButton mouseButton) { return m_mouseButtonStates[mouseButton]; }
bool isVisible() { return m_visible; }
bool isMaximized() { return m_maximized; }
bool isFullscreen() { return m_fullscreen; }
@@ -107,6 +108,7 @@ protected:
Size m_unmaximizedSize;
Point m_unmaximizedPos;
InputEvent m_inputEvent;
Boolean<false> m_mouseButtonStates[4];
Boolean<false> m_created;
Boolean<false> m_visible;

View File

@@ -490,6 +490,7 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
SetCapture(m_window);
m_inputEvent.reset(Fw::MousePressInputEvent);
m_inputEvent.mouseButton = Fw::MouseLeftButton;
m_mouseButtonStates[Fw::MouseLeftButton] = true;
if(m_onInputEvent)
m_onInputEvent(m_inputEvent);
break;
@@ -498,6 +499,7 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
SetCapture(NULL);
m_inputEvent.reset(Fw::MouseReleaseInputEvent);
m_inputEvent.mouseButton = Fw::MouseLeftButton;
m_mouseButtonStates[Fw::MouseLeftButton] = false;
if(m_onInputEvent)
m_onInputEvent(m_inputEvent);
break;
@@ -506,6 +508,7 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
SetCapture(m_window);
m_inputEvent.reset(Fw::MousePressInputEvent);
m_inputEvent.mouseButton = Fw::MouseMidButton;
m_mouseButtonStates[Fw::MouseMidButton] = true;
if(m_onInputEvent)
m_onInputEvent(m_inputEvent);
break;
@@ -514,6 +517,7 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
SetCapture(NULL);
m_inputEvent.reset(Fw::MouseReleaseInputEvent);
m_inputEvent.mouseButton = Fw::MouseMidButton;
m_mouseButtonStates[Fw::MouseMidButton] = false;
if(m_onInputEvent)
m_onInputEvent(m_inputEvent);
break;
@@ -522,6 +526,7 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
SetCapture(m_window);
m_inputEvent.reset(Fw::MousePressInputEvent);
m_inputEvent.mouseButton = Fw::MouseRightButton;
m_mouseButtonStates[Fw::MouseRightButton] = true;
if(m_onInputEvent)
m_onInputEvent(m_inputEvent);
break;
@@ -530,6 +535,7 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
SetCapture(NULL);
m_inputEvent.reset(Fw::MouseReleaseInputEvent);
m_inputEvent.mouseButton = Fw::MouseRightButton;
m_mouseButtonStates[Fw::MouseRightButton] = false;
if(m_onInputEvent)
m_onInputEvent(m_inputEvent);
break;

View File

@@ -719,12 +719,15 @@ void X11Window::poll()
switch(event.xbutton.button) {
case Button1:
m_inputEvent.mouseButton = Fw::MouseLeftButton;
m_mouseButtonStates[Fw::MouseLeftButton] = (event.type == ButtonPress);
break;
case Button3:
m_inputEvent.mouseButton = Fw::MouseRightButton;
m_mouseButtonStates[Fw::MouseRightButton] = (event.type == ButtonPress);
break;
case Button2:
m_inputEvent.mouseButton = Fw::MouseMidButton;
m_mouseButtonStates[Fw::MouseMidButton] = (event.type == ButtonPress);
break;
case Button4:
if(event.type == ButtonPress) {