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

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 855
Date       : Fri Apr 21 18:13:35 BST 2006

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

More gallery sizing fixes
Make context menus pop up at the right position (wxFrame->PopUpMenu takes frame relative coordinates, not a mouse position, and the default works just fine)
Make gallery context menus work (create a name for their dynamic optokens)


Diff:
Index: Trunk/XaraLX/Kernel/sgallery.cpp
===================================================================
--- Trunk/XaraLX/Kernel/sgallery.cpp	(revision 854)
+++ Trunk/XaraLX/Kernel/sgallery.cpp	(revision 855)
@@ -419,6 +419,10 @@
 		switch (Msg->DlgMsg)
 		{
 			case DIM_CREATE:
+				{
+					String_32 name(CamResource::GetObjectName(DlgResID));
+					SetName(name);
+				}
 				break;
 
 			case DIM_CANCEL:			// We're closing - close our owned dlgs
Index: Trunk/XaraLX/Kernel/sgallery.h
===================================================================
--- Trunk/XaraLX/Kernel/sgallery.h	(revision 854)
+++ Trunk/XaraLX/Kernel/sgallery.h	(revision 855)
@@ -645,7 +645,7 @@
 
 	String_32		Name;
 	String_32&		GetName()								{ return Name; }
-	void			SetName(String_32& str)					{ Name = str; }
+	void			SetName(const String_32& str)			{ Name = str; }
 
 };
 
Index: Trunk/XaraLX/wxOil/oilmenus.cpp
===================================================================
--- Trunk/XaraLX/wxOil/oilmenus.cpp	(revision 854)
+++ Trunk/XaraLX/wxOil/oilmenus.cpp	(revision 855)
@@ -1183,10 +1183,7 @@
 //		CamelotContextMenu->UpdateMenuState(FALSE);
 //		UpdateWinMenu(WinContextMenu, CamelotContextMenu);
 
-		// And open it on screen
-		wxPoint			pos = wxGetMousePosition();
-		 
-		if( CCamFrame::GetMainFrame()->PopupMenu( WinContextMenu, pos.x, pos.y ) )
+		if( CCamFrame::GetMainFrame()->PopupMenu( WinContextMenu ) )
 			worked = TRUE;
 		else
 		{
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 854)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 855)
@@ -369,6 +369,14 @@
 		}
 		if (Title.IsEmpty())
 			 Title = wxString(CamResource::GetText(_R(IDS_ANONYMOUSBARTITLE)));
+
+		wxSizer * pSizer = pDialogWnd->GetSizer();
+		if (pSizer)
+		{
+			pSizer->SetSizeHints(pDialogWnd);
+			pDialogWnd->SetSizerAndFit(pSizer);
+		}
+
 		CCamFrame::GetFrameManager()->AddPane(pDialogWnd, paneinfo.
 			Name(pDialogName).Caption(Title).
 			PinButton(TRUE));


Xara