X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ffecfa5aeb540b54914739dbb8603edbbd4c00a0..511fb92a6c68a9635dee0d97bd2110cdeb35deb8:/src/palmos/checkbox.cpp diff --git a/src/palmos/checkbox.cpp b/src/palmos/checkbox.cpp index 527868a833..75e98f33be 100644 --- a/src/palmos/checkbox.cpp +++ b/src/palmos/checkbox.cpp @@ -1,11 +1,11 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: palmos/checkbox.cpp +// Name: src/palmos/checkbox.cpp // Purpose: wxCheckBox -// Author: William Osborne -// Modified by: +// Author: William Osborne - minimal working wxPalmOS port +// Modified by: Wlodzimierz ABX Skiba - native implementation // Created: 10/13/04 -// RCS-ID: $Id: -// Copyright: (c) William Osborne +// RCS-ID: $Id$ +// Copyright: (c) William Osborne, Wlodzimierz Skiba // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "checkbox.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -37,19 +33,7 @@ #include "wx/settings.h" #endif -#include "wx/palmos/private.h" - -#ifndef BST_UNCHECKED - #define BST_UNCHECKED 0x0000 -#endif - -#ifndef BST_CHECKED - #define BST_CHECKED 0x0001 -#endif - -#ifndef BST_INDETERMINATE - #define BST_INDETERMINATE 0x0002 -#endif +#include // ============================================================================ // implementation @@ -67,7 +51,7 @@ wxBEGIN_FLAGS( wxCheckBoxStyle ) wxFLAGS_MEMBER(wxBORDER_RAISED) wxFLAGS_MEMBER(wxBORDER_STATIC) wxFLAGS_MEMBER(wxBORDER_NONE) - + // old style border flags wxFLAGS_MEMBER(wxSIMPLE_BORDER) wxFLAGS_MEMBER(wxSUNKEN_BORDER) @@ -102,7 +86,7 @@ wxEND_PROPERTIES_TABLE() wxBEGIN_HANDLERS_TABLE(wxCheckBox) wxEND_HANDLERS_TABLE() -wxCONSTRUCTOR_6( wxCheckBox , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle ) +wxCONSTRUCTOR_6( wxCheckBox , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle ) #else IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) #endif @@ -112,11 +96,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl) // wxCheckBox // ---------------------------------------------------------------------------- -bool wxCheckBox::MSWCommand(WXUINT WXUNUSED(param), WXWORD WXUNUSED(id)) -{ - return true; -} - bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, @@ -125,11 +104,10 @@ bool wxCheckBox::Create(wxWindow *parent, const wxValidator& validator, const wxString& name) { - return false; -} + if(!wxControl::Create(parent, id, pos, size, style, validator, name)) + return false; -void wxCheckBox::SetLabel(const wxString& label) -{ + return wxControl::PalmCreateControl(checkboxCtl, label, pos, size); } wxSize wxCheckBox::DoGetBestSize() const @@ -139,20 +117,25 @@ wxSize wxCheckBox::DoGetBestSize() const void wxCheckBox::SetValue(bool val) { + SetBoolValue(val); } bool wxCheckBox::GetValue() const { - return false; + return GetBoolValue(); } -void wxCheckBox::Command(wxCommandEvent& event) +bool wxCheckBox::SendClickEvent() { + wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, GetId()); + event.SetInt(GetValue()); + event.SetEventObject(this); + return ProcessCommand(event); } -wxCOMPILE_TIME_ASSERT(wxCHK_UNCHECKED == BST_UNCHECKED - && wxCHK_CHECKED == BST_CHECKED - && wxCHK_UNDETERMINED == BST_INDETERMINATE, EnumValuesIncorrect); +void wxCheckBox::Command(wxCommandEvent& event) +{ +} void wxCheckBox::DoSet3StateValue(wxCheckBoxState state) {