← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2219: cache the RichEdit seed used in dialogs

 

------------------------------------------------------------
revno: 2219
committer: poy <poy@xxxxxxxxxx>
branch nick: repo
timestamp: Sun 2010-08-29 15:02:34 +0200
message:
  cache the RichEdit seed used in dialogs
modified:
  win32/NetworkPage.cpp
  win32/SettingsDialog.cpp
  win32/WinUtil.cpp
  win32/WinUtil.h


--
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 'win32/NetworkPage.cpp'
--- win32/NetworkPage.cpp	2010-08-23 16:04:27 +0000
+++ win32/NetworkPage.cpp	2010-08-29 13:02:34 +0000
@@ -62,12 +62,7 @@
 
 		GroupBoxPtr logGroup = cur->addChild(GroupBox::Seed(T_("Detection log")));
 		
-		RichTextBox::Seed seed;
-		seed.style |= ES_READONLY | ES_SUNKEN;
-		seed.lines = 7;
-		seed.foregroundColor = ::GetSysColor(COLOR_WINDOWTEXT);
-		seed.backgroundColor = ::GetSysColor(COLOR_3DFACE);
-		log = logGroup->addChild(seed);
+		log = logGroup->addChild(WinUtil::Seeds::Dialog::richTextBox);
 		log->setHelpId(IDH_SETTINGS_NETWORK_DETECTION_LOG);
 	}
 

=== modified file 'win32/SettingsDialog.cpp'
--- win32/SettingsDialog.cpp	2010-08-23 16:04:27 +0000
+++ win32/SettingsDialog.cpp	2010-08-29 13:02:34 +0000
@@ -133,15 +133,8 @@
 		}
 	}
 
-	{
-		RichTextBox::Seed seed;
-		seed.style |= ES_READONLY | ES_SUNKEN;
-		seed.lines = 6;
-		seed.foregroundColor = ::GetSysColor(COLOR_WINDOWTEXT);
-		seed.backgroundColor = ::GetSysColor(COLOR_3DFACE);
-		help = grid->addChild(seed);
-		help->onRaw(std::bind(&helpDlgCode, _1), dwt::Message(WM_GETDLGCODE));
-	}
+	help = grid->addChild(WinUtil::Seeds::Dialog::richTextBox);
+	help->onRaw(std::bind(&helpDlgCode, _1), dwt::Message(WM_GETDLGCODE));
 
 	{
 		GridPtr cur = grid->addChild(Grid::Seed(1, 3));

=== modified file 'win32/WinUtil.cpp'
--- win32/WinUtil.cpp	2010-08-06 21:02:04 +0000
+++ win32/WinUtil.cpp	2010-08-29 13:02:34 +0000
@@ -86,6 +86,7 @@
 const ComboBox::Seed WinUtil::Seeds::Dialog::comboBox;
 const TextBox::Seed WinUtil::Seeds::Dialog::textBox;
 const TextBox::Seed WinUtil::Seeds::Dialog::intTextBox;
+const RichTextBox::Seed WinUtil::Seeds::Dialog::richTextBox;
 const Table::Seed WinUtil::Seeds::Dialog::table;
 const Table::Seed WinUtil::Seeds::Dialog::optionsTable;
 
@@ -152,6 +153,7 @@
 	ComboBox::Seed& xdComboBox = const_cast<ComboBox::Seed&> (Seeds::Dialog::comboBox);
 	TextBox::Seed& xdTextBox = const_cast<TextBox::Seed&> (Seeds::Dialog::textBox);
 	TextBox::Seed& xdintTextBox = const_cast<TextBox::Seed&> (Seeds::Dialog::intTextBox);
+	RichTextBox::Seed& xdRichTextBox = const_cast<RichTextBox::Seed&> (Seeds::Dialog::richTextBox);
 	Table::Seed& xdTable = const_cast<Table::Seed&> (Seeds::Dialog::table);
 	Table::Seed& xdoptionsTable = const_cast<Table::Seed&> (Seeds::Dialog::optionsTable);
 
@@ -200,6 +202,13 @@
 	xdintTextBox = xdTextBox;
 	xdintTextBox.style |= ES_NUMBER;
 
+	xdRichTextBox.style |= ES_READONLY | ES_SUNKEN;
+	xdRichTextBox.exStyle = WS_EX_CLIENTEDGE;
+	xdRichTextBox.font = font;
+	xdRichTextBox.lines = 6;
+	xdRichTextBox.foregroundColor = ::GetSysColor(COLOR_WINDOWTEXT);
+	xdRichTextBox.backgroundColor = ::GetSysColor(COLOR_3DFACE);
+
 	xdTable.style |= WS_HSCROLL | WS_VSCROLL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER;
 	xdTable.exStyle = WS_EX_CLIENTEDGE;
 	xdTable.lvStyle |= LVS_EX_FULLROWSELECT | LVS_EX_LABELTIP;

=== modified file 'win32/WinUtil.h'
--- win32/WinUtil.h	2010-07-22 15:31:17 +0000
+++ win32/WinUtil.h	2010-08-29 13:02:34 +0000
@@ -87,6 +87,7 @@
 			static const ComboBox::Seed comboBox;
 			static const TextBox::Seed textBox;
 			static const TextBox::Seed intTextBox;
+			static const RichTextBox::Seed richTextBox;
 			static const Table::Seed table;
 			static const Table::Seed optionsTable;
 		};