]> git.saurik.com Git - wxWidgets.git/blobdiff - src/palmos/tglbtn.cpp
Replace deprecated wxNB_* flags with wxBK_* used in last commit.
[wxWidgets.git] / src / palmos / tglbtn.cpp
index e4b49b65ab743b10e694c580bbed7b987fa1be35..d9de36c03ffc1f37a4ce97356373a5ffaef6feaf 100644 (file)
@@ -37,6 +37,8 @@
 
 #include "wx/tglbtn.h"
 
+#include <Control.h>
+
 // ----------------------------------------------------------------------------
 // macros
 // ----------------------------------------------------------------------------
@@ -60,8 +62,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
@@ -84,6 +88,14 @@ bool wxToggleButton::GetValue() const
     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)
 {
 }