[Commits] (davids) colheader - changed all "FlagAttr" symbols to "Attribute"

commits at osafoundation.org commits at osafoundation.org
Mon Apr 18 14:56:02 PDT 2005


Commit by: davids
Modified files:
internal/wxPython-2.5/include/wx/colheader.h 1.9 1.10
internal/wxPython-2.5/include/wx/generic/colheader.h 1.34 1.35
internal/wxPython-2.5/src/generic/colheader.cpp 1.70 1.71
internal/wxPython-2.5/wxPython/demo/ColumnHeader.py 1.27 1.28
internal/wxPython-2.5/wxPython/src/colheader.i 1.17 1.18

Log message:

colheader - changed all "FlagAttr" symbols to "Attribute"
improved generic renderer text positioning
reduced size of generic sort arrow
r=TBD



ViewCVS links:
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/include/wx/colheader.h.diff?r1=text&tr1=1.9&r2=text&tr2=1.10
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/include/wx/generic/colheader.h.diff?r1=text&tr1=1.34&r2=text&tr2=1.35
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/src/generic/colheader.cpp.diff?r1=text&tr1=1.70&r2=text&tr2=1.71
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/wxPython/demo/ColumnHeader.py.diff?r1=text&tr1=1.27&r2=text&tr2=1.28
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/wxPython/src/colheader.i.diff?r1=text&tr1=1.17&r2=text&tr2=1.18

Index: internal/wxPython-2.5/include/wx/generic/colheader.h
diff -u internal/wxPython-2.5/include/wx/generic/colheader.h:1.34 internal/wxPython-2.5/include/wx/generic/colheader.h:1.35
--- internal/wxPython-2.5/include/wx/generic/colheader.h:1.34	Mon Apr 18 10:19:29 2005
+++ internal/wxPython-2.5/include/wx/generic/colheader.h	Mon Apr 18 14:55:59 2005
@@ -35,8 +35,8 @@
 {
 	wxCH_kMetricInsetX				= 4,
 	wxCH_kMetricInsetY				= 4,
-	wxCH_kMetricArrowSizeX		= 12,
-	wxCH_kMetricArrowSizeY		= 12,
+	wxCH_kMetricArrowSizeX		= 8,
+	wxCH_kMetricArrowSizeY		= 8,
 	wxCH_kMetricBitmapSizeX		= 12,
 	wxCH_kMetricBitmapSizeY		= 12
 }
@@ -84,10 +84,10 @@
 		long			&originX,
 		long			&extentX ) const;
 
-	bool GetFlagAttribute(
-		wxColumnHeaderItemFlagAttr	flagEnum ) const;
-	bool SetFlagAttribute(
-		wxColumnHeaderItemFlagAttr	flagEnum,
+	bool GetAttribute(
+		wxColumnHeaderItemAttribute	flagEnum ) const;
+	bool SetAttribute(
+		wxColumnHeaderItemAttribute	flagEnum,
 		bool						bFlagValue );
 
 	long GenericDrawItem(
@@ -206,10 +206,10 @@
 	long GetSelectionDrawStyle( void ) const;
 	void SetSelectionDrawStyle(
 		long				styleValue );
-	bool GetFlagAttribute(
-		wxColumnHeaderFlagAttr		flagEnum ) const;
-	bool SetFlagAttribute(
-		wxColumnHeaderFlagAttr		flagEnum,
+	bool GetAttribute(
+		wxColumnHeaderAttribute		flagEnum ) const;
+	bool SetAttribute(
+		wxColumnHeaderAttribute		flagEnum,
 		bool						bFlagValue );
 
 	// returns a non-negative value for a column header item
@@ -263,12 +263,12 @@
 	void SetUIExtent(
 		long				itemIndex,
 		wxSize			&extentPt );
-	bool GetItemFlagAttribute(
+	bool GetItemAttribute(
 		long						itemIndex,
-		wxColumnHeaderItemFlagAttr	flagEnum ) const;
-	bool SetItemFlagAttribute(
+		wxColumnHeaderItemAttribute	flagEnum ) const;
+	bool SetItemAttribute(
 		long						itemIndex,
-		wxColumnHeaderItemFlagAttr	flagEnum,
+		wxColumnHeaderItemAttribute	flagEnum,
 		bool						bFlagValue );
 
 	// implementation only from now on

Index: internal/wxPython-2.5/include/wx/colheader.h
diff -u internal/wxPython-2.5/include/wx/colheader.h:1.9 internal/wxPython-2.5/include/wx/colheader.h:1.10
--- internal/wxPython-2.5/include/wx/colheader.h:1.9	Mon Apr 18 10:19:28 2005
+++ internal/wxPython-2.5/include/wx/colheader.h	Mon Apr 18 14:55:58 2005
@@ -34,22 +34,22 @@
 
 typedef enum
 {
-	CH_FLAGATTR_Unicode,
-	CH_FLAGATTR_GenericRenderer,
-	CH_FLAGATTR_VisibleSelection,
-	CH_FLAGATTR_ProportionalResizing
+	CH_ATTR_Unicode,
+	CH_ATTR_GenericRenderer,
+	CH_ATTR_VisibleSelection,
+	CH_ATTR_ProportionalResizing
 }
-wxColumnHeaderFlagAttr;
+wxColumnHeaderAttribute;
 
 typedef enum
 {
-	CH_ITEM_FLAGATTR_Enabled,
-	CH_ITEM_FLAGATTR_Selected,
-	CH_ITEM_FLAGATTR_SortEnabled,
-	CH_ITEM_FLAGATTR_SortDirection,
-	CH_ITEM_FLAGATTR_FixedWidth
+	CH_ITEM_ATTR_Enabled,
+	CH_ITEM_ATTR_Selected,
+	CH_ITEM_ATTR_SortEnabled,
+	CH_ITEM_ATTR_SortDirection,
+	CH_ITEM_ATTR_FixedWidth
 }
-wxColumnHeaderItemFlagAttr;
+wxColumnHeaderItemAttribute;
 
 typedef enum
 {

Index: internal/wxPython-2.5/wxPython/src/colheader.i
diff -u internal/wxPython-2.5/wxPython/src/colheader.i:1.17 internal/wxPython-2.5/wxPython/src/colheader.i:1.18
--- internal/wxPython-2.5/wxPython/src/colheader.i:1.17	Mon Apr 18 10:19:30 2005
+++ internal/wxPython-2.5/wxPython/src/colheader.i	Mon Apr 18 14:56:00 2005
@@ -30,27 +30,27 @@
 
 //---------------------------------------------------------------------------
 
-enum wxColumnHeaderFlagAttr
+enum wxColumnHeaderHitTestResult
 {
-    CH_FLAGATTR_Unicode,
-    CH_FLAGATTR_GenericRenderer,
-    CH_FLAGATTR_VisibleSelection,
-    CH_FLAGATTR_ProportionalResizing
+    CH_HITTEST_NoPart            = -1,    // not within a known sub-item (but within the client bounds)
+    CH_HITTEST_ItemZero        = 0        // any other (non-negative) value is a sub-item
 };
 
-enum wxColumnHeaderItemFlagAttr
+enum wxColumnHeaderAttribute
 {
-    CH_ITEM_FLAGATTR_Enabled,
-    CH_ITEM_FLAGATTR_Selected,
-    CH_ITEM_FLAGATTR_SortEnabled,
-    CH_ITEM_FLAGATTR_SortDirection,
-    CH_ITEM_FLAGATTR_FixedWidth
+    CH_ATTR_Unicode,
+    CH_ATTR_GenericRenderer,
+    CH_ATTR_VisibleSelection,
+    CH_ATTR_ProportionalResizing
 };
 
-enum wxColumnHeaderHitTestResult
+enum wxColumnHeaderItemAttribute
 {
-    CH_HITTEST_NoPart            = -1,    // not within a known sub-item (but within the client bounds)
-    CH_HITTEST_ItemZero        = 0        // any other (non-negative) value is a sub-item
+    CH_ITEM_ATTR_Enabled,
+    CH_ITEM_ATTR_Selected,
+    CH_ITEM_ATTR_SortEnabled,
+    CH_ITEM_ATTR_SortDirection,
+    CH_ITEM_ATTR_FixedWidth
 };
 
 enum wxColumnHeaderJustification
@@ -137,10 +137,10 @@
     long GetSelectionDrawStyle( void ) const;
     void SetSelectionDrawStyle(
         long                styleValue );
-    bool GetFlagAttribute(
-        wxColumnHeaderFlagAttr    flagEnum ) const;
-    bool SetFlagAttribute(
-        wxColumnHeaderFlagAttr        flagEnum,
+    bool GetAttribute(
+        wxColumnHeaderAttribute    flagEnum ) const;
+    bool SetAttribute(
+        wxColumnHeaderAttribute        flagEnum,
         bool                        bFlagValue );
 
     long GetItemCount( void ) const;
@@ -187,12 +187,12 @@
     void SetUIExtent(
         long                itemIndex,
         wxSize            &extentPt );
-    bool GetItemFlagAttribute(
+    bool GetItemAttribute(
         long                            itemIndex,
-        wxColumnHeaderItemFlagAttr    flagEnum ) const;
-    bool SetItemFlagAttribute(
+        wxColumnHeaderItemAttribute    flagEnum ) const;
+    bool SetItemAttribute(
         long                            itemIndex,
-        wxColumnHeaderItemFlagAttr        flagEnum,
+        wxColumnHeaderItemAttribute        flagEnum,
         bool                        bFlagValue );
 };
 

Index: internal/wxPython-2.5/wxPython/demo/ColumnHeader.py
diff -u internal/wxPython-2.5/wxPython/demo/ColumnHeader.py:1.27 internal/wxPython-2.5/wxPython/demo/ColumnHeader.py:1.28
--- internal/wxPython-2.5/wxPython/demo/ColumnHeader.py:1.27	Mon Apr 18 12:30:33 2005
+++ internal/wxPython-2.5/wxPython/demo/ColumnHeader.py	Mon Apr 18 14:56:00 2005
@@ -57,7 +57,7 @@
         # add demo UI controls
         miscControlsY = 175
 
-        if (ch1.GetFlagAttribute( wx.colheader.CH_FLAGATTR_Unicode )):
+        if (ch1.GetAttribute( wx.colheader.CH_ATTR_Unicode )):
                 prompt = "Unicode build"
         else:
                 prompt = "ANSI build"
@@ -96,15 +96,15 @@
 
         cb2 = wx.CheckBox( self, -1, "Generic Renderer", (self.colStartX, miscControlsY + 25), (150, 20), wx.NO_BORDER )
         self.Bind( wx.EVT_CHECKBOX, self.OnTestGenericRendererCheckBox, cb2 )
-        cb2.SetValue( ch1.GetFlagAttribute( wx.colheader.CH_FLAGATTR_GenericRenderer ) )
+        cb2.SetValue( ch1.GetAttribute( wx.colheader.CH_ATTR_GenericRenderer ) )
 
         cb3 = wx.CheckBox( self, -1, "Visible Selection", (self.colStartX, miscControlsY + 50), (200, 20), wx.NO_BORDER )
         self.Bind( wx.EVT_CHECKBOX, self.OnTestVisibleSelectionCheckBox, cb3 )
-        cb3.SetValue( ch1.GetFlagAttribute( wx.colheader.CH_FLAGATTR_VisibleSelection ) )
+        cb3.SetValue( ch1.GetAttribute( wx.colheader.CH_ATTR_VisibleSelection ) )
 
         cb4 = wx.CheckBox( self, -1, "Proportional Resizing", (self.colStartX, miscControlsY + 75), (200, 20), wx.NO_BORDER )
         self.Bind( wx.EVT_CHECKBOX, self.OnTestProportionalResizingCheckBox, cb4 )
-        cb4.SetValue( ch1.GetFlagAttribute( wx.colheader.CH_FLAGATTR_ProportionalResizing ) )
+        cb4.SetValue( ch1.GetAttribute( wx.colheader.CH_ATTR_ProportionalResizing ) )
 
         self.colStartX = 175
 
@@ -151,7 +151,7 @@
              if (itemIndex < 0):
                  itemIndex = itemCount
              ch.AddItem( itemIndex, "", wx.colheader.CH_JUST_Center, 40, 0, 0, 1 )
-             ch.SetItemFlagAttribute( itemIndex, wx.colheader.CH_ITEM_FLAGATTR_FixedWidth, 1 )
+             ch.SetItemAttribute( itemIndex, wx.colheader.CH_ITEM_ATTR_FixedWidth, 1 )
              testBmp = images.getTest2Bitmap()
              ch.SetBitmapRef( itemIndex, testBmp )
              ch.SetSelectedItem( itemIndex )
@@ -179,24 +179,24 @@
         self.l0.SetLabel( "enabled (%d)" %(curEnabled) )
 
     def OnTestGenericRendererCheckBox( self, event ):
-        curEnabled = self.ch1.GetFlagAttribute( wx.colheader.CH_FLAGATTR_GenericRenderer )
+        curEnabled = self.ch1.GetAttribute( wx.colheader.CH_ATTR_GenericRenderer )
         curEnabled = not curEnabled
-        self.ch1.SetFlagAttribute( wx.colheader.CH_FLAGATTR_GenericRenderer, curEnabled )
-        self.ch2.SetFlagAttribute( wx.colheader.CH_FLAGATTR_GenericRenderer, curEnabled )
+        self.ch1.SetAttribute( wx.colheader.CH_ATTR_GenericRenderer, curEnabled )
+        self.ch2.SetAttribute( wx.colheader.CH_ATTR_GenericRenderer, curEnabled )
         self.l0.SetLabel( "generic renderer (%d)" %(curEnabled) )
 
     def OnTestVisibleSelectionCheckBox( self, event ):
-        curEnabled = self.ch1.GetFlagAttribute( wx.colheader.CH_FLAGATTR_VisibleSelection )
+        curEnabled = self.ch1.GetAttribute( wx.colheader.CH_ATTR_VisibleSelection )
         curEnabled = not curEnabled
-        self.ch1.SetFlagAttribute( wx.colheader.CH_FLAGATTR_VisibleSelection, curEnabled )
-        self.ch2.SetFlagAttribute( wx.colheader.CH_FLAGATTR_VisibleSelection, curEnabled )
+        self.ch1.SetAttribute( wx.colheader.CH_ATTR_VisibleSelection, curEnabled )
+        self.ch2.SetAttribute( wx.colheader.CH_ATTR_VisibleSelection, curEnabled )
         self.l0.SetLabel( "selection visible (%d)" %(curEnabled) )
 
     def OnTestProportionalResizingCheckBox( self, event ):
-        curEnabled = self.ch1.GetFlagAttribute( wx.colheader.CH_FLAGATTR_ProportionalResizing )
+        curEnabled = self.ch1.GetAttribute( wx.colheader.CH_ATTR_ProportionalResizing )
         curEnabled = not curEnabled
-        self.ch1.SetFlagAttribute( wx.colheader.CH_FLAGATTR_ProportionalResizing, curEnabled )
-        self.ch2.SetFlagAttribute( wx.colheader.CH_FLAGATTR_ProportionalResizing, curEnabled )
+        self.ch1.SetAttribute( wx.colheader.CH_ATTR_ProportionalResizing, curEnabled )
+        self.ch2.SetAttribute( wx.colheader.CH_ATTR_ProportionalResizing, curEnabled )
         self.l0.SetLabel( "proportional resizing (%d)" %(curEnabled) )
 
     def OnEvtChoice( self, event ):

Index: internal/wxPython-2.5/src/generic/colheader.cpp
diff -u internal/wxPython-2.5/src/generic/colheader.cpp:1.70 internal/wxPython-2.5/src/generic/colheader.cpp:1.71
--- internal/wxPython-2.5/src/generic/colheader.cpp:1.70	Mon Apr 18 12:30:33 2005
+++ internal/wxPython-2.5/src/generic/colheader.cpp	Mon Apr 18 14:55:59 2005
@@ -299,7 +299,7 @@
 	for (i=0; i<m_ItemCount; i++)
 	{
 		if ((m_ItemList != NULL) && (m_ItemList[i] != NULL))
-			m_ItemList[i]->SetFlagAttribute( CH_ITEM_FLAGATTR_Enabled, bEnable );
+			m_ItemList[i]->SetAttribute( CH_ITEM_ATTR_Enabled, bEnable );
 
 		RefreshItem( i );
 	}
@@ -522,10 +522,10 @@
 
 		item = ((m_ItemList != NULL) ? m_ItemList[itemIndex] : NULL);
 		if (item != NULL)
-			if (item->GetFlagAttribute( CH_ITEM_FLAGATTR_SortEnabled ))
+			if (item->GetAttribute( CH_ITEM_ATTR_SortEnabled ))
 			{
-				bSortFlag = item->GetFlagAttribute( CH_ITEM_FLAGATTR_SortDirection );
-				item->SetFlagAttribute( CH_ITEM_FLAGATTR_SortDirection, ! bSortFlag );
+				bSortFlag = item->GetAttribute( CH_ITEM_ATTR_SortDirection );
+				item->SetAttribute( CH_ITEM_ATTR_SortDirection, ! bSortFlag );
 
 				if (m_BVisibleSelection)
 				{
@@ -591,8 +591,8 @@
 	}
 }
 
-bool wxColumnHeader::GetFlagAttribute(
-	wxColumnHeaderFlagAttr		flagEnum ) const
+bool wxColumnHeader::GetAttribute(
+	wxColumnHeaderAttribute		flagEnum ) const
 {
 bool			bResult;
 
@@ -600,19 +600,19 @@
 
 	switch (flagEnum)
 	{
-	case CH_FLAGATTR_Unicode:
+	case CH_ATTR_Unicode:
 		bResult = m_BUseUnicode;
 		break;
 
-	case CH_FLAGATTR_GenericRenderer:
+	case CH_ATTR_GenericRenderer:
 		bResult = m_BUseGenericRenderer;
 		break;
 
-	case CH_FLAGATTR_VisibleSelection:
+	case CH_ATTR_VisibleSelection:
 		bResult = m_BVisibleSelection;
 		break;
 
-	case CH_FLAGATTR_ProportionalResizing:
+	case CH_ATTR_ProportionalResizing:
 		bResult = m_BProportionalResizing;
 		break;
 
@@ -623,8 +623,8 @@
 	return bResult;
 }
 
-bool wxColumnHeader::SetFlagAttribute(
-	wxColumnHeaderFlagAttr		flagEnum,
+bool wxColumnHeader::SetAttribute(
+	wxColumnHeaderAttribute		flagEnum,
 	bool						bFlagValue )
 {
 bool			bResult;
@@ -633,12 +633,12 @@
 
 	switch (flagEnum)
 	{
-	case CH_FLAGATTR_Unicode:
+	case CH_ATTR_Unicode:
 		// NB: runtime set not allowed
 		// m_BUseUnicode = bFlagValue;
 		break;
 
-	case CH_FLAGATTR_GenericRenderer:
+	case CH_ATTR_GenericRenderer:
 #if defined(__WXMSW__) || defined(__WXMAC__)
 		if (m_BUseGenericRenderer != bFlagValue)
 		{
@@ -648,7 +648,7 @@
 #endif
 		break;
 
-	case CH_FLAGATTR_VisibleSelection:
+	case CH_ATTR_VisibleSelection:
 		if (m_BVisibleSelection != bFlagValue)
 		{
 			m_BVisibleSelection = bFlagValue;
@@ -661,7 +661,7 @@
 		}
 		break;
 
-	case CH_FLAGATTR_ProportionalResizing:
+	case CH_ATTR_ProportionalResizing:
 		if (m_BProportionalResizing != bFlagValue)
 		{
 			m_BProportionalResizing = bFlagValue;
@@ -834,7 +834,7 @@
 		{
 			bSelected = (i == itemIndex);
 			if ((m_ItemList != NULL) && (m_ItemList[i] != NULL))
-				m_ItemList[i]->SetFlagAttribute( CH_ITEM_FLAGATTR_Selected, bSelected );
+				m_ItemList[i]->SetAttribute( CH_ITEM_ATTR_Selected, bSelected );
 
 			RefreshItem( i );
 		}
@@ -1250,9 +1250,9 @@
 	}
 }
 
-bool wxColumnHeader::GetItemFlagAttribute(
+bool wxColumnHeader::GetItemAttribute(
 	long						itemIndex,
-	wxColumnHeaderItemFlagAttr	flagEnum ) const
+	wxColumnHeaderItemAttribute	flagEnum ) const
 {
 wxColumnHeaderItem		*itemRef;
 bool					bResultV;
@@ -1260,14 +1260,14 @@
 	itemRef = GetItemRef( itemIndex );
 	bResultV = (itemRef != NULL);
 	if (bResultV)
-		bResultV = itemRef->GetFlagAttribute( flagEnum );
+		bResultV = itemRef->GetAttribute( flagEnum );
 
 	return bResultV;
 }
 
-bool wxColumnHeader::SetItemFlagAttribute(
+bool wxColumnHeader::SetItemAttribute(
 	long						itemIndex,
-	wxColumnHeaderItemFlagAttr	flagEnum,
+	wxColumnHeaderItemAttribute	flagEnum,
 	bool						bFlagValue )
 {
 wxColumnHeaderItem		*itemRef;
@@ -1277,7 +1277,7 @@
 	bResultV = (itemRef != NULL);
 	if (bResultV)
 	{
-		if (itemRef->SetFlagAttribute( flagEnum, bFlagValue ))
+		if (itemRef->SetAttribute( flagEnum, bFlagValue ))
 			RefreshItem( itemIndex );
 	}
 
@@ -1863,20 +1863,39 @@
 	long				&originX,
 	long				&extentX ) const
 {
-	originX = m_OriginX + wxCH_kMetricInsetX;
-	if (extentX > m_ExtentX)
-		extentX = m_ExtentX;
+long		leftInsetX, rightInsetX;
 
-	if (m_BSortEnabled)
-		extentX = m_ExtentX - ((3 * wxCH_kMetricInsetX) + wxCH_kMetricArrowSizeX);
-	else
-		extentX = m_ExtentX - (2 * wxCH_kMetricInsetX);
+	rightInsetX =
+		(m_BSortEnabled
+		? (2 * wxCH_kMetricInsetX) + wxCH_kMetricArrowSizeX
+		: wxCH_kMetricInsetX );
+
+	switch (m_TextJust)
+	{
+	case CH_JUST_Center:
+		leftInsetX = rightInsetX;
+		break;
+
+	case CH_JUST_Right:
+	case CH_JUST_Left:
+	default:
+		leftInsetX = wxCH_kMetricInsetX;
+		break;
+	}
+
+	originX = m_OriginX + leftInsetX;
+	extentX = m_ExtentX - (leftInsetX + rightInsetX);
+
+	if (originX > m_OriginX + m_ExtentX)
+		originX = m_OriginX + m_ExtentX;
+	if (extentX > m_ExtentX - originX)
+		extentX = m_ExtentX - originX;
 	if (extentX < 0)
 		extentX = 0;
 }
 
-bool wxColumnHeaderItem::GetFlagAttribute(
-	wxColumnHeaderItemFlagAttr		flagEnum ) const
+bool wxColumnHeaderItem::GetAttribute(
+	wxColumnHeaderItemAttribute		flagEnum ) const
 {
 bool			bResult;
 
@@ -1884,23 +1903,23 @@
 
 	switch (flagEnum)
 	{
-	case CH_ITEM_FLAGATTR_Enabled:
+	case CH_ITEM_ATTR_Enabled:
 		bResult = m_BEnabled;
 		break;
 
-	case CH_ITEM_FLAGATTR_Selected:
+	case CH_ITEM_ATTR_Selected:
 		bResult = m_BSelected;
 		break;
 
-	case CH_ITEM_FLAGATTR_SortEnabled:
+	case CH_ITEM_ATTR_SortEnabled:
 		bResult = m_BSortEnabled;
 		break;
 
-	case CH_ITEM_FLAGATTR_SortDirection:
+	case CH_ITEM_ATTR_SortDirection:
 		bResult = m_BSortAscending;
 		break;
 
-	case CH_ITEM_FLAGATTR_FixedWidth:
+	case CH_ITEM_ATTR_FixedWidth:
 		bResult = m_BFixedWidth;
 		break;
 
@@ -1911,8 +1930,8 @@
 	return bResult;
 }
 
-bool wxColumnHeaderItem::SetFlagAttribute(
-	wxColumnHeaderItemFlagAttr	flagEnum,
+bool wxColumnHeaderItem::SetAttribute(
+	wxColumnHeaderItemAttribute	flagEnum,
 	bool						bFlagValue )
 {
 bool			bResult;
@@ -1921,23 +1940,23 @@
 
 	switch (flagEnum)
 	{
-	case CH_ITEM_FLAGATTR_Enabled:
+	case CH_ITEM_ATTR_Enabled:
 		m_BEnabled = bFlagValue;
 		break;
 
-	case CH_ITEM_FLAGATTR_Selected:
+	case CH_ITEM_ATTR_Selected:
 		m_BSelected = bFlagValue;
 		break;
 
-	case CH_ITEM_FLAGATTR_SortEnabled:
+	case CH_ITEM_ATTR_SortEnabled:
 		m_BSortEnabled = bFlagValue;
 		break;
 
-	case CH_ITEM_FLAGATTR_SortDirection:
+	case CH_ITEM_ATTR_SortDirection:
 		m_BSortAscending = bFlagValue;
 		break;
 
-	case CH_ITEM_FLAGATTR_FixedWidth:
+	case CH_ITEM_ATTR_FixedWidth:
 		m_BFixedWidth = bFlagValue;
 		break;
 
@@ -2082,9 +2101,9 @@
 	bool				bUseUnicode,
 	bool				bVisibleSelection )
 {
-wxRect				localBoundsR, subItemBoundsR;
-long					originX, insetX, maxExtentX;
-bool					bSelected, bHasIcon;
+wxRect		localBoundsR, subItemBoundsR;
+long			originX, maxExtentX;
+bool			bSelected, bHasIcon;
 
 	wxUnusedVar( bUseUnicode );
 
@@ -2105,14 +2124,8 @@
 	wxRendererNative::Get().DrawHeaderButton( parentW, *dc, localBoundsR );
 
 	// draw (justified) label text (if specified)
-	// FIXME: need to clip long text items
-	insetX = wxCH_kMetricInsetX;
 	if (! bHasIcon && ! m_LabelTextRef.IsEmpty())
 	{
-		originX = localBoundsR.x;
-		maxExtentX = m_ExtentX;
-//		GetTextUIExtent( originX, maxExtentX );
-
 		// calculate and cache text extent
 		if ((m_LabelTextExtent.x < 0) || (m_LabelTextExtent.y < 0))
 		{
@@ -2127,26 +2140,8 @@
 			m_LabelTextExtent.y = targetHeight;
 		}
 
-		// determine left size text origin
-		switch (m_TextJust)
-		{
-		case CH_JUST_Right:
-		case CH_JUST_Center:
-			if (maxExtentX > m_LabelTextExtent.x)
-			{
-				if (m_TextJust == CH_JUST_Center)
-					originX += (maxExtentX - m_LabelTextExtent.x) / 2;
-				else
-					originX += maxExtentX - (m_LabelTextExtent.x + insetX);
-			}
-			break;
-
-		case CH_JUST_Left:
-		default:
-			originX += insetX;
-			break;
-		}
-
+		// FIXME: need to clip long text items
+		GetTextUIExtent( originX, maxExtentX );
 		dc->DrawText( m_LabelTextRef.c_str(), originX, localBoundsR.y + 1 );
 	}
 
@@ -2398,6 +2393,8 @@
 		triPt[2].y = boundsR->height;
 	}
 
+	dc->SetPen( *wxGREY_PEN );
+	dc->SetBrush( *wxGREY_BRUSH );
 	dc->DrawPolygon( 3, triPt, boundsR->x, boundsR->y );
 }
 



More information about the Commits mailing list