[Commits] (davids) colheader - removed redundant Win32Select; fixed Win32 selection drawing bug

commits at osafoundation.org commits at osafoundation.org
Tue Apr 12 11:51:46 PDT 2005


Commit by: davids
Modified files:
internal/wxPython-2.5/include/wx/generic/colheader.h 1.28 1.29
internal/wxPython-2.5/src/generic/colheader.cpp 1.63 1.64

Log message:

colheader - removed redundant Win32Select; fixed Win32 selection drawing bug
r=TBD



ViewCVS links:
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/include/wx/generic/colheader.h.diff?r1=text&tr1=1.28&r2=text&tr2=1.29
http://cvs.osafoundation.org/index.cgi/internal/wxPython-2.5/src/generic/colheader.cpp.diff?r1=text&tr1=1.63&r2=text&tr2=1.64

Index: internal/wxPython-2.5/include/wx/generic/colheader.h
diff -u internal/wxPython-2.5/include/wx/generic/colheader.h:1.28 internal/wxPython-2.5/include/wx/generic/colheader.h:1.29
--- internal/wxPython-2.5/include/wx/generic/colheader.h:1.28	Tue Apr 12 11:18:18 2005
+++ internal/wxPython-2.5/include/wx/generic/colheader.h	Tue Apr 12 11:51:45 2005
@@ -334,11 +334,6 @@
 	long Win32ItemRefresh(
 		long			itemIndex,
 		bool			bCheckChanged = false );
-	long Win32ItemSelect(
-		long			itemIndex,
-		bool			bSelected,
-		bool			bSortEnabled,
-		bool			bSortAscending );
 #endif
 
 protected:

Index: internal/wxPython-2.5/src/generic/colheader.cpp
diff -u internal/wxPython-2.5/src/generic/colheader.cpp:1.63 internal/wxPython-2.5/src/generic/colheader.cpp:1.64
--- internal/wxPython-2.5/src/generic/colheader.cpp:1.63	Tue Apr 12 11:22:55 2005
+++ internal/wxPython-2.5/src/generic/colheader.cpp	Tue Apr 12 11:51:45 2005
@@ -176,10 +176,10 @@
 #if defined(__WXMAC__)
 	// NB: or kThemeSystemFontTag, kThemeViewsFontTag
 	m_Font.MacCreateThemeFont( kThemeSmallSystemFont );
-	m_SelectionDrawStyle = wxCOLUMNHEADER_SELECTIONDRAWSTYLE_None;
+	m_SelectionDrawStyle = wxCOLUMNHEADER_SELECTIONDRAWSTYLE_Native;
 #else
 	m_Font.SetFamily( 0 );
-	m_SelectionDrawStyle = wxCOLUMNHEADER_SELECTIONDRAWSTYLE_Native;
+	m_SelectionDrawStyle = wxCOLUMNHEADER_SELECTIONDRAWSTYLE_Underline;
 #endif
 
 	m_BProportionalResizing = true;
@@ -300,19 +300,7 @@
 			m_ItemList[i]->SetFlagAttribute( wxCOLUMNHEADER_FLAGATTR_Enabled, bEnable );
 
 #if defined(__WXMSW__)
-		// FIXME: possibly replace with simpler Win32ItemRefresh( i, false ) call
-	bool		bSelected, bSortEnabled, bSortAscending;
-
-		bSelected = false;
-		bSortEnabled = false;
-		bSortAscending = false;
-		if ((m_ItemList != NULL) && (m_ItemList[i] != NULL))
-		{
-			bSelected = m_ItemList[i]->GetFlagAttribute( wxCOLUMNHEADER_FLAGATTR_Selected );
-			bSortEnabled = m_ItemList[i]->GetFlagAttribute( wxCOLUMNHEADER_FLAGATTR_SortEnabled );
-			bSortAscending = m_ItemList[i]->GetFlagAttribute( wxCOLUMNHEADER_FLAGATTR_SortDirection );
-		}
-		(void)Win32ItemSelect( i, bSelected, bSortEnabled, bSortAscending );
+		Win32ItemRefresh( i, false );
 #endif
 	}
 
@@ -816,18 +804,7 @@
 				m_ItemList[i]->SetFlagAttribute( wxCOLUMNHEADER_FLAGATTR_Selected, bSelected );
 
 #if defined(__WXMSW__)
-		// FIXME: possibly replace with simpler Win32ItemRefresh( i, false ) call
-		bool		bSortEnabled, bSortAscending;
-
-			bSortEnabled = false;
-			bSortAscending = false;
-			if ((m_ItemList != NULL) && (m_ItemList[i] != NULL))
-			{
-				bSortEnabled = m_ItemList[i]->GetFlagAttribute( wxCOLUMNHEADER_FLAGATTR_SortEnabled );
-				bSortAscending = m_ItemList[i]->GetFlagAttribute( wxCOLUMNHEADER_FLAGATTR_SortDirection );
-			}
-
-			(void)Win32ItemSelect( i, bSelected, bSortEnabled, bSortAscending );
+			Win32ItemRefresh( i, false );
 #endif
 		}
 
@@ -1596,7 +1573,7 @@
 		itemData.pszText = (LPTSTR)(itemRef->m_LabelTextRef.c_str());
 	}
 
-	if (! bCheckChanged || (temData.fmt != newFmt))
+	if (! bCheckChanged || (itemData.fmt != newFmt))
 	{
 		itemData.fmt = newFmt;
 		resultV = (long)Header_SetItem( targetViewRef, itemIndex, &itemData );
@@ -1610,49 +1587,6 @@
 
 	return resultV;
 }
-
-// FIXME: is this routine necessary ???
-//
-long wxColumnHeader::Win32ItemSelect(
-	long			itemIndex,
-	bool			bSelected,
-	bool			bSortEnabled,
-	bool			bSortAscending )
-{
-HDITEM		itemData;
-HWND		targetViewRef;
-LONG			newFmt;
-long		resultV;
-
-	targetViewRef = GetHwnd();
-	if (targetViewRef == NULL)
-	{
-		//wxLogDebug( _T("Win32ItemSelect - GetHwnd failed (NULL)") );
-		return (-1L);
-	}
-
-	ZeroMemory( &itemData, sizeof(itemData) );
-	itemData.mask = HDI_FORMAT | HDI_WIDTH;
-	resultV = (long)Header_GetItem( targetViewRef, itemIndex, &itemData );
-
-	newFmt = itemData.fmt & ~(HDF_SORTDOWN | HDF_SORTUP);
-	if (bSelected && bSortEnabled)
-		newFmt |= (bSortAscending ? HDF_SORTUP : HDF_SORTDOWN);
-
-	if (itemData.fmt != newFmt)
-	{
-		itemData.fmt = newFmt;
-		resultV = (long)Header_SetItem( targetViewRef, itemIndex, &itemData );
-//		resultV = (long)SendMessage( targetViewRef, itemRef->mBTextUnicode ? HDM_SETITEMW : HDM_SETITEMA, (WPARAM)itemIndex, (LPARAM)&itemData );
-	}
-	else
-		resultV = 1;
-
-	if (resultV == 0)
-		wxLogDebug( _T("Win32ItemSelect - SendMessage failed") );
-
-	return resultV;
-}
 #endif
 
 // ================



More information about the Commits mailing list