]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/listctrl.cpp
added wxPATH_RMDIR_FULL/RECURSIVE wxFileName::Rmdir() flags (closes #10422)
[wxWidgets.git] / src / generic / listctrl.cpp
index 4e4fdf03a64a4b7a61371c21d9b803f4af1cd864..f33e2b1437adc2b1757254fee60d8a0dd947126b 100644 (file)
@@ -43,6 +43,7 @@
     #include "wx/dcscreen.h"
     #include "wx/math.h"
     #include "wx/settings.h"
+    #include "wx/sizer.h"
 #endif
 
 #include "wx/imaglist.h"
@@ -79,7 +80,12 @@ static const int EXTRA_WIDTH = 6;
 #else
 static const int EXTRA_WIDTH = 4;
 #endif
+
+#ifdef __WXGTK__
+static const int EXTRA_HEIGHT = 6;
+#else
 static const int EXTRA_HEIGHT = 4;
+#endif
 
 // margin between the window and the items
 static const int EXTRA_BORDER_X = 2;
@@ -430,7 +436,7 @@ public:
     bool m_sendSetColumnWidth;
     int m_colToSend;
     int m_widthToSend;
-    
+
     virtual void OnInternalIdle();
 
 private:
@@ -1793,7 +1799,7 @@ void wxListHeaderWindow::AdjustDC(wxDC& dc)
 void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
 {
     wxGenericListCtrl *parent = m_owner->GetListCtrl();
-    
+
     wxPaintDC dc( this );
 
     AdjustDC( dc );
@@ -1931,7 +1937,7 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
 void wxListHeaderWindow::OnInternalIdle()
 {
     wxWindow::OnInternalIdle();
-    
+
     if (m_sendSetColumnWidth)
     {
         m_owner->SetColumnWidth( m_colToSend, m_widthToSend );
@@ -1975,7 +1981,7 @@ void wxListHeaderWindow::DrawCurrent()
 void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
 {
     wxGenericListCtrl *parent = m_owner->GetListCtrl();
-    
+
     // we want to work with logical coords
     int x;
     parent->CalcUnscrolledPosition(event.GetX(), 0, &x, NULL);
@@ -3479,11 +3485,21 @@ void wxListMainWindow::OnChar( wxKeyEvent &event )
         parent->GetEventHandler()->ProcessEvent( le );
     }
 
-    // propagate the char event upwards
-    wxKeyEvent ke(event);
-    ke.SetEventObject( parent );
-    if (parent->GetEventHandler()->ProcessEvent( ke ))
-        return;
+    if ( (event.GetKeyCode() != WXK_UP) &&
+         (event.GetKeyCode() != WXK_DOWN) &&
+         (event.GetKeyCode() != WXK_RIGHT) &&
+         (event.GetKeyCode() != WXK_LEFT) &&
+         (event.GetKeyCode() != WXK_PAGEUP) &&
+         (event.GetKeyCode() != WXK_PAGEDOWN) &&
+         (event.GetKeyCode() != WXK_END) &&
+         (event.GetKeyCode() != WXK_HOME) )
+    {
+        // propagate the char event upwards
+        wxKeyEvent ke(event);
+        ke.SetEventObject( parent );
+        if (parent->GetEventHandler()->ProcessEvent( ke ))
+            return;
+    }
 
     if ( HandleAsNavigationKey(event) )
         return;
@@ -3776,7 +3792,7 @@ void wxListMainWindow::SetColumnWidth( int col, int width )
 
     wxCHECK_RET( InReportView(),
                  _T("SetColumnWidth() can only be called in report mode.") );
-                 
+
     m_dirty = true;
 
     wxListHeaderWindow *headerWin = GetListCtrl()->m_headerWin;
@@ -4874,8 +4890,8 @@ int wxListMainWindow::GetItemWidthWithImage(wxListItem * item)
 // sorting
 // ----------------------------------------------------------------------------
 
-wxListCtrlCompare list_ctrl_compare_func_2;
-long              list_ctrl_compare_data;
+static wxListCtrlCompare list_ctrl_compare_func_2;
+static long              list_ctrl_compare_data;
 
 int LINKAGEMODE list_ctrl_compare_func_1( wxListLineData **arg1, wxListLineData **arg2 )
 {
@@ -4908,10 +4924,6 @@ void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data )
 
 void wxListMainWindow::OnScroll(wxScrollWinEvent& event)
 {
-    wxPrintf( "wxListMainWindow::OnScroll\n" );
-    
-    // HandleOnScroll( event );
-
     // update our idea of which lines are shown when we redraw the window the
     // next time
     ResetVisibleLinesRange();
@@ -5015,7 +5027,7 @@ void wxGenericListCtrl::CreateOrDestroyHeaderWindowAsNeeded()
 {
     bool needs_header = HasHeader();
     bool has_header = (m_headerWin != NULL);
-    
+
     if (needs_header == has_header)
         return;
 
@@ -5028,7 +5040,7 @@ void wxGenericListCtrl::CreateOrDestroyHeaderWindowAsNeeded()
                         wxSize(GetClientSize().x, m_headerHeight),
                         wxTAB_TRAVERSAL
                       );
-                      
+
 #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON
         wxFont font;
 #if wxOSX_USE_ATSU_TEXT
@@ -5038,15 +5050,15 @@ void wxGenericListCtrl::CreateOrDestroyHeaderWindowAsNeeded()
 #endif
         m_headerWin->SetFont( font );
 #endif
-        
+
         GetSizer()->Prepend( m_headerWin, 0, wxGROW );
     }
     else
     {
         GetSizer()->Detach( m_headerWin );
-    
+
         delete m_headerWin;
-        
+
         m_headerWin = NULL;
     }
 }
@@ -5068,15 +5080,19 @@ bool wxGenericListCtrl::Create(wxWindow *parent,
     if ( !wxControl::Create( parent, id, pos, size, style|wxVSCROLL|wxHSCROLL, validator, name ) )
         return false;
 
+#ifdef __WXGTK__
+    style &= ~wxBORDER_MASK;
+    style |= wxBORDER_THEME;
+#endif
 
     m_mainWin = new wxListMainWindow( this, wxID_ANY, wxPoint(0, 0), size, style );
 
     SetTargetWindow( m_mainWin );
-    
+
     wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
     sizer->Add( m_mainWin, 1, wxGROW );
     SetSizer( sizer );
-    
+
     CreateOrDestroyHeaderWindowAsNeeded();
 
     SetInitialSize(size);
@@ -5174,7 +5190,7 @@ void wxGenericListCtrl::SetWindowStyleFlag( long flag )
         // m_mainWin->DeleteEverything();  wxMSW doesn't do that
 
         CreateOrDestroyHeaderWindowAsNeeded();
-    
+
         GetSizer()->Layout();
     }
 
@@ -5521,7 +5537,7 @@ bool wxGenericListCtrl::DeleteColumn( int col )
 
     // if we don't have the header any longer, we need to relayout the window
     // if ( !GetColumnCount() )
-    
+
     return true;
 }
 
@@ -5669,7 +5685,7 @@ void wxGenericListCtrl::OnSize(wxSizeEvent& WXUNUSED(event))
     Layout();
 
     m_mainWin->RecalculatePositions();
-    
+
     AdjustScrollbars();
 }