← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2675: seed setup of typed controls

 

------------------------------------------------------------
revno: 2675
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sat 2011-11-12 20:36:12 +0100
message:
  seed setup of typed controls
modified:
  dcpp/SConscript
  dwt/include/dwt/aspects/Help.h
  dwt/include/dwt/aspects/Painting.h
  win32/DirectoryListingFrame.cpp
  win32/FavHubGroupsDlg.cpp
  win32/FinishedFrameBase.h
  win32/HubFrame.cpp
  win32/PublicHubsFrame.cpp
  win32/QueueFrame.cpp
  win32/SearchFrame.cpp
  win32/TransferView.cpp
  win32/TypedTable.h
  win32/TypedTree.h
  win32/UsersFrame.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 'dcpp/SConscript'
--- dcpp/SConscript	2011-10-16 23:06:25 +0000
+++ dcpp/SConscript	2011-11-12 19:36:12 +0000
@@ -30,12 +30,7 @@
 
 env.Append(CPPPATH = ['#/openssl/include', '#/bzip2', '#/zlib', '#/geoip'])
 
-env.Append(CPPDEFINES=["BUILDING_DCPP=1"])
-
-for i, source in enumerate(sources):
-	if source.find("version.cpp") != -1:
-		rev = ['DCPP_REVISION=' + str(getRevision(env))]
-		sources[i] = env.StaticObject(source, CPPDEFINES=env['CPPDEFINES'] + rev)
+env.Append(CPPDEFINES = ['BUILDING_DCPP=1', 'DCPP_REVISION=' + str(getRevision(env))])
 
 headers=dev.get_sources(source_path, "*.h")
 dev.i18n(source_path, env, [sources, headers], 'libdcpp')

=== modified file 'dwt/include/dwt/aspects/Help.h'
--- dwt/include/dwt/aspects/Help.h	2011-11-08 19:42:19 +0000
+++ dwt/include/dwt/aspects/Help.h	2011-11-12 19:36:12 +0000
@@ -81,7 +81,7 @@
 
 			HWND hWnd = reinterpret_cast<HWND>(lphi->hItemHandle);
 			// make sure this handle is ours
-			if(hWnd != this->H() && !::IsChild(this->H(), hWnd)) /// @todo why does GCC need a "this->"?
+			if(hWnd != this->H() && !::IsChild(this->H(), hWnd))
 				return false;
 
 			WidgetType* widget = hwnd_cast<WidgetType*>(hWnd);

=== modified file 'dwt/include/dwt/aspects/Painting.h'
--- dwt/include/dwt/aspects/Painting.h	2011-11-08 19:42:19 +0000
+++ dwt/include/dwt/aspects/Painting.h	2011-11-12 19:36:12 +0000
@@ -58,7 +58,7 @@
 	  */
 	void onPainting(std::function<void (PaintCanvas&)> f) {
 		W().addCallback(Message(WM_PAINT), [f, this](const MSG&, LRESULT&) -> bool {
-			PaintCanvas canvas(&this->W()); /// @todo why does GCC need a "this->"?
+			PaintCanvas canvas(&this->W());
 			f(canvas);
 			return true;
 		});

=== modified file 'win32/DirectoryListingFrame.cpp'
--- win32/DirectoryListingFrame.cpp	2011-11-04 16:30:55 +0000
+++ win32/DirectoryListingFrame.cpp	2011-11-12 19:36:12 +0000
@@ -269,7 +269,7 @@
 	auto paned = grid->addChild(SplitterContainer::Seed(0.3));
 
 	{
-		dirs = paned->addChild(WidgetDirs::Seed());
+		dirs = paned->addChild(WidgetDirs::Seed(WinUtil::Seeds::treeView));
 		dirs->setHelpId(IDH_FILE_LIST_DIRS);
 		addWidget(dirs);
 
@@ -280,7 +280,7 @@
 		dirs->onContextMenu([this](const dwt::ScreenCoordinate &sc) { return handleDirsContextMenu(sc); });
 		dirs->onXMouseUp([this](const dwt::MouseEvent &me) { return handleXMouseUp(me); });
 
-		files = paned->addChild(WidgetFiles::Seed());
+		files = paned->addChild(WidgetFiles::Seed(WinUtil::Seeds::table));
 		files->setHelpId(IDH_FILE_LIST_FILES);
 		addWidget(files);
 

=== modified file 'win32/FavHubGroupsDlg.cpp'
--- win32/FavHubGroupsDlg.cpp	2011-05-04 19:32:00 +0000
+++ win32/FavHubGroupsDlg.cpp	2011-11-12 19:36:12 +0000
@@ -90,14 +90,8 @@
 	grid->row(0).mode = GridInfo::FILL;
 	grid->row(0).align = GridInfo::STRETCH;
 
-	{
-		Groups::Seed seed;
-		// remove some of the WinUtil styles that have been imported...
-		seed.exStyle &= ~WS_EX_CLIENTEDGE;
-		seed.font = 0;
-		groups = grid->addChild(seed);
-		groups->setHelpId(IDH_FAV_HUB_GROUPS_LIST);
-	}
+	groups = grid->addChild(Groups::Seed(WinUtil::Seeds::Dialog::table));
+	groups->setHelpId(IDH_FAV_HUB_GROUPS_LIST);
 
 	{
 		GridPtr cur = grid->addChild(Grid::Seed(1, 2));

=== modified file 'win32/FinishedFrameBase.h'
--- win32/FinishedFrameBase.h	2011-06-27 16:46:13 +0000
+++ win32/FinishedFrameBase.h	2011-11-12 19:36:12 +0000
@@ -103,7 +103,7 @@
 		}
 
 		{
-			files = filesWindow->addChild(typename WidgetFiles::Seed());
+			files = filesWindow->addChild(typename WidgetFiles::Seed(WinUtil::Seeds::table));
 			files->setTableStyle(LVS_EX_LABELTIP | LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT);
 			addWidget(files);
 
@@ -119,7 +119,7 @@
 		}
 
 		{
-			users = usersWindow->addChild(typename WidgetUsers::Seed());
+			users = usersWindow->addChild(typename WidgetUsers::Seed(WinUtil::Seeds::table));
 			users->setTableStyle(LVS_EX_LABELTIP | LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT);
 			addWidget(users);
 

=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp	2011-10-30 14:40:38 +0000
+++ win32/HubFrame.cpp	2011-11-12 19:36:12 +0000
@@ -186,7 +186,7 @@
 		userGrid->row(0).mode = GridInfo::FILL;
 		userGrid->row(0).align = GridInfo::STRETCH;
 
-		users = userGrid->addChild(WidgetUsers::Seed());
+		users = userGrid->addChild(WidgetUsers::Seed(WinUtil::Seeds::table));
 		userGrid->setWidget(users, 0, 0, 1, 2);
 		addWidget(users);
 

=== modified file 'win32/PublicHubsFrame.cpp'
--- win32/PublicHubsFrame.cpp	2011-10-08 15:21:54 +0000
+++ win32/PublicHubsFrame.cpp	2011-11-12 19:36:12 +0000
@@ -118,7 +118,7 @@
 		}
 
 		{
-			WidgetHubs::Seed seed;
+			WidgetHubs::Seed seed(WinUtil::Seeds::table);
 			seed.style |= LVS_SINGLESEL;
 			hubs = upper->addChild(seed);
 			addWidget(hubs);

=== modified file 'win32/QueueFrame.cpp'
--- win32/QueueFrame.cpp	2011-11-04 16:30:55 +0000
+++ win32/QueueFrame.cpp	2011-11-12 19:36:12 +0000
@@ -74,7 +74,7 @@
 	paned = addChild(SplitterContainer::Seed(SETTING(QUEUE_PANED_POS)));
 
 	{
-		dirs = paned->addChild(WidgetDirs::Seed());
+		dirs = paned->addChild(WidgetDirs::Seed(WinUtil::Seeds::treeView));
 		addWidget(dirs);
 
 		dirs->setNormalImageList(WinUtil::fileImages);
@@ -85,7 +85,7 @@
 	}
 
 	{
-		files = paned->addChild(WidgetFiles::Seed());
+		files = paned->addChild(WidgetFiles::Seed(WinUtil::Seeds::table));
 		addWidget(files, true);
 
 		files->setSmallImageList(WinUtil::fileImages);

=== modified file 'win32/SearchFrame.cpp'
--- win32/SearchFrame.cpp	2011-11-10 10:23:08 +0000
+++ win32/SearchFrame.cpp	2011-11-12 19:36:12 +0000
@@ -235,7 +235,7 @@
 		group = options->addChild(gs);
 		group->setHelpId(IDH_SEARCH_HUBS);
 
-		WidgetHubs::Seed ls;
+		WidgetHubs::Seed ls(WinUtil::Seeds::table);
 		ls.style |= LVS_NOCOLUMNHEADER;
 		ls.lvStyle |= LVS_EX_CHECKBOXES;
 		hubs = group->addChild(ls);
@@ -249,7 +249,7 @@
 		hubs->setChecked(0, false);
 	}
 
-	results = paned->addChild(WidgetResults::Seed());
+	results = paned->addChild(WidgetResults::Seed(WinUtil::Seeds::table));
 	addWidget(results);
 
 	results->setSmallImageList(WinUtil::fileImages);

=== modified file 'win32/TransferView.cpp'
--- win32/TransferView.cpp	2011-11-07 17:59:57 +0000
+++ win32/TransferView.cpp	2011-11-12 19:36:12 +0000
@@ -111,7 +111,7 @@
 	}
 
 	{
-		connections = connectionsWindow->addChild(WidgetConnections::Seed());
+		connections = connectionsWindow->addChild(WidgetConnections::Seed(WinUtil::Seeds::table));
 
 		arrows = dwt::ImageListPtr(new dwt::ImageList(dwt::Point(16, 16)));
 		arrows->add(*WinUtil::createIcon(IDI_DOWNLOAD, 16));
@@ -132,7 +132,7 @@
 	}
 
 	{
-		downloads = downloadsWindow->addChild(WidgetDownloads::Seed());
+		downloads = downloadsWindow->addChild(WidgetDownloads::Seed(WinUtil::Seeds::table));
 
 		WinUtil::makeColumns(downloads, downloadColumns, DOWNLOAD_COLUMN_LAST, SETTING(DOWNLOADS_ORDER), SETTING(DOWNLOADS_WIDTHS));
 		downloads->setSort(DOWNLOAD_COLUMN_STATUS);

=== modified file 'win32/TypedTable.h'
--- win32/TypedTable.h	2011-11-07 17:59:57 +0000
+++ win32/TypedTable.h	2011-11-12 19:36:12 +0000
@@ -39,12 +39,7 @@
 	struct Seed : public BaseType::Seed {
 		typedef ThisType WidgetType;
 
-		Seed() : BaseType::Seed() {
-			// @todo find a better way to directly use styles set in WinUtil...
-			style = WinUtil::Seeds::table.style;
-			exStyle = WinUtil::Seeds::table.exStyle;
-			lvStyle = WinUtil::Seeds::table.lvStyle;
-			font = WinUtil::Seeds::table.font;
+		explicit Seed(const BaseType::Seed& seed) : BaseType::Seed(seed) {
 		}
 	};
 

=== modified file 'win32/TypedTree.h'
--- win32/TypedTree.h	2011-01-02 17:12:02 +0000
+++ win32/TypedTree.h	2011-11-12 19:36:12 +0000
@@ -35,11 +35,7 @@
 	struct Seed : public BaseType::Seed {
 		typedef ThisType WidgetType;
 
-		Seed() : BaseType::Seed() {
-			// @todo find a better way to directly use styles set in WinUtil...
-			style = WinUtil::Seeds::treeView.style;
-			exStyle = WinUtil::Seeds::treeView.exStyle;
-			font = WinUtil::Seeds::treeView.font;
+		explicit Seed(const BaseType::Seed& seed) : BaseType::Seed(seed) {
 		}
 	};
 

=== modified file 'win32/UsersFrame.cpp'
--- win32/UsersFrame.cpp	2011-10-17 19:39:46 +0000
+++ win32/UsersFrame.cpp	2011-11-12 19:36:12 +0000
@@ -151,7 +151,7 @@
 	}
 
 	{
-		WidgetUsers::Seed cs;
+		WidgetUsers::Seed cs(WinUtil::Seeds::table);
 		cs.lvStyle |= LVS_EX_SUBITEMIMAGES;
 		users = splitter->addChild(cs);
 		addWidget(users);