|
From: <arn...@us...> - 2008-03-26 14:15:01
|
Revision: 1064
http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=1064&view=rev
Author: arnetheduck
Date: 2008-03-26 07:14:56 -0700 (Wed, 26 Mar 2008)
Log Message:
-----------
Single interface for color setting
Modified Paths:
--------------
dcplusplus/trunk/changelog.txt
dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h
dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetComboBox.h
dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h
dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatic.h
dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h
dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h
dcplusplus/trunk/win32/ADLSearchFrame.cpp
dcplusplus/trunk/win32/Appearance2Page.cpp
dcplusplus/trunk/win32/Appearance2Page.h
dcplusplus/trunk/win32/DirectoryListingFrame.cpp
dcplusplus/trunk/win32/FavHubsFrame.cpp
dcplusplus/trunk/win32/FinishedFrameBase.h
dcplusplus/trunk/win32/HubFrame.cpp
dcplusplus/trunk/win32/MDIChildFrame.h
dcplusplus/trunk/win32/PublicHubsFrame.cpp
dcplusplus/trunk/win32/QueueFrame.cpp
dcplusplus/trunk/win32/SearchFrame.cpp
dcplusplus/trunk/win32/SpyFrame.cpp
dcplusplus/trunk/win32/UsersFrame.cpp
dcplusplus/trunk/win32/WaitingUsersFrame.cpp
Added Paths:
-----------
dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectColor.h
Removed Paths:
-------------
dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectBackgroundColor.h
Property Changed:
----------------
dcplusplus/trunk/
Property changes on: dcplusplus/trunk
___________________________________________________________________
Name: bzr:revision-info
- timestamp: 2008-03-25 18:52:16.157999992 +0100
committer: zouzou123gen
properties:
branch-nick: bzr
+ timestamp: 2008-03-25 22:01:37.789999962 +0100
committer: Jacek Sieka <arn...@gm...>
properties:
branch-nick: dcplusplus
Name: bzr:file-ids
-
+ smartwin/include/smartwin/aspects/AspectColor.h 712@f586c4b0-9d0d-0410-bc51-f1fe239209fc:dcplusplus%2Ftrunk:smartwin%2Finclude%2Fsmartwin%2Faspects%2FAspectBackgroundColor.h
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
+ 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
Modified: dcplusplus/trunk/changelog.txt
===================================================================
--- dcplusplus/trunk/changelog.txt 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/changelog.txt 2008-03-26 14:14:56 UTC (rev 1064)
@@ -6,6 +6,7 @@
* [L#203865] Fixed multiple instances (poy)
* Context-sensitive help (poy)
* Fixed toolbar separators (poy)
+* Upgraded to bzip2 1.0.5 (thanks mikejj)
-- 0.705 2008-03-14 --
* Several patches for better *nix compatibility of the core (thanks steven sheehy et al)
Deleted: dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectBackgroundColor.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectBackgroundColor.h 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectBackgroundColor.h 2008-03-26 14:14:56 UTC (rev 1064)
@@ -1,77 +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 AspectBackgroundColor_h
-#define AspectBackgroundColor_h
-
-#include "../resources/Brush.h"
-#include "../CanvasClasses.h"
-
-namespace SmartWin
-{
-// begin namespace SmartWin
-
-/// Aspect class used by Widgets that have the possibility of handling the
-/// erase background property
-/** \ingroup AspectClasses
- * E.g. the WidgetWindow has a background Aspect to it, therefore WidgetListView
- * realizes the AspectEnabled through inheritance.
- */
-template< class WidgetType >
-class AspectCtlColor {
- WidgetType& W() { return *static_cast<WidgetType*>(this); }
-
- struct Dispatcher {
- Dispatcher(const BrushPtr& brush_, COLORREF text_, COLORREF bg_) : brush(brush_), text(text_), bg(bg_) { }
-
- bool operator()(const MSG& msg, LRESULT& ret) {
- HDC dc = (HDC) msg.wParam;
- ::SetTextColor(dc, text);
- ::SetBkColor(dc, bg);
- ret = brush ? reinterpret_cast< LRESULT >( brush->handle() ) : 0;
- return true;
- }
-
- BrushPtr brush;
- COLORREF text;
- COLORREF bg;
- };
-
-public:
- /// Set the background, text and text colors
- void setColor(const BrushPtr& brush, COLORREF text, COLORREF textBackground) {
- W().setCallback(Message(WM_CTLCOLOR), Dispatcher( brush, text, textBackground ));
- }
-
-protected:
- virtual ~AspectCtlColor() { }
-};
-
-// end namespace SmartWin
-}
-
-#endif
Modified: dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectButton.h 2008-03-26 14:14:56 UTC (rev 1064)
@@ -1,8 +1,8 @@
#ifndef ASPECTBUTTON_H_
#define ASPECTBUTTON_H_
-#include "AspectBackgroundColor.h"
#include "AspectBorder.h"
+#include "AspectColor.h"
#include "AspectClickable.h"
#include "AspectControl.h"
#include "AspectDblClickable.h"
@@ -15,9 +15,10 @@
/** Common stuff for all buttons */
template<typename WidgetType>
class AspectButton :
- public AspectCtlColor<WidgetType>,
public AspectBorder< WidgetType >,
public AspectClickable<WidgetType>,
+ public AspectColor<WidgetType>,
+ public AspectColorCtlImpl<WidgetType>,
public AspectControl<WidgetType>,
public AspectDblClickable<WidgetType>,
public AspectFocus< WidgetType >,
Copied: dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectColor.h (from rev 1063, dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectBackgroundColor.h)
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectColor.h (rev 0)
+++ dcplusplus/trunk/smartwin/include/smartwin/aspects/AspectColor.h 2008-03-26 14:14:56 UTC (rev 1064)
@@ -0,0 +1,91 @@
+/*
+ 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 AspectColor_h
+#define AspectColor_h
+
+#include "../resources/Brush.h"
+#include "../CanvasClasses.h"
+
+namespace SmartWin
+{
+// begin namespace SmartWin
+
+/// Aspect class used by Widgets that have the possibility of handling the
+/// erase background property
+/** \ingroup AspectClasses
+ * E.g. the WidgetWindow has a background Aspect to it, therefore WidgetListView
+ * realizes the AspectEnabled through inheritance.
+ */
+template<class WidgetType>
+class AspectColor {
+ WidgetType& W() { return *static_cast<WidgetType*>(this); }
+public:
+ void setColor(COLORREF text, COLORREF background) {
+ W().setColorImpl(text, background);
+ }
+
+protected:
+ virtual ~AspectColor() { }
+};
+
+template< class WidgetType >
+class AspectColorCtlImpl {
+ friend class AspectColor<WidgetType>;
+
+ WidgetType& W() { return *static_cast<WidgetType*>(this); }
+
+ struct Dispatcher {
+ Dispatcher(COLORREF text_, COLORREF bg_) : brush(new Brush(bg_)), text(text_), bg(bg_) { }
+
+ bool operator()(const MSG& msg, LRESULT& ret) {
+ HDC dc = (HDC) msg.wParam;
+ ::SetTextColor(dc, text);
+ ::SetBkColor(dc, bg);
+ ret = brush ? reinterpret_cast< LRESULT >( brush->handle() ) : 0;
+ return true;
+ }
+
+ BrushPtr brush;
+ COLORREF text;
+ COLORREF bg;
+ };
+
+ /// Set the background, text and text colors
+ void setColorImpl(COLORREF text, COLORREF background) {
+ W().setCallback(Message(WM_CTLCOLOR), Dispatcher(text, background));
+ }
+
+protected:
+ virtual ~AspectColorCtlImpl() { }
+};
+
+
+// end namespace SmartWin
+}
+
+#endif
Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetComboBox.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetComboBox.h 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetComboBox.h 2008-03-26 14:14:56 UTC (rev 1064)
@@ -30,7 +30,7 @@
#include "../Widget.h"
#include "../aspects/AspectBorder.h"
-#include "../aspects/AspectBackgroundColor.h"
+#include "../aspects/AspectColor.h"
#include "../aspects/AspectClickable.h"
#include "../aspects/AspectControl.h"
#include "../aspects/AspectDblClickable.h"
@@ -58,9 +58,10 @@
*/
class WidgetComboBox :
// Aspects
- public AspectCtlColor< WidgetComboBox >,
public AspectBorder< WidgetComboBox >,
public AspectClickable< WidgetComboBox >,
+ public AspectColor< WidgetComboBox >,
+ public AspectColorCtlImpl<WidgetComboBox>,
public AspectControl<WidgetComboBox>,
public AspectDblClickable< WidgetComboBox >,
public AspectFocus< WidgetComboBox >,
@@ -70,6 +71,8 @@
public AspectText< WidgetComboBox >
{
friend class WidgetCreator< WidgetComboBox >;
+ friend class AspectColor<WidgetComboBox>;
+
public:
/// Seed class
@@ -99,9 +102,6 @@
// Aspect expectation implementation
Message getDblClickMessage();
- // Aspect expectation implementation
- static const Message & getBackgroundColorMessage();
-
// Commented in AspectSelection
int getSelectedIndex() const;
@@ -183,12 +183,6 @@
return Message( WM_COMMAND, MAKEWPARAM(this->getControlId(), CBN_DBLCLK) );
}
-inline const Message & WidgetComboBox::getBackgroundColorMessage()
-{
- static const Message retVal( WM_CTLCOLORLISTBOX );
- return retVal;
-}
-
inline int WidgetComboBox::getSelectedIndex() const
{
int retVal = ComboBox_GetCurSel( handle() );
Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetListView.h 2008-03-26 14:14:56 UTC (rev 1064)
@@ -35,6 +35,7 @@
#include "../aspects/AspectBorder.h"
#include "../aspects/AspectClickable.h"
#include "../aspects/AspectCollection.h"
+#include "../aspects/AspectColor.h"
#include "../aspects/AspectControl.h"
#include "../aspects/AspectData.h"
#include "../aspects/AspectDblClickable.h"
@@ -72,6 +73,7 @@
public AspectBorder< WidgetListView >,
public AspectClickable< WidgetListView >,
public AspectCollection<WidgetListView, int>,
+ public AspectColor<WidgetListView>,
public AspectControl<WidgetListView>,
public AspectData<WidgetListView, int>,
public AspectDblClickable< WidgetListView >,
@@ -97,6 +99,7 @@
// Need to be friend to access private data...
friend class WidgetCreator< WidgetListView >;
friend class AspectCollection<WidgetListView, int>;
+ friend class AspectColor<WidgetListView>;
friend class AspectData<WidgetListView, int>;
public:
@@ -469,8 +472,6 @@
void ensureVisible(int i, bool partial = false);
- void setColor(COLORREF text, COLORREF background);
-
/// Actually creates the Data Grid Control
/** You should call WidgetFactory::createListView if you instantiate class
* directly. <br>
@@ -545,6 +546,10 @@
void eraseImpl( int row );
void clearImpl();
size_t sizeImpl() const;
+
+ // AspectColor
+ void setColorImpl(COLORREF text, COLORREF background);
+
};
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -852,7 +857,7 @@
ListView_EnsureVisible(this->handle(), i, false);
}
-inline void WidgetListView::setColor(COLORREF text, COLORREF background) {
+inline void WidgetListView::setColorImpl(COLORREF text, COLORREF background) {
ListView_SetTextColor(this->handle(), text);
ListView_SetTextBkColor(this->handle(), background);
ListView_SetBkColor(this->handle(), background);
Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatic.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatic.h 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetStatic.h 2008-03-26 14:14:56 UTC (rev 1064)
@@ -29,8 +29,8 @@
#define WidgetStatic_h
#include "../Widget.h"
-#include "../aspects/AspectBackgroundColor.h"
#include "../aspects/AspectBorder.h"
+#include "../aspects/AspectColor.h"
#include "../aspects/AspectClickable.h"
#include "../aspects/AspectControl.h"
#include "../aspects/AspectDblClickable.h"
@@ -62,9 +62,10 @@
*/
class WidgetStatic :
// Aspects
- public AspectCtlColor< WidgetStatic >,
public AspectBorder< WidgetStatic >,
public AspectClickable< WidgetStatic >,
+ public AspectColor< WidgetStatic >,
+ public AspectColorCtlImpl<WidgetStatic>,
public AspectControl<WidgetStatic>,
public AspectDblClickable< WidgetStatic >,
public AspectFocus< WidgetStatic >,
@@ -92,9 +93,6 @@
// Contract needed by AspectClickable Aspect class
Message getClickMessage();
- // Contract needed by AspectBackgroundColor Aspect class
- static const Message & getBackgroundColorMessage();
-
// Contract needed by AspectDblClickable Aspect class
Message getDblClickMessage();
@@ -126,21 +124,11 @@
void setBitmap( HBITMAP bitmap );
};
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// Implementation of class
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
inline Message WidgetStatic::getClickMessage()
{
return Message( WM_COMMAND, MAKEWPARAM(this->getControlId(), STN_CLICKED) );
}
-inline const Message & WidgetStatic::getBackgroundColorMessage()
-{
- static const Message retVal( WM_CTLCOLORSTATIC );
- return retVal;
-}
-
inline Message WidgetStatic::getDblClickMessage()
{
return Message( WM_COMMAND, MAKEWPARAM(this->getControlId(), STN_DBLCLK) );
Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTextBox.h 2008-03-26 14:14:56 UTC (rev 1064)
@@ -29,8 +29,8 @@
#define WidgetTextBox_h
#include "../Widget.h"
-#include "../aspects/AspectBackgroundColor.h"
#include "../aspects/AspectBorder.h"
+#include "../aspects/AspectColor.h"
#include "../aspects/AspectControl.h"
#include "../aspects/AspectFocus.h"
#include "../aspects/AspectFont.h"
@@ -66,8 +66,9 @@
*/
class WidgetTextBoxBase :
// Aspect classes
- public AspectCtlColor< WidgetTextBoxBase >,
public AspectBorder< WidgetTextBoxBase >,
+ public AspectColor< WidgetTextBoxBase >,
+ public AspectColorCtlImpl<WidgetTextBoxBase>,
public AspectControl< WidgetTextBoxBase >,
public AspectFocus< WidgetTextBoxBase >,
public AspectFont< WidgetTextBoxBase >,
@@ -83,9 +84,6 @@
// Contract needed by AspectUpdate Aspect class
Message getUpdateMessage();
- // Contract needed by AspectBackgroundColor Aspect class
- const Message & getBackgroundColorMessage();
-
/// Sets the current selection of the Edit Control
/** Start means the offset of where the current selection shall start, if it is
* omitted it defaults to 0. <br>
@@ -289,15 +287,6 @@
return Message( WM_COMMAND, MAKEWPARAM(this->getControlId(), EN_UPDATE) );
}
-inline const Message & WidgetTextBoxBase::getBackgroundColorMessage()
-{
- // TODO What if readonly status changes?
- static const Message rw = Message( WM_CTLCOLOREDIT );
- static const Message ro = Message( WM_CTLCOLORSTATIC );
-
- return this->isReadOnly() ? ro : rw;
-}
-
inline void WidgetTextBoxBase::setSelection( long start, long end )
{
this->sendMessage(EM_SETSEL, start, end );
Modified: dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h
===================================================================
--- dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/smartwin/include/smartwin/widgets/WidgetTreeView.h 2008-03-26 14:14:56 UTC (rev 1064)
@@ -34,6 +34,7 @@
#include "../aspects/AspectBorder.h"
#include "../aspects/AspectClickable.h"
#include "../aspects/AspectCollection.h"
+#include "../aspects/AspectColor.h"
#include "../aspects/AspectControl.h"
#include "../aspects/AspectData.h"
#include "../aspects/AspectDblClickable.h"
@@ -65,6 +66,7 @@
public AspectBorder< WidgetTreeView >,
public AspectClickable< WidgetTreeView >,
public AspectCollection<WidgetTreeView, HTREEITEM>,
+ public AspectColor<WidgetTreeView>,
public AspectControl<WidgetTreeView>,
public AspectData<WidgetTreeView, HTREEITEM>,
public AspectDblClickable< WidgetTreeView >,
@@ -95,6 +97,7 @@
friend class WidgetCreator< WidgetTreeView >;
friend class AspectCollection<WidgetTreeView, HTREEITEM>;
+ friend class AspectColor<WidgetTreeView>;
friend class AspectData<WidgetTreeView, HTREEITEM>;
public:
@@ -143,8 +146,6 @@
HTREEITEM getRoot();
- void setColor(COLORREF text, COLORREF background);
-
ScreenCoordinate getContextMenuPos();
void expand(HTREEITEM node);
@@ -305,6 +306,9 @@
void eraseImpl( HTREEITEM node );
void clearImpl();
size_t sizeImpl() const;
+
+ // AspectColor
+ void setColorImpl(COLORREF text, COLORREF background);
};
@@ -332,7 +336,7 @@
return TreeView_GetRoot(this->handle());
}
-inline void WidgetTreeView::setColor(COLORREF text, COLORREF background) {
+inline void WidgetTreeView::setColorImpl(COLORREF text, COLORREF background) {
TreeView_SetTextColor(this->handle(), text);
TreeView_SetBkColor(this->handle(), background);
}
Modified: dcplusplus/trunk/win32/ADLSearchFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/ADLSearchFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/ADLSearchFrame.cpp 2008-03-26 14:14:56 UTC (rev 1064)
@@ -54,7 +54,6 @@
items->createColumns(WinUtil::getStrings(columnNames));
items->setColumnOrder(WinUtil::splitTokens(SETTING(ADLSEARCHFRAME_ORDER), columnIndexes));
items->setColumnWidths(WinUtil::splitTokens(SETTING(ADLSEARCHFRAME_WIDTHS), columnSizes));
- items->setColor(WinUtil::textColor, WinUtil::bgColor);
items->onDblClicked(std::tr1::bind(&ADLSearchFrame::handleDoubleClick, this));
items->onKeyDown(std::tr1::bind(&ADLSearchFrame::handleKeyDown, this, _1));
Modified: dcplusplus/trunk/win32/Appearance2Page.cpp
===================================================================
--- dcplusplus/trunk/win32/Appearance2Page.cpp 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/Appearance2Page.cpp 2008-03-26 14:14:56 UTC (rev 1064)
@@ -75,13 +75,11 @@
upBar = SETTING(UPLOAD_BAR_COLOR);
downBar = SETTING(DOWNLOAD_BAR_COLOR);
- bgBrush = SmartWin::BrushPtr(new SmartWin::Brush(bg));
-
WinUtil::decodeFont(Text::toT(SETTING(TEXT_FONT)), logFont);
font = SmartWin::FontPtr(new SmartWin::Font(::CreateFontIndirect(&logFont), true));
example = attachStatic(IDC_COLOREXAMPLE);
- example->setColor(bgBrush, fg, bg);
+ example->setColor(fg, bg);
example->setFont(font);
WidgetButtonPtr button = attachButton(IDC_SELWINCOLOR);
@@ -122,8 +120,7 @@
colorParams = createChooseColor().showDialog(initialColorParams);
if(colorParams.userPressedOk()) {
bg = colorParams.getColor();
- bgBrush = SmartWin::BrushPtr(new SmartWin::Brush(bg));
- example->setColor(bgBrush, fg, bg);
+ example->setColor(fg, bg);
}
}
Modified: dcplusplus/trunk/win32/Appearance2Page.h
===================================================================
--- dcplusplus/trunk/win32/Appearance2Page.h 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/Appearance2Page.h 2008-03-26 14:14:56 UTC (rev 1064)
@@ -36,7 +36,6 @@
WidgetStaticPtr example;
COLORREF fg, bg, upBar, downBar;
- SmartWin::BrushPtr bgBrush;
SmartWin::FontPtr font;
LOGFONT logFont;
Modified: dcplusplus/trunk/win32/DirectoryListingFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/DirectoryListingFrame.cpp 2008-03-26 14:14:56 UTC (rev 1064)
@@ -130,7 +130,6 @@
dirs = SmartWin::WidgetCreator<WidgetDirs>::create(this, WinUtil::Seeds::treeView);
addWidget(dirs);
paned->setFirst(dirs);
- dirs->setColor(WinUtil::textColor, WinUtil::bgColor);
dirs->setNormalImageList(WinUtil::fileImages);
dirs->onSelectionChanged(std::tr1::bind(&DirectoryListingFrame::handleSelectionChanged, this));
dirs->onContextMenu(std::tr1::bind(&DirectoryListingFrame::handleDirsContextMenu, this, _1));
@@ -145,7 +144,6 @@
files->createColumns(WinUtil::getStrings(columnNames));
files->setColumnOrder(WinUtil::splitTokens(SETTING(QUEUEFRAME_ORDER), columnIndexes));
files->setColumnWidths(WinUtil::splitTokens(SETTING(QUEUEFRAME_WIDTHS), columnSizes));
- files->setColor(WinUtil::textColor, WinUtil::bgColor);
files->setSort(COLUMN_FILENAME);
files->onSelectionChanged(std::tr1::bind(&DirectoryListingFrame::updateStatus, this));
Modified: dcplusplus/trunk/win32/FavHubsFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/FavHubsFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/FavHubsFrame.cpp 2008-03-26 14:14:56 UTC (rev 1064)
@@ -58,7 +58,6 @@
hubs->createColumns(WinUtil::getStrings(columnNames));
hubs->setColumnOrder(WinUtil::splitTokens(SETTING(FAVHUBSFRAME_ORDER), columnIndexes));
hubs->setColumnWidths(WinUtil::splitTokens(SETTING(FAVHUBSFRAME_WIDTHS), columnSizes));
- hubs->setColor(WinUtil::textColor, WinUtil::bgColor);
hubs->onDblClicked(std::tr1::bind(&FavHubsFrame::handleDoubleClick, this));
hubs->onKeyDown(std::tr1::bind(&FavHubsFrame::handleKeyDown, this, _1));
Modified: dcplusplus/trunk/win32/FinishedFrameBase.h
===================================================================
--- dcplusplus/trunk/win32/FinishedFrameBase.h 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/FinishedFrameBase.h 2008-03-26 14:14:56 UTC (rev 1064)
@@ -66,7 +66,6 @@
items->setColumnWidths(WinUtil::splitTokens(SettingsManager::getInstance()->get(in_UL ? SettingsManager::FINISHED_UL_WIDTHS : SettingsManager::FINISHED_WIDTHS), columnSizes));
items->setSort(COLUMN_DONE);
- items->setColor(WinUtil::textColor, WinUtil::bgColor);
items->setSmallImageList(WinUtil::fileImages);
items->onDblClicked(std::tr1::bind(&ThisType::handleDoubleClick, this));
Modified: dcplusplus/trunk/win32/HubFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/HubFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/HubFrame.cpp 2008-03-26 14:14:56 UTC (rev 1064)
@@ -140,7 +140,6 @@
users->createColumns(WinUtil::getStrings(columnNames));
users->setColumnOrder(WinUtil::splitTokens(SETTING(HUBFRAME_ORDER), columnIndexes));
users->setColumnWidths(WinUtil::splitTokens(SETTING(HUBFRAME_WIDTHS), columnSizes));
- users->setColor(WinUtil::textColor, WinUtil::bgColor);
users->setSort(COLUMN_NICK);
users->onSelectionChanged(std::tr1::bind(&HubFrame::updateStatus, this));
Modified: dcplusplus/trunk/win32/MDIChildFrame.h
===================================================================
--- dcplusplus/trunk/win32/MDIChildFrame.h 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/MDIChildFrame.h 2008-03-26 14:14:56 UTC (rev 1064)
@@ -145,15 +145,15 @@
}
void addColor(WidgetComboBox* widget) {
- widget->setColor(WinUtil::bgBrush, WinUtil::textColor, WinUtil::bgColor);
+ widget->setColor(WinUtil::textColor, WinUtil::bgColor);
WidgetTextBox* text = widget->getTextBox();
if(text)
- text->setColor(WinUtil::bgBrush, WinUtil::textColor, WinUtil::bgColor);
+ text->setColor(WinUtil::textColor, WinUtil::bgColor);
}
template<typename A>
- void addColor(SmartWin::AspectCtlColor<A>* widget) {
- widget->setColor(WinUtil::bgBrush, WinUtil::textColor, WinUtil::bgColor);
+ void addColor(SmartWin::AspectColor<A>* widget) {
+ widget->setColor(WinUtil::textColor, WinUtil::bgColor);
}
// Catch-rest for the above
Modified: dcplusplus/trunk/win32/PublicHubsFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/PublicHubsFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/PublicHubsFrame.cpp 2008-03-26 14:14:56 UTC (rev 1064)
@@ -111,7 +111,6 @@
hubs->createColumns(WinUtil::getStrings(columnNames));
hubs->setColumnOrder(WinUtil::splitTokens(SETTING(FAVHUBSFRAME_ORDER), columnIndexes));
hubs->setColumnWidths(WinUtil::splitTokens(SETTING(FAVHUBSFRAME_WIDTHS), columnSizes));
- hubs->setColor(WinUtil::textColor, WinUtil::bgColor);
hubs->setSort(COLUMN_USERS, false);
hubs->onDblClicked(std::tr1::bind(&PublicHubsFrame::openSelected, this));
Modified: dcplusplus/trunk/win32/QueueFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/QueueFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/QueueFrame.cpp 2008-03-26 14:14:56 UTC (rev 1064)
@@ -72,7 +72,6 @@
addWidget(dirs);
paned->setFirst(dirs);
- dirs->setColor(WinUtil::textColor, WinUtil::bgColor);
dirs->setNormalImageList(WinUtil::fileImages);
dirs->onSelectionChanged(std::tr1::bind(&QueueFrame::updateFiles, this));
@@ -89,7 +88,6 @@
files->createColumns(WinUtil::getStrings(columnNames));
files->setColumnOrder(WinUtil::splitTokens(SETTING(QUEUEFRAME_ORDER), columnIndexes));
files->setColumnWidths(WinUtil::splitTokens(SETTING(QUEUEFRAME_WIDTHS), columnSizes));
- files->setColor(WinUtil::textColor, WinUtil::bgColor);
files->setSort(COLUMN_TARGET);
files->onKeyDown(std::tr1::bind(&QueueFrame::handleKeyDownFiles, this, _1));
Modified: dcplusplus/trunk/win32/SearchFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/SearchFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/SearchFrame.cpp 2008-03-26 14:14:56 UTC (rev 1064)
@@ -209,14 +209,10 @@
dummy.push_back(Util::emptyStringT);
hubs->createColumns(dummy);
- hubs->setColor(WinUtil::textColor, WinUtil::bgColor);
-
hubs->onRaw(std::tr1::bind(&SearchFrame::handleHubItemChanged, this, _1, _2), SmartWin::Message(WM_NOTIFY, LVN_ITEMCHANGED));
hubs->insert(new HubInfo(Util::emptyStringT, T_("Only where I'm op"), false));
hubs->setChecked(0, false);
-
-
}
{
@@ -227,7 +223,6 @@
results->setColumnOrder(WinUtil::splitTokens(SETTING(SEARCHFRAME_ORDER), columnIndexes));
results->setColumnWidths(WinUtil::splitTokens(SETTING(SEARCHFRAME_WIDTHS), columnSizes));
- results->setColor(WinUtil::textColor, WinUtil::bgColor);
results->setSmallImageList(WinUtil::fileImages);
results->onDblClicked(std::tr1::bind(&SearchFrame::handleDoubleClick, this));
Modified: dcplusplus/trunk/win32/SpyFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/SpyFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/SpyFrame.cpp 2008-03-26 14:14:56 UTC (rev 1064)
@@ -56,10 +56,8 @@
searches->setColumnOrder(WinUtil::splitTokens(SETTING(SPYFRAME_ORDER), columnIndexes));
searches->setColumnWidths(WinUtil::splitTokens(SETTING(SPYFRAME_WIDTHS), columnSizes));
searches->setSort(COLUMN_COUNT, SmartWin::WidgetListView::SORT_INT, false);
- searches->setColor(WinUtil::textColor, WinUtil::bgColor);
searches->onColumnClick(std::tr1::bind(&SpyFrame::handleColumnClick, this, _1));
searches->onContextMenu(std::tr1::bind(&SpyFrame::handleContextMenu, this, _1));
-
}
{
Modified: dcplusplus/trunk/win32/UsersFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/UsersFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/UsersFrame.cpp 2008-03-26 14:14:56 UTC (rev 1064)
@@ -49,7 +49,6 @@
users->setColumnOrder(WinUtil::splitTokens(SETTING(HUBFRAME_ORDER), columnIndexes));
users->setColumnWidths(WinUtil::splitTokens(SETTING(HUBFRAME_WIDTHS), columnSizes));
users->setSort(COLUMN_NICK);
- users->setColor(WinUtil::textColor, WinUtil::bgColor);
users->onDblClicked(std::tr1::bind(&UsersFrame::handleGetList, this));
users->onKeyDown(std::tr1::bind(&UsersFrame::handleKeyDown, this, _1));
Modified: dcplusplus/trunk/win32/WaitingUsersFrame.cpp
===================================================================
--- dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2008-03-26 14:13:06 UTC (rev 1063)
+++ dcplusplus/trunk/win32/WaitingUsersFrame.cpp 2008-03-26 14:14:56 UTC (rev 1064)
@@ -38,7 +38,6 @@
{
queued = createTreeView(WinUtil::Seeds::treeView);
addWidget(queued);
- queued->setColor(WinUtil::textColor, WinUtil::bgColor);
queued->onContextMenu(std::tr1::bind(&WaitingUsersFrame::handleContextMenu, this, _1));
queued->onChar(std::tr1::bind(&WaitingUsersFrame::handleChar, this, _1));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|