← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2816: dwt: regroup Z order wrappers to the same place

 

------------------------------------------------------------
revno: 2816
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2012-01-13 18:22:24 +0100
message:
  dwt: regroup Z order wrappers to the same place
modified:
  dwt/include/dwt/Widget.h
  dwt/include/dwt/aspects/Sizable.h
  dwt/include/dwt/aspects/Visible.h
  dwt/src/Widget.cpp
  win32/DirectoryListingFrame.cpp
  win32/HubFrame.cpp
  win32/SettingsDialog.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/Widget.h'
--- dwt/include/dwt/Widget.h	2012-01-13 17:10:09 +0000
+++ dwt/include/dwt/Widget.h	2012-01-13 17:22:24 +0000
@@ -146,6 +146,10 @@
 	/** Return the desktop size of the monitor closest to this widget. */
 	Rectangle getDesktopSize() const;
 
+	/** Change the Z order of this widget. See the SetWindowPos doc for special values the
+	"insertAfter" parameter can take. */
+	void setZOrder(HWND insertAfter);
+
 	/// Sets the enabled property of the Widget
 	/** Changes the enabled property of the Widget. Use this function to change the
 	  * enabled property of the Widget

=== modified file 'dwt/include/dwt/aspects/Sizable.h'
--- dwt/include/dwt/aspects/Sizable.h	2012-01-13 17:10:09 +0000
+++ dwt/include/dwt/aspects/Sizable.h	2012-01-13 17:22:24 +0000
@@ -81,16 +81,6 @@
 	typedef Dispatchers::ConvertBase<Point, &Point::fromMSG, 0, false> MoveDispatcher;
 
 public:
-	/// Brings the widget to the front
-	/** Makes the widget become the front most widget meaning it will not be obscured
-	  * by other widgets which are contained in the same container widget. <br>
-	  * For instance if you have two widgets which partially hides eachother and you
-	  * call bringToFront on one of them it will make sure that the widget you call
-	  * bringToFront on will be the one which will be all visible and the other one
-	  * will be partially hidden by the parts which are obscured by the this widget.
-	  */
-	void bringToFront();
-
 	void centerWindow() {
 		// this is greatly inspired by MFC (wincore.cpp - CWnd::CenterWindow). 
 
@@ -105,16 +95,6 @@
 		resize(rect.ensureVisibility(root));
 	}
 
-	/// Brings the widget to the bottom
-	/** Makes the widget become the bottom most widget meaning it will be obscured by
-	  * all other widgets which are contained in the same container widget. <br>
-	  * For instance if you have two widgets which partially hides eachother and you
-	  * call bringToBottom on one of them it will make sure that the widget you call
-	  * bringToBottom on will be the one which will be invisible and the other one
-	  * will be all visible by the parts which are obscured by the this widget.
-	  */
-	void bringToBottom();
-
 	bool isIconic();
 	bool isZoomed();
 
@@ -143,19 +123,7 @@
 		W().addCallback(Message( WM_MOVE ), MoveDispatcher(f));
 	}
 };
-
-template< class WidgetType >
-void Sizable< WidgetType >::bringToFront()
-{
-	::SetWindowPos(H(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
-}
-
-template< class WidgetType >
-void Sizable< WidgetType >::bringToBottom()
-{
-	::SetWindowPos(H(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
-}
-
+ 
 template< class WidgetType >
 bool Sizable< WidgetType >::isIconic()
 {

=== modified file 'dwt/include/dwt/aspects/Visible.h'
--- dwt/include/dwt/aspects/Visible.h	2011-12-17 14:08:57 +0000
+++ dwt/include/dwt/aspects/Visible.h	2012-01-13 17:22:24 +0000
@@ -95,11 +95,6 @@
 	void redraw(bool now = false);
 
 	void redraw(const Rectangle& r, bool now = false);
-
-	/// move the widget to the top of the Z order.
-	void bringToTop() {
-		::SetWindowPos(H(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER);
-	}
 };
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

=== modified file 'dwt/src/Widget.cpp'
--- dwt/src/Widget.cpp	2012-01-13 17:10:09 +0000
+++ dwt/src/Widget.cpp	2012-01-13 17:22:24 +0000
@@ -186,4 +186,8 @@
 	return Rectangle(rc);
 }
 
+void Widget::setZOrder(HWND insertAfter) {
+	::SetWindowPos(handle(), insertAfter, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER);
+}
+
 }

=== modified file 'win32/DirectoryListingFrame.cpp'
--- win32/DirectoryListingFrame.cpp	2012-01-08 16:45:11 +0000
+++ win32/DirectoryListingFrame.cpp	2012-01-13 17:22:24 +0000
@@ -551,7 +551,7 @@
 	dwt::Rectangle r(getClientSize());
 
 	if(loading) {
-		loading->bringToFront();
+		loading->setZOrder(HWND_TOPMOST);
 		loading->resize(r);
 		loading->redraw(true);
 		return;

=== modified file 'win32/HubFrame.cpp'
--- win32/HubFrame.cpp	2012-01-01 21:25:05 +0000
+++ win32/HubFrame.cpp	2012-01-13 17:22:24 +0000
@@ -320,9 +320,9 @@
 		paned->maximize(0);
 
 		if(filterOpts->hasStyle(WS_VISIBLE)) {
-			filterOpts->bringToTop();
-			filter.column->bringToTop();
-			filter.method->bringToTop();
+			filterOpts->setZOrder(HWND_TOP);
+			filter.column->setZOrder(HWND_TOP);
+			filter.method->setZOrder(HWND_TOP);
 
 			auto r = filter.text->getWindowRect();
 			r.pos = dwt::ClientCoordinate(dwt::ScreenCoordinate(r.pos), filterOpts->getParent()).getPoint();

=== modified file 'win32/SettingsDialog.cpp'
--- win32/SettingsDialog.cpp	2012-01-12 16:14:38 +0000
+++ win32/SettingsDialog.cpp	2012-01-13 17:22:24 +0000
@@ -307,7 +307,7 @@
 		auto page = find_if(pages.begin(), pages.end(), CompareSecond<PropPage*, HTREEITEM>(sel))->first;
 
 		// move to the top of the Z order so the ScrolledContainer thinks this is the only child.
-		page->bringToTop();
+		page->setZOrder(HWND_TOP);
 		page->setVisible(true);
 
 		if(currentPage) {