From 96aeeb72871f0136435ae5f177476d8f6578d0d4 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Tue, 1 Dec 2009 04:51:06 +0000 Subject: [PATCH] Merge r3339,r3484 (osx fixes). Originally committed to SVN as r3843. --- aegisub/src/Makefile.am | 9 +--- aegisub/src/audio_box.cpp | 10 +---- aegisub/src/browse_button.cpp | 2 - aegisub/src/dialog_options.cpp | 2 +- aegisub/src/dialog_options.h | 2 +- aegisub/src/osx_bevelButton.cpp | 74 --------------------------------- aegisub/src/osx_bevelButton.h | 52 ----------------------- aegisub/src/subs_edit_box.cpp | 5 --- aegisub/src/video_display.cpp | 4 -- 9 files changed, 5 insertions(+), 155 deletions(-) delete mode 100644 aegisub/src/osx_bevelButton.cpp delete mode 100644 aegisub/src/osx_bevelButton.h diff --git a/aegisub/src/Makefile.am b/aegisub/src/Makefile.am index 5ec4544c6..1c7467229 100644 --- a/aegisub/src/Makefile.am +++ b/aegisub/src/Makefile.am @@ -176,10 +176,6 @@ else UNIVCHARSET = charset_detect.cpp text_file_reader.cpp endif -if BUILD_DARWIN - BEVEL_BUTTON = osx_bevelButton.cpp -endif - if FONTLISTER_FREETYPE FONT_LISTER = font_file_lister_freetype.cpp endif @@ -213,7 +209,6 @@ EXTRA_aegisub_2_1_SOURCES = \ dialog_associations.cpp \ lavc_file.cpp \ lavc_keyframes.cpp \ - osx_bevelButton.cpp \ setup.cpp \ spellchecker_hunspell.cpp \ stdwx.cpp \ @@ -231,7 +226,6 @@ aegisub_2_1_SOURCES = \ $(HUNSPELL) \ $(LIBASS) \ $(UNIVCHARSET) \ - $(BEVEL_BUTTON) \ font_file_lister.cpp \ $(FONT_LISTER) \ MatroskaParser.c \ @@ -382,4 +376,5 @@ noinst_HEADERS = \ osx_bevelButton.h EXTRA_DIST = \ - auto4_perldata.inc + auto4_perldata.inc \ + $(srcdir)/*.hxx diff --git a/aegisub/src/audio_box.cpp b/aegisub/src/audio_box.cpp index d9de1ee1c..8a7edb085 100644 --- a/aegisub/src/audio_box.cpp +++ b/aegisub/src/audio_box.cpp @@ -52,12 +52,9 @@ #include "hotkeys.h" #include "tooltip_manager.h" -//#ifdef __WXMAC__ -//#include "bevelButton.h" -//#endif - /////////////// // Constructor +/// AudioBox::AudioBox(wxWindow *parent) : wxPanel(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL|wxBORDER_RAISED) { @@ -202,12 +199,7 @@ wxPanel(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL|wxBORDER_RAISE KaraokeButton = new wxToggleButton(this,Audio_Button_Karaoke,_("Karaoke"),wxDefaultPosition,wxSize(-1,-1)); KaraokeButton->SetToolTip(_("Toggle karaoke mode")); karaokeSizer->Add(KaraokeButton,0,wxRIGHT|wxEXPAND,0); -//#ifndef __WXMAC__ JoinButton = new wxButton(this,Audio_Button_Join,_T(""),wxDefaultPosition,wxSize(-1,10)); -//#else - // we use this custom class to match the button style of toggle buttons in wxMac -// JoinButton = new wxBevelButton(this,Audio_Button_Join,_T(""),wxDefaultPosition,wxSize(-1,-1)); -//#endif karaokeSizer->Add(JoinButton,0,wxRIGHT|wxEXPAND,0); SplitButton = new wxButton(this,Audio_Button_Split,_T(""),wxDefaultPosition,wxSize(-1,-1)); karaokeSizer->Add(SplitButton,0,wxRIGHT|wxEXPAND,5); diff --git a/aegisub/src/browse_button.cpp b/aegisub/src/browse_button.cpp index 5e35bd5b1..d75f308c4 100644 --- a/aegisub/src/browse_button.cpp +++ b/aegisub/src/browse_button.cpp @@ -71,14 +71,12 @@ void BrowseButton::OnPressed(wxCommandEvent &event) { // Folder if (type == BROWSE_FOLDER) { // For some reason I can't make this work on Mac... -jfs -#ifndef __WXMAC__ wxString def = StandardPaths::DecodePathMaybeRelative(ctrl[0]->GetValue(), _T("?user/")); wxDirDialog dlg(0, _("Please choose the folder:"), def); if (dlg.ShowModal() == wxID_OK) { wxString dir = StandardPaths::EncodePath(dlg.GetPath()); if (dir != _T("")) ctrl[0]->SetValue(dir); } -#endif } // File diff --git a/aegisub/src/dialog_options.cpp b/aegisub/src/dialog_options.cpp index c1f651a22..10356def9 100644 --- a/aegisub/src/dialog_options.cpp +++ b/aegisub/src/dialog_options.cpp @@ -39,7 +39,7 @@ #include "config.h" #include "dialog_options.h" -#if wxUSE_TREEBOOK && !__WXMAC__ +#if wxUSE_TREEBOOK #include #else #define AddSubPage(page,text,select) AddPage(page,wxString::Format(_T("\t%s"),text),select) diff --git a/aegisub/src/dialog_options.h b/aegisub/src/dialog_options.h index 2212dddf8..c214e3c34 100644 --- a/aegisub/src/dialog_options.h +++ b/aegisub/src/dialog_options.h @@ -52,7 +52,7 @@ // Prototypes class FrameMain; class DialogInputHotkey; -#if wxUSE_TREEBOOK && !__WXMAC__ +#if wxUSE_TREEBOOK class wxTreebook; #else #include diff --git a/aegisub/src/osx_bevelButton.cpp b/aegisub/src/osx_bevelButton.cpp deleted file mode 100644 index c153c3d51..000000000 --- a/aegisub/src/osx_bevelButton.cpp +++ /dev/null @@ -1,74 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: bevelButton.cpp -// Purpose: wxBevelButton, a button that looks like a toggle button in wxMac -// Author: David Conrad -// Modified by: -// Created: 2006-06-16 -// RCS-ID: $Id: bevelButton.cpp,v 1.0 2006/06/16 23:29:20 SC Exp $ -// Copyright: (c) David Conrad -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#include "config.h" - -#ifdef __WXMAC__ - -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "osx_bevelButton.h" -#endif - -#include "wx/wxprec.h" - -#include "osx_bevelButton.h" -#include "wx/panel.h" -#include "wx/stockitem.h" - -IMPLEMENT_DYNAMIC_CLASS(wxBevelButton, wxControl) - -#include "wx/mac/uma.h" -// Button - -static const int kMacOSXHorizontalBorder = 2 ; -static const int kMacOSXVerticalBorder = 4 ; - -bool wxBevelButton::Create(wxWindow *parent, wxWindowID id, const wxString& lbl, - const wxPoint& pos, - const wxSize& size, long style, - const wxValidator& validator, - const wxString& name) -{ - wxString label(lbl); - if (label.empty() && wxIsStockID(id)) - label = wxGetStockLabel(id); - - m_macIsUserPane = FALSE ; - - if ( !wxButtonBase::Create(parent, id, pos, size, style, validator, name) ) - return false; - - m_label = label ; - - Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; - m_peer = new wxMacControl(this) ; - - verify_noerr ( CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") , - kControlBevelButtonNormalBevel , 0 , NULL , 0 , 0 , 0 , m_peer->GetControlRefAddr() ) ); - - MacPostControlCreate(pos,size) ; - - return TRUE; -} - -wxSize wxBevelButton::DoGetBestSize() const -{ - int wBtn = 70 ; - int hBtn = 20 ; - - int lBtn = m_label.Length() * 8 + 12 ; - if (lBtn > wBtn) - wBtn = lBtn; - - return wxSize ( wBtn , hBtn ) ; -} - -#endif // __WXMAC__ diff --git a/aegisub/src/osx_bevelButton.h b/aegisub/src/osx_bevelButton.h deleted file mode 100644 index d951f4f63..000000000 --- a/aegisub/src/osx_bevelButton.h +++ /dev/null @@ -1,52 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: bevelButton.h -// Purpose: wxBevelButton class, a button that looks like Toggle buttons in wxMac -// Author: David Conrad -// Modified by: -// Created: 2006-06-16 -// RCS-ID: $Id: bevelButton.h,v 1.0 2006/06/16 23:29:20 VS Exp $ -// Copyright: (c) David Conrad -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifdef __WXMAC__ - -#ifndef _WX_BEVEL_BUTTON_H_ -#define _WX_BEVEL_BUTTON_H_ - -#include "wx/control.h" -#include "wx/gdicmn.h" - -//WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr; - -// Pushbutton -class WXDLLEXPORT wxBevelButton: public wxButton -{ - DECLARE_DYNAMIC_CLASS(wxButton) -public: - inline wxBevelButton() {} - inline wxBevelButton(wxWindow *parent, wxWindowID id, - const wxString& label = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr) -{ - Create(parent, id, label, pos, size, style, validator, name); -} - -bool Create(wxWindow *parent, wxWindowID id, - const wxString& label = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, long style = 0, - const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxButtonNameStr); - -protected: -virtual wxSize DoGetBestSize() const ; -}; - -#endif -// _WX_BUTTON_H_ - -#endif // __WXMAC__ diff --git a/aegisub/src/subs_edit_box.cpp b/aegisub/src/subs_edit_box.cpp index ce11f8cde..e46818d1d 100644 --- a/aegisub/src/subs_edit_box.cpp +++ b/aegisub/src/subs_edit_box.cpp @@ -62,7 +62,6 @@ #include "idle_field_event.h" #include "float_spin.h" #include "tooltip_manager.h" -#include "osx_bevelButton.h" /////////////// @@ -135,11 +134,7 @@ SubsEditBox::SubsEditBox (wxWindow *parent,SubtitlesGrid *gridp) : wxPanel(paren Color3->SetToolTip(_("Outline color")); Color4 = new wxBitmapButton(this,BUTTON_COLOR4,wxBITMAP(button_color_four),wxDefaultPosition,wxSize(30,20)); Color4->SetToolTip(_("Shadow color")); -#ifdef __WXMAC__ - CommitButton = new wxBevelButton(this,BUTTON_COMMIT,_("Commit"),wxDefaultPosition,wxDefaultSize); -#else CommitButton = new wxButton(this,BUTTON_COMMIT,_("Commit"),wxDefaultPosition,wxDefaultSize); -#endif ToolTipManager::Bind(CommitButton,_("Commits the text (Enter). Hold Ctrl to stay in line (%KEY%)."),_T("Edit Box Commit")); ByTime = new wxRadioButton(this,RADIO_TIME_BY_TIME,_("Time"),wxDefaultPosition,wxDefaultSize,wxRB_GROUP); ByTime->SetToolTip(_("Time by h:mm:ss.cs")); diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index c9bf50c00..e66a5a329 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -114,11 +114,7 @@ int attribList[] = { WX_GL_RGBA , WX_GL_DOUBLEBUFFER, WX_GL_STENCIL_SIZE, 8, 0 } /////////////// // Constructor VideoDisplay::VideoDisplay(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) -#ifdef __WXMAC__ -: wxGLCanvas (parent, id, pos, size, style, name, attribList) -#else : wxGLCanvas (parent, id, attribList, pos, size, style, name) -#endif , videoOut(new VideoOutGL()) { // Set options