|
From: <arn...@us...> - 2008-03-29 06:25:52
|
Revision: 1073
http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1073&view=rev
Author: arnetheduck
Date: 2008-03-28 23:25:50 -0700 (Fri, 28 Mar 2008)
Log Message:
-----------
Make buttons inherit differently
Modified Paths:
--------------
dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h
dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectClickable.h
dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCheckBox.h
dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCoolbar.h
dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetGroupBox.h
dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRadioButton.h
dcplusplus/trunk/win32/ADLSProperties.cpp
dcplusplus/trunk/win32/ADLSearchFrame.cpp
dcplusplus/trunk/win32/ADLSearchFrame.h
dcplusplus/trunk/win32/Appearance2Page.cpp
dcplusplus/trunk/win32/CommandDlg.cpp
dcplusplus/trunk/win32/DirectoryListingFrame.cpp
dcplusplus/trunk/win32/DirectoryListingFrame.h
dcplusplus/trunk/win32/FavHubProperties.cpp
dcplusplus/trunk/win32/FavHubsFrame.cpp
dcplusplus/trunk/win32/FavHubsFrame.h
dcplusplus/trunk/win32/HashProgressDlg.cpp
dcplusplus/trunk/win32/HubListsDlg.cpp
dcplusplus/trunk/win32/MagnetDlg.cpp
dcplusplus/trunk/win32/PublicHubsFrame.cpp
dcplusplus/trunk/win32/PublicHubsFrame.h
dcplusplus/trunk/win32/SearchFrame.cpp
dcplusplus/trunk/win32/SearchFrame.h
dcplusplus/trunk/win32/SettingsDialog.cpp
dcplusplus/trunk/win32/UploadPage.cpp
dcplusplus/trunk/win32/WinUtil.cpp
dcplusplus/trunk/win32/WinUtil.h
Added Paths:
-----------
dcplusplus/trunk/smartwin/include/smartwin/widgets/Button.h
dcplusplus/trunk/smartwin/source/widgets/Button.cpp
Removed Paths:
-------------
dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h
dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetButton.h
dcplusplus/trunk/smartwin/source/widgets/WidgetButton.cpp
Property Changed:
----------------
dcplusplus/trunk/
Property changes on: dcplusplus/trunk
___________________________________________________________________
Name: bzr:revision-info
- timestamp: 2008-03-26 18:28:21.986000061 +0100
committer: zouzou123gen
properties:
branch-nick: bzr
+ timestamp: 2008-03-26 22:32:57.963999987 +0100
committer: Jacek Sieka <arn...@gm...>
properties:
branch-nick: dcplusplus
Name: bzr:file-ids
-
+ smartwin/include/smartwin/widgets/Button.h 844@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Faspects%2FAspectButton.h
smartwin/source/widgets/Button.cpp 800@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Fsource%2Fwidgets%2FWidgetButton.cpp
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
1045 arn...@gm...-20080326164801-8dru8mjc06xgzjpv
1046 arn...@gm...-20080326170438-uzl2rx8fqnohak7g
1047 zouzou123gen-20080326172821-d6uqcbmfb0c6rwlv
+ 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
1046 arn...@gm...-20080326170438-uzl2rx8fqnohak7g
1047 zouzou123gen-20080326172821-d6uqcbmfb0c6rwlv
1048 arn...@gm...-20080326213257-qlgdh7m2712p2l0q
Modified: dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/smartwin/include/smartwin/WidgetFactory.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -29,7 +29,7 @@
#define WidgetFactory_h
#include "../SmartUtil.h"
-#include "widgets/WidgetButton.h"
+#include "widgets/Button.h"
#include "widgets/WidgetCheckBox.h"
#include "widgets/WidgetChooseColor.h"
#include "widgets/WidgetChooseFolder.h"
@@ -76,8 +76,8 @@
* MessageMapPolicyNormalWidget, if this is a Widget constructed from a dialog
* resource, you must state so by adding SmartWin::MessageMapPolicyDialogWidget and
* if it is a MDI Child you must add SmartWin::MessageMapPolicyMDIChildWidget as the
- * third argument Then when you need e.g. a WidgetButton you would create that
- * button by calling createWidgetButton. Class contains type defs for your
+ * third argument Then when you need e.g. a Button you would create that
+ * button by calling createButton. Class contains type defs for your
* convenience for all Widget types that exists in the SmartWin library.< /p > Note!
* <br>
* It is CRUCIAL that you DON'T explicitly delete any of the objects returned from
@@ -130,10 +130,10 @@
typedef typename WidgetStatusBarSections::ObjectType WidgetStatusBarSectionsPtr;
/// Button class type.
- typedef SmartWin::WidgetButton WidgetButton;
+ typedef SmartWin::Button Button;
/// Button object type.
- typedef typename WidgetButton::ObjectType WidgetButtonPtr;
+ typedef typename Button::ObjectType ButtonPtr;
/// MDIWindow class type.
typedef SmartWin::WidgetMDIParent WidgetMDIParent;
@@ -345,7 +345,7 @@
/// Creates a Button Control and returns a pointer to it.
/** DON'T delete the returned pointer!!!
*/
- WidgetButtonPtr createButton( const typename WidgetButton::Seed & cs = WidgetButton::Seed() );
+ ButtonPtr createButton( const typename Button::Seed & cs = Button::Seed() );
/// Creates a Button Control and returns a pointer to it.
/** DON'T delete the returned pointer!!!
@@ -382,7 +382,7 @@
/** DON'T delete the returned pointer!!!< br >
* Use e.g. the Dialog Designer to design a dialog and attach the controls with this function.
*/
- WidgetButtonPtr attachButton( unsigned id );
+ ButtonPtr attachButton( unsigned id );
/// \ingroup SubclassDialog
/// Subclasses a Progress Bar Control from the given resource id.
@@ -592,10 +592,10 @@
}
template<typename ContainerWidgetType>
-typename WidgetFactory< ContainerWidgetType >::WidgetButtonPtr
- WidgetFactory< ContainerWidgetType >::createButton( const typename WidgetButton::Seed & cs )
+typename WidgetFactory< ContainerWidgetType >::ButtonPtr
+ WidgetFactory< ContainerWidgetType >::createButton( const Button::Seed & cs )
{
- return WidgetCreator< WidgetButton >::create( this, cs );
+ return WidgetCreator< Button >::create( this, cs );
}
template<typename ContainerWidgetType>
@@ -641,10 +641,10 @@
}
template<typename ContainerWidgetType>
-typename WidgetFactory< ContainerWidgetType >::WidgetButtonPtr
+typename WidgetFactory< ContainerWidgetType >::ButtonPtr
WidgetFactory< ContainerWidgetType >::attachButton( unsigned id )
{
- return WidgetCreator< WidgetButton >::attach( this, id );
+ return WidgetCreator< Button >::attach( this, id );
}
template<typename ContainerWidgetType>
Deleted: dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -1,75 +0,0 @@
-#ifndef ASPECTBUTTON_H_
-#define ASPECTBUTTON_H_
-
-#include "AspectColor.h"
-#include "AspectClickable.h"
-#include "AspectDblClickable.h"
-#include "AspectFocus.h"
-#include "AspectFont.h"
-#include "AspectPainting.h"
-#include "AspectText.h"
-#include "../widgets/Control.h"
-
-namespace SmartWin {
-/** Common stuff for all buttons */
-template<typename WidgetType>
-class AspectButton :
- public AspectClickable<WidgetType>,
- public AspectColor<WidgetType>,
- public AspectColorCtlImpl<WidgetType>,
- public Control,
- public AspectDblClickable<WidgetType>,
- public AspectFocus< WidgetType >,
- public AspectFont< WidgetType >,
- public AspectPainting< WidgetType >,
- public AspectText< WidgetType >
-{
- 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();
-
- // Contract needed by AspectDblClickable Aspect class
- Message getDblClickMessage();
-
- template<typename SeedType>
- void create(const SeedType& cs);
-
-protected:
- typedef AspectButton<WidgetType> ButtonType;
-
- AspectButton(Widget* parent);
-};
-
-template<typename WidgetType>
-Message AspectButton<WidgetType>::getClickMessage() {
- return Message( WM_COMMAND, MAKEWPARAM(static_cast<WidgetType*>(this)->getControlId(), BN_CLICKED) );
-}
-
-template<typename WidgetType>
-Message AspectButton<WidgetType>::getDblClickMessage() {
- return Message( WM_COMMAND, MAKEWPARAM(static_cast<WidgetType*>(this)->getControlId(), BN_DBLCLK) );
-}
-
-template<typename WidgetType>
-AspectButton<WidgetType>::AspectButton(Widget* parent) : ControlType(parent) {
-
-}
-
-template<typename WidgetType>
-template<typename SeedType>
-void AspectButton<WidgetType>::create( const SeedType & cs ) {
- ControlType::create(cs);
- if(cs.font)
- setFont( cs.font );
-}
-
-}
-
-#endif /*ASPECTBUTTON_H_*/
Modified: dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectClickable.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectClickable.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectClickable.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -36,7 +36,7 @@
/// Aspect class used by Widgets that have the possibility of being "clicked".
/** \ingroup AspectClasses
- * E.g. the WidgetButton have a "clicked" Aspect therefore it realizes the
+ * E.g. the Button have a "clicked" Aspect therefore it realizes the
* AspectClickable through inheritance. When you click a Widget which realizes this
* Aspect the onClicked event will be raised.
*/
Copied: dcplusplus/trunk/smartwin/include/smartwin/widgets/Button.h (from rev 1072, dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h)
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/widgets/Button.h (rev 0)
+++ dcplusplus/trunk/smartwin/include/smartwin/widgets/Button.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -0,0 +1,88 @@
+#ifndef ASPECTBUTTON_H_
+#define ASPECTBUTTON_H_
+
+#include "../aspects/AspectColor.h"
+#include "../aspects/AspectClickable.h"
+#include "../aspects/AspectDblClickable.h"
+#include "../aspects/AspectFocus.h"
+#include "../aspects/AspectFont.h"
+#include "../aspects/AspectPainting.h"
+#include "../aspects/AspectText.h"
+#include "Control.h"
+
+namespace SmartWin {
+
+// Forward declaring friends
+template< class WidgetType >
+class WidgetCreator;
+
+/** Common stuff for all buttons */
+class Button :
+ public Control,
+ public AspectClickable<Button>,
+ public AspectColor<Button>,
+ public AspectColorCtlImpl<Button>,
+ public AspectDblClickable<Button>,
+ public AspectFocus< Button >,
+ public AspectFont< Button >,
+ public AspectPainting< Button >,
+ public AspectText< Button >
+{
+ friend class WidgetCreator<Button>;
+public:
+ /// Class type
+ typedef Button 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
+ * should define one of these.
+ */
+ class Seed : public Widget::Seed {
+ public:
+ FontPtr font;
+
+ /// Fills with default parameters
+ Seed(const SmartUtil::tstring& caption_ = SmartUtil::tstring());
+ };
+
+ // Contract needed by AspectClickable Aspect class
+ Message getClickMessage();
+
+ // Contract needed by AspectDblClickable Aspect class
+ Message getDblClickMessage();
+
+ template<typename SeedType>
+ void create(const SeedType& cs);
+
+protected:
+ typedef Button ButtonType;
+
+ Button(Widget* parent);
+};
+
+inline Message Button::getClickMessage() {
+ return Message( WM_COMMAND, MAKEWPARAM(getControlId(), BN_CLICKED) );
+}
+
+inline Message Button::getDblClickMessage() {
+ return Message( WM_COMMAND, MAKEWPARAM(getControlId(), BN_DBLCLK) );
+}
+
+inline Button::Button(Widget* parent) : ControlType(parent) {
+
+}
+
+template<typename SeedType>
+void Button::create( const SeedType & cs ) {
+ ControlType::create(cs);
+ if(cs.font)
+ setFont( cs.font );
+}
+
+}
+
+#endif /*ASPECTBUTTON_H_*/
Deleted: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetButton.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetButton.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetButton.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -1,90 +0,0 @@
-/*
- Copyright ( c ) 2005, Thomas Hansen
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification,
- are permitted provided that the following conditions are met :
-
- * Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- * Neither the name of the SmartWin++ nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- ( INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#ifndef WidgetButton_h
-#define WidgetButton_h
-
-#include "../Widget.h"
-#include "../aspects/AspectButton.h"
-
-namespace SmartWin
-{
-// begin namespace SmartWin
-
-// Forward declaring friends
-template< class WidgetType >
-class WidgetCreator;
-
-/// Button Control class
-/** \ingroup WidgetControls
- * \WidgetUsageInfo
- * \image html button.PNG
- * Class for creating a button control Widget. <br>
- * A button is a Widget which can be pressed, it can contain descriptive text etc.
- */
-class WidgetButton :
- // Aspects
- public AspectButton< WidgetButton >
-{
- friend class WidgetCreator< WidgetButton >;
-public:
- /// 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
- * should define one of these.
- */
- class Seed : public Widget::Seed {
- public:
- FontPtr font;
-
- /// Fills with default parameters
- Seed(const SmartUtil::tstring& caption_ = SmartUtil::tstring());
- };
-
-protected:
- /// Constructor Taking pointer to parent
- explicit WidgetButton( Widget * parent );
-
- // Protected to avoid direct instantiation, you can inherit and use
- // WidgetCreator class which is friend
- virtual ~WidgetButton()
- {}
-};
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// Implementation of class
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-inline WidgetButton::WidgetButton( Widget * parent )
- : ButtonType( parent )
-{
-}
-
-// end namespace SmartWin
-}
-
-#endif
Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCheckBox.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCheckBox.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCheckBox.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -29,7 +29,7 @@
#define WidgetCheckBox_h
#include "../Widget.h"
-#include "../aspects/AspectButton.h"
+#include "Button.h"
namespace SmartWin
{
@@ -50,17 +50,22 @@
*/
class WidgetCheckBox :
// Aspect classes
- public AspectButton< WidgetCheckBox >
+ public Button
{
friend class WidgetCreator< WidgetCheckBox >;
public:
+ /// Class type
+ typedef WidgetCheckBox 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
- * should define one of these.
+ * should define one of these.
*/
- class Seed : public Widget::Seed
- {
+ class Seed : public Widget::Seed {
public:
FontPtr font;
Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCoolbar.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCoolbar.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetCoolbar.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -38,7 +38,7 @@
#include "../aspects/AspectSizable.h"
#include "../aspects/AspectVisible.h"
#include "../xCeption.h"
-#include "WidgetButton.h"
+#include "Button.h"
#include "WidgetCheckBox.h"
#include "WidgetComboBox.h"
#include "WidgetDateTimePicker.h"
@@ -47,6 +47,7 @@
#include "WidgetSpinner.h"
#include "WidgetTextBox.h"
#include "WidgetTreeView.h"
+#include "WidgetRadioButton.h"
namespace SmartWin
{
@@ -121,7 +122,7 @@
typedef WidgetTextBox::ObjectType WidgetTextBoxPtr;
/// Button object type.
- typedef WidgetButton::ObjectType WidgetButtonPtr;
+ typedef Button::ObjectType ButtonPtr;
/// Button object type.
typedef WidgetTreeView::ObjectType WidgetTreeViewPtr;
Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetGroupBox.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetGroupBox.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetGroupBox.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -29,11 +29,8 @@
#define WidgetGroupBox_h
#include "../Widget.h"
-#include "../aspects/AspectButton.h"
-#include "WidgetRadioButton.h"
+#include "Button.h"
-#include <vector>
-
namespace SmartWin
{
// begin namespace SmartWin
@@ -53,19 +50,22 @@
* add up your WidgetRadioButtons into an object of this type
*/
class WidgetGroupBox :
- // Aspects
- public AspectButton< WidgetGroupBox >
+ public Button
{
friend class WidgetCreator< WidgetGroupBox >;
public:
+ /// Class type
+ typedef WidgetGroupBox 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
- * should define one of these.
+ * should define one of these.
*/
- class Seed
- : public Widget::Seed
- {
+ class Seed : public Widget::Seed {
public:
FontPtr font;
@@ -73,57 +73,25 @@
Seed(const SmartUtil::tstring& caption_ = SmartUtil::tstring());
};
- /// Add a radio button to the group box
- void addChild( WidgetRadioButton::ObjectType btn );
-
protected:
/// Constructor Taking pointer to parent
- explicit WidgetGroupBox( SmartWin::Widget * parent );
+ explicit WidgetGroupBox( Widget * parent );
// Protected to avoid direct instantiation, you can inherit and use
// WidgetFactory class which is friend
virtual ~WidgetGroupBox()
{}
-private:
- std::vector< WidgetRadioButton::ObjectType > itsChildrenBtns;
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Implementation of class
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-inline WidgetGroupBox::WidgetGroupBox( SmartWin::Widget * parent )
+inline WidgetGroupBox::WidgetGroupBox( Widget * parent )
: ButtonType( parent )
{
}
-
-inline void WidgetGroupBox::addChild( WidgetRadioButton::ObjectType btn )
-{
- itsChildrenBtns.push_back( btn );
-}
-
-#ifdef PORT_ME
-
-LRESULT WidgetGroupBox::sendWidgetMessage( HWND hWnd, UINT msg, WPARAM & wPar, LPARAM & lPar )
-{
- switch ( msg )
- {
- // Checking to see if it's a click event which should be routed to one of the children
- case WM_COMMAND :
- {
- for ( typename std::list< typename WidgetRadioButton::ObjectType >::iterator idx = itsChildrenBtns.begin();
- idx != itsChildrenBtns.end();
- ++idx )
- {
- if ( reinterpret_cast< HANDLE >( lPar ) == ( * idx )->handle() )
- return ( * idx )->sendWidgetMessage( hWnd, msg, wPar, lPar );
- }
- }
- }
- return MessageMapType::sendWidgetMessage( hWnd, msg, wPar, lPar );
-}
-#endif
// end namespace SmartWin
}
Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRadioButton.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRadioButton.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetRadioButton.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -29,7 +29,7 @@
#define WidgetRadioButton_h
#include "../Widget.h"
-#include "../aspects/AspectButton.h"
+#include "Button.h"
namespace SmartWin
{
@@ -54,18 +54,22 @@
*/
class WidgetRadioButton :
// Aspects
- public AspectButton< WidgetRadioButton >
+ public Button
{
friend class WidgetCreator< WidgetRadioButton >;
public:
+ /// Class type
+ typedef WidgetRadioButton 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
* should define one of these.
*/
- class Seed
- : public Widget::Seed
- {
+ class Seed : public Widget::Seed {
public:
FontPtr font;
Copied: dcplusplus/trunk/smartwin/source/widgets/Button.cpp (from rev 1072, dcplusplus/trunk/smartwin/source/widgets/WidgetButton.cpp)
===================================================================
--- dcplusplus/trunk/smartwin/source/widgets/Button.cpp (rev 0)
+++ dcplusplus/trunk/smartwin/source/widgets/Button.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -0,0 +1,11 @@
+#include "../../include/smartwin/widgets/Button.h"
+
+namespace SmartWin {
+
+Button::Seed::Seed(const SmartUtil::tstring& caption) :
+ Widget::Seed(WC_BUTTON, WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON, 0, caption),
+ font(new Font(DefaultGuiFont))
+{
+}
+
+}
Deleted: dcplusplus/trunk/smartwin/source/widgets/WidgetButton.cpp
===================================================================
--- dcplusplus/trunk/smartwin/source/widgets/WidgetButton.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/smartwin/source/widgets/WidgetButton.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -1,11 +0,0 @@
-#include "../../include/smartwin/widgets/WidgetButton.h"
-
-namespace SmartWin {
-
-WidgetButton::Seed::Seed(const SmartUtil::tstring& caption) :
- Widget::Seed(WC_BUTTON, WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON, 0, caption),
- font(new Font(DefaultGuiFont))
-{
-}
-
-}
Modified: dcplusplus/trunk/win32/ADLSProperties.cpp
===================================================================
--- dcplusplus/trunk/win32/ADLSProperties.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/ADLSProperties.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -88,7 +88,7 @@
autoQueue->setText(T_("Download Matches"));
autoQueue->setChecked(search->isAutoQueue);
- WidgetButtonPtr button = attachButton(IDOK);
+ ButtonPtr button = attachButton(IDOK);
button->onClicked(std::tr1::bind(&ADLSProperties::handleOKClicked, this));
button = attachButton(IDCANCEL);
Modified: dcplusplus/trunk/win32/ADLSearchFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/ADLSearchFrame.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/ADLSearchFrame.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -62,7 +62,7 @@
}
{
- WidgetButton::Seed cs = WinUtil::Seeds::button;
+ Button::Seed cs = WinUtil::Seeds::button;
cs.caption = T_("&New...");
add = createButton(cs);
Modified: dcplusplus/trunk/win32/ADLSearchFrame.h
===================================================================
--- dcplusplus/trunk/win32/ADLSearchFrame.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/ADLSearchFrame.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -57,12 +57,12 @@
static int columnIndexes[COLUMN_LAST];
WidgetListViewPtr items;
- WidgetButtonPtr add;
- WidgetButtonPtr properties;
- WidgetButtonPtr up;
- WidgetButtonPtr down;
- WidgetButtonPtr remove;
- WidgetButtonPtr help;
+ ButtonPtr add;
+ ButtonPtr properties;
+ ButtonPtr up;
+ ButtonPtr down;
+ ButtonPtr remove;
+ ButtonPtr help;
void handleAdd();
void handleProperties();
Modified: dcplusplus/trunk/win32/Appearance2Page.cpp
===================================================================
--- dcplusplus/trunk/win32/Appearance2Page.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/Appearance2Page.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -82,7 +82,7 @@
example->setColor(fg, bg);
example->setFont(font);
- WidgetButtonPtr button = attachButton(IDC_SELWINCOLOR);
+ ButtonPtr button = attachButton(IDC_SELWINCOLOR);
button->onClicked(std::tr1::bind(&Appearance2Page::handleBackgroundClicked, this));
button = attachButton(IDC_SELTEXT);
Modified: dcplusplus/trunk/win32/CommandDlg.cpp
===================================================================
--- dcplusplus/trunk/win32/CommandDlg.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/CommandDlg.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -148,7 +148,7 @@
openHelp->setChecked(bOpenHelp);
{
- WidgetButtonPtr button = attachButton(IDOK);
+ ButtonPtr button = attachButton(IDOK);
button->setText(T_("OK"));
button->onClicked(std::tr1::bind(&CommandDlg::handleOKClicked, this));
Modified: dcplusplus/trunk/win32/DirectoryListingFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -153,7 +153,7 @@
}
{
- WidgetButton::Seed cs = WinUtil::Seeds::button;
+ Button::Seed cs = WinUtil::Seeds::button;
cs.caption = T_("Find");
find = createButton(cs);
Modified: dcplusplus/trunk/win32/DirectoryListingFrame.h
===================================================================
--- dcplusplus/trunk/win32/DirectoryListingFrame.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/DirectoryListingFrame.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -137,10 +137,10 @@
WidgetFilesPtr files;
WidgetVPanedPtr paned;
- WidgetButtonPtr find;
- WidgetButtonPtr findNext;
- WidgetButtonPtr listDiff;
- WidgetButtonPtr matchQueue;
+ ButtonPtr find;
+ ButtonPtr findNext;
+ ButtonPtr listDiff;
+ ButtonPtr matchQueue;
int64_t speed; /**< Speed at which this file list was downloaded */
Modified: dcplusplus/trunk/win32/FavHubProperties.cpp
===================================================================
--- dcplusplus/trunk/win32/FavHubProperties.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/FavHubProperties.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -79,7 +79,7 @@
userDescription->setTextLimit(35);
userDescription->setText(Text::toT(entry->getUserDescription()));
- WidgetButtonPtr button = attachButton(IDOK);
+ ButtonPtr button = attachButton(IDOK);
button->onClicked(std::tr1::bind(&FavHubProperties::handleOKClicked, this));
button = attachButton(IDCANCEL);
Modified: dcplusplus/trunk/win32/FavHubsFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/FavHubsFrame.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/FavHubsFrame.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -66,7 +66,7 @@
}
{
- WidgetButton::Seed cs = WinUtil::Seeds::button;
+ Button::Seed cs = WinUtil::Seeds::button;
cs.caption = T_("&Connect");
connect = createButton(cs);
Modified: dcplusplus/trunk/win32/FavHubsFrame.h
===================================================================
--- dcplusplus/trunk/win32/FavHubsFrame.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/FavHubsFrame.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -63,12 +63,12 @@
static int columnIndexes[COLUMN_LAST];
WidgetListViewPtr hubs;
- WidgetButtonPtr connect;
- WidgetButtonPtr add;
- WidgetButtonPtr properties;
- WidgetButtonPtr up;
- WidgetButtonPtr down;
- WidgetButtonPtr remove;
+ ButtonPtr connect;
+ ButtonPtr add;
+ ButtonPtr properties;
+ ButtonPtr up;
+ ButtonPtr down;
+ ButtonPtr remove;
bool nosave;
Modified: dcplusplus/trunk/win32/HashProgressDlg.cpp
===================================================================
--- dcplusplus/trunk/win32/HashProgressDlg.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/HashProgressDlg.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -46,7 +46,7 @@
progress = attachProgressBar(IDC_HASH_PROGRESS);
progress->setRange(0, 10000);
- WidgetButtonPtr ok = attachButton(IDOK);
+ ButtonPtr ok = attachButton(IDOK);
ok->setText(T_("Run in background"));
ok->onClicked(std::tr1::bind(&HashProgressDlg::endDialog, this, IDOK));
Modified: dcplusplus/trunk/win32/HubListsDlg.cpp
===================================================================
--- dcplusplus/trunk/win32/HubListsDlg.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/HubListsDlg.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -59,7 +59,7 @@
hubLists->onDblClicked(std::tr1::bind(&HubListsDlg::handleDoubleClick, this));
hubLists->onKeyDown(std::tr1::bind(&HubListsDlg::handleKeyDown, this, _1));
- WidgetButtonPtr button = attachButton(IDC_LIST_ADD);
+ ButtonPtr button = attachButton(IDC_LIST_ADD);
button->setText(T_("&Add"));
button->onClicked(std::tr1::bind(&HubListsDlg::handleAddClicked, this));
Modified: dcplusplus/trunk/win32/MagnetDlg.cpp
===================================================================
--- dcplusplus/trunk/win32/MagnetDlg.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/MagnetDlg.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -68,7 +68,7 @@
::CheckRadioButton(handle(), IDC_MAGNET_1_QUEUE, IDC_MAGNET_3_NOTHING, IDC_MAGNET_2_SEARCH);
- WidgetButtonPtr button = attachButton(IDOK);
+ ButtonPtr button = attachButton(IDOK);
button->onClicked(std::tr1::bind(&MagnetDlg::handleOKClicked, this));
button = attachButton(IDCANCEL);
Modified: dcplusplus/trunk/win32/PublicHubsFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/PublicHubsFrame.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/PublicHubsFrame.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -147,7 +147,7 @@
}
{
- WidgetButton::Seed cs = WinUtil::Seeds::button;
+ Button::Seed cs = WinUtil::Seeds::button;
cs.caption = T_("&Configure");
configure = createButton(cs);
Modified: dcplusplus/trunk/win32/PublicHubsFrame.h
===================================================================
--- dcplusplus/trunk/win32/PublicHubsFrame.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/PublicHubsFrame.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -96,10 +96,10 @@
typedef WidgetHubs* WidgetHubsPtr;
WidgetHubsPtr hubs;
- WidgetButtonPtr configure;
- WidgetButtonPtr refresh;
- WidgetButtonPtr lists;
- WidgetButtonPtr filterDesc;
+ ButtonPtr configure;
+ ButtonPtr refresh;
+ ButtonPtr lists;
+ ButtonPtr filterDesc;
WidgetTextBoxPtr filter;
WidgetComboBoxPtr pubLists;
WidgetComboBoxPtr filterSel;
Modified: dcplusplus/trunk/win32/SearchFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/SearchFrame.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/SearchFrame.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -144,7 +144,7 @@
}
{
- WidgetButton::Seed cs = WinUtil::Seeds::button;
+ Button::Seed cs = WinUtil::Seeds::button;
cs.caption = T_("Purge");
purge = createButton(cs);
purge->setHelpId(IDH_SEARCH_PURGE);
Modified: dcplusplus/trunk/win32/SearchFrame.h
===================================================================
--- dcplusplus/trunk/win32/SearchFrame.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/SearchFrame.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -156,7 +156,7 @@
WidgetStaticPtr searchLabel;
WidgetComboBoxPtr searchBox;
- WidgetButtonPtr purge;
+ ButtonPtr purge;
WidgetStaticPtr sizeLabel;
WidgetComboBoxPtr mode;
@@ -175,7 +175,7 @@
typedef WidgetHubs* WidgetHubsPtr;
WidgetHubsPtr hubs;
- WidgetButtonPtr doSearch;
+ ButtonPtr doSearch;
typedef TypedListView<SearchInfo> WidgetResults;
typedef WidgetResults* WidgetResultsPtr;
Modified: dcplusplus/trunk/win32/SettingsDialog.cpp
===================================================================
--- dcplusplus/trunk/win32/SettingsDialog.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/SettingsDialog.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -74,7 +74,7 @@
pageTree->onSelectionChanged(std::tr1::bind(&SettingsDialog::selectionChanged, this));
{
- WidgetButtonPtr button = attachButton(IDOK);
+ ButtonPtr button = attachButton(IDOK);
button->setText(T_("OK"));
button->onClicked(std::tr1::bind(&SettingsDialog::handleOKClicked, this));
Modified: dcplusplus/trunk/win32/UploadPage.cpp
===================================================================
--- dcplusplus/trunk/win32/UploadPage.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/UploadPage.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -111,7 +111,7 @@
total = attachStatic(IDC_TOTAL);
total->setText(Text::toT(Util::formatBytes(ShareManager::getInstance()->getShareSize())));
- WidgetButtonPtr button = attachButton(IDC_RENAME);
+ ButtonPtr button = attachButton(IDC_RENAME);
button->onClicked(std::tr1::bind(&UploadPage::handleRenameClicked, this));
button = attachButton(IDC_REMOVE);
Modified: dcplusplus/trunk/win32/WinUtil.cpp
===================================================================
--- dcplusplus/trunk/win32/WinUtil.cpp 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/WinUtil.cpp 2008-03-29 06:25:50 UTC (rev 1073)
@@ -58,7 +58,7 @@
WinUtil::ImageMap WinUtil::fileIndexes;
DWORD WinUtil::helpCookie = 0;
-const SmartWin::WidgetButton::Seed WinUtil::Seeds::button;
+const SmartWin::Button::Seed WinUtil::Seeds::button;
const SmartWin::WidgetComboBox::Seed WinUtil::Seeds::comboBoxStatic;
const SmartWin::WidgetComboBox::Seed WinUtil::Seeds::comboBoxEdit;
const SmartWin::WidgetListView::Seed WinUtil::Seeds::listView;
@@ -120,7 +120,7 @@
}
// Const so that noone else will change them after they've been initialized
- //SmartWin::WidgetButton::Seed& xbutton = const_cast<SmartWin::WidgetButton::Seed&>(Seeds::button);
+ //SmartWin::Button::Seed& xbutton = const_cast<SmartWin::Button::Seed&>(Seeds::button);
SmartWin::WidgetComboBox::Seed& xcomboBoxEdit = const_cast<SmartWin::WidgetComboBox::Seed&>(Seeds::comboBoxEdit);
SmartWin::WidgetComboBox::Seed& xcomboBoxStatic = const_cast<SmartWin::WidgetComboBox::Seed&>(Seeds::comboBoxStatic);
SmartWin::WidgetListView::Seed& xlistView = const_cast<SmartWin::WidgetListView::Seed&>(Seeds::listView);
Modified: dcplusplus/trunk/win32/WinUtil.h
===================================================================
--- dcplusplus/trunk/win32/WinUtil.h 2008-03-29 06:24:22 UTC (rev 1072)
+++ dcplusplus/trunk/win32/WinUtil.h 2008-03-29 06:25:50 UTC (rev 1073)
@@ -67,7 +67,7 @@
static ImageMap fileIndexes;
struct Seeds {
- static const SmartWin::WidgetButton::Seed button;
+ static const SmartWin::Button::Seed button;
static const SmartWin::WidgetComboBox::Seed comboBoxStatic;
static const SmartWin::WidgetComboBox::Seed comboBoxEdit;
static const SmartWin::WidgetListView::Seed listView;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|