[Commits] (davids) colheader - exposed selection color

commits at osafoundation.org commits at osafoundation.org
Sat Apr 9 11:52:46 PDT 2005


Commit by: davids
Modified files:
internal/wxPython-2.5/include/wx/generic/colheader.h 1.24 1.25
internal/wxPython-2.5/src/generic/colheader.cpp 1.56 1.57
internal/wxPython-2.5/wxPython/src/colheader.i 1.12 1.13

Log message:

colheader - exposed selection color
r=TBD



ViewCVS links:
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/include/wx/generic/colheader.h.diff?r1=text&tr1=1.24&r2=text&tr2=1.25
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/src/generic/colheader.cpp.diff?r1=text&tr1=1.56&r2=text&tr2=1.57
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/wxPython/src/colheader.i.diff?r1=text&tr1=1.12&r2=text&tr2=1.13

Index: internal/wxPython-2.5/include/wx/generic/colheader.h
diff -u internal/wxPython-2.5/include/wx/generic/colheader.h:1.24 internal/wxPython-2.5/include/wx/generic/colheader.h:1.25
--- internal/wxPython-2.5/include/wx/generic/colheader.h:1.24	Fri Apr  8 20:59:54 2005
+++ internal/wxPython-2.5/include/wx/generic/colheader.h	Sat Apr  9 11:52:43 2005
@@ -19,6 +19,7 @@
 #include "wx/control.h"			// the base class
 #include "wx/dcclient.h"
 #include "wx/font.h"
+#include "wx/colour.h"
 #include "wx/bitmap.h"
 
 
@@ -27,7 +28,7 @@
 // class wxBitmap;
 
 // ----------------------------------------------------------------------------
-// wxColumnHeader: a control that provides a native-appearance column header
+// private data definitions
 // ----------------------------------------------------------------------------
 
 typedef enum
@@ -105,6 +106,7 @@
 	static void GenericDrawSelection(
 		wxClientDC		*dc,
 		const wxRect		*boundsR,
+		const wxColour		*targetColour,
 		long				drawStyle );
 
 	static void GenericDrawSortArrow(
@@ -185,6 +187,10 @@
 		long				itemIndex,
 		long				originX );
 
+	void GetSelectionColour(
+		wxColor			&targetColour ) const;
+	void SetSelectionColour(
+		const wxColor		&targetColour );
 	long GetSelectionDrawStyle( void ) const;
 	void SetSelectionDrawStyle(
 		long				styleValue );
@@ -347,6 +353,7 @@
 protected:
 	wxRect					m_NativeBoundsR;
 	wxFont				m_Font;
+	wxColour				m_SelectionColour;
 	wxColumnHeaderItem		**m_ItemList;
 	long					m_ItemCount;
 	long					m_ItemSelected;

Index: internal/wxPython-2.5/src/generic/colheader.cpp
diff -u internal/wxPython-2.5/src/generic/colheader.cpp:1.56 internal/wxPython-2.5/src/generic/colheader.cpp:1.57
--- internal/wxPython-2.5/src/generic/colheader.cpp:1.56	Sat Apr  9 10:31:20 2005
+++ internal/wxPython-2.5/src/generic/colheader.cpp	Sat Apr  9 11:52:43 2005
@@ -165,6 +165,8 @@
 	m_ItemSelected = wxCOLUMNHEADER_HITTEST_NoPart;
 	m_SelectionDrawStyle = 0;
 
+	m_SelectionColour.Set( 0x66, 0x66, 0x66 );
+
 #if defined(__WXMAC__)
 	// NB: or kThemeSystemFontTag, kThemeViewsFontTag
 	m_Font.MacCreateThemeFont( kThemeSmallSystemFont );
@@ -549,6 +551,18 @@
 #pragma mark -
 #endif
 
+void wxColumnHeader::GetSelectionColour(
+	wxColor			&targetColour ) const
+{
+	targetColour = m_SelectionColour;
+}
+
+void wxColumnHeader::SetSelectionColour(
+	const wxColor		&targetColour )
+{
+	m_SelectionColour = targetColour;
+}
+
 long wxColumnHeader::GetSelectionDrawStyle( void ) const
 {
 	return m_SelectionDrawStyle;
@@ -1308,7 +1322,7 @@
 		{
 		wxClientDC		dc( this );
 
-			wxColumnHeaderItem::GenericDrawSelection( &dc, &boundsR, m_SelectionDrawStyle );
+			wxColumnHeaderItem::GenericDrawSelection( &dc, &boundsR, m_SelectionColour, m_SelectionDrawStyle );
 		}
 
 #else
@@ -1330,7 +1344,7 @@
 			// generic case - add selection indicator
 			resultV |= m_ItemList[i]->GenericDrawItem( this, &dc, &boundsR, m_BUseUnicode, m_BVisibleSelection );
 			if (m_BVisibleSelection && (i == m_ItemSelected))
-				wxColumnHeaderItem::GenericDrawSelection( &dc, &boundsR, m_SelectionDrawStyle );
+				wxColumnHeaderItem::GenericDrawSelection( &dc, &boundsR, m_SelectionColour, m_SelectionDrawStyle );
 #endif
 		}
 
@@ -2142,15 +2156,18 @@
 void wxColumnHeaderItem::GenericDrawSelection(
 	wxClientDC			*dc,
 	const wxRect			*boundsR,
+	const wxColour			*targetColour,
 	long					drawStyle )
 {
-wxColour		stdSelRGB( 0x66, 0x66, 0x66 );
-wxPen		targetPen( stdSelRGB, 1, wxSOLID );
+wxPen		targetPen( *wxLIGHT_GREY, 1, wxSOLID );
 int			borderWidth;
 
 	if ((dc == NULL) || (boundsR == NULL))
 		return;
 
+	if (targetColour != NULL)
+		targetPen.SetColour( *targetColour );
+
 //	wxLogDebug(
 //		_T("GenericDrawSelection: [%ld, %ld, %ld, %ld]"),
 //		boundsR->x, boundsR->y, boundsR->width, boundsR->height );

Index: internal/wxPython-2.5/wxPython/src/colheader.i
diff -u internal/wxPython-2.5/wxPython/src/colheader.i:1.12 internal/wxPython-2.5/wxPython/src/colheader.i:1.13
--- internal/wxPython-2.5/wxPython/src/colheader.i:1.12	Fri Apr  8 20:59:54 2005
+++ internal/wxPython-2.5/wxPython/src/colheader.i	Sat Apr  9 11:52:44 2005
@@ -107,6 +107,10 @@
         long            itemIndex,
         long            originX );
 
+    void GetSelectionColour(
+        wxColor            &targetColour ) const;
+    void SetSelectionColour(
+        const wxColor        &targetColour );
     long GetSelectionDrawStyle( void ) const;
     void SetSelectionDrawStyle(
         long                styleValue );



More information about the Commits mailing list