]> git.saurik.com Git - wxWidgets.git/blobdiff - src/palmos/tglbtn.cpp
Second try to add "support" for deriving from
[wxWidgets.git] / src / palmos / tglbtn.cpp
index 9e69fc4b8291ea8ff0001e1559be4ea822d63b24..7412efaf5c60a461b21e5fff87c956c24ef03408 100644 (file)
@@ -60,8 +60,10 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id,
                             const wxValidator& validator,
                             const wxString& name)
 {
-    wxControl::PalmCreateControl(pushButtonCtl, parent, id, label, pos, size);
-    return true;
+    if(!wxControl::Create(parent, id, pos, size, style, validator, name))
+        return false;
+
+    return wxControl::PalmCreateControl(pushButtonCtl, label, pos, size);
 }
 
 wxBorder wxToggleButton::GetDefaultBorder() const
@@ -76,11 +78,20 @@ wxSize wxToggleButton::DoGetBestSize() const
 
 void wxToggleButton::SetValue(bool val)
 {
+    SetBoolValue(val);
 }
 
 bool wxToggleButton::GetValue() const
 {
-    return false;
+    return GetBoolValue();
+}
+
+bool wxToggleButton::SendClickEvent()
+{
+    wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, GetId());
+    event.SetInt(GetValue());
+    event.SetEventObject(this);
+    return ProcessCommand(event);
 }
 
 void wxToggleButton::Command(wxCommandEvent & event)