]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/filectrl.cpp
Fixed problems caused by duplicated names across different style types.
[wxWidgets.git] / samples / widgets / filectrl.cpp
index 4a83c698300fb65bd69837298c2ae3514a5807ac..2c4f633259eee95f273ba18692596635cae5a333 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     28 Jul 2007
 // Id:          $Id$
 // Copyright:   (c) 2007 Diaa M. Sami
 // Created:     28 Jul 2007
 // Id:          $Id$
 // Copyright:   (c) 2007 Diaa M. Sami
-// License:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
 /////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
@@ -130,6 +130,7 @@ BEGIN_EVENT_TABLE( FileCtrlWidgetsPage, WidgetsPage )
     EVT_CHECKBOX( wxID_ANY, FileCtrlWidgetsPage::OnCheckBox )
     EVT_RADIOBOX( wxID_ANY, FileCtrlWidgetsPage::OnRadioBox )
 
     EVT_CHECKBOX( wxID_ANY, FileCtrlWidgetsPage::OnCheckBox )
     EVT_RADIOBOX( wxID_ANY, FileCtrlWidgetsPage::OnRadioBox )
 
+    EVT_FILECTRL_FILTERCHANGED( wxID_ANY, FileCtrlWidgetsPage::OnFileCtrl )
     EVT_FILECTRL_FOLDERCHANGED( wxID_ANY, FileCtrlWidgetsPage::OnFileCtrl )
     EVT_FILECTRL_SELECTIONCHANGED( wxID_ANY, FileCtrlWidgetsPage::OnFileCtrl )
     EVT_FILECTRL_FILEACTIVATED( wxID_ANY, FileCtrlWidgetsPage::OnFileCtrl )
     EVT_FILECTRL_FOLDERCHANGED( wxID_ANY, FileCtrlWidgetsPage::OnFileCtrl )
     EVT_FILECTRL_SELECTIONCHANGED( wxID_ANY, FileCtrlWidgetsPage::OnFileCtrl )
     EVT_FILECTRL_FILEACTIVATED( wxID_ANY, FileCtrlWidgetsPage::OnFileCtrl )
@@ -177,21 +178,21 @@ void FileCtrlWidgetsPage::CreateContent()
                     0, wxALL | wxEXPAND , 5 );
 
     wxSizer *sizerUseFlags =
                     0, wxALL | wxEXPAND , 5 );
 
     wxSizer *sizerUseFlags =
-        new wxStaticBoxSizer( wxVERTICAL, this, _T( "&Flags" ) );
+        new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Flags" ) );
 
 
-    m_chkMultiple   = CreateCheckBoxAndAddToSizer( sizerUseFlags, _T( "wxFC_MULTIPLE" ) );
-    m_chkNoShowHidden   = CreateCheckBoxAndAddToSizer( sizerUseFlags, _T( "wxFC_NOSHOWHIDDEN" ) );
+    m_chkMultiple   = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_MULTIPLE" ) );
+    m_chkNoShowHidden   = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_NOSHOWHIDDEN" ) );
     sizerLeft->Add( sizerUseFlags, wxSizerFlags().Expand().Border() );
 
     wxSizer *sizerFilters =
     sizerLeft->Add( sizerUseFlags, wxSizerFlags().Expand().Border() );
 
     wxSizer *sizerFilters =
-        new wxStaticBoxSizer( wxVERTICAL, this, _T( "&Filters" ) );
+        new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Filters" ) );
     m_fltr[0] = CreateCheckBoxAndAddToSizer( sizerFilters, wxString::Format( wxT( "all files (%s)|%s" ),
                 wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr ) );
     m_fltr[1] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "C++ files (*.cpp; *.h)|*.cpp;*.h" ) );
     m_fltr[2] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "PNG images (*.png)|*.png" ) );
     sizerLeft->Add( sizerFilters, wxSizerFlags().Expand().Border() );
 
     m_fltr[0] = CreateCheckBoxAndAddToSizer( sizerFilters, wxString::Format( wxT( "all files (%s)|%s" ),
                 wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr ) );
     m_fltr[1] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "C++ files (*.cpp; *.h)|*.cpp;*.h" ) );
     m_fltr[2] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "PNG images (*.png)|*.png" ) );
     sizerLeft->Add( sizerFilters, wxSizerFlags().Expand().Border() );
 
-    wxButton *btn = new wxButton( this, FileCtrlPage_Reset, _T( "&Reset" ) );
+    wxButton *btn = new wxButton( this, FileCtrlPage_Reset, wxT( "&Reset" ) );
     sizerLeft->Add( btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15 );
 
     // right pane
     sizerLeft->Add( btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15 );
 
     // right pane
@@ -306,11 +307,22 @@ void FileCtrlWidgetsPage::OnRadioBox( wxCommandEvent& WXUNUSED( event ) )
 void FileCtrlWidgetsPage::OnFileCtrl( wxFileCtrlEvent& event )
 {
     if ( event.GetEventType() == wxEVT_FILECTRL_FOLDERCHANGED )
 void FileCtrlWidgetsPage::OnFileCtrl( wxFileCtrlEvent& event )
 {
     if ( event.GetEventType() == wxEVT_FILECTRL_FOLDERCHANGED )
+    {
         wxLogMessage("Folder changed event, new folder: %s", event.GetDirectory());
         wxLogMessage("Folder changed event, new folder: %s", event.GetDirectory());
+    }
     else if ( event.GetEventType() == wxEVT_FILECTRL_FILEACTIVATED )
     else if ( event.GetEventType() == wxEVT_FILECTRL_FILEACTIVATED )
+    {
         wxLogMessage("File activated event: %s", wxJoin(event.GetFiles(), ' '));
         wxLogMessage("File activated event: %s", wxJoin(event.GetFiles(), ' '));
+    }
     else if ( event.GetEventType() == wxEVT_FILECTRL_SELECTIONCHANGED )
     else if ( event.GetEventType() == wxEVT_FILECTRL_SELECTIONCHANGED )
+    {
         wxLogMessage("Selection changed event: %s", wxJoin(event.GetFiles(), ' '));
         wxLogMessage("Selection changed event: %s", wxJoin(event.GetFiles(), ' '));
+    }
+    else if ( event.GetEventType() == wxEVT_FILECTRL_FILTERCHANGED )
+    {
+        wxLogMessage("Filter changed event: filter %d selected",
+                     event.GetFilterIndex() + 1);
+    }
 }
 
 #endif // wxUSE_FILECTRL
 }
 
 #endif // wxUSE_FILECTRL