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

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1014
Date       : Thu May 11 22:19:24 BST 2006

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

Put in dummy bitmaps


Diff:
Index: Trunk/XaraLX/Kernel/appprefs.h
===================================================================
--- Trunk/XaraLX/Kernel/appprefs.h	(revision 1013)
+++ Trunk/XaraLX/Kernel/appprefs.h	(revision 1014)
@@ -171,7 +171,7 @@
 	// Functions to commit the values on the dialog box and its sections on ok
 	BOOL CommitDialogValues();
 
-	BOOL HasImages() {return FALSE;}
+	BOOL HasImages() {return TRUE;}
 	TabType GetTabType() {return TABTYPE_LIST;}
 
 private:
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1013)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1014)
@@ -341,7 +341,10 @@
 				pPropertySheet=NULL; // error handling done below
 			}
 			else
+			{
 				pPropertySheet->CreateButtons( wxOK|wxCANCEL|wxHELP );
+				pPropertySheet->SetTitle(wxString((TCHAR*)((DialogTabOp*)DlgOp)->GetName()));
+			}
 		}
 		pDialogWnd=pPropertySheet;
 	}
@@ -6488,14 +6491,34 @@
 		if (pTip) Title=pTip->GetTip();
 	}
 
-	wxImageList * pImageList = pNoteBook->GetImageList();
+	wxImageList * pImageList = NULL;
+	wxBitmap b;
+	// Add images if present
+	if (pDialogTabOp->HasImages())
+	{
+		b = wxArtProvider::GetBitmap(wxART_HELP_SETTINGS, wxART_OTHER, wxSize(32, 32));
+		//wxBitmap b = *CamArtProvider::Get()->FindBitmap(pDialogTabOp->DlgResID);
+		// b.LoadFile(_T("/tmp/foo.png"), wxBITMAP_TYPE_PNG);
+
+		// Get the image list or create one
+		pImageList = pNoteBook->GetImageList();
+		if (!pImageList)
+		{
+			pImageList = new wxImageList(b.GetWidth(), b.GetHeight());
+			if (pImageList)
+				pNoteBook->AssignImageList(pImageList);
+		}
+
+	}
+
+	pNoteBook->AddPage( pNewPage, Title );
+	// add our image
 	if (pImageList)
 	{
-		// It has images - we should go find appropriate bitmap
-		pImageList->Add(*CamArtProvider::Get()->FindBitmap(pDialogTabOp->DlgResID));
+		pImageList->Add(b);
+		pNoteBook->SetPageImage(pNoteBook->GetPageCount()-1, pImageList->GetImageCount()-1);
 	}
 
-	pNoteBook->AddPage( pNewPage, Title );
 	return true;
 }
 
@@ -7136,15 +7159,6 @@
 	if (!pBook)
 		return TRUE; // nothing to do
 
-	wxImageList * pImageList = NULL;
-	// Add images if present
-	if (pTabDlgOp->HasImages())
-	{
-		pImageList=new wxImageList;
-		if (pImageList)
-			pBook->SetImageList(pImageList);
-	}
-
 	// Before we can create the property sheet we must add pages to it.
 	// Let's ask the op do do this for us
 	if (!(pTabDlgOp->RegisterYourPagesInOrderPlease()))
@@ -7152,6 +7166,14 @@
 		// We failed to add pages to the dialog so we must tidy-up and fail
 		return FALSE;
 	}
+#if 0
+	// Something very odd happens with the image list so we copy and reset it
+	if (pBook->GetImageList())
+	{
+		wxImageList temp=*pBook->GetImageList();
+		pBook->SetImageList(&temp);
+	}
+#endif
 
 	// Get the dialog sized to fit
 	RelayoutDialog(pTabDlgOp);


Xara