And reuse EnableTextChangedEvents() between these classes as well.
No real changes so far, this is just a refactoring to centralize the
code in a single place before modifying it.
Check whether we should ignore the event and mark the control as being
dirty if necessary in a virtual method, which can be defined in
wxTextEntry and overridden by wxTextCtrl, instead of doing it in GTK
callback itself.
This will allow to reuse wxTextEntry callback for wxTextCtrl too in the
upcoming commits.
No real changes so far.
This is slightly simpler, as it doesn't require checking whether the
control state really changes or not (it always does if DoEnable() is
called) and allows disabling the controls before creating them, e.g.
code like
wxButton* const b = new wxButton();
b->Disable();
b->Create(this, wxID_OK);
works as expected now instead of spewing GTK+ errors.
This method seems completely unnecessary, the base
wxTextEntry::DoSetValue(), which delegates to Remove() and WriteText(),
seems to work just as well and avoids code duplication between this
method and wxTextCtrl::WriteText().
Notice that gtk_text_buffer_set_text() is just a trivial wrapper around
gtk_text_buffer_delete() and gtk_text_buffer_insert() anyhow, so there
is no efficiency loss in not using it neither.
Don't prevent people from using hints in wxMSW and wxGTK2, where they work
with multiline text controls too, even though they do not work with wxGTK3 nor
wxOSX.
Closes#14456.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.
If nothing else, this will make an eventual transition to Git simpler.
Closes#14487.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't change the background colour when the control is being enabled or
disabled, it doesn't seem necessary and it's unclear why was this added by
r10179 in the first place. It does result in problems however as it could
somehow make the selection of wxTextCtrl invisible when it lost focus and so
fixes a serious usability problem which happened to all wxTextCtrls for which
a wxEVT_UPDATE_UI handler using wxUpdateUIEvent::Enable() was defined.
Closes#14898.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Generate wxEVT_CHAR events for non-ASCII characters entered in these controls
by intercepting their insert-text signal.
Also try to use GtkEntry/GtkTextView internal IM objects but unsuccessfully so
far.
Closes#3158.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This reverts r72978, 72984, 72989 and 72992. Do not use wxNOEXCEPT for
wxTextCtrl dtor as this breaks compilation of any user-defined classes
inheriting from it unless they use wxNOEXCEPT as well and the benefits
(fixing a harmless warning for the niche ICC compiler) are just not worth
the compatibility breakage.
See #14826.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72993 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix compilation with some compilers after r72978 which added wxNOEXCEPT to
wxTextCtrlBase dtor and wxTextCtrl dtor in wxMSW but not in all the other
ports.
See #14826.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This function can be used to size a, say, wxTextCtrl to be exactly of the size
needed to enter the given amount of text in it.
This patch adds wxGTK implementation for wxTextCtrl, wxChoice and wxCombobox;
changes to the samples and the documentation.
Closes#14812.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
- Introduced GTKGetWindow() which returns all GdkWindows associated with the
given wxWindow
- Renamed IsOwnGtkWindow() to GTKIsOwnWindow() to avoid confusion with the old
virtual function (the new one is non-virtual and is implemented in terms of
GTKGetWindow())
- Refactored/simplified event handlers code in gtk/window.cpp
- Fixed some header guards names (__GTKFOO__ -> _WX_GTK_FOO_H_)
- Added GTKUpdateCursor() which sets the current cursor for all windows
returned by GTKGetWindow()
- Factored out code from many different classes in wxControl::OnInternalIdle()
which now updates the cursor, checks for internal focus and sends update UI
events
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40815 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775