Fixed the "Overwrite-Insertion in time boxes" option on Linux and enabled it as the default mode for the time edit boxes on all OS's instead of just Windows

Originally committed to SVN as r3094.
This commit is contained in:
harukalover 2009-07-02 17:29:20 +00:00
parent bd4644d1bd
commit 4d0f48f303
2 changed files with 15 additions and 5 deletions

View file

@ -123,11 +123,7 @@ void OptionsManager::LoadDefaults(bool onlyDefaults,bool doOverride) {
SetText(_T("Spell Checker"),_T("hunspell")); SetText(_T("Spell Checker"),_T("hunspell"));
SetModificationType(MOD_AUTOMATIC); SetModificationType(MOD_AUTOMATIC);
SetBool(_T("Link time boxes commit"),true); SetBool(_T("Link time boxes commit"),true);
#ifdef WIN32
SetBool(_T("Insert mode on time boxes"),true); SetBool(_T("Insert mode on time boxes"),true);
#else
SetBool(_T("Insert mode on time boxes"),false);
#endif
SetModificationType(MOD_EDIT_BOX); SetModificationType(MOD_EDIT_BOX);
SetBool(_T("Call tips enabled"),false,1700); SetBool(_T("Call tips enabled"),false,1700);
SetBool(_T("Syntax highlight enabled"),true); SetBool(_T("Syntax highlight enabled"),true);

View file

@ -46,11 +46,17 @@
#include "vfr.h" #include "vfr.h"
#include "options.h" #include "options.h"
// Use the multiline style only on wxGTK to workaround some wxGTK bugs with the default singleline style
#ifdef __WXGTK__
#define TimeEditWindowStyle wxTE_MULTILINE | wxTE_CENTRE
#else
#define TimeEditWindowStyle wxTE_CENTRE
#endif
/////////////// ///////////////
// Constructor // Constructor
TimeEdit::TimeEdit(wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) : TimeEdit::TimeEdit(wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) :
wxTextCtrl(parent,id,value,pos,size,wxTE_CENTRE | style,validator,name) wxTextCtrl(parent,id,value,pos,size,TimeEditWindowStyle | style,validator,name)
{ {
// Set validator // Set validator
wxTextValidator val(wxFILTER_INCLUDE_CHAR_LIST); wxTextValidator val(wxFILTER_INCLUDE_CHAR_LIST);
@ -72,6 +78,14 @@ wxTextCtrl(parent,id,value,pos,size,wxTE_CENTRE | style,validator,name)
// Other stuff // Other stuff
if (!value) SetValue(time.GetASSFormated()); if (!value) SetValue(time.GetASSFormated());
// This is a multiline control on wxGTK so we need to size it manually there
#ifdef __WXGTK__
int w, h;
GetTextExtent(GetValue(),&w,&h);
w += 20;
h += 5;
SetSizeHints(w,h,w,h);
#endif
ready = true; ready = true;
byFrame = false; byFrame = false;
isEnd = false; isEnd = false;