From: <arn...@us...> - 2008-03-29 06:10:16
|
Revision: 1070 http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1070&view=rev Author: arnetheduck Date: 2008-03-28 23:10:14 -0700 (Fri, 28 Mar 2008) Log Message: ----------- AspectControl doesn't need template parameter Modified Paths: -------------- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectControl.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetComboBox.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetDateTimePicker.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetProgressBar.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSlider.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSpinner.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatic.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatusBar.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabSheet.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetToolbar.h dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h Property Changed: ---------------- dcplusplus/trunk/ Property changes on: dcplusplus/trunk ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2008-03-26 17:20:31.842000008 +0100 committer: Jacek Sieka <arn...@gm...> properties: branch-nick: dcplusplus + timestamp: 2008-03-26 17:48:01.759999990 +0100 committer: Jacek Sieka <arn...@gm...> properties: branch-nick: dcplusplus Name: bzr:file-ids - smartwin/include/smartwin/aspects/AspectMinMax.h aspectminmax.h-20080326161823-8s7owo1xy79ij3ve-1 + Name: bzr:revision-id:v3-trunk1 - 1027 arn...@gm...-20080323183926-schknwnkgeo7ivdn 1028 zouzou123gen-20080323220411-r8usuc3qxwuh7zsn 1029 zouzou123gen-20080323221249-0su72zaj13e706mk 1030 arn...@gm...-20080324140623-muba1dl46m000o8c 1031 zouzou123gen-20080324141933-qbgr93ugpe0297m6 1032 arn...@gm...-20080324153706-siidja05n84i00b1 1033 arn...@gm...-20080324153823-lhn3awurnu77riln 1034 arn...@gm...-20080324165650-zapppziji67yf5a2 1035 zouzou123gen-20080324175936-4mqc2kh0lo5wtdu2 1036 zouzou123gen-20080325004602-6wdsoym95mjuhwd3 1037 arn...@gm...-20080325100659-8fqy6q65itmghlep 1038 zouzou123gen-20080325175216-s297sdiucukfvijh 1039 arn...@gm...-20080325210137-3dfqyoi8ykosy087 1040 arn...@gm...-20080325211747-nwwy1eb33r071sca 1041 arn...@gm...-20080326084110-qbselrjckku275xi 1042 zouzou123gen-20080326123631-35642mgbk2i4ty32 1043 zouzou123gen-20080326124345-f4xwn2d3ty8ubd6r 1044 arn...@gm...-20080326162031-il0nyms30w0mky43 + 1027 arn...@gm...-20080323183926-schknwnkgeo7ivdn 1028 zouzou123gen-20080323220411-r8usuc3qxwuh7zsn 1029 zouzou123gen-20080323221249-0su72zaj13e706mk 1030 arn...@gm...-20080324140623-muba1dl46m000o8c 1031 zouzou123gen-20080324141933-qbgr93ugpe0297m6 1032 arn...@gm...-20080324153706-siidja05n84i00b1 1033 arn...@gm...-20080324153823-lhn3awurnu77riln 1034 arn...@gm...-20080324165650-zapppziji67yf5a2 1035 zouzou123gen-20080324175936-4mqc2kh0lo5wtdu2 1036 zouzou123gen-20080325004602-6wdsoym95mjuhwd3 1037 arn...@gm...-20080325100659-8fqy6q65itmghlep 1038 zouzou123gen-20080325175216-s297sdiucukfvijh 1039 arn...@gm...-20080325210137-3dfqyoi8ykosy087 1040 arn...@gm...-20080325211747-nwwy1eb33r071sca 1041 arn...@gm...-20080326084110-qbselrjckku275xi 1042 zouzou123gen-20080326123631-35642mgbk2i4ty32 1043 zouzou123gen-20080326124345-f4xwn2d3ty8ubd6r 1044 arn...@gm...-20080326162031-il0nyms30w0mky43 1045 arn...@gm...-20080326164801-8dru8mjc06xgzjpv Modified: dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -17,7 +17,7 @@ public AspectClickable<WidgetType>, public AspectColor<WidgetType>, public AspectColorCtlImpl<WidgetType>, - public AspectControl<WidgetType>, + public AspectControl, public AspectDblClickable<WidgetType>, public AspectFocus< WidgetType >, public AspectFont< WidgetType >, @@ -26,7 +26,12 @@ { WidgetType& W() { return *static_cast<WidgetType*>(this); } public: - + /// Class type + typedef WidgetType ThisType; + + /// Object type + typedef ThisType* ObjectType; + // Contract needed by AspectClickable Aspect class Message getClickMessage(); @@ -53,14 +58,14 @@ } template<typename WidgetType> -AspectButton<WidgetType>::AspectButton(Widget* parent) : AspectControl<WidgetType>(parent) { +AspectButton<WidgetType>::AspectButton(Widget* parent) : ControlType(parent) { } template<typename WidgetType> template<typename SeedType> void AspectButton<WidgetType>::create( const SeedType & cs ) { - WidgetType::ControlType::create(cs); + ControlType::create(cs); if(cs.font) setFont( cs.font ); } Modified: dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectControl.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectControl.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectControl.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -17,50 +17,41 @@ namespace SmartWin { /** This class is for all windows common controls */ -template<typename WidgetType > + class AspectControl : public MessageMapPolicy< Policies::Subclassed >, - public AspectBorder<WidgetType>, - public AspectContextMenu<WidgetType>, - public AspectEnabled<WidgetType>, - public AspectHelp<WidgetType>, - public AspectKeyboard<WidgetType>, - public AspectMouse<WidgetType>, - public AspectRaw<WidgetType>, - public AspectSizable<WidgetType>, - public AspectVisible<WidgetType> + public AspectBorder<AspectControl>, + public AspectContextMenu<AspectControl>, + public AspectEnabled<AspectControl>, + public AspectHelp<AspectControl>, + public AspectKeyboard<AspectControl>, + public AspectMouse<AspectControl>, + public AspectRaw<AspectControl>, + public AspectSizable<AspectControl>, + public AspectVisible<AspectControl> { public: - /// Class type - typedef WidgetType ThisType; - - /// Object type - typedef ThisType* ObjectType; - unsigned int getControlId(); virtual HWND create(const Seed& cs); protected: - typedef AspectControl<WidgetType> ControlType; + typedef AspectControl ControlType; AspectControl(Widget* parent); }; -template<typename WidgetType> -AspectControl<WidgetType>::AspectControl(Widget* parent) : PolicyType(parent) { +inline AspectControl::AspectControl(Widget* parent) : PolicyType(parent) { xAssert( parent, _T( "Common Controls must have a parent" ) ); } -template<typename WidgetType> -HWND AspectControl<WidgetType>::create(const Seed& cs) { +inline HWND AspectControl::create(const Seed& cs) { xAssert((cs.style & WS_CHILD) == WS_CHILD, _T("Common controls must have WS_CHILD style")); return PolicyType::create(cs); } -template<typename WidgetType> -unsigned int AspectControl<WidgetType>::getControlId() { - return static_cast<unsigned int>(::GetWindowLongPtr(static_cast<WidgetType*>(this)->handle(), GWLP_ID)); +inline unsigned int AspectControl::getControlId() { + return static_cast<unsigned int>(::GetWindowLongPtr(handle(), GWLP_ID)); } } Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetComboBox.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetComboBox.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetComboBox.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -62,7 +62,7 @@ public AspectCollection<WidgetComboBox, int>, public AspectColor< WidgetComboBox >, public AspectColorCtlImpl<WidgetComboBox>, - public AspectControl<WidgetComboBox>, + public AspectControl, public AspectDblClickable< WidgetComboBox >, public AspectFocus< WidgetComboBox >, public AspectFont< WidgetComboBox >, @@ -75,7 +75,12 @@ friend class AspectColor<WidgetComboBox>; friend class AspectSelection<WidgetComboBox, int>; public: + /// Class type + typedef WidgetComboBox ThisType; + /// Object type + typedef ThisType* ObjectType; + /// Seed class /** This class contains all of the values needed to create the widget. It also * knows the type of the class whose seed values it contains. Every widget Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetDateTimePicker.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetDateTimePicker.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetDateTimePicker.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -56,7 +56,7 @@ class WidgetDateTimePicker : // Aspects public AspectClickable< WidgetDateTimePicker >, - public AspectControl<WidgetDateTimePicker>, + public AspectControl, public AspectFocus< WidgetDateTimePicker >, public AspectFont< WidgetDateTimePicker >, public AspectPainting< WidgetDateTimePicker > @@ -76,8 +76,11 @@ }; public: + /// Class type + typedef WidgetDateTimePicker ThisType; - typedef MessageMapPolicy<Policies::Subclassed> PolicyType; + /// Object type + typedef ThisType* ObjectType; friend class WidgetCreator< WidgetDateTimePicker >; Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -72,7 +72,7 @@ public AspectClickable< WidgetListView >, public AspectCollection<WidgetListView, int>, public AspectColor<WidgetListView>, - public AspectControl<WidgetListView>, + public AspectControl, public AspectData<WidgetListView, int>, public AspectDblClickable< WidgetListView >, public AspectFocus< WidgetListView >, @@ -102,6 +102,12 @@ friend class AspectSelection<WidgetListView, int>; public: + /// Class type + typedef WidgetListView ThisType; + + /// Object type + typedef ThisType* ObjectType; + typedef std::tr1::function<int (LPARAM a, LPARAM b)> SortFunction; /// Seed class Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetProgressBar.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetProgressBar.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetProgressBar.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -52,11 +52,16 @@ */ class WidgetProgressBar : // Aspects - public AspectControl<WidgetProgressBar>, + public AspectControl, public AspectPainting< WidgetProgressBar > { friend class WidgetCreator< WidgetProgressBar >; public: + /// Class type + typedef WidgetProgressBar ThisType; + + /// Object type + typedef ThisType* ObjectType; /// Seed class /** This class contains all of the values needed to create the widget. It also * knows the type of the class whose seed values it contains. Every widget Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSlider.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSlider.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSlider.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -57,15 +57,19 @@ */ class WidgetSlider : // Aspects - public AspectControl<WidgetSlider>, + public AspectControl, public AspectFocus< WidgetSlider >, public AspectPainting< WidgetSlider >, public AspectScrollable< WidgetSlider > { friend class WidgetCreator< WidgetSlider >; public: - typedef MessageMapPolicy<Policies::Subclassed> PolicyType; + /// Class type + typedef WidgetSlider ThisType; + /// Object type + typedef ThisType* ObjectType; + /// Seed class /** This class contains all of the values needed to create the widget. It also * knows the type of the class whose seed values it contains. Every widget Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSpinner.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSpinner.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetSpinner.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -55,13 +55,18 @@ */ class WidgetSpinner : // Aspects - public AspectControl<WidgetSpinner>, + public AspectControl, public AspectFocus< WidgetSpinner >, public AspectPainting< WidgetSpinner >, public AspectScrollable< WidgetSpinner > { friend class WidgetCreator< WidgetSpinner >; public: + /// Class type + typedef WidgetSpinner ThisType; + + /// Object type + typedef ThisType* ObjectType; /// Seed class /** This class contains all of the values needed to create the widget. It also * knows the type of the class whose seed values it contains. Every widget Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatic.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatic.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatic.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -64,7 +64,7 @@ public AspectClickable< WidgetStatic >, public AspectColor< WidgetStatic >, public AspectColorCtlImpl<WidgetStatic>, - public AspectControl<WidgetStatic>, + public AspectControl, public AspectDblClickable< WidgetStatic >, public AspectFocus< WidgetStatic >, public AspectFont< WidgetStatic >, @@ -73,6 +73,12 @@ { friend class WidgetCreator< WidgetStatic >; public: + /// Class type + typedef WidgetStatic ThisType; + + /// Object type + typedef ThisType* ObjectType; + /// Seed class /** This class contains all of the values needed to create the widget. It also * knows the type of the class whose seed values it contains. Every widget Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatusBar.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatusBar.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatusBar.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -107,13 +107,19 @@ // Aspects public AspectClickable< WidgetStatusBar< TypeOfStatusBar > >, - public AspectControl<WidgetStatusBar< TypeOfStatusBar > >, + public AspectControl, public AspectDblClickable< WidgetStatusBar< TypeOfStatusBar > >, public AspectFont< WidgetStatusBar< TypeOfStatusBar > >, public AspectPainting< WidgetStatusBar< TypeOfStatusBar > > { friend class WidgetCreator< WidgetStatusBar >; public: + /// Class type + typedef WidgetStatusBar<TypeOfStatusBar> ThisType; + + /// Object type + typedef ThisType* ObjectType; + /// Seed class /** This class contains all of the values needed to create the widget. It also * knows the type of the class whose seed values it contains. Every widget @@ -229,14 +235,14 @@ template< class TypeOfStatusBar > WidgetStatusBar< TypeOfStatusBar >::WidgetStatusBar( SmartWin::Widget * parent ) - : AspectControl<WidgetStatusBar< TypeOfStatusBar > >( parent ) + : ControlType( parent ) { } template< class TypeOfStatusBar > void WidgetStatusBar< TypeOfStatusBar >::create( const Seed & cs ) { - AspectControl<WidgetStatusBar< TypeOfStatusBar > >::create(cs); + ControlType::create(cs); if(cs.font) setFont( cs.font ); } Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabSheet.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabSheet.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTabSheet.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -65,7 +65,7 @@ class WidgetTabSheet : // Aspects public AspectCollection<WidgetTabSheet, int>, - public AspectControl<WidgetTabSheet>, + public AspectControl, public AspectFocus< WidgetTabSheet >, public AspectFont< WidgetTabSheet >, public AspectPainting< WidgetTabSheet >, @@ -110,8 +110,12 @@ friend class WidgetCreator< WidgetTabSheet >; public: - typedef MessageMapPolicy<Policies::Subclassed> PolicyType; + /// Class type + typedef WidgetTabSheet ThisType; + /// Object type + typedef ThisType* ObjectType; + /// Seed class /** This class contains all of the values needed to create the widget. It also * knows the type of the class whose seed values it contains. Every widget Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -67,7 +67,7 @@ // Aspect classes public AspectColor< WidgetTextBoxBase >, public AspectColorCtlImpl<WidgetTextBoxBase>, - public AspectControl< WidgetTextBoxBase >, + public AspectControl, public AspectFocus< WidgetTextBoxBase >, public AspectFont< WidgetTextBoxBase >, public AspectScrollable< WidgetTextBoxBase >, Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetToolbar.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetToolbar.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetToolbar.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -58,7 +58,7 @@ */ class WidgetToolbar : // Aspects - public AspectControl< WidgetToolbar >, + public AspectControl, public AspectFocus< WidgetToolbar >, public AspectFont< WidgetToolbar > { @@ -67,8 +67,12 @@ friend class WidgetCreator< WidgetToolbar >; friend class SmartWin::AspectSizable<WidgetToolbar>; public: - typedef MessageMapPolicy<Policies::Subclassed> PolicyType; + /// Class type + typedef WidgetToolbar ThisType; + /// Object type + typedef ThisType* ObjectType; + /// Seed class /** This class contains all of the values needed to create the widget. It also * knows the type of the class whose seed values it contains. Every widget Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h =================================================================== --- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h 2008-03-29 06:09:14 UTC (rev 1069) +++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h 2008-03-29 06:10:14 UTC (rev 1070) @@ -65,7 +65,7 @@ public AspectClickable< WidgetTreeView >, public AspectCollection<WidgetTreeView, HTREEITEM>, public AspectColor<WidgetTreeView>, - public AspectControl<WidgetTreeView>, + public AspectControl, public AspectData<WidgetTreeView, HTREEITEM>, public AspectDblClickable< WidgetTreeView >, public AspectFocus< WidgetTreeView >, @@ -100,6 +100,12 @@ friend class AspectSelection<WidgetTreeView, HTREEITEM>; public: + /// Class type + typedef WidgetTreeView ThisType; + + /// Object type + typedef ThisType* ObjectType; + /// Seed class /** This class contains all of the values needed to create the widget. It also * knows the type of the class whose seed values it contains. Every widget This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |