]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
Applied minor documentation corrections to wxRegKey from charles (fixes #10407).
[wxWidgets.git] / src / generic / listctrl.cpp
index 028a0fddd429ffbe26877f5a2a3d2bcce8b3e411..5283ba99542f4d0c34387b7f57f7345d4b87d72b 100644 (file)
@@ -618,7 +618,7 @@ public:
     void OnPaint( wxPaintEvent &event );
 
     void OnChildFocus(wxChildFocusEvent& event);
-    
+
     void DrawImage( int index, wxDC *dc, int x, int y );
     void GetImageSize( int index, int &width, int &height ) const;
     int GetTextLength( const wxString &s ) const;
@@ -1414,7 +1414,7 @@ bool wxListLineData::SetAttributes(wxDC *dc,
 #ifdef __WXMAC__
     {
         if (m_owner->HasFocus()
-#if !defined(__WXUNIVERSAL__)
+#if !defined(__WXUNIVERSAL__) && wxOSX_USE_CARBON
                 && IsControlActive( (ControlRef)m_owner->GetHandle() )
 #endif
         )
@@ -1478,7 +1478,7 @@ void wxListLineData::Draw( wxDC *dc )
         {
             int flags = wxCONTROL_SELECTED;
             if (m_owner->HasFocus()
-#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__)
+#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__) && wxOSX_USE_CARBON
                 && IsControlActive( (ControlRef)m_owner->GetHandle() )
 #endif
             )
@@ -1700,7 +1700,7 @@ END_EVENT_TABLE()
 
 void wxListHeaderWindow::Init()
 {
-    m_currentCursor = (wxCursor *) NULL;
+    m_currentCursor = NULL;
     m_isDragging = false;
     m_dirty = false;
 }
@@ -1709,8 +1709,8 @@ wxListHeaderWindow::wxListHeaderWindow()
 {
     Init();
 
-    m_owner = (wxListMainWindow *) NULL;
-    m_resizeCursor = (wxCursor *) NULL;
+    m_owner = NULL;
+    m_resizeCursor = NULL;
 }
 
 wxListHeaderWindow::wxListHeaderWindow( wxWindow *win,
@@ -2277,8 +2277,8 @@ void wxListMainWindow::Init()
     m_headerWidth =
     m_lineHeight = 0;
 
-    m_small_image_list = (wxImageList *) NULL;
-    m_normal_image_list = (wxImageList *) NULL;
+    m_small_image_list = NULL;
+    m_normal_image_list = NULL;
 
     m_small_spacing = 30;
     m_normal_spacing = 40;
@@ -2302,7 +2302,7 @@ wxListMainWindow::wxListMainWindow()
     Init();
 
     m_highlightBrush =
-    m_highlightUnfocusedBrush = (wxBrush *) NULL;
+    m_highlightUnfocusedBrush = NULL;
 }
 
 wxListMainWindow::wxListMainWindow( wxWindow *parent,
@@ -4881,12 +4881,7 @@ void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data )
 
 void wxListMainWindow::OnScroll(wxScrollWinEvent& event)
 {
-    // FIXME
-#if ( defined(__WXGTK__) || defined(__WXMAC__) ) && !defined(__WXUNIVERSAL__)
-    wxScrolledCanvas::OnScroll(event);
-#else
     HandleOnScroll( event );
-#endif
 
     // update our idea of which lines are shown when we redraw the window the
     // next time
@@ -4963,16 +4958,16 @@ END_EVENT_TABLE()
 
 wxGenericListCtrl::wxGenericListCtrl()
 {
-    m_imageListNormal = (wxImageList *) NULL;
-    m_imageListSmall = (wxImageList *) NULL;
-    m_imageListState = (wxImageList *) NULL;
+    m_imageListNormal = NULL;
+    m_imageListSmall = NULL;
+    m_imageListState = NULL;
 
     m_ownsImageListNormal =
     m_ownsImageListSmall =
     m_ownsImageListState = false;
 
-    m_mainWin = (wxListMainWindow*) NULL;
-    m_headerWin = (wxListHeaderWindow*) NULL;
+    m_mainWin = NULL;
+    m_headerWin = NULL;
     m_headerHeight = 0;
 }
 
@@ -5035,20 +5030,19 @@ bool wxGenericListCtrl::Create(wxWindow *parent,
 {
     m_imageListNormal =
     m_imageListSmall =
-    m_imageListState = (wxImageList *) NULL;
+    m_imageListState = NULL;
     m_ownsImageListNormal =
     m_ownsImageListSmall =
     m_ownsImageListState = false;
 
-    m_mainWin = (wxListMainWindow*) NULL;
-    m_headerWin = (wxListHeaderWindow*) NULL;
+    m_mainWin = NULL;
+    m_headerWin = NULL;
 
     m_headerHeight = 0;
 
-    if ( !(style & wxLC_MASK_TYPE) )
-    {
-        style = style | wxLC_LIST;
-    }
+    // just like in other ports, an assert will fail if the user doesn't give any type style:
+    wxASSERT_MSG( (style & wxLC_MASK_TYPE),
+                  _T("wxListCtrl style should have exactly one mode bit set") );
 
     if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) )
         return false;
@@ -5066,7 +5060,7 @@ bool wxGenericListCtrl::Create(wxWindow *parent,
     if ( GetWindowVariant() == wxWINDOW_VARIANT_NORMAL )
     {
         wxFont font;
-#if wxOSX_USE_CARBON
+#if wxOSX_USE_ATSU_TEXT
         font.MacCreateFromThemeFont( kThemeViewsFont );
 #else
         font.MacCreateFromUIFont( kCTFontViewsFontType );
@@ -5083,7 +5077,7 @@ bool wxGenericListCtrl::Create(wxWindow *parent,
         if (m_headerWin)
         {
             wxFont font;
-#if wxOSX_USE_CARBON
+#if wxOSX_USE_ATSU_TEXT
             font.MacCreateFromThemeFont( kThemeSmallSystemFont );
 #else
         font.MacCreateFromUIFont( kCTFontSystemFontType );
@@ -5452,7 +5446,7 @@ wxImageList *wxGenericListCtrl::GetImageList(int which) const
     else if (which == wxIMAGE_LIST_STATE)
         return m_imageListState;
 
-    return (wxImageList *) NULL;
+    return NULL;
 }
 
 void wxGenericListCtrl::SetImageList( wxImageList *imageList, int which )
@@ -5769,7 +5763,7 @@ wxGenericListCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
 #else
     wxUnusedVar(variant);
     wxVisualAttributes attr;
-    attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
+    attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT);
     attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX);
     attr.font  = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
     return attr;