]> git.saurik.com Git - wxWidgets.git/commitdiff
declare and define wxEVT_COMMAND_TEXT_UPDATED even if wxUSE_TEXTCTRL == 0
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 31 Jul 2001 17:56:45 +0000 (17:56 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 31 Jul 2001 17:56:45 +0000 (17:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/event.h
include/wx/textctrl.h
src/common/textcmn.cpp

index 92f344d41ce15beae4a165c7ada443b1130cb99a..d259a3a7e5e8a68cd348b4ad2555f86ae5fbc0b3 100644 (file)
@@ -115,10 +115,12 @@ BEGIN_DECLARE_EVENT_TYPES()
     DECLARE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_SELECTED, 4)
     DECLARE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 5)
     DECLARE_EVENT_TYPE(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 6)
-    /* now in wx/textctrl.h
+    // now they are in wx/textctrl.h
+#if WXWIN_COMPATIBILITY_EVENT_TYPES
     DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED, 7)
     DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER, 8)
-    */
+    DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_URL, 13)
+#endif // WXWIN_COMPATIBILITY_EVENT_TYPES
     DECLARE_EVENT_TYPE(wxEVT_COMMAND_MENU_SELECTED, 9)
     DECLARE_EVENT_TYPE(wxEVT_COMMAND_SLIDER_UPDATED, 10)
     DECLARE_EVENT_TYPE(wxEVT_COMMAND_RADIOBOX_SELECTED, 11)
@@ -258,7 +260,17 @@ END_DECLARE_EVENT_TYPES()
 // these 2 events are the same
 #define wxEVT_COMMAND_TOOL_CLICKED wxEVT_COMMAND_MENU_SELECTED
 
+// ----------------------------------------------------------------------------
 // Compatibility
+// ----------------------------------------------------------------------------
+
+// this event is also used by wxComboBox and wxSpinCtrl which don't include
+// wx/textctrl.h in all ports [yet], so declare it here as well
+//
+// still, any new code using it should include wx/textctrl.h explicitly
+#if !WXWIN_COMPATIBILITY_EVENT_TYPES
+    extern const wxEventType WXDLLEXPORT wxEVT_COMMAND_TEXT_UPDATED;
+#endif
 
 #if WXWIN_COMPATIBILITY
 
index aa8f5bf48a683d09faed50df23e477f3948e3f34..f70f125f4c22fc178cc48adf942f45b7dc84da44 100644 (file)
@@ -283,12 +283,16 @@ private:
 // wxTextCtrl events
 // ----------------------------------------------------------------------------
 
+#if !WXWIN_COMPATIBILITY_EVENT_TYPES
+
 BEGIN_DECLARE_EVENT_TYPES()
     DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED, 7)
     DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER, 8)
     DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_URL, 13)
 END_DECLARE_EVENT_TYPES()
 
+#endif // !WXWIN_COMPATIBILITY_EVENT_TYPES
+
 class WXDLLEXPORT wxTextUrlEvent : public wxCommandEvent
 {
 public:
index 3563743cfd0f51bab5cf94929a611b2a11ba01c9..523b23085c85fdee72f198e86fac27f8c0610d35 100644 (file)
@@ -278,5 +278,13 @@ void wxTextCtrlBase::SelectAll()
     SetSelection(0, GetLastPosition());
 }
 
-#endif // wxUSE_TEXTCTRL
+#else // !wxUSE_TEXTCTRL
+
+// define this one even if !wxUSE_TEXTCTRL because it is also used by other
+// controls (wxComboBox and wxSpinCtrl)
+#include "wx/event.h"
+
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED)
+
+#endif // wxUSE_TEXTCTRL/!wxUSE_TEXTCTRL