From c5ca409b6a6cc4ab503f5d81afa2f637ec609f4c Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 27 Aug 2003 17:53:15 +0000 Subject: [PATCH] event exposure git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/checklst.cpp | 2 ++ src/msw/choice.cpp | 5 +++-- src/msw/combobox.cpp | 3 +++ src/msw/frame.cpp | 10 +++------- src/msw/listbox.cpp | 6 ++++-- src/msw/listctrl.cpp | 2 ++ src/msw/notebook.cpp | 12 +++--------- src/msw/radiobox.cpp | 1 + src/msw/scrolbar.cpp | 4 +++- src/msw/slider95.cpp | 5 ++++- src/msw/spinbutt.cpp | 2 ++ src/msw/spinctrl.cpp | 5 +++++ src/msw/textctrl.cpp | 5 ++++- src/msw/treectrl.cpp | 2 ++ src/msw/window.cpp | 3 +++ 15 files changed, 44 insertions(+), 23 deletions(-) diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index 384aa27851..6c843f7009 100644 --- a/src/msw/checklst.cpp +++ b/src/msw/checklst.cpp @@ -112,6 +112,8 @@ WX_END_FLAGS( wxCheckListBoxStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxCheckListBox, wxListBox,"wx/checklst.h") WX_BEGIN_PROPERTIES_TABLE(wxCheckListBox) + WX_DELEGATE( OnToggle , wxEVT_COMMAND_CHECKLISTBOX_TOGGLED , wxCommandEvent ) + WX_PROPERTY_FLAGS( WindowStyle , wxCheckListBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style WX_END_PROPERTIES_TABLE() diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 02e76e8487..6d0d18243b 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -76,8 +76,9 @@ WX_END_FLAGS( wxChoiceStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxChoice, wxControl,"wx/choice.h") WX_BEGIN_PROPERTIES_TABLE(wxChoice) - // TODO DELEGATES - WX_PROPERTY( Font , wxFont , SetFont , GetFont , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + WX_DELEGATE( OnSelect , wxEVT_COMMAND_CHOICE_SELECTED , wxCommandEvent ) + + WX_PROPERTY( Font , wxFont , SetFont , GetFont , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY( Selection ,int, SetSelection, GetSelection, , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY_FLAGS( WindowStyle , wxChoiceStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 1a00fcfead..00f1314ae2 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -94,6 +94,9 @@ WX_END_FLAGS( wxComboBoxStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxComboBox, wxControl,"wx/combobox.h") WX_BEGIN_PROPERTIES_TABLE(wxComboBox) + WX_DELEGATE( OnSelect , wxEVT_COMMAND_COMBOBOX_SELECTED , wxCommandEvent ) + WX_DELEGATE( OnTextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent ) + // TODO DELEGATES WX_PROPERTY( Font , wxFont , SetFont , GetFont , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 438db56ff0..b9bd4090b7 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -131,15 +131,11 @@ WX_END_FLAGS( wxFrameStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxFrame, wxTopLevelWindow,"wx/frame.h") WX_BEGIN_PROPERTIES_TABLE(wxFrame) - WX_PROPERTY( Title,wxString, SetTitle, GetTitle, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + WX_DELEGATE( OnMenu , wxEVT_COMMAND_MENU_SELECTED , wxCommandEvent) + + WX_PROPERTY( Title,wxString, SetTitle, GetTitle, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY_FLAGS( WindowStyle , wxFrameStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style WX_PROPERTY( MenuBar , wxMenuBar * , SetMenuBar , GetMenuBar , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) - /* - TODO PROPERTIES - - style (wxDEFAULT_FRAME_STYLE) - centered (bool, false ) -*/ WX_END_PROPERTIES_TABLE() WX_BEGIN_HANDLERS_TABLE(wxFrame) diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 46c08431c3..1e18452643 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -91,8 +91,10 @@ WX_END_FLAGS( wxListBoxStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxListBox, wxControl,"wx/listbox.h") WX_BEGIN_PROPERTIES_TABLE(wxListBox) - // TODO DELEGATES - WX_PROPERTY( Font , wxFont , SetFont , GetFont , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + WX_DELEGATE( OnSelect , wxEVT_COMMAND_LISTBOX_SELECTED , wxCommandEvent ) + WX_DELEGATE( OnDoubleClick , wxEVT_COMMAND_LISTBOX_DOUBLECLICKED , wxCommandEvent ) + + WX_PROPERTY( Font , wxFont , SetFont , GetFont , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY_COLLECTION( Choices , wxArrayString , wxString , AppendString , GetStrings, 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) WX_PROPERTY( Selection ,int, SetSelection, GetSelection,, 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) WX_PROPERTY_FLAGS( WindowStyle , wxListBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 68149b52c3..e40225b1c0 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -264,6 +264,8 @@ WX_END_FLAGS( wxListCtrlStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxListCtrl, wxControl,"wx/listctrl.h") WX_BEGIN_PROPERTIES_TABLE(wxListCtrl) + WX_DELEGATE( OnTextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent ) + WX_PROPERTY_FLAGS( WindowStyle , wxListCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style WX_END_PROPERTIES_TABLE() diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index b98ac069e8..caa85a7269 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -165,17 +165,11 @@ template<> void wxCollectionToVariantArray( wxNotebookPageInfoList const &theLis } WX_BEGIN_PROPERTIES_TABLE(wxNotebook) + WX_DELEGATE( OnPageChanging , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , wxNotebookEvent ) + WX_DELEGATE( OnPageChanged , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , wxNotebookEvent ) + WX_PROPERTY_COLLECTION( PageInfos , wxNotebookPageInfoList , wxNotebookPageInfo* , AddPageInfo , GetPageInfos , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY_FLAGS( WindowStyle , wxNotebookStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style -/* - notebookpage - object - object_ref - label - selected - style - usenotebooksizer -*/ WX_END_PROPERTIES_TABLE() WX_BEGIN_HANDLERS_TABLE(wxNotebook) diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index e5e8e0ded0..4fc11d862c 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -89,6 +89,7 @@ WX_END_FLAGS( wxRadioBoxStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxRadioBox, wxControl,"wx/radiobox.h") WX_BEGIN_PROPERTIES_TABLE(wxRadioBox) + WX_DELEGATE( OnSelect , wxEVT_COMMAND_RADIOBOX_SELECTED , wxCommandEvent ) WX_PROPERTY_FLAGS( WindowStyle , wxRadioBoxStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style WX_END_PROPERTIES_TABLE() diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index 8d41e6dfe8..aa0847ee14 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -68,7 +68,9 @@ WX_END_FLAGS( wxScrollBarStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxScrollBar, wxControl,"wx/scrolbar.h") WX_BEGIN_PROPERTIES_TABLE(wxScrollBar) - WX_PROPERTY( ThumbPosition , int , SetThumbPosition, GetThumbPosition, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + WX_DELEGATE_RANGE( OnScroll , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxScrollEvent ) + + WX_PROPERTY( ThumbPosition , int , SetThumbPosition, GetThumbPosition, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY( Range , int , SetRange, GetRange, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY( ThumbSize , int , SetThumbSize, GetThumbSize, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY( PageSize , int , SetPageSize, GetPageSize, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index b099bb5d49..0f1726f0da 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -84,7 +84,10 @@ WX_END_FLAGS( wxSliderStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxSlider95, wxControl,"wx/scrolbar.h") WX_BEGIN_PROPERTIES_TABLE(wxSlider95) - WX_PROPERTY( Value , int , SetValue, GetValue , 0, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) + WX_DELEGATE_RANGE( OnScroll , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxScrollEvent ) + WX_DELEGATE( OnUpdated , wxEVT_COMMAND_SLIDER_UPDATED , wxCommandEvent ) + + WX_PROPERTY( Value , int , SetValue, GetValue , 0, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY( Minimum , int , SetMin, GetMin, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY( Maximum , int , SetMax, GetMax, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY( PageSize , int , SetPageSize, GetLineSize, 1 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index e5b120c6b6..9e739763d2 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -97,6 +97,8 @@ WX_END_FLAGS( wxSpinButtonStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxSpinButton, wxControl,"wx/spinbut.h") WX_BEGIN_PROPERTIES_TABLE(wxSpinButton) + WX_DELEGATE_RANGE( OnSpin , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxSpinEvent ) + WX_PROPERTY( Value , int , SetValue, GetValue, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY( Min , int , SetMin, GetMin, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY( Max , int , SetMax, GetMax, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 2da526afa2..1a5a8b1f12 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -91,6 +91,11 @@ WX_END_FLAGS( wxSpinCtrlStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxSpinCtrl, wxControl,"wx/spinbut.h") WX_BEGIN_PROPERTIES_TABLE(wxSpinCtrl) + WX_DELEGATE_RANGE( OnSpin , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxSpinEvent ) + WX_DELEGATE( OnUpdated , wxEVT_COMMAND_SPINCTRL_UPDATED , wxCommandEvent ) + WX_DELEGATE( OnTextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent ) + WX_DELEGATE( OnTextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent ) + WX_PROPERTY( ValueString , wxString , SetValue , GetValue , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) ; WX_PROPERTY( Value , int , SetValue, GetValue, 0 , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY( Min , int , SetMin, GetMin, 0, 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 018c197c8d..ef301f96b9 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -169,7 +169,10 @@ WX_END_FLAGS( wxTextCtrlStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxTextCtrl, wxControl,"wx/textctrl.h") WX_BEGIN_PROPERTIES_TABLE(wxTextCtrl) - WX_PROPERTY( Font , wxFont , SetFont , GetFont ,, 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) + WX_DELEGATE( OnTextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent ) + WX_DELEGATE( OnTextEnter , wxEVT_COMMAND_TEXT_ENTER , wxCommandEvent ) + + WX_PROPERTY( Font , wxFont , SetFont , GetFont ,, 0 /*flags*/ , wxT("Helpstring") , wxT("group") ) WX_PROPERTY( Value , wxString , SetValue, GetValue, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) WX_PROPERTY_FLAGS( WindowStyle , wxTextCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style WX_END_PROPERTIES_TABLE() diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 8332f740ea..9ecd6aebf1 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -521,6 +521,8 @@ WX_END_FLAGS( wxTreeCtrlStyle ) IMPLEMENT_DYNAMIC_CLASS_XTI(wxTreeCtrl, wxControl,"wx/treectrl.h") WX_BEGIN_PROPERTIES_TABLE(wxTreeCtrl) + WX_DELEGATE( OnTextUpdated , wxEVT_COMMAND_TEXT_UPDATED , wxCommandEvent ) + WX_DELEGATE_RANGE( OnTreeEvent , wxEVT_COMMAND_TREE_BEGIN_DRAG , wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK , wxTreeEvent ) WX_PROPERTY_FLAGS( WindowStyle , wxTreeCtrlStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style WX_END_PROPERTIES_TABLE() diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 3e34e88e6d..baf19c19f3 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -287,6 +287,9 @@ WX_BEGIN_FLAGS( wxWindowStyle ) WX_END_FLAGS( wxWindowStyle ) WX_BEGIN_PROPERTIES_TABLE(wxWindow) + WX_DELEGATE( OnClose , wxEVT_CLOSE_WINDOW , wxCloseEvent) + WX_DELEGATE( OnCreate , wxEVT_CREATE , wxWindowCreateEvent ) + WX_DELEGATE( OnDestroy , wxEVT_DESTROY , wxWindowDestroyEvent ) // Always constructor Properties first WX_READONLY_PROPERTY( Parent,wxWindow*, GetParent, , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) -- 2.45.2