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

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1041
Date       : Sun May 14 13:43:47 BST 2006

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

Tweak code which substitutes missing artwork on dialog tabs


Diff:
Index: Trunk/XaraLX/wxOil/cartprov.h
===================================================================
--- Trunk/XaraLX/wxOil/cartprov.h	(revision 1040)
+++ Trunk/XaraLX/wxOil/cartprov.h	(revision 1041)
@@ -229,6 +229,9 @@
 	static CamArtFlags GetBitmapFlags(const wxString &str);
 	static wxString MakeBitmapFlagString(const CamArtFlags flags);
 
+	wxImage * GetMissingImage() const {return m_pMissingImage;}
+	wxBitmap * GetMissingBitmap() const {return m_pMissingBitmap;}
+
 protected:
 	ResIDWithFlagsToBitmapPtr::iterator Find(ResourceID Resource, CamArtFlags Flags, BOOL SkipArtLoad);
 
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1040)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1041)
@@ -6615,15 +6615,23 @@
 	// Add images if present
 	if (pDialogTabOp->HasImages())
 	{
-		b = *CamArtProvider::Get()->FindBitmap(DialogResID);
-		if (!b.Ok() || b.GetWidth()!=32 || b.GetHeight()!=32)
+		// Get the image list 
+		pImageList = pNoteBook->GetImageList();
+
+		wxBitmap * pBitmap = CamArtProvider::Get()->FindBitmap(DialogResID);
+		if (!pBitmap || (pBitmap==CamArtProvider::Get()->GetMissingBitmap()) || !pBitmap->Ok())
 		{
 			TRACEUSER("Phil", _T("Unable to use options tab icon %d
"), DialogResID);
-			b = wxArtProvider::GetBitmap(wxART_HELP_SETTINGS, wxART_OTHER, wxSize(32, 32));
+			int /*TYPENOTE: Correct */ w=32;
+			int /*TYPENOTE: Correct */ h=32;
+			if (pImageList)
+				pImageList->GetSize(0, w, h);
+			b = wxArtProvider::GetBitmap(wxART_HELP_SETTINGS, wxART_OTHER, wxSize(w, h));
 		}
+		else
+			b= *pBitmap;
 
-		// Get the image list or create one
-		pImageList = pNoteBook->GetImageList();
+		// If there is no image list, create one
 		if (!pImageList)
 		{
 			pImageList = new wxImageList(b.GetWidth(), b.GetHeight());


Xara