Commit Graph

102 Commits

Author SHA1 Message Date
Vadim Zeitlin
c024944d78 Move logic from GTK callback to GTKOnTextChanged() virtual method
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.
2019-07-08 18:31:57 +02:00
Robin Dunn
8d6198c59d DoEnable is protected everywhere else, not private 2019-05-24 13:32:52 -07:00
Vadim Zeitlin
96f3832d52 Override DoEnable() instead of Enable() in wxGTK controls
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.
2018-12-09 19:21:51 +01:00
Paul Cornett
696a5ba3dd Fix for modified state not set after next change following a ChangeValue()
See #17540
2017-12-05 06:41:08 -08:00
Vadim Zeitlin
1c946a469a Get rid of overridden wxTextCtrl::DoSetValue() in wxGTK
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.
2017-08-24 22:30:33 +02:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Vadim Zeitlin
e8374a47fe Allow setting hints for multi-line wxTextCtrl when supported.
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
2014-12-25 01:32:00 +00:00
Paul Cornett
8b4ae731d3 use wxOVERRIDE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-30 00:02:23 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
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
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
00a399c062 Remove wxTextCtrl::OnEnabled() hack from wxGTK.
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
2013-03-31 01:12:21 +00:00
Vadim Zeitlin
b2c357747d Add IM and full wxEVT_CHAR support to wxTextCtrl and wxComboBox in wxGTK.
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
2013-03-21 22:37:09 +00:00
Vadim Zeitlin
a0e5592007 Revert all wxNOEXCEPT-related changes.
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
2012-11-20 12:49:03 +00:00
Vadim Zeitlin
24f54e45dc Add wxNOEXCEPT to all wxTextCtrl dtors.
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
2012-11-19 11:53:49 +00:00
Vadim Zeitlin
7a78a93782 Add wxControl::GetSizeFromTextSize() to size the control to its text.
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
2012-11-09 21:11:37 +00:00
Paul Cornett
95dc31e001 make more Init() functions private
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72604 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-10-02 15:57:03 +00:00
Vadim Zeitlin
6ce832135e Add wxTextCtrl::PositionToCoords() functions for wxMSW and wxGTK.
The new method allows to find the coordinates in pixels of the given character
in a text control.

Closes #13221.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-29 15:11:54 +00:00
Paul Cornett
385e8575dd avoid deprecated functions and direct struct access
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67326 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-28 06:27:49 +00:00
Robert Roebling
c2246a3881 Applied patch, fixes #12090: wxGTK cursor handling revamp
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-26 17:37:55 +00:00
Vadim Zeitlin
e9ee227022 Partially implement wxTextCtrl::GetStyle() in wxGTK.
Support retrieving the (both foreground and background) colours for the given
position.

Closes #11281.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-05 22:53:26 +00:00
Jaakko Salli
0847e36eff wxTextEntry::SetMargins(), GetMargins() - implemented on wxMSW and wxGTK (GTK+ 2.10+); also added similar functions into wxComboCtrl, deprecated old indent-functions; wxPropertyGrid modified to use the new functionality
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-05 12:39:12 +00:00
Vadim Zeitlin
63f7d5022e added wxTextEntry::SetHint() (a.k.a. cue banner or placeholder string)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-02 12:25:01 +00:00
Vadim Zeitlin
5c33522fca replace wx_{const,static,reinterpret}_cast with their standard C++ equivalents
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-02 02:39:52 +00:00
Vadim Zeitlin
17808a7596 move Freeze() and Thaw() to wxWindowBase to ensure that they behave consistently (i.e. recursively, as described in the docs) in all ports; removed different duplications of freeze count from derived classes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-01-05 00:21:31 +00:00
Vadim Zeitlin
ff805cac74 use gtk_entry_set_activates_default() instead of redoing its work manually ourselves
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-04 16:34:36 +00:00
Paul Cornett
3c75d8baf9 make access for virtuals match base
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-10-26 06:20:23 +00:00
Vadim Zeitlin
0ec1179b86 added wxTextEntry common base class for both wxTextCtrl and wxComboBox; refactor wxGTK code to put common parts of these classes in the base class; fixed some inconsistencies in the text control behaviour between platforms
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-09-26 00:30:22 +00:00
Vadim Zeitlin
86e37f69bc fix generation of events from SetValue() broken in rev 46611
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48183 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-08-19 19:05:56 +00:00
Vadim Zeitlin
47a8a4d5cc make IsEnabled() return false even if the window parent, and not the window itself, is disabled and added IsThisEnabled() implementing the old IsEnabled() behaviour; also significantly simplify the window state management code in all ports by factoring out the common parts in wxWindowBase
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-03-23 14:01:53 +00:00
Paul Cornett
5a3ef19432 fix for SetPosition/SetInsertionPoint when called during Freeze
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43870 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-12-09 06:21:15 +00:00
Vadim Zeitlin
927637fdaf allow dynamically changing most of text control styles in wxGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-12-04 12:39:52 +00:00
Vadim Zeitlin
403e664e5b removed empty and unused CalculateScrollbar() method
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-12-04 11:39:27 +00:00
Paul Cornett
50679f941e correct access for virtual
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42014 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-14 16:50:04 +00:00
Vadim Zeitlin
ee2ec18e88 moved DoSetValue() to wxTextCtrlBase instead of having it in almost, but not quite all, derived classes; linking fixes for wxCocoa/wxX11/wxMotif
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-08 22:40:14 +00:00
Vadim Zeitlin
28fdd8db44 added wxTextCtrl::IsEmpty()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-08 17:52:39 +00:00
Vadim Zeitlin
f6519b40fe added wxTextCtrl::ChangeValue() which is the same as SetValue() but doesn't send the text changed event (first part of patch 1553551)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41739 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-08 17:46:12 +00:00
Vadim Zeitlin
d3c7fc996a mark all dtors which are virtual because base class dtor is virtual explicitly virtual themselves
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41020 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-09-05 20:47:48 +00:00
Vadim Zeitlin
8312c461b8 always let GtkTextView have mouse release events to avoid assertion failures in gtk_text_view_start_selection_drag()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-09-01 22:23:51 +00:00
Vadim Zeitlin
ef5c70f96f Many changes:
- 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
2006-08-25 12:59:28 +00:00
Vadim Zeitlin
0d91b2342a respect the encoding of the text style and not only the global control font encoding when inserting the text in the control
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-08-23 13:33:04 +00:00
Vadim Zeitlin
6964cbbac9 make sure that IsModified() returns false when it's called from EVT_TEXT handler invoked because of SetValue() call
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-05-17 00:20:20 +00:00
Vadim Zeitlin
781acf8347 removed GTK-specific SetModified() as we already have a public MarkDirty() which does the same thing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-05-16 23:58:20 +00:00
Paul Cornett
8539643021 unused member variables
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-05-09 16:54:24 +00:00
Vadim Zeitlin
0c131a5ad2 implemented ScrollLines/Pages() for all classes in wxGTK, not just wxTextCtrl (patch 1281503)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-02-09 03:53:34 +00:00
Vadim Zeitlin
6f02a879ed make access specifiers for the virtual functions match their access in the base class (patch 1400131)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-02-08 21:47:09 +00:00
Mart Raudsepp
bdbd4e9612 Nuke GTK1 from include/gtk
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37058 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-01-22 21:00:19 +00:00
Mart Raudsepp
8907154c1a Nuke #pragma implementation/interface's
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-23 12:56:45 +00:00
Michael Wetherell
20123d4958 Add import/export attributes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-08-02 22:58:06 +00:00
Kevin Hock
9440c3d0e9 wxTE_AUTO_URL for wxGTK2 from Mart R. [patch 1126182]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32159 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-02-19 02:55:32 +00:00
Jouk Jansen
777105f2b7 ----------------------------------------------------------------------
Committing in .

 -delete superfluous semicolons
 -Update OpenVMS compile support

 Modified Files:
 	wxWidgets/include/wx/gtk/region.h
 	wxWidgets/include/wx/gtk/textctrl.h
 	wxWidgets/include/wx/motif/icon.h
 	wxWidgets/include/wx/x11/region.h
 	wxWidgets/src/common/descrip.mms
 ----------------------------------------------------------------------


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-02-09 15:01:49 +00:00
Włodzimierz Skiba
7d8268a1d6 wxTextPos for all GetLastPosition with constants for special cases. Make it virtual everywhere. Avoid doubling typedefs. Always include textctrl.h for combobox.h. Source cleaning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-01-19 16:25:34 +00:00