Set initial wxTextCtrl text earlier in wxOSX
This reverts the changes of63bcc669d8
(fixing setting initial value under osx_cocoa for single line text controls, 2009-10-01) and fixes the problem which this commit probably tried to fix in a different way, using the same approach as in98f5315405
(Don't set initial label in wxNativeWindow on OS X, 2016-04-29) as the real root of the problem was that the text set in CreateTextControl() was overwritten later when the label was set from SetPeer(). This change means that the text is now set correctly before SetPeer() calls SetInitialSize() call, which makes it possible to set the correct initial size based on the initial text, as will be done in later commits. It also makes Cocoa port more consistent with iOS one, as a nice side effect.
This commit is contained in:
@@ -32,6 +32,12 @@ public :
|
||||
virtual ~wxNSTextBase() { }
|
||||
|
||||
virtual bool ShouldHandleKeyNavigation(const wxKeyEvent &event) const wxOVERRIDE;
|
||||
|
||||
virtual void SetInitialLabel(const wxString& WXUNUSED(title), wxFontEncoding WXUNUSED(encoding)) wxOVERRIDE
|
||||
{
|
||||
// Don't do anything here, text controls don't have any label and
|
||||
// setting it would overwrite the string value set when creating it.
|
||||
}
|
||||
};
|
||||
|
||||
// implementation exposed, so that search control can pull it
|
||||
|
Reference in New Issue
Block a user