added (half working) wxGTKRenderer

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8133 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-08-18 19:05:02 +00:00
parent 3b2555e2d0
commit 4dc12a1a28
10 changed files with 818 additions and 36 deletions

View File

@@ -123,18 +123,50 @@ wxInputHandler *wxButton::CreateInputHandler() const
return wxTheme::Get()->GetInputHandler(wxCONTROL_BUTTON);
}
void wxButton::Press()
{
m_isPressed = TRUE;
}
void wxButton::Release()
{
m_isPressed = FALSE;
}
void wxButton::Toggle()
{
m_isPressed = !m_isPressed;
if ( !m_isPressed )
{
// releasing button after it had been pressed generates a click event
Click();
}
}
void wxButton::Click()
{
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
InitCommandEvent(event);
Command(event);
}
bool wxButton::PerformAction(const wxControlAction& action)
{
if ( action == wxACTION_BUTTON_TOGGLE )
{
m_isPressed = !m_isPressed;
}
else
{
return wxControl::PerformAction(action);
}
bool wasPressed = IsPressed();
return TRUE;
if ( action == wxACTION_BUTTON_TOGGLE )
Toggle();
else if ( action == wxACTION_BUTTON_CLICK )
Click();
else if ( action == wxACTION_BUTTON_PRESS )
Press();
else if ( action == wxACTION_BUTTON_RELEASE )
Release();
else
return wxControl::PerformAction(action);
return wasPressed != IsPressed();
}
// ----------------------------------------------------------------------------