linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #04817
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2686: simplify setFontImpl
------------------------------------------------------------
revno: 2686
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sun 2011-11-20 19:04:00 +0100
message:
simplify setFontImpl
modified:
dwt/include/dwt/aspects/Fonts.h
dwt/include/dwt/widgets/RichTextBox.h
dwt/include/dwt/widgets/TabView.h
dwt/include/dwt/widgets/TextBox.h
dwt/src/widgets/RichTextBox.cpp
dwt/src/widgets/TabView.cpp
dwt/src/widgets/TextBox.cpp
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dwt/include/dwt/aspects/Fonts.h'
--- dwt/include/dwt/aspects/Fonts.h 2011-11-20 16:59:46 +0000
+++ dwt/include/dwt/aspects/Fonts.h 2011-11-20 18:04:00 +0000
@@ -43,7 +43,7 @@
/** Aspect class used by Widgets that have the possibility of changing their main font. By default,
this is done by sending a WM_SETFONT message. Widgets that want to customize this behavior can
-provide a void setFontImpl(FontPtr font) function. */
+provide a void setFontImpl() function. */
template<typename WidgetType>
class Fonts
{
@@ -68,7 +68,7 @@
/// Sets the font used by the Widget
void setFont(FontPtr font) {
this->font = font ? font : new Font(Font::DefaultGui);
- W().setFontImpl(this->font);
+ W().setFontImpl();
}
/// Returns the font used by the Widget
@@ -80,7 +80,7 @@
}
protected:
- virtual void setFontImpl(FontPtr) {
+ virtual void setFontImpl() {
W().sendMessage(WM_SETFONT, reinterpret_cast<WPARAM>(font->handle()), TRUE);
}
=== modified file 'dwt/include/dwt/widgets/RichTextBox.h'
--- dwt/include/dwt/widgets/RichTextBox.h 2011-11-20 16:59:46 +0000
+++ dwt/include/dwt/widgets/RichTextBox.h 2011-11-20 18:04:00 +0000
@@ -162,7 +162,7 @@
void setColorImpl(COLORREF text, COLORREF background);
// aspects::Font
- void setFontImpl(FontPtr font);
+ void setFontImpl();
// store current colors for the onPrinting handler and for setFontImpl.
COLORREF textColor;
=== modified file 'dwt/include/dwt/widgets/TabView.h'
--- dwt/include/dwt/widgets/TabView.h 2011-11-20 16:59:46 +0000
+++ dwt/include/dwt/widgets/TabView.h 2011-11-20 18:04:00 +0000
@@ -230,7 +230,7 @@
size_t sizeImpl() const;
// aspects::Font
- void setFontImpl(FontPtr font);
+ void setFontImpl();
// aspects::Help
void helpImpl(unsigned& id);
=== modified file 'dwt/include/dwt/widgets/TextBox.h'
--- dwt/include/dwt/widgets/TextBox.h 2011-11-20 16:59:46 +0000
+++ dwt/include/dwt/widgets/TextBox.h 2011-11-20 18:04:00 +0000
@@ -193,7 +193,7 @@
void create(const Seed& cs);
// aspects::Font
- virtual void setFontImpl(FontPtr font);
+ virtual void setFontImpl();
// Contract needed by aspects::Update Aspect class
static Message getUpdateMessage();
=== modified file 'dwt/src/widgets/RichTextBox.cpp'
--- dwt/src/widgets/RichTextBox.cpp 2011-11-20 16:59:46 +0000
+++ dwt/src/widgets/RichTextBox.cpp 2011-11-20 18:04:00 +0000
@@ -337,9 +337,9 @@
sendMessage(EM_SETBKGNDCOLOR, 0, static_cast<LPARAM>(bgColor));
}
-void RichTextBox::setFontImpl(FontPtr font) {
+void RichTextBox::setFontImpl() {
// changing the default font resets the default text color.
- BaseType::setFontImpl(font);
+ BaseType::setFontImpl();
updateTextColor();
}
=== modified file 'dwt/src/widgets/TabView.cpp'
--- dwt/src/widgets/TabView.cpp 2011-11-20 16:59:46 +0000
+++ dwt/src/widgets/TabView.cpp 2011-11-20 18:04:00 +0000
@@ -816,11 +816,11 @@
return false;
}
-void TabView::setFontImpl(FontPtr font) {
- BaseType::setFontImpl(font);
- this->font = getFont(); // might be a default font, so get it this way.
+void TabView::setFontImpl() {
+ BaseType::setFontImpl();
+ font = getFont();
if(hasStyle(TCS_OWNERDRAWFIXED)) {
- boldFont = this->font->makeBold();
+ boldFont = font->makeBold();
}
}
=== modified file 'dwt/src/widgets/TextBox.cpp'
--- dwt/src/widgets/TextBox.cpp 2011-11-20 16:59:46 +0000
+++ dwt/src/widgets/TextBox.cpp 2011-11-20 18:04:00 +0000
@@ -237,9 +237,9 @@
return handled;
}
-void TextBoxBase::setFontImpl(FontPtr font) {
- BaseType::setFontImpl(font);
- menuSeed.font = font;
+void TextBoxBase::setFontImpl() {
+ BaseType::setFontImpl();
+ menuSeed.font = getFont();
}
bool TextBox::handleMessage(const MSG& msg, LRESULT& retVal) {