Merge r3339,r3484 (osx fixes).

Originally committed to SVN as r3843.
This commit is contained in:
Amar Takhar 2009-12-01 04:51:06 +00:00
parent ff563785b8
commit 96aeeb7287
9 changed files with 5 additions and 155 deletions

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -39,7 +39,7 @@
#include "config.h"
#include "dialog_options.h"
#if wxUSE_TREEBOOK && !__WXMAC__
#if wxUSE_TREEBOOK
#include <wx/treebook.h>
#else
#define AddSubPage(page,text,select) AddPage(page,wxString::Format(_T("\t%s"),text),select)

View File

@ -52,7 +52,7 @@
// Prototypes
class FrameMain;
class DialogInputHotkey;
#if wxUSE_TREEBOOK && !__WXMAC__
#if wxUSE_TREEBOOK
class wxTreebook;
#else
#include <wx/choicebk.h>

View File

@ -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__

View File

@ -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__

View File

@ -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"));

View File

@ -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