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 c2d89e8898
commit 61c0cbcb17
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"));
SetModificationType(MOD_AUTOMATIC);
SetBool(_T("Link time boxes commit"),true);
#ifdef WIN32
SetBool(_T("Insert mode on time boxes"),true);
#else
SetBool(_T("Insert mode on time boxes"),false);
#endif
SetModificationType(MOD_EDIT_BOX);
SetBool(_T("Call tips enabled"),false,1700);
SetBool(_T("Syntax highlight enabled"),true);

View File

@ -46,11 +46,17 @@
#include "vfr.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
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
wxTextValidator val(wxFILTER_INCLUDE_CHAR_LIST);
@ -72,6 +78,14 @@ wxTextCtrl(parent,id,value,pos,size,wxTE_CENTRE | style,validator,name)
// Other stuff
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;
byFrame = false;
isEnd = false;