]> git.saurik.com Git - wxWidgets.git/commitdiff
Changed argument of wxPropertyGrid::OnCustomEditorEvent() from wxCommandEvent to...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 19 Oct 2008 11:48:49 +0000 (11:48 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Sun, 19 Oct 2008 11:48:49 +0000 (11:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/propgrid/propgrid.h
interface/wx/propgrid/editors.h
interface/wx/propgrid/propgrid.h
src/propgrid/advprops.cpp
src/propgrid/editors.cpp
src/propgrid/propgrid.cpp

index ac5d71c0184863d1f3530118e5990c1266cf1a69..1c2d8de3f2bef6f9c4d5e7a14892b5fd83ad5fe6 100644 (file)
@@ -1215,9 +1215,21 @@ public:
     // Mostly useful for page switching.
     void SwitchState( wxPropertyGridPageState* pNewState );
 
-    /** Pass this function to Connect calls in propertyclass::CreateEditor.
+    /**
+        When creating custom property editors, connect required editor events to
+        this function. For instance:
+
+        @code
+            control->Connect(control->GetId(), wxEVT_COMMAND_TEXT_UPDATED,
+                             wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+                             NULL, propgrid);
+        @endcode
+
+        @remarks You should never need to call this function directly!
+
+        @see wxPGEditor::CreateControls(), wxEvtHandler::Connect()
     */
-    void OnCustomEditorEvent( wxCommandEvent &event );
+    void OnCustomEditorEvent( wxEvent &event );
 
     long GetInternalFlags() const { return m_iFlags; }
     bool HasInternalFlag( long flag ) const
index 7f39b20814b1b287c5f54cbc1e875bce3f89350e..f074085fad0864999164461f1af37a959fe89cfb 100644 (file)
@@ -76,16 +76,16 @@ public:
         - Primary control shall use id wxPG_SUBID1, and secondary (button) control
           shall use wxPG_SUBID2.
         - Implementation shoud connect all necessary events to the
-          wxPropertyGrid::OnCustomEditorEvent. For Example:
+          wxPropertyGrid::OnCustomEditorEvent(). For example:
             @code
-                // Relays wxEVT_COMMAND_TEXT_UPDATED events of primary editor
-                // control to the OnEvent.
                 control->Connect(control->GetId(), wxEVT_COMMAND_TEXT_UPDATED,
-                                 wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+                                 wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
                                  NULL, propgrid);
             @endcode
           OnCustomEditorEvent will then forward events, first to
           wxPGEditor::OnEvent() and then to wxPGProperty::OnEvent().
+
+        @see wxPropertyGrid::OnCustomEditorEvent(), wxEvtHandler::Connect()
     */
     virtual wxPGWindowList CreateControls( wxPropertyGrid* propgrid,
                                            wxPGProperty* property,
index 4e213ec77fd247af4ad958a6569670ae5a7fa766..202dd9c71762e0536994146c765a0daba9bc7560 100644 (file)
@@ -671,6 +671,22 @@ public:
     */
     bool IsFrozen() const;
 
+    /**
+        When creating custom property editors, connect required editor events to
+        this function. For instance:
+
+        @code
+            control->Connect(control->GetId(), wxEVT_COMMAND_TEXT_UPDATED,
+                             wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+                             NULL, propgrid);
+        @endcode
+
+        @remarks You should never need to call this function directly!
+
+        @see wxPGEditor::CreateControls(), wxEvtHandler::Connect()
+    */
+    void OnCustomEditorEvent( wxEvent &event );
+
     /**
         Redraws given property.
     */
index 4a18197dc44742191765926acec9e01a807bbf74..9defd31b6ba1452e3b75dd914f9f094c4000a99b 100644 (file)
@@ -144,10 +144,10 @@ wxPGWindowList wxPGSpinCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxP
 
     wxWindowID id = wnd2->GetId();
     wnd2->Connect( id, wxEVT_SCROLL_LINEUP,
-                   wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+                   wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
                    NULL, propgrid );
     wnd2->Connect( id, wxEVT_SCROLL_LINEDOWN,
-                   wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+                   wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
                    NULL, propgrid );
 
     // Let's add validator to make sure only numbers can be entered
@@ -157,7 +157,7 @@ wxPGWindowList wxPGSpinCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxP
     wnd1->SetValidator(validator);
 
     wnd1->Connect( wnd1->GetId(), wxEVT_KEY_DOWN,
-                   wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+                   wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
                    NULL, propgrid );
 
     return wxPGWindowList(wnd1, wnd2);
@@ -343,7 +343,7 @@ wxPGWindowList wxPGDatePickerCtrlEditor::CreateControls( wxPropertyGrid* propgri
     // (all relevenat wxTextCtrl, wxComboBox and wxButton events are
     // already connected)
     ctrl->Connect( wxPG_SUBID1, wxEVT_DATE_CHANGED,
-                   wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent),
+                   wxEventHandler(wxPropertyGrid::OnCustomEditorEvent),
                    NULL, propgrid );
 
 #ifdef __WXMSW__
index e1b1e1373198a809bfbcadfbb4f08706de332d0a..2ef0d70adb8b781393eabc8dd70dd203acf07ad0 100644 (file)
@@ -872,11 +872,11 @@ wxWindow* wxPGChoiceEditor::CreateControlsBase( wxPropertyGrid* propGrid,
     // Connect event handling
     wxWindowID id = cb->GetId();
     propGrid->Connect(id, wxEVT_COMMAND_COMBOBOX_SELECTED,
-        wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
     propGrid->Connect(id, wxEVT_COMMAND_TEXT_UPDATED,
-        wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
     propGrid->Connect(id, wxEVT_COMMAND_TEXT_ENTER,
-        wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
 
 #ifdef __WXMSW__
     cb->Show();
@@ -1706,9 +1706,9 @@ wxWindow* wxPropertyGrid::GenerateEditorTextCtrl( const wxPoint& pos,
     // Connect event handling
     id = ed->GetId();
     this->Connect(id, wxEVT_COMMAND_TEXT_UPDATED,
-        wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
     this->Connect(id, wxEVT_COMMAND_TEXT_ENTER,
-        wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
 
     return (wxWindow*) ed;
 }
@@ -1774,7 +1774,7 @@ wxWindow* wxPropertyGrid::GenerateEditorButton( const wxPoint& pos, const wxSize
     // Connect event handling
     id = but->GetId();
     this->Connect(id, wxEVT_COMMAND_BUTTON_CLICKED,
-        wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+        wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
 
     return but;
 }
@@ -1882,7 +1882,7 @@ void wxPGMultiButton::Finalize( wxPropertyGrid* propGrid, const wxPoint& pos )
     {
         wxWindowID id = GetButtonId(i);
         propGrid->Connect(id, wxEVT_COMMAND_BUTTON_CLICKED,
-            wxCommandEventHandler(wxPropertyGrid::OnCustomEditorEvent));
+            wxEventHandler(wxPropertyGrid::OnCustomEditorEvent));
     }
 }
 
index 61bb108e4c79875d6c1a0d2a859711ce1a648f49..1c364c0862ae5e920a4f64540d15f4459589947d 100644 (file)
@@ -3125,7 +3125,7 @@ bool wxPropertyGrid::ProcessEvent(wxEvent& event)
              (parent == m_canvas ||
               parent->GetParent() == m_canvas) )
         {
-            OnCustomEditorEvent((wxCommandEvent&)event);
+            OnCustomEditorEvent(event);
             return true;
         }
     }
@@ -3134,9 +3134,7 @@ bool wxPropertyGrid::ProcessEvent(wxEvent& event)
 
 // -----------------------------------------------------------------------
 
-// NB: It may really not be wxCommandEvent - must check if necessary
-//     (usually not).
-void wxPropertyGrid::OnCustomEditorEvent( wxCommandEvent &event )
+void wxPropertyGrid::OnCustomEditorEvent( wxEvent &event )
 {
     wxPGProperty* selected = m_selected;