[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 1500
Date       : Mon Jul 24 11:43:12 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/bmapprev.cpp
   M /Trunk/XaraLX/wxOil/dlgmgr.cpp
   M /Trunk/XaraLX/wxOil/dlgmgr.h

Slight tidy-up of oil in kernel


Diff:
Index: Trunk/XaraLX/Kernel/bmapprev.cpp
===================================================================
--- Trunk/XaraLX/Kernel/bmapprev.cpp	(revision 1499)
+++ Trunk/XaraLX/Kernel/bmapprev.cpp	(revision 1500)
@@ -725,71 +725,8 @@
 		m_DialogWnd = m_pPreviewDlg->WindowID;
 		ERROR2IF(m_DialogWnd == NULL, FALSE, "No preview dialog!");
 	
-PORTNOTE("other","Nasty pool of oil contaminating nive clean kernel");
-		// Fuse the whole lot into one dialog
-		wxSizer*		pMainSizer = WindowID->GetSizer();
-		wxSizer*		pVertSizer( new wxBoxSizer( wxVERTICAL ) );
-		pVertSizer->Add( m_pPreviewDlg->WindowID, wxALL );
-		pVertSizer->Add( pMainSizer );
+		DialogManager::MergeDialogs( WindowID, m_pPreviewDlg->WindowID, true );
 
-		WindowID->SetSizerAndFit( pVertSizer, false );
-
-PORTNOTE("other","Preview section NOT setup");
-#ifndef EXCLUDE_FROM_XARALX
-		//And get the Preview Dialog's rectangle
-		wxRect rectPreview;
-		GetWindowRect(m_DialogWnd, &rectPreview);
-
-		//First we must get the height of the Preview section
-		INT32 lPreviewHeight = rectPreview.GetBottom() - rectPreview.GetTop();
-		ERROR2IF(lPreviewHeight <= 0, FALSE, "Preview Dialog has no height");
-
-		if (!m_MovedWindow)
-		{ 
-			// Move the window to take account of it's incressed size (only need to do this
-			// the first time the dialog is run) and incress its size
-			::MoveWindow(
-				WindowID,									// The window
-				Rect.GetLeft(),									// Horiz position
-				Rect.GetTop() - lPreviewHeight / 2,				// Vertical position
-				Rect.GetRight() - Rect.GetLeft(),						// Width
-				Rect.GetBottom() - Rect.GetTop() + lPreviewHeight,	// Height
-				TRUE										// Repaint option
-			);
-			m_MovedWindow = true;
-		}
-		else
-		{
-			// Just incress the window's size
-			::MoveWindow(
-				WindowID,									// The window
-				Rect.GetLeft(),									// Horiz position
-				Rect.GetTop(),									// Vertical position
-				Rect.GetRight() - Rect.GetLeft(),						// Width
-				Rect.GetBottom() - Rect.GetTop() + lPreviewHeight,	// Height
-				TRUE										// Repaint option
-			);
-		}
-
-		// Now step 2. We need to move the tabbed section
-		// downwards by the height of the Preview dialog.
-		// Remember, take into account the height of the tabs which will be the top offset
-		ChildWindowParameters cwpToPass;
-		cwpToPass.FirstID	= WindowID;
-		cwpToPass.SecondID	= m_DialogWnd;
-		cwpToPass.Distance	= lPreviewHeight;
-		cwpToPass.TopOffset	= 28;
-
-		EnumChildWindows(WindowID, EnumChildProc, (LPARAM)&cwpToPass);
-
-		//Right and...er...move the Preview section again.
-		//I've no idea how the preview section got moved,
-		//but it does, and moving it again does actually
-		//produce the right effect, so let's not question
-		//why.
-		MoveWindow(m_DialogWnd, 0, 0, rectPreview.GetRight() - rectPreview.GetLeft(), rectPreview.GetBottom() - rectPreview.GetTop(), TRUE);
-#endif
-
 		// enable our window (which has been disabled when the preview window was created)
 		WindowID->Enable( TRUE );
 	}
Index: Trunk/XaraLX/wxOil/dlgmgr.h
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.h	(revision 1499)
+++ Trunk/XaraLX/wxOil/dlgmgr.h	(revision 1500)
@@ -363,6 +363,9 @@
 	// resources associated with it. It hides the dialog.  
 	static void Close(CWindowID WindowID, DialogOp* DlgOp); 
 
+	// Place dialog above or below exist controls in dialog
+	static BOOL MergeDialogs( CWindowID Dialog, CWindowID Mergee, bool fAbove );
+
 	// Brings a dialog to the top-most z-order position
 	static BOOL BringToTop(CWindowID WindowID, DialogOp* pDlgOp);
 
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1499)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1500)
@@ -845,8 +845,36 @@
 		CCamFrame::GetMainFrame()->UpdateFrameManager();
 }
 
+
 /********************************************************************************************
 
+>	static BOOL MergeDialogs( CWindowID Dialog, CWindowID Mergee, bool fAbove )
+
+	Author:		Luke_Hart (Xara Group Ltd) <lukeh@xxxxxxxx>
+	Created:	21/07/2006
+	Inputs:		-
+	Returns:	FALSE if the function failed.
+	Purpose:	This function places the contents of a dialog above or below the
+				contents of an existing dialog
+
+********************************************************************************************/
+BOOL DialogManager::MergeDialogs( CWindowID Dialog, CWindowID Mergee, bool fAbove )
+{
+	wxSizer*			pMainSizer = Dialog->GetSizer();
+	wxSizer*			pVertSizer( new wxBoxSizer( wxVERTICAL ) );
+	if( fAbove )
+		pVertSizer->Add( Mergee, wxALL );
+	pVertSizer->Add( pMainSizer );
+	if( !fAbove )
+		pVertSizer->Add( Mergee, wxALL );
+
+	Dialog->SetSizerAndFit( pVertSizer, false );
+	return TRUE;
+}
+
+
+/********************************************************************************************
+
 >	static BOOL DialogManager::BringToTop(CWindowID WindowID)
 
 	Author:		Simon_Maneggio (Xara Group Ltd) <camelotdev@xxxxxxxx>


Xara