From 515ed54f1d6506d8a80d4ba1863b7f48c5bc5c9b Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 22 Dec 2011 21:18:45 +0000 Subject: [PATCH] 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. --- aegisub/src/timeedit_ctrl.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/aegisub/src/timeedit_ctrl.cpp b/aegisub/src/timeedit_ctrl.cpp index ea7b91c61..faf88ad0c 100644 --- a/aegisub/src/timeedit_ctrl.cpp +++ b/aegisub/src/timeedit_ctrl.cpp @@ -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);