From f3a65071987ac699afa1cf7edf909f5770244dba Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 21 Jan 1999 17:38:28 +0000 Subject: [PATCH] Made EVT_SLIDER event happen always; some doc and wxProperty updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/proplist/classes.tex | 40 ++++++++++++++++++++++++++++----- docs/latex/wx/list.tex | 12 +++++----- include/wx/msw/slider95.h | 6 ----- include/wx/msw/slidrmsw.h | 8 ------- include/wx/prop.h | 17 ++++++++++++-- src/generic/prop.cpp | 28 +++++++++++++++++++++-- src/motif/makefile.unx | 5 +---- src/msw/makefile.nt | 38 +++++++++++++++---------------- src/msw/slider95.cpp | 27 +++++----------------- src/msw/slidrmsw.cpp | 26 ++++----------------- 10 files changed, 111 insertions(+), 96 deletions(-) diff --git a/docs/latex/proplist/classes.tex b/docs/latex/proplist/classes.tex index d197d77d6d..9b0b5aa11d 100644 --- a/docs/latex/proplist/classes.tex +++ b/docs/latex/proplist/classes.tex @@ -768,9 +768,9 @@ wxProperty objects (essentially names and values). \membersection{wxPropertySheet::wxPropertySheet} -\func{void}{wxPropertySheet}{\void} +\func{void}{wxPropertySheet}{\param{const wxString}{ name = ""}} -Constructor. +Constructor. Sets property sheet's name to name if present. \membersection{wxPropertySheet::\destruct{wxPropertySheet}} @@ -790,17 +790,47 @@ Adds a property to the sheet. Clears all the properties from the sheet (deleting them). +\membersection{wxPropertySheet::GetName}\label{wxpropertysheetgetname} + +\func{wxString}{GetName}{\void} + +Gets the sheet's name. + +\membersection{wxPropertySheet::GetProperty}\label{wxpropertysheetgetproperty} + +\func{wxProperty *}{GetProperty}{\param{wxString}{ name}} + +Gets a property by name. + \membersection{wxPropertySheet::GetProperties}\label{wxpropertysheetgetproperties} \func{wxList\&}{GetProperties}{\void} Returns a reference to the internal list of properties. -\membersection{wxPropertySheet::GetProperty}\label{wxpropertysheetgetproperty} +\membersection{wxPropertySheet::HasProperty}\label{wxpropertysheethasproperty} -\func{wxProperty *}{GetProperty}{\param{char *}{name}} +\func{bool}{HasProperty}{\param{wxString}{ propname}} -Gets a property by name. +Returns true if sheet contains property propname. + +\membersection{wxPropertySheet::RemoveProperty}\label{wxpropertysheetremoveproperty} + +\func{void}{RemoveProperty}{\param{wxString}{ propname}} + +Removes property propname from sheet, deleting it. + +\membersection{wxPropertySheet::SetName}\label{wxpropertysheetsetname} + +\func{void}{SetName}{\param{wxString}{ sheetname}} + +Set the sheet's name to sheetname + +\membersection{wxPropertySheet::SetProperty}\label{wxpropertysheetsetproperty} + +\func{bool}{SetProperty}{\param{wxString}{ propname}, \param{wxPropertyValue}{ value}} + +Sets property propname to value. Returns false if property is not a member of sheet. \membersection{wxPropertySheet::SetAllModified} diff --git a/docs/latex/wx/list.tex b/docs/latex/wx/list.tex index 90d45d6187..6e53b0e541 100644 --- a/docs/latex/wx/list.tex +++ b/docs/latex/wx/list.tex @@ -89,7 +89,7 @@ It is very common to iterate on a list as follows: ... - wxNode *node = SomeList.First(); + wxNode *node = SomeList.GetFirst(); while (node) { wxPoint *point = (wxPoint *)node->Data(); @@ -112,7 +112,7 @@ with ... delete point; delete node; - node = SomeList.First(); + node = SomeList.GetFirst(); ... \end{verbatim} @@ -203,9 +203,9 @@ TRUE if successful. The application must delete the actual object separately. Returns the node whose stored key matches {\it key}. Use on a keyed list only. -\membersection{wxList::First} +\membersection{wxList::GetFirst} -\func{wxNode *}{First}{\void} +\func{wxNode *}{GetFirst}{\void} Returns the first node in the list (NULL if the list is empty). @@ -227,9 +227,9 @@ Insert object at front of list. Insert object before {\it position}. -\membersection{wxList::Last} +\membersection{wxList::GetLast} -\func{wxNode *}{Last}{\void} +\func{wxNode *}{GetLast}{\void} Returns the last node in the list (NULL if the list is empty). diff --git a/include/wx/msw/slider95.h b/include/wx/msw/slider95.h index d5adce947d..612c5f5044 100644 --- a/include/wx/msw/slider95.h +++ b/include/wx/msw/slider95.h @@ -92,11 +92,6 @@ public: inline WXHWND GetEditValue() const { return m_staticValue; } virtual bool ContainsHWND(WXHWND hWnd) const; - // Backward compatibility: translate to familiar wxEVT_COMMAND_SLIDER_UPDATED -#if WXWIN_COMPATIBILITY - void OnScroll(wxScrollEvent& event); -#endif - void Command(wxCommandEvent& event); virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, WXUINT message, WXWPARAM wParam, WXLPARAM lParam); @@ -112,7 +107,6 @@ public: int m_pageSize; int m_lineSize; int m_tickFreq; -DECLARE_EVENT_TABLE() }; #endif diff --git a/include/wx/msw/slidrmsw.h b/include/wx/msw/slidrmsw.h index d1042cb345..47a8fb2196 100644 --- a/include/wx/msw/slidrmsw.h +++ b/include/wx/msw/slidrmsw.h @@ -92,11 +92,6 @@ public: inline WXHWND GetEditValue() const { return m_staticValue; } virtual bool ContainsHWND(WXHWND hWnd) const; - // Backward compatibility: translate to familiar wxEVT_COMMAND_SLIDER_UPDATED -#if WXWIN_COMPATIBILITY - void OnScroll(wxScrollEvent& event); -#endif - void Command(wxCommandEvent& event); virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, WXUINT message, WXWPARAM wParam, WXLPARAM lParam); @@ -112,9 +107,6 @@ public: int m_pageSize; int m_lineSize; int m_tickFreq; -#if WXWIN_COMPATIBILITY -DECLARE_EVENT_TABLE() -#endif }; #endif diff --git a/include/wx/prop.h b/include/wx/prop.h index bb9ebc64bb..327bd20379 100644 --- a/include/wx/prop.h +++ b/include/wx/prop.h @@ -42,9 +42,22 @@ class WXDLLEXPORT wxPropertySheet: public wxObject { DECLARE_DYNAMIC_CLASS(wxPropertySheet) public: - wxPropertySheet(void); + wxPropertySheet(wxString name = ""); ~wxPropertySheet(void); + // Set the name of the sheet + inline virtual void SetName(wxString name) { m_name=name; } + inline virtual wxString GetName() { return m_name; } + // Does this sheet contain a property with this name + virtual bool HasProperty(wxString name); + + // Set property name to value + virtual bool SetProperty(const wxString name, wxPropertyValue value); + + // Remove property from sheet by name, deleting it + virtual void RemoveProperty(wxString name); + + // Get the name of the sheet // Add a property virtual void AddProperty(wxProperty *property); @@ -67,7 +80,7 @@ class WXDLLEXPORT wxPropertySheet: public wxObject wxObject* m_viewedObject; wxList m_properties; wxPropertyView* m_propertyView; - + wxString m_name; }; diff --git a/src/generic/prop.cpp b/src/generic/prop.cpp index fa9b47d096..b63cafa0cf 100644 --- a/src/generic/prop.cpp +++ b/src/generic/prop.cpp @@ -941,7 +941,8 @@ wxPropertyValidator *wxPropertyView::FindPropertyValidator(wxProperty *property) IMPLEMENT_DYNAMIC_CLASS(wxPropertySheet, wxObject) -wxPropertySheet::wxPropertySheet(void):m_properties(wxKEY_STRING) +wxPropertySheet::wxPropertySheet(wxString name) +:m_properties(wxKEY_STRING),m_name(name) { } @@ -979,7 +980,30 @@ wxProperty *wxPropertySheet::GetProperty(wxString name) else return (wxProperty *)node->Data(); } - +bool wxPropertySheet::SetProperty(const wxString name, wxPropertyValue value) +{ + wxProperty* prop = GetProperty(name); + if(prop){ + prop->SetValue(value); + return true; + }else{ + return false; + } +} +void wxPropertySheet::RemoveProperty(wxString name) +{ + wxNode *node = m_properties.Find(name); + if(node) + { + wxProperty *prop = (wxProperty *)node->Data(); + delete prop; + m_properties.DeleteNode(node); + } +} +bool wxPropertySheet::HasProperty(wxString name) +{ + return (GetProperty(name)?true:false); +} // Clear all properties void wxPropertySheet::Clear(void) { diff --git a/src/motif/makefile.unx b/src/motif/makefile.unx index f90dbdbec5..17ae26ec6c 100644 --- a/src/motif/makefile.unx +++ b/src/motif/makefile.unx @@ -82,7 +82,6 @@ LIB_CPP_SRC=\ choice.cpp \ clipbrd.cpp \ colour.cpp \ - colordlg.cpp \ control.cpp \ combobox.cpp \ cursor.cpp \ @@ -97,7 +96,6 @@ LIB_CPP_SRC=\ dnd.cpp \ filedlg.cpp \ font.cpp \ - fontdlg.cpp \ frame.cpp \ gauge.cpp \ gdiobj.cpp \ @@ -108,12 +106,10 @@ LIB_CPP_SRC=\ mdi.cpp \ menu.cpp \ menuitem.cpp \ - metafile.cpp \ minifram.cpp \ msgdlg.cpp \ palette.cpp \ pen.cpp \ - print.cpp \ radiobox.cpp \ radiobut.cpp \ region.cpp \ @@ -139,6 +135,7 @@ LIB_CPP_SRC=\ ../generic/dirdlgg.cpp \ ../generic/fontdlgg.cpp \ ../generic/gridg.cpp \ + ../generic/helphtml.cpp \ ../generic/helpext.cpp \ ../generic/imaglist.cpp \ ../generic/listctrl.cpp \ diff --git a/src/msw/makefile.nt b/src/msw/makefile.nt index 85fa790b88..ef65744b9b 100644 --- a/src/msw/makefile.nt +++ b/src/msw/makefile.nt @@ -1273,23 +1273,23 @@ docs: allhlp allhtml allpdfrtf alldocs: docs hlp: wxhlp portinghlp # faqhlp wxhlp: $(DOCDIR)/winhelp/wx.hlp -wxprophlp: $(DOCDIR)/winhelp/wxprop.hlp +prophlp: $(DOCDIR)/winhelp/prop.hlp faqhlp: $(DOCDIR)/winhelp/faq.hlp refhlp: $(DOCDIR)/winhelp/techref.hlp rtf: $(DOCDIR)/winhelp/wx.rtf faqrtf: $(DOCDIR)/winhelp/faq.rtf -wxproprtf: $(DOCDIR)/winhelp/wxprop.rtf +proprtf: $(DOCDIR)/winhelp/prop.rtf pdfrtf: $(DOCDIR)/pdf/wx.rtf faqpdfrtf: $(DOCDIR)/pdf/faq.rtf -wxproppdfrtf: $(DOCDIR)/pdf/wxprop.rtf +proppdfrtf: $(DOCDIR)/pdf/prop.rtf refpdfrtf: $(DOCDIR)/pdf/techref.rtf html: wxhtml # faqhtml wxhtml: $(DOCDIR)\html\wx\wx.htm faqhtml: $(DOCDIR)\html\faq\faq.htm -wxprophtml: $(DOCDIR)\html\proplist\prop.htm +prophtml: $(DOCDIR)\html\proplist\prop.htm ps: wxps referencps # faqps wxps: $(WXDIR)\docs\ps\wx.ps -wxpropps: $(WXDIR)\docs\ps\wxprop.ps +propps: $(WXDIR)\docs\ps\prop.ps faqps: $(WXDIR)\docs\ps\faq.ps referencps: $(WXDIR)\docs\ps\referenc.ps @@ -1299,7 +1299,7 @@ portinghlp: $(DOCDIR)/winhelp/porting.hlp portingpdfrtf: $(DOCDIR)/pdf/porting.rtf portingps: $(WXDIR)\docs\ps\porting.ps -allhlp: wxhlp portinghlp wxprop # faqhlp +allhlp: wxhlp portinghlp prop # faqhlp cd $(WXDIR)\utils\dialoged\src nmake -f makefile.nt hlp cd $(THISDIR) @@ -1330,7 +1330,7 @@ allhlp: wxhlp portinghlp wxprop # faqhlp # cd $(WXDIR)\utils\clips2c\src # nmake -f makefile.nt hlp -allhtml: wxhtml portinghtml wxprophtml # faqhtml +allhtml: wxhtml portinghtml prophtml # faqhtml cd $(WXDIR)\utils\dialoged\src nmake -f makefile.nt html cd $(THISDIR) @@ -1362,12 +1362,12 @@ allhtml: wxhtml portinghtml wxprophtml # faqhtml # cd $(WXDIR)\utils\clips2c\src # nmake -f makefile.nt html -allps: wxps referencps portingps wxpropps # faqps +allps: wxps referencps portingps propps # faqps cd $(WXDIR)\utils\dialoged\src nmake -f makefile.nt ps cd $(THISDIR) -allpdfrtf: pdfrtf portingpdfrtf wxproppdfrtf # faqpdfrtf +allpdfrtf: pdfrtf portingpdfrtf proppdfrtf # faqpdfrtf cd $(WXDIR)\utils\dialoged\src nmake -f makefile.nt pdfrtf cd $(THISDIR) @@ -1419,12 +1419,12 @@ $(DOCDIR)/winhelp/faq.hlp: $(DOCDIR)/latex/faq/faq.rtf $(DOCDIR)/latex/f move faq.cnt $(DOCDIR)\winhelp\faq.cnt cd $(THISDIR) -$(DOCDIR)/winhelp/wxprop.hlp: $(DOCDIR)/latex/proplist/wxprop.rtf $(DOCDIR)/latex/proplist/wxprop.hpj +$(DOCDIR)/winhelp/prop.hlp: $(DOCDIR)/latex/proplist/prop.rtf $(DOCDIR)/latex/proplist/prop.hpj cd $(DOCDIR)/latex/proplist - -erase wxprop.ph - hc wxprop - move wxprop.hlp $(DOCDIR)\winhelp\wxprop.hlp - move wxprop.cnt $(DOCDIR)\winhelp\wxprop.cnt + -erase prop.ph + hc prop + move prop.hlp $(DOCDIR)\winhelp\prop.hlp + move prop.cnt $(DOCDIR)\winhelp\prop.cnt cd $(THISDIR) $(DOCDIR)/winhelp/techref.hlp: $(DOCDIR)/latex/techref/techref.rtf $(DOCDIR)/latex/techref/techref.hpj @@ -1450,9 +1450,9 @@ $(DOCDIR)/latex/faq/faq.rtf: $(DOCDIR)/latex/faq/faq.tex -start /w tex2rtf $(DOCDIR)/latex/faq/faq.tex $(DOCDIR)/latex/faq/faq.rtf -twice -winhelp cd $(THISDIR) -$(DOCDIR)/latex/proplist/wxprop.rtf: $(DOCDIR)/latex/proplist/prop.tex $(DOCDIR)/latex/proplist/body.tex $(DOCDIR)/latex/proplist/classes.tex $(DOCDIR)/latex/proplist/changes.tex +$(DOCDIR)/latex/proplist/prop.rtf: $(DOCDIR)/latex/proplist/prop.tex $(DOCDIR)/latex/proplist/body.tex $(DOCDIR)/latex/proplist/classes.tex $(DOCDIR)/latex/proplist/changes.tex cd $(DOCDIR)\latex\proplist - -start /w tex2rtf $(DOCDIR)/latex/proplist/prop.tex $(DOCDIR)/latex/proplist/wxprop.rtf -twice -winhelp + -start /w tex2rtf $(DOCDIR)/latex/proplist/prop.tex $(DOCDIR)/latex/proplist/prop.rtf -twice -winhelp cd $(THISDIR) $(DOCDIR)/latex/techref/techref.rtf: $(DOCDIR)/latex/techref/techref.tex @@ -1478,10 +1478,10 @@ $(DOCDIR)/pdf/faq.rtf: $(DOCDIR)/latex/faq/faq.tex -start /w tex2rtf $(DOCDIR)/latex/faq/faq.tex $(DOCDIR)/pdf/faq.rtf -twice -rtf cd $(THISDIR) -$(DOCDIR)/pdf/wxprop.rtf: $(DOCDIR)/latex/proplist/proplist.tex $(DOCDIR)/latex/proplist/body.tex $(DOCDIR)/latex/proplist/classes.tex $(DOCDIR)/latex/proplist/changes.tex +$(DOCDIR)/pdf/prop.rtf: $(DOCDIR)/latex/proplist/proplist.tex $(DOCDIR)/latex/proplist/body.tex $(DOCDIR)/latex/proplist/classes.tex $(DOCDIR)/latex/proplist/changes.tex cd $(DOCDIR)\latex\proplist -copy *.bmp *.wmf $(DOCDIR)\pdf - -start /w tex2rtf $(DOCDIR)/latex/proplist/wxprop.tex $(DOCDIR)/pdf/wxprop.rtf -twice -rtf + -start /w tex2rtf $(DOCDIR)/latex/proplist/prop.tex $(DOCDIR)/pdf/prop.rtf -twice -rtf cd $(THISDIR) $(DOCDIR)/pdf/techref.rtf: $(DOCDIR)/latex/techref/techref.tex @@ -1523,7 +1523,7 @@ $(DOCDIR)\html\faq\faq.htm: $(DOCDIR)\latex\faq\faq.tex $(DOCDIR)\html\proplist\prop.htm: $(DOCDIR)\latex\proplist\prop.tex $(DOCDIR)\latex\proplist\body.tex $(DOCDIR)\latex\proplist\classes.tex $(DOCDIR)\latex\proplist\changes.tex cd $(DOCDIR)\latex\proplist -mkdir $(DOCDIR)\html\proplist - -start /w tex2rtf $(DOCDIR)\latex\proplist\wxprop.tex $(DOCDIR)\html\proplist\prop.htm -twice -html + -start /w tex2rtf $(DOCDIR)\latex\proplist\prop.tex $(DOCDIR)\html\proplist\prop.htm -twice -html -erase $(DOCDIR)\html\proplist\*.con -erase $(DOCDIR)\html\proplist\*.ref -erase $(DOCDIR)\latex\proplist\*.con diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index b06bc4aaaa..6981d0a1b0 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -37,13 +37,6 @@ #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxSlider95, wxControl) - -BEGIN_EVENT_TABLE(wxSlider95, wxControl) -#if WXWIN_COMPATIBILITY - EVT_SCROLL(wxSlider95::OnScroll) -#endif -END_EVENT_TABLE() - #endif // Slider @@ -257,6 +250,11 @@ void wxSlider95::MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control) event.SetPosition(newPos); event.SetEventObject( this ); GetEventHandler()->ProcessEvent(event); + + wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() ); + cevent.SetEventObject( this ); + GetEventHandler()->ProcessEvent( cevent ); + } } } @@ -616,21 +614,6 @@ bool wxSlider95::ContainsHWND(WXHWND hWnd) const return ( hWnd == GetStaticMin() || hWnd == GetStaticMax() || hWnd == GetEditValue() ); } -#if WXWIN_COMPATIBILITY -// Backward compatibility -void wxSlider95::OnScroll(wxScrollEvent& event) -{ - wxEventType oldEvent = event.GetEventType(); - event.SetEventType( wxEVT_COMMAND_SLIDER_UPDATED ); - if ( !GetEventHandler()->ProcessEvent(event) ) - { - event.SetEventType( oldEvent ); - if (!GetParent()->GetEventHandler()->ProcessEvent(event)) - event.Skip(); - } -} -#endif - void wxSlider95::Command (wxCommandEvent & event) { SetValue (event.GetInt()); diff --git a/src/msw/slidrmsw.cpp b/src/msw/slidrmsw.cpp index 3ce6a0b075..83d4a14846 100644 --- a/src/msw/slidrmsw.cpp +++ b/src/msw/slidrmsw.cpp @@ -31,13 +31,6 @@ #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxSliderMSW, wxControl) - -#if WXWIN_COMPATIBILITY -BEGIN_EVENT_TABLE(wxSliderMSW, wxControl) - EVT_SCROLL(wxSliderMSW::OnScroll) -END_EVENT_TABLE() -#endif - #endif // Slider @@ -229,6 +222,10 @@ void wxSliderMSW::MSWOnVScroll(WXWORD wParam, WXWORD pos, WXHWND control) event.SetPosition(newPos); event.SetEventObject( this ); GetEventHandler()->ProcessEvent(event); + + wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, GetId() ); + cevent.SetEventObject( this ); + GetEventHandler()->ProcessEvent( cevent ); } } } @@ -559,21 +556,6 @@ bool wxSliderMSW::ContainsHWND(WXHWND hWnd) const return ( hWnd == GetStaticMin() || hWnd == GetStaticMax() || hWnd == GetEditValue() ); } -#if WXWIN_COMPATIBILITY -// Backward compatibility -void wxSliderMSW::OnScroll(wxScrollEvent& event) -{ - wxEventType oldEvent = event.GetEventType(); - event.SetEventType( wxEVT_COMMAND_SLIDER_UPDATED ); - if ( !GetEventHandler()->ProcessEvent(event) ) - { - event.SetEventType( oldEvent ); - if (!GetParent()->GetEventHandler()->ProcessEvent(event)) - event.Skip(); - } -} -#endif - void wxSliderMSW::Command (wxCommandEvent & event) { SetValue (event.GetInt()); -- 2.45.2