diff --git src/AlbumBrowser.cpp src/AlbumBrowser.cpp index d14fb05..3aad539 100644 --- src/AlbumBrowser.cpp +++ src/AlbumBrowser.cpp @@ -2308,7 +2308,7 @@ void guAlbumBrowser::OnBigCoverTracksMouseMoved( wxMouseEvent &event ) // Its a LeftUp event event.SetEventType( wxEVT_LEFT_DOWN ); event.m_leftDown = true; - m_BigCoverTracksListBox->AddPendingEvent( event ); + m_BigCoverTracksListBox->GetEventHandler()->AddPendingEvent( event ); } return; } diff --git src/AuiDockArt.cpp src/AuiDockArt.cpp index c4e26a1..5f838b0 100644 --- src/AuiDockArt.cpp +++ src/AuiDockArt.cpp @@ -23,7 +23,34 @@ #include "Images.h" #include "Utils.h" -extern wxString wxAuiChopText( wxDC &dc, const wxString &text, int max_size ); +wxString wxAuiChopText(wxDC& dc, const wxString& text, int max_size) +{ + wxCoord x,y; + + // first check if the text fits with no problems + dc.GetTextExtent(text, &x, &y); + if (x <= max_size) + return text; + + size_t i, len = text.Length(); + size_t last_good_length = 0; + for (i = 0; i < len; ++i) + { + wxString s = text.Left(i); + s += wxT("..."); + + dc.GetTextExtent(s, &x, &y); + if (x > max_size) + break; + + last_good_length = i; + } + + wxString ret = text.Left(last_good_length); + ret += wxT("..."); + return ret; +} + // -------------------------------------------------------------------------------- // guAuiDockArt::guAuiDockArt() : wxAuiDefaultDockArt() @@ -42,12 +69,12 @@ void inline DrawGradientRectangle( wxDC &dc, const wxRect &rect, const wxColour // -------------------------------------------------------------------------------- // void guAuiDockArt::DrawCaptionBackground( wxDC &dc, const wxRect &rect, bool active ) { - if( m_gradient_type == wxAUI_GRADIENT_NONE ) + if( m_gradientType == wxAUI_GRADIENT_NONE ) { if( active ) - dc.SetBrush( wxBrush( m_active_caption_colour ) ); + dc.SetBrush( wxBrush( m_activeCaptionColour ) ); else - dc.SetBrush( wxBrush( m_inactive_caption_colour ) ); + dc.SetBrush( wxBrush( m_inactiveCaptionColour ) ); dc.DrawRectangle( rect.x, rect.y, rect.width, rect.height ); } @@ -58,15 +85,15 @@ void guAuiDockArt::DrawCaptionBackground( wxDC &dc, const wxRect &rect, bool act // on mac the gradients are expected to become darker from the top #ifdef __WXMAC__ DrawGradientRectangle( dc, rect, - m_active_caption_colour, - m_active_caption_gradient_colour, - m_gradient_type ); + m_activeCaptionColour, + m_activeCaptionGradientColour, + m_gradientType ); #else // on other platforms, active gradients become lighter at the top DrawGradientRectangle( dc, rect, - m_active_caption_colour, - m_active_caption_gradient_colour, - m_gradient_type ); + m_activeCaptionColour, + m_activeCaptionGradientColour, + m_gradientType ); #endif } else @@ -74,20 +101,20 @@ void guAuiDockArt::DrawCaptionBackground( wxDC &dc, const wxRect &rect, bool act #ifdef __WXMAC__ // on mac the gradients are expected to become darker from the top DrawGradientRectangle( dc, rect, - m_inactive_caption_colour, - m_inactive_caption_gradient_colour, - m_gradient_type ); + m_inactiveCaptionColour, + m_inactiveCaptionGradientColour, + m_gradientType ); #else // on other platforms, inactive gradients become lighter at the bottom DrawGradientRectangle( dc, rect, - m_inactive_caption_colour, - m_inactive_caption_gradient_colour, - m_gradient_type ); + m_inactiveCaptionColour, + m_inactiveCaptionGradientColour, + m_gradientType ); #endif } } - dc.SetPen( m_border_pen ); + dc.SetPen( m_borderPen ); int y = rect.y + rect.height - 1; dc.DrawLine( rect.x, y, rect.x + rect.width, y ); } @@ -97,11 +124,11 @@ void guAuiDockArt::DrawCaptionBackground( wxDC &dc, const wxRect &rect, bool act void guAuiDockArt::DrawCaption( wxDC &dc, wxWindow * window, const wxString &text, const wxRect &rect, wxAuiPaneInfo &pane ) { dc.SetPen( * wxTRANSPARENT_PEN ); - dc.SetFont( m_caption_font ); + dc.SetFont( m_captionFont ); DrawCaptionBackground( dc, rect, bool( pane.state & wxAuiPaneInfo::optionActive ) ); - dc.SetTextForeground( pane.state & wxAuiPaneInfo::optionActive ? m_active_caption_text_colour : m_inactive_caption_text_colour ); + dc.SetTextForeground( pane.state & wxAuiPaneInfo::optionActive ? m_activeCaptionTextColour : m_inactiveCaptionTextColour ); wxCoord w, h; dc.GetTextExtent( wxT( "ABCDEFHXfgkj" ), &w, &h ); @@ -110,11 +137,11 @@ void guAuiDockArt::DrawCaption( wxDC &dc, wxWindow * window, const wxString &tex clip_rect.width -= 3; // text offset clip_rect.width -= 2; // button padding if( pane.HasCloseButton() ) - clip_rect.width -= m_button_size; + clip_rect.width -= m_buttonSize; if( pane.HasPinButton() ) - clip_rect.width -= m_button_size; + clip_rect.width -= m_buttonSize; if( pane.HasMaximizeButton() ) - clip_rect.width -= m_button_size; + clip_rect.width -= m_buttonSize; wxString draw_text = wxAuiChopText( dc, text, clip_rect.width ); diff --git src/AuiNotebook.cpp src/AuiNotebook.cpp index 26968b4..72592ff 100644 --- src/AuiNotebook.cpp +++ src/AuiNotebook.cpp @@ -47,8 +47,8 @@ guAuiTabArt::guAuiTabArt() : wxAuiDefaultTabArt() m_TextFgColor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ); m_SelTextFgColour = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ); - m_disabled_close_bmp = guImage( guIMAGE_INDEX_tiny_close_normal ); - m_active_close_bmp = guImage( guIMAGE_INDEX_tiny_close_highlight ); + m_disabledCloseBmp = guImage( guIMAGE_INDEX_tiny_close_normal ); + m_activeCloseBmp = guImage( guIMAGE_INDEX_tiny_close_highlight ); } // -------------------------------------------------------------------------------- // @@ -60,9 +60,9 @@ guAuiTabArt::~guAuiTabArt() wxAuiTabArt * guAuiTabArt::Clone() { guAuiTabArt * art = new guAuiTabArt; - art->SetNormalFont( m_normal_font ); - art->SetSelectedFont( m_selected_font ); - art->SetMeasuringFont( m_measuring_font ); + art->SetNormalFont( m_normalFont ); + art->SetSelectedFont( m_selectedFont ); + art->SetMeasuringFont( m_measuringFont ); // art->m_BgColor = m_BgColor; // art->m_SelBgColor = m_SelBgColor; // art->m_TextFgColor = m_TextFgColor; @@ -75,7 +75,7 @@ void guAuiTabArt::DrawBackground( wxDC &dc, wxWindow * wnd, const wxRect &rect ) // draw background //wxColor top_color = m_base_colour; wxColor top_color = m_BgColor; - wxColor bottom_color = wxAuiStepColour( m_base_colour, 120 ); + wxColor bottom_color = wxAuiStepColour( m_baseColour, 120 ); wxRect r; if( m_flags & wxAUI_NB_BOTTOM ) @@ -88,7 +88,7 @@ void guAuiTabArt::DrawBackground( wxDC &dc, wxWindow * wnd, const wxRect &rect ) dc.GradientFillLinear( r, top_color, bottom_color, wxNORTH ); // draw base lines - dc.SetPen( m_border_pen ); + dc.SetPen( m_borderPen ); int y = rect.GetHeight(); int w = rect.GetWidth(); @@ -120,10 +120,10 @@ void guAuiTabArt::DrawTab(wxDC &dc, wxWindow * wnd, const wxAuiNotebookPage &pag if( caption.empty() ) caption = wxT("Xj"); - dc.SetFont(m_selected_font); + dc.SetFont(m_selectedFont); dc.GetTextExtent(caption, &selected_textx, &selected_texty); - dc.SetFont(m_normal_font); + dc.SetFont(m_normalFont); dc.GetTextExtent(caption, &normal_textx, &normal_texty); // figure out the size of the tab @@ -135,7 +135,7 @@ void guAuiTabArt::DrawTab(wxDC &dc, wxWindow * wnd, const wxAuiNotebookPage &pag close_button_state, x_extent); - wxCoord tab_height = m_tab_ctrl_height - 1; + wxCoord tab_height = m_tabCtrlHeight - 1; if( !page.active ) tab_height -= 2; wxCoord tab_width = tab_size.x; @@ -150,12 +150,12 @@ void guAuiTabArt::DrawTab(wxDC &dc, wxWindow * wnd, const wxAuiNotebookPage &pag if( page.active ) { - dc.SetFont( m_selected_font ); + dc.SetFont( m_selectedFont ); texty = selected_texty; } else { - dc.SetFont(m_normal_font); + dc.SetFont(m_normalFont); texty = normal_texty; } @@ -221,7 +221,7 @@ void guAuiTabArt::DrawTab(wxDC &dc, wxWindow * wnd, const wxAuiNotebookPage &pag // } // draw tab outline - dc.SetPen( m_border_pen ); + dc.SetPen( m_borderPen ); dc.SetBrush( * wxTRANSPARENT_BRUSH ); dc.DrawPolygon( WXSIZEOF( border_points ), border_points ); @@ -230,7 +230,7 @@ void guAuiTabArt::DrawTab(wxDC &dc, wxWindow * wnd, const wxAuiNotebookPage &pag if( page.active ) { if( m_flags & wxAUI_NB_BOTTOM ) - dc.SetPen( wxPen( wxColour( wxAuiStepColour( m_base_colour, 170 ) ) ) ); + dc.SetPen( wxPen( wxColour( wxAuiStepColour( m_baseColour, 170 ) ) ) ); // TODO: else if (m_flags &wxAUI_NB_LEFT) {} // TODO: else if (m_flags &wxAUI_NB_RIGHT) {} else //for wxAUI_NB_TOP @@ -246,7 +246,7 @@ void guAuiTabArt::DrawTab(wxDC &dc, wxWindow * wnd, const wxAuiNotebookPage &pag int close_button_width = 0; if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN) { - close_button_width = m_active_close_bmp.GetWidth(); + close_button_width = m_activeCloseBmp.GetWidth(); } @@ -284,12 +284,12 @@ void guAuiTabArt::DrawTab(wxDC &dc, wxWindow * wnd, const wxAuiNotebookPage &pag // draw close button if necessary if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN) { - wxBitmap bmp = m_disabled_close_bmp; + wxBitmap bmp = m_disabledCloseBmp; if (close_button_state == wxAUI_BUTTON_STATE_HOVER || close_button_state == wxAUI_BUTTON_STATE_PRESSED) { - bmp = m_active_close_bmp; + bmp = m_activeCloseBmp; } wxRect rect(tab_x + tab_width - close_button_width - 1, @@ -367,14 +367,14 @@ guAuiNotebook::~guAuiNotebook() // UpdateTabCtrlHeight() does the actual tab resizing. It's meant // to be used interally // -------------------------------------------------------------------------------- // -void guAuiNotebook::UpdateTabCtrlHeight() +bool guAuiNotebook::UpdateTabCtrlHeight() { // get the tab ctrl height we will use int height = CalculateTabCtrlHeight(); wxAuiTabArt* art = m_tabs.GetArtProvider(); - m_tab_ctrl_height = height; + m_tabCtrlHeight = height; wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes(); size_t i, pane_count = all_panes.GetCount(); @@ -385,10 +385,12 @@ void guAuiNotebook::UpdateTabCtrlHeight() continue; wxTabFrame* tab_frame = (wxTabFrame*)pane.window; wxAuiTabCtrl* tabctrl = tab_frame->m_tabs; - tab_frame->SetTabCtrlHeight(m_tab_ctrl_height); + tab_frame->SetTabCtrlHeight(m_tabCtrlHeight); tabctrl->SetArtProvider(art->Clone()); tab_frame->DoSizing(); } + + return true; } // -------------------------------------------------------------------------------- // @@ -447,7 +449,7 @@ wxString guAuiNotebook::SavePerspective( void ) if( p ) tabs += wxT( "," ); - if( ( int ) page_idx == m_curpage ) + if( ( int ) page_idx == m_curPage ) tabs += wxT( "*" ); else if( ( int ) p == tabframe->m_tabs->GetActivePage() ) tabs += wxT( "+" ); @@ -501,12 +503,12 @@ bool guAuiNotebook::LoadPerspective( const wxString &layout ) // create a new tab frame wxTabFrame * new_tabs = new wxTabFrame; new_tabs->m_tabs = new wxAuiTabCtrl( this, - m_tab_id_counter++, + m_tabIdCounter++, wxDefaultPosition, wxDefaultSize, wxNO_BORDER | wxWANTS_CHARS ); new_tabs->m_tabs->SetArtProvider( m_tabs.GetArtProvider()->Clone() ); - new_tabs->SetTabCtrlHeight( m_tab_ctrl_height ); + new_tabs->SetTabCtrlHeight( m_tabCtrlHeight ); new_tabs->m_tabs->SetFlags( m_flags ); wxAuiTabCtrl * dest_tabs = new_tabs->m_tabs; @@ -555,7 +557,7 @@ bool guAuiNotebook::LoadPerspective( const wxString &layout ) m_mgr.LoadPerspective( frames ); // Force refresh of selection - m_curpage = -1; + m_curPage = -1; SetSelection( sel_page ); return true; diff --git src/AuiNotebook.h src/AuiNotebook.h index 7e6d522..a6eea98 100644 --- src/AuiNotebook.h +++ src/AuiNotebook.h @@ -205,7 +205,7 @@ class guAuiNotebook : public wxAuiNotebook virtual ~guAuiNotebook(); - virtual void UpdateTabCtrlHeight(); + virtual bool UpdateTabCtrlHeight(); wxString SavePerspective( void ); bool LoadPerspective( const wxString &layout ); diff --git src/Equalizer.cpp src/Equalizer.cpp index bde222e..33d4eb7 100644 --- src/Equalizer.cpp +++ src/Equalizer.cpp @@ -537,7 +537,7 @@ void guEq10Band::OnPresetText( wxCommandEvent& event ) { int Sel = m_PresetComboBox->GetSelection(); - m_SaveButton->Enable( !m_PresetComboBox->IsEmpty() && + m_SaveButton->Enable( m_PresetComboBox->GetCount() != 0 && ( m_BandChanged || !FindPresetName( m_PresetComboBox->GetValue(), m_EQPresets ) ) ); m_DelButton->Enable( Sel != wxNOT_FOUND ); diff --git src/FileBrowser.cpp src/FileBrowser.cpp index fd02a09..7bfc310 100644 --- src/FileBrowser.cpp +++ src/FileBrowser.cpp @@ -36,6 +36,7 @@ #include #include #include +#include WX_DEFINE_OBJARRAY(guFileItemArray); @@ -221,7 +222,7 @@ guFileBrowserDirCtrl::guFileBrowserDirCtrl( wxWindow * parent, guMainFrame * mai DirBtnSizer->Add( 0, 0, 1, wxEXPAND, 5 ); - m_ShowLibPathsBtn = new wxToggleBitmapButton( this, wxID_ANY, guImage( guIMAGE_INDEX_tiny_library ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + m_ShowLibPathsBtn = new wxBitmapToggleButton( this, wxID_ANY, guImage( guIMAGE_INDEX_tiny_library ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); m_ShowLibPathsBtn->SetToolTip( ShowPaths == guFILEBROWSER_SHOWPATH_SYSTEM ? _( "See used locations" ) : _( "See system files" ) ); diff --git src/FileBrowser.h src/FileBrowser.h index 80d2223..6314a3b 100644 --- src/FileBrowser.h +++ src/FileBrowser.h @@ -36,6 +36,7 @@ #include #include #include +#include #define guPANEL_FILEBROWSER_DIRCTRL ( 1 << 0 ) @@ -122,7 +123,7 @@ class guFileBrowserDirCtrl : public wxPanel guMediaViewer * m_MediaViewer; guGenericDirCtrl * m_DirCtrl; bool m_AddingFolder; - wxToggleBitmapButton * m_ShowLibPathsBtn; + wxBitmapToggleButton * m_ShowLibPathsBtn; void OnShowLibPathsClick( wxCommandEvent& event ); diff --git src/LastFMPanel.cpp src/LastFMPanel.cpp index 56d8edd..fff8ee0 100644 --- src/LastFMPanel.cpp +++ src/LastFMPanel.cpp @@ -2812,7 +2812,7 @@ void guLastFMPanel::OnTextCtrlKeyDown( wxKeyEvent &event ) if( event.GetKeyCode() == WXK_RETURN ) { wxCommandEvent CmdEvent( wxEVT_COMMAND_TEXT_ENTER ); - m_ArtistTextCtrl->AddPendingEvent( CmdEvent ); + m_ArtistTextCtrl->GetEventHandler()->AddPendingEvent( CmdEvent ); return; } event.Skip(); diff --git src/ListView.cpp src/ListView.cpp index 3160503..a8fc649 100644 --- src/ListView.cpp +++ src/ListView.cpp @@ -914,7 +914,7 @@ void guListViewClient::OnPaint( wxPaintEvent &event ) // iterate over all visible lines for( ; line < lineMax; line++ ) { - const wxCoord hLine = OnGetLineHeight( line ); + const wxCoord hLine = OnGetRowHeight( line ); rectLine.height = hLine; diff --git src/ListView.h src/ListView.h index f6abcd1..c12b8e7 100644 --- src/ListView.h +++ src/ListView.h @@ -28,6 +28,7 @@ #include #include #include +#include class guListViewClient; class guListViewHeader; @@ -330,7 +331,7 @@ class guListView : public wxScrolledWindow size_t GetVisibleEnd( void ) const { return m_ListBox->GetVisibleEnd(); } size_t GetFirstVisibleLine() const { return m_ListBox->GetFirstVisibleLine(); } size_t GetLastVisibleLine() const { return m_ListBox->GetLastVisibleLine(); } - bool ScrollLines( int lines ) { return m_ListBox->ScrollLines( lines ); } + bool ScrollLines( int lines ) { return m_ListBox->wxWindow::ScrollLines( lines ); } bool ScrollToLine( size_t line ) { return m_ListBox->ScrollToLine( line ); } diff --git src/LocationPanel.cpp src/LocationPanel.cpp index 5ca31ff..223a177 100644 --- src/LocationPanel.cpp +++ src/LocationPanel.cpp @@ -161,7 +161,52 @@ int guLocationTreeCtrl::GetIconIndex( const wxString &iconstring ) return 1; } -extern wxColor wxAuiStepColour( const wxColor & c, int percent ); +unsigned char wxAuiBlendColour(unsigned char fg, unsigned char bg, double alpha) +{ + double result = bg + (alpha * (fg - bg)); + if (result < 0.0) + result = 0.0; + if (result > 255) + result = 255; + return (unsigned char)result; +} + +wxColor wxAuiStepColour(const wxColor& c, int ialpha) +{ + if (ialpha == 100) + return c; + + unsigned char r = c.Red(), + g = c.Green(), + b = c.Blue(); + unsigned char bg; + + // ialpha is 0..200 where 0 is completely black + // and 200 is completely white and 100 is the same + // convert that to normal alpha 0.0 - 1.0 + ialpha = wxMin(ialpha, 200); + ialpha = wxMax(ialpha, 0); + double alpha = ((double)(ialpha - 100.0))/100.0; + + if (ialpha > 100) + { + // blend with white + bg = 255; + alpha = 1.0 - alpha; // 0 = transparent fg; 1 = opaque fg + } + else + { + // blend with black + bg = 0; + alpha += 1.0; // 0 = transparent fg; 1 = opaque fg + } + + r = wxAuiBlendColour(r, bg, alpha); + g = wxAuiBlendColour(g, bg, alpha); + b = wxAuiBlendColour(b, bg, alpha); + + return wxColour(r, g, b); +} // -------------------------------------------------------------------------------- // void guLocationTreeCtrl::ReloadItems( const bool loadstate ) diff --git src/MainApp.cpp src/MainApp.cpp index b358e06..92af164 100644 --- src/MainApp.cpp +++ src/MainApp.cpp @@ -360,8 +360,7 @@ bool guMainApp::OnInit() if( LangInfo ) { guLogError( wxT( "Could not initialize the translations engine for ( %s )" ), LangInfo->CanonicalName.c_str() ); - wxStandardPaths StdPaths; - guLogError( wxT( "Locale directory '%s'" ), StdPaths.GetLocalizedResourcesDir( LangInfo->CanonicalName, wxStandardPaths::ResourceCat_Messages).c_str() ); + guLogError( wxT( "Locale directory '%s'" ), wxStandardPaths::Get().GetLocalizedResourcesDir( LangInfo->CanonicalName, wxStandardPaths::ResourceCat_Messages).c_str() ); } else { diff --git src/PLSoListBox.cpp src/PLSoListBox.cpp index 626bd13..d0f7320 100644 --- src/PLSoListBox.cpp +++ src/PLSoListBox.cpp @@ -179,7 +179,7 @@ void guPLSoListBox::OnKeyDown( wxKeyEvent &event ) if( event.GetKeyCode() == WXK_DELETE ) { wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED, ID_TRACKS_DELETE ); - GetParent()->AddPendingEvent( evt ); + GetParent()->GetEventHandler()->AddPendingEvent( evt ); return; } diff --git src/PlayListAppend.cpp src/PlayListAppend.cpp index 9b7b8b0..9e7b851 100644 --- src/PlayListAppend.cpp +++ src/PlayListAppend.cpp @@ -128,7 +128,7 @@ int FindPlayListItem( guListItems * items, const wxString &playlistname ) int guPlayListAppend::GetSelectedPlayList( void ) { int Selection = m_PlayListComboBox->GetSelection(); - if( Selection == wxNOT_FOUND && !m_PlayListComboBox->IsEmpty() ) + if( Selection == wxNOT_FOUND && m_PlayListComboBox->GetCount() != 0 ) { Selection = FindPlayListItem( m_PlayListItems, m_PlayListComboBox->GetValue().Lower().Trim().Trim( false ) ); } diff --git src/RatingCtrl.cpp src/RatingCtrl.cpp index 03bdbeb..1646bf2 100644 --- src/RatingCtrl.cpp +++ src/RatingCtrl.cpp @@ -34,7 +34,8 @@ BEGIN_EVENT_TABLE( guRating, wxControl ) END_EVENT_TABLE() // -------------------------------------------------------------------------------- // -guRating::guRating( wxWindow * parent, const int style ) : wxControl( parent, wxID_ANY ) +guRating::guRating( wxWindow * parent, const int style ) : + wxControl( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE ) { m_Rating = wxNOT_FOUND; m_Style = style; diff --git src/RoundButton.cpp src/RoundButton.cpp index ed36397..09e3ba4 100644 --- src/RoundButton.cpp +++ src/RoundButton.cpp @@ -33,7 +33,7 @@ END_EVENT_TABLE() // -------------------------------------------------------------------------------- // guRoundButton::guRoundButton( wxWindow * parent, const wxImage &image, const wxImage &selimage, const int flags ) : - wxControl( parent, wxID_ANY ) + wxControl( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE ) { m_Bitmap = wxBitmap( image ); m_HoverBitmap = wxBitmap( selimage ); diff --git src/SmartMode.cpp src/SmartMode.cpp index b2db8eb..6eebdeb 100644 --- src/SmartMode.cpp +++ src/SmartMode.cpp @@ -500,7 +500,7 @@ guGenSmartPlaylist::~guGenSmartPlaylist() int guGenSmartPlaylist::GetPlayListId( void ) { int Selection = m_SaveToComboBox->GetSelection(); - if( Selection == wxNOT_FOUND && !m_SaveToComboBox->IsEmpty() ) + if( Selection == wxNOT_FOUND && m_SaveToComboBox->GetCount() != 0 ) { Selection = FindPlayListItem( &m_Playlists, m_SaveToComboBox->GetValue().Lower().Trim().Trim( false ) ); } diff --git src/SplashWin.cpp src/SplashWin.cpp index b700535..ce05393 100644 --- src/SplashWin.cpp +++ src/SplashWin.cpp @@ -79,7 +79,7 @@ guSplashFrame::guSplashFrame( wxWindow * parent, int timeout ) : Show( true ); SetThemeEnabled( false ); - SetBackgroundStyle( wxBG_STYLE_CUSTOM ); + SetBackgroundStyle( wxBG_STYLE_ERASE ); m_Timer.SetOwner( this ); m_Timer.Start( timeout, wxTIMER_ONE_SHOT ); diff --git src/StaticBitmap.cpp src/StaticBitmap.cpp index b0ce9a1..97af7c3 100644 --- src/StaticBitmap.cpp +++ src/StaticBitmap.cpp @@ -70,7 +70,7 @@ void guStaticBitmapTimer::Notify() { wxCommandEvent event( guStaticBitmapMouseOverEvent, guEVT_STATICBITMAP_MOUSE_OVER ); event.SetEventObject( this ); - m_Bitmap->AddPendingEvent( event ); + m_Bitmap->GetEventHandler()->AddPendingEvent( event ); } } diff --git src/StatusBar.cpp src/StatusBar.cpp index 8b51750..7be6312 100644 --- src/StatusBar.cpp +++ src/StatusBar.cpp @@ -509,7 +509,7 @@ void guStatusBar::SetSelInfo( const wxString &label ) } // -------------------------------------------------------------------------------- // -void guStatusBar::DrawField( wxDC &dc, int i ) +void guStatusBar::DrawField( wxDC &dc, int i, int textHeight ) { wxRect rect; GetFieldRect( i, rect ); @@ -521,7 +521,7 @@ void guStatusBar::DrawField( wxDC &dc, int i ) dc.DrawLine( rect.x + rect.width, rect.y + 1, rect.x + rect.width, rect.y + rect.height - 1 ); } - DrawFieldText( dc, i ); + DrawFieldText( dc, rect, i, textHeight ); } // -------------------------------------------------------------------------------- // diff --git src/StatusBar.h src/StatusBar.h index 3ba1d1c..a0effa0 100644 --- src/StatusBar.h +++ src/StatusBar.h @@ -46,7 +46,7 @@ class guGauge : public wxControl public : guGauge() : wxControl() { m_LastValue = wxNOT_FOUND; m_PaintWidth = 0; }; guGauge( wxWindow * parent, const wxString &label = wxEmptyString, bool showporcent = true, wxWindowID id = wxID_ANY, unsigned int max = 100, - const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxGA_HORIZONTAL ); + const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxGA_HORIZONTAL | wxBORDER_NONE ); ~guGauge( void ); void SetRange( int range ); @@ -101,7 +101,7 @@ class guStatusBar : public wxStatusBar void SetPlayMode( const bool forcegapless ); void SetAudioScrobble( const bool audioscrobble ); - virtual void DrawField( wxDC &dc, int i ); + virtual void DrawField( wxDC &dc, int i, int textHeight ); }; diff --git src/TagInfo.cpp src/TagInfo.cpp index 51c19b8..fd170ec 100644 --- src/TagInfo.cpp +++ src/TagInfo.cpp @@ -2453,7 +2453,7 @@ wxString guTagGetLyrics( const wxString &filename ) } // -------------------------------------------------------------------------------- // -bool guTagSetLyrics( const wxString &filename, wxString &lyrics ) +bool guTagSetLyrics( const wxString &filename, const wxString &lyrics ) { guMainFrame * MainFrame = ( guMainFrame * ) wxTheApp->GetTopWindow(); diff --git src/TagInfo.h src/TagInfo.h index cbccd80..bbc1363 100644 --- src/TagInfo.h +++ src/TagInfo.h @@ -329,7 +329,7 @@ wxImage * guTagGetPicture( const wxString &filename ); bool guTagSetPicture( const wxString &filename, wxImage * picture ); bool guTagSetPicture( const wxString &filename, const wxString &imagefile ); wxString guTagGetLyrics( const wxString &filename ); -bool guTagSetLyrics( const wxString &filename, wxString &lyrics ); +bool guTagSetLyrics( const wxString &filename, const wxString &lyrics ); //void guUpdateTrack( const guTrack &track, const wxImage * image, const wxString &lyrics, const int &changedflags ); void guUpdateTracks( const guTrackArray &tracks, const guImagePtrArray &images, const wxArrayString &lyrics, const wxArrayInt &changedflags ); diff --git src/ToggleRoundButton.cpp src/ToggleRoundButton.cpp index c81bd45..b331351 100644 --- src/ToggleRoundButton.cpp +++ src/ToggleRoundButton.cpp @@ -35,7 +35,7 @@ END_EVENT_TABLE() // -------------------------------------------------------------------------------- // guToggleRoundButton::guToggleRoundButton( wxWindow * parent, const wxImage &image, const wxImage &selimage, const wxImage &hoverimage ) : - wxControl( parent, wxID_ANY ) + wxControl( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE ) { m_Bitmap = wxBitmap( selimage ); m_DisBitmap = wxBitmap( image ); diff --git src/Utils.cpp src/Utils.cpp index e0fdd90..5c9d103 100644 --- src/Utils.cpp +++ src/Utils.cpp @@ -308,7 +308,7 @@ wxString guURLEncode( const wxString &url ) static const wxChar marks[] = wxT( "-_.\"!~*()'" ); wxString RetVal; - unsigned char CurChar; + wxChar CurChar; wxCharBuffer CharBuffer = url.ToUTF8(); int Index; @@ -349,7 +349,7 @@ wxString guFileDnDEncode( const wxString &file ) for( index = 0; index < StrLen; index++ ) { - unsigned char C = CharBuffer[ index ]; + wxChar C = CharBuffer[ index ]; { static const wxChar marks[] = wxT( " -_.\"/+!~*()'[]%" ); //~!@#$&*()=:/,;?+'