Use a single-line text edit for TimeEdit on wxGTK as the unspecified bugs appear to have been fixed

Originally committed to SVN as r6059.
This commit is contained in:
Thomas Goyne 2011-12-22 21:18:45 +00:00
parent 6a24046b91
commit 515ed54f1d
1 changed files with 2 additions and 16 deletions

View File

@ -53,13 +53,7 @@
#include "main.h"
#include "video_context.h"
#ifdef __WXGTK__
/// Use the multiline style only on wxGTK to workaround some wxGTK bugs with the default singleline style.
#define TimeEditWindowStyle wxTE_MULTILINE | wxTE_CENTRE
#else
/// All other platforms than wxGTK.
#define TimeEditWindowStyle wxTE_CENTRE
#endif
#define TimeEditWindowStyle
enum {
Time_Edit_Copy = 1320,
@ -67,7 +61,7 @@ enum {
};
TimeEdit::TimeEdit(wxWindow* parent, wxWindowID id, agi::Context *c, const wxString& value, const wxSize& size, bool asEnd)
: wxTextCtrl(parent, id, value, wxDefaultPosition, size,TimeEditWindowStyle | wxTE_PROCESS_ENTER)
: wxTextCtrl(parent, id, value, wxDefaultPosition, size, wxTE_CENTRE | wxTE_PROCESS_ENTER)
, c(c)
, byFrame(false)
, isEnd(asEnd)
@ -94,14 +88,6 @@ TimeEdit::TimeEdit(wxWindow* parent, wxWindowID id, agi::Context *c, const wxStr
// 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 += 30;
h += 8;
SetSizeHints(w,h,w,h);
#endif
Bind(wxEVT_COMMAND_TEXT_UPDATED, &TimeEdit::OnModified, this);
Bind(wxEVT_CONTEXT_MENU, &TimeEdit::OnContextMenu, this);