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

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1050
Date       : Mon May 15 13:24:43 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/guides.cpp
   M /Trunk/XaraLX/wxOil/coldrop.cpp
   M /Trunk/XaraLX/wxOil/coldrop.h
   M /Trunk/XaraLX/wxOil/dropdown.cpp
   M /Trunk/XaraLX/wxOil/dropdown.h

More colour dropdown work - enabled changing guide layer colour


Diff:
Index: Trunk/XaraLX/Kernel/guides.cpp
===================================================================
--- Trunk/XaraLX/Kernel/guides.cpp	(revision 1049)
+++ Trunk/XaraLX/Kernel/guides.cpp	(revision 1050)
@@ -2162,12 +2162,9 @@
 			OpNewGuideline::Init() 		&&
 			OpSpreadOrigin::Init() 		&& 
 			OpResetSpreadOrigin::Init() &&
-PORTNOTE("other", "Removed use of OpChangeLayerColour")
-#ifndef EXCLUDE_FROM_XARALX
 #ifndef STANDALONE
 			OpChangeLayerColour::Init() &&
 #endif
-#endif
 			RegisterOpDescriptor(
 								0, 
 								0,
Index: Trunk/XaraLX/wxOil/coldrop.cpp
===================================================================
--- Trunk/XaraLX/wxOil/coldrop.cpp	(revision 1049)
+++ Trunk/XaraLX/wxOil/coldrop.cpp	(revision 1050)
@@ -762,7 +762,7 @@
 
 ********************************************************************************************/
 
-BOOL ColourDropDown::DrawIcon(void * ItemData, wxDC& dc, wxRect& IconRect, BOOL Disabled)
+BOOL ColourDropDown::DrawIcon(void * ItemData, wxDC& dc, wxRect& IconRect, BOOL Disabled, INT32 flags)
 {
 	GDrawBrush.Init(&dc);
 	GDrawBrush.Start();
Index: Trunk/XaraLX/wxOil/dropdown.h
===================================================================
--- Trunk/XaraLX/wxOil/dropdown.h	(revision 1049)
+++ Trunk/XaraLX/wxOil/dropdown.h	(revision 1050)
@@ -132,10 +132,10 @@
 	virtual BOOL HasIcon(void * ItemData);
 				// Returns TRUE if the item has an icon. Default is no icon
 
-	virtual BOOL DrawIcon(void * ItemData, wxDC& dc, wxRect& IconRect, BOOL Disabled);
+	virtual BOOL DrawIcon(void * ItemData, wxDC& dc, wxRect& IconRect, BOOL Disabled, INT32 flags);
 				// Handles redraw of the icon, if any. Default is nothing gets drawn
 
-	virtual wxSize DrawText(void * ItemData, wxDC& dc, wxRect& TextRect, INT32 item, BOOL Draw);
+	virtual wxSize DrawText(void * ItemData, wxDC& dc, wxRect& TextRect, INT32 item, INT32 flags, BOOL Draw);
 				// Handles redraw of the text for an item. Default draws the text
 				// returned by GetText. You this probably do not need to override this
 
Index: Trunk/XaraLX/wxOil/coldrop.h
===================================================================
--- Trunk/XaraLX/wxOil/coldrop.h	(revision 1049)
+++ Trunk/XaraLX/wxOil/coldrop.h	(revision 1050)
@@ -184,7 +184,7 @@
 	virtual BOOL HasIcon(void * ItemData);
 				// Returns TRUE if the item has an icon. Default is no icon
 
-	virtual BOOL DrawIcon(void * ItemData, wxDC& dc, wxRect& IconRect, BOOL Disabled);
+	virtual BOOL DrawIcon(void * ItemData, wxDC& dc, wxRect& IconRect, BOOL Disabled, INT32 flags);
 				// Handles redraw of the icon, if any. Default is nothing gets drawn
 
 	virtual wxString GetText(void * ItemData);
Index: Trunk/XaraLX/wxOil/dropdown.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dropdown.cpp	(revision 1049)
+++ Trunk/XaraLX/wxOil/dropdown.cpp	(revision 1050)
@@ -350,7 +350,10 @@
 	wxOwnerDrawnComboBox * pGadget = GetBox();
 	if (!pGadget)
 		return;
-	m_pPopup->SetItemClientData(pGadget->Append(wxEmptyString), ItemData, wxClientData_Void);
+	INT32 n=pGadget->Append(wxEmptyString); // put in an empty string first
+	m_pPopup->SetItemClientData(n, ItemData, wxClientData_Void);
+	if (ItemData)
+		pGadget->SetString(n, GetText(ItemData));
 }
 
 
@@ -475,9 +478,14 @@
 	if (!ItemData)
 	{
 		// It's a divider, so draw it specially - it is a simple black line across the center of the rectangle
-		wxCoord midpoint = Rect.GetBottom()+Rect.GetHeight()/2;
+		wxCoord midpoint = Rect.GetTop()+Rect.GetHeight()/2;
 		if (Draw)
-			dc.DrawLine(Rect.GetLeft(), midpoint, Rect.GetRight(), midpoint);
+		{
+			wxPen OldPen=dc.GetPen();
+			dc.SetPen(wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)));
+			dc.DrawLine(Rect.GetLeft(), midpoint, Rect.GetRight()+1, midpoint);
+			dc.SetPen(OldPen);
+		}
 		return(wxSize(-1,5));
 	}
 
@@ -486,7 +494,7 @@
 	{
 		// Call the derived class
 		wxRect def(-1,-1,-1,-1);
-		wxSize TextSize = DrawText(ItemData, dc, def, item, FALSE); // Rect is unused here as Draw is FALSE
+		wxSize TextSize = DrawText(ItemData, dc, def, item, flags, FALSE); // Rect is unused here as Draw is FALSE
 		TextSize.x+=2*border;
 		TextSize.y+=2*border; // This gives us the bounding rect as we leave some space around it
 		if (HasIcon(ItemData))
@@ -518,7 +526,7 @@
 
 		// Call the derived class to draw the icon
 		if (Draw)
-			DrawIcon(ItemData, dc, IconRect, !pGadget->IsEnabled());
+			DrawIcon(ItemData, dc, IconRect, !pGadget->IsEnabled(), flags);
 
 		// Shift the text to the right of the icon
 		INT32 shift=IconRect.GetWidth()+6;
@@ -531,7 +539,7 @@
 	{
 		// Call derived class to draw the text
 		if (Draw)
-			DrawText(ItemData, dc, TextRect, item, TRUE);
+			DrawText(ItemData, dc, TextRect, item, flags, TRUE);
 	}
 
 	// Restore the DC's previous palette if we selected our one in
@@ -604,7 +612,7 @@
 
 ********************************************************************************************/
 
-BOOL DropDown::DrawIcon(void * ItemData, wxDC& dc, wxRect& IconRect, BOOL Disabled)
+BOOL DropDown::DrawIcon(void * ItemData, wxDC& dc, wxRect& IconRect, BOOL Disabled, INT32 flags)
 {
 	return(TRUE);
 }
@@ -613,7 +621,7 @@
 
 /********************************************************************************************
 
->	virtual wxSize DropDown::DrawText(void * ItemData, wxDC& dc, wxRect& TextRect, INT32 Item, BOOL Draw)
+>	virtual wxSize DropDown::DrawText(void * ItemData, wxDC& dc, wxRect& TextRect, INT32 Item, INT32 flags, BOOL Draw)
 
 	Author:		Jason_Williams (Xara Group Ltd) <camelotdev@xxxxxxxx>
 	Date:		13/9/95
@@ -621,6 +629,9 @@
 	Inputs:		ItemData - Your item data
 				wxDC& - the DC to draw into
 				TextRect - points at a rectangle in which the text should be rendered
+				Item - the index of the item
+				flags - the flags sent to OnDrawItem
+				Draw - TRUE to Draw, FALSE to just get a size
 
 	Returns:	The size of the text
 
@@ -640,9 +651,9 @@
 
 ********************************************************************************************/
 
-wxSize DropDown::DrawText(void * ItemData, wxDC& dc, wxRect& TextRect, INT32 item, BOOL Draw)
+wxSize DropDown::DrawText(void * ItemData, wxDC& dc, wxRect& TextRect, INT32 item, INT32 flags, BOOL Draw)
 {
-	if ( m_pPopup->GetSelection() == (INT32) item )
+	if ( (m_pPopup->GetSelection() == (INT32)item) && !(flags & wxCP_PAINTING_CONTROL) )
 		dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) );
 	else
 		dc.SetTextForeground( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT) );


Xara