Commit Graph

72 Commits

Author SHA1 Message Date
Artur Wieczorek
6eccec3ae7 Use empty() member function to determine if string is empty
Use this dedicated function instead of checking if length() function returns zero/non-zero value.
2019-11-08 18:53:03 +01:00
Artur Wieczorek
6b00cc80f1 Revert making wxComboCtrl a wxCompositeWindow
Commit 70e9dbd756 has fixed #18394 but unfortunately it also caused several other issues observed e.g. in #18540. Apparently wxComboCtrl doesn't fit well to the wxCompositeWindow framework -  especially when wxCB_READONLY flag is set and there is no main editor control what is problematic for wxCompositeWindow implementation. At the moment it is more pragmatic to go back to the original wxComboCtrl concept as a plain compound control to fix the regression and try to fix #18394 in an alternative way.

Closes #18540.
See #18394.
2019-11-08 18:51:07 +01:00
Artur Wieczorek
70e9dbd756 Make wxComboCtrl a wxCompositeWindow
wxComboCtrl consists of several controls (text entry, button, popup) and therefore should be implemented as a wxCompositeWindow to prevent problems with generating spurious events when e.g. focus is transferred between the sub-controls.

Closes #18394.
2019-08-23 22:55:05 +02:00
Artur Wieczorek
c05fac0ade Don't re-enter wxComboCtrlBase::HidePopup
Under wxMSW this method is re-entered due to triggering EVT_ACTIVATE when EVT_LEFT_UP is being already handled.
We need to prevent this to avoid generating spurious EVT_TEXT events and raising errors on calling SetFocus().

Closes #18260.
2018-11-14 21:30:35 +01:00
orbitcowboy
e3f1423632 Fix typos in comments in C++ code
No real changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/268
2016-04-12 17:15:23 +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
Artur Wieczorek
830458af2b Non-PCH build fix after d892274.
Include time.h to get wxMilliClock_t used now instead of wxLongLong for the
timestamp.

Closes #16939.
2015-04-06 22:23:43 +02:00
Artur Wieczorek
d8922744cf Use wxMilliClock_t to store values returned by wxGetLocalTimeMillis().
This fixes wxComboCtrl compilation with wxUSE_LONGLONG==0 as wxMilliClock_t is
always mapped to the proper base type and hence can be used even if wxLongLong
type is not defined.

See #16939.
2015-04-04 17:51:40 +02: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
9b31387508 Merge the changes from 3.0 branch.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-12 18:06:37 +00:00
Václav Slavík
5d9b5db01e Make wxComboCtrlBase::Set*groundColour() methods public.
SetForegroundColour() and SetBackgroundColour() were -- presumably
accidentally -- protected in wxComboCtrlBase, even though they are
documented public virtual methods of wxWindow. This prevented their
use from user code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-27 19:39:37 +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
e2ac737fba Implement wxComboCtrl::GetSizeFromTextSize().
Improve calculation of wxComboCtrl best size which doesn't work correctly for
non-default fonts as shown by r72935. It is still not perfect but better now.

Closes #14825.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-14 13:48:23 +00:00
Vadim Zeitlin
30e92ba333 Remove vertical wxTextCtrl adjustment hacks for wxMSW in wxComboCtrl code.
Because wxTextCtrl used to wrongly report its best size in wxNO_BORDER case
under MSW, wxComboCtrl manually adjusted its position to work around this.
However since r69066 wxTextCtrl::GetBestSize() was fixed and now these
adjustments resulted in wrong vertical position for the control.

Just remove all manual adjustments completely now to fix this.

Closes #13722.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-12-07 14:05:11 +00:00
Dimitri Schoolwerth
d13b34d3f2 No code changes, fixed various typos.
Applied patch by snowleopard2 fixing typos in interface/. Extended the fixes throughout trunk.

Closes #13076.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-03 20:31:32 +00:00
Jaakko Salli
df3c4a42d9 Added wxComboPopup::DestroyPopup(), which responsibility is to call Destroy() for the popup control and also delete the combo popup object itself. The default implementation should be able to handle common cases.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-31 17:22:51 +00:00
Dimitri Schoolwerth
4c51a665c6 Fixed various typos.
Applied patch by snowleopard2 fixing a bunch of typos such as misspellings and double words in the documentation. Combined the patch with some local queued typos waiting to be committed as well as adding new typo fixes inspired by the patch.

Function names with American spelling were not changed nor was third-party code touched. The only code changes involve some changes in strings that are translated ("Can not" -> "Cannot").

Closes #13063 (again).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-22 14:17:38 +00:00
Jaakko Salli
bed867e3f9 Added wxComboCtrlBase::m_hasTcBgCol. Re-using base wxWindow::m_hasBgCol was trouble.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-20 11:15:17 +00:00
Jaakko Salli
10ba26777d Redone (generic) wxComboCtrl background painting and handling. The 'actual' wxWindow background colour is now largely ignored and overridden to refer the text-area's background colour instead (as is usually the case with controls like this). Base 'transparent' background is now only painted when double-buffered rendering is required, and otherwise delegated to the system, as appropriate. This should significantly improve control's appearance and compliancy with GTK+ and OS X themes and custom backgrounds.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67255 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-20 10:59:22 +00:00
Jaakko Salli
238b33ab0e Added wxComboPopup::FindItem() to help in deciding how SetValue() should change the value of a read-only wxComboCtrl. This allows wxOwnerDrawnComboBox to have the same behavior as wxComboBox in that respect.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66409 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-12-20 13:51:24 +00:00
Jaakko Salli
ffb9247a85 Add wxComboBox-compatible Popup() and Dismiss() functions in wxComboCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66397 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-12-17 12:08:55 +00:00
Jaakko Salli
0306e73e63 Make the wxComboCtrl's wxTextEntry interface more complete and consistent. All text is no longer selected on SetValue(), but only when user selects an item from the drop-down list.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-12-17 11:20:50 +00:00
Jaakko Salli
fda6279358 Instead of having wxComboCtrl mimic wxTextEntry interface, make it actually inherit from the class and implement functions to redirect to the embedded wxTextCtrl. This allows us to simplify the code and get rid of the dirty trick of directing wxComboCtrl's validator to the embedded wxTextCtrl. Also see #12779, which issue 1 is fixed by this change.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-12-16 17:21:49 +00:00
Jaakko Salli
1ac5cfc7c9 Added wxComboCtrl::SetTextCtrlStyle()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-13 09:59:32 +00:00
Jaakko Salli
db3d75435a In wxComboPopupEvtHandler::OnMouseEvent(), when need to relay event to drop-down button, call HandleButtonMouseEvent() directly, if possible. This is less confusing for the platform-specific wxComboCtrl implementations, and fixes issue where the drop-down button could remain in pressed state after the mouse button was lifted.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-01 15:01:59 +00:00
Jaakko Salli
063155781d For clarity: wxComboPopupExtraEventHandler -> wxComboPopupEvtHandler (there is nothing particularly extra about it)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-01 14:17:32 +00:00
Jaakko Salli
735a300a96 Fixed wxComboCtrl::SetButtonPosition() on Vista/Win7 by marking the drop-down button as 'non-standard' when its size or position is changed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64410 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-27 14:51:07 +00:00
Václav Slavík
c765e6fb9d Fix text input and completion in wxComboCtrl and wxOwnerDrawnComboBox.
Both wxEVT_KEY_DOWN and wxEVT_CHAR must be handled and only the latter
used for completion (or any characters input). Don't make incorrect
assumptions about wxEVT_CHAR keycodes either, it's only the Unicode
character and printability that matter.

Otherwise, completion in readonly controls wouldn't work correctly
for e.g. numbers on numpad or non-ASCII characters.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63864 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-05 17:19:04 +00:00
Jaakko Salli
107defe36a Added wxComboCtrl::SetHint(), GetHint()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-26 10:33:35 +00:00
Jaakko Salli
5f54075053 Added wxComboCtrlBase::SetFore/BackgroundColour()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62983 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-25 09:04:53 +00:00
Jaakko Salli
ddadf560da Some wxComboCtrlBase member functions were enclosed within incorrect compatibility condition
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62537 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-02 14:57:35 +00:00
Jaakko Salli
a1d5aa9361 Have wxComboCtrl generate wxEVT_COMMAND_COMBOBOX_DROPDOWN and wxEVT_COMMAND_COMBOBOX_CLOSEUP events
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62136 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-26 09:15:29 +00:00
Jouk Jansen
c5885966f0 fixed typo : wxDEPRECTED -> wxDEPRECATED
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61849 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-07 12:14:21 +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
03647350fc No changes, just removed hard tabs and trailing white space.
This commit is huge but there are no non-white-space changes in it.

Some files containing third-party sources (src/msw/wince/time.cpp,
src/x11/pango*.cpp) were left unchanged.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61724 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-08-21 10:41:26 +00:00
Jaakko Salli
8c61a9ea94 Added wxComboPopup::GetComboCtrl()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-22 15:13:29 +00:00
Vadim Zeitlin
d3b9f782ef don't use annoying and unneeded in C++ casts of NULL to "T *" in all other files neither
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-19 13:55:27 +00:00
Robert Roebling
e569b49372 [ 1945434 ] Changing method wxComboCtrlBase::DrawButton to virtual one
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53296 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-04-21 18:48:03 +00:00
Francesco Montorsi
53a2db124c substitute WXDLLEXPORT with WXDLLIMPEXP_CORE and WXDLLEXPORT_DATA with WXDLLIMPEXP_DATA_CORE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-26 15:06:00 +00:00
Václav Slavík
b5dbe15d0b added WXDLLIMPEXP_FWD_FOO macros in addition to WXDLLIMPEXP_FOO for use with forward declarations (in preparation for GCC visibility support)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-07-09 10:09:52 +00:00
Vadim Zeitlin
c475be6dfa make PositionTextCtrl() virtual (patch 1734405)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-06-10 16:32:06 +00:00
Václav Slavík
47b378bd88 removed extra semicolons (patch #1700459; fixes compilation with gcc's -pedantic flag)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-14 09:58:37 +00:00
Vadim Zeitlin
c905c0d60f miscellaneous LnF improvements, including support for Vista-style (patch 1588794)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44735 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-03-10 18:06:11 +00:00
Robin Dunn
2dfa37d69e Make room for the focus ring to be visible on Mac.
wxMac fix for resetting the focus to the textctrl when the combo ctrl gets it.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43709 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-11-28 23:11:21 +00:00
Vadim Zeitlin
670048b2f0 set/get validator for wxTextCtrl part of wxComboCtrl and not the combo itself (patch 1599214, closes bug 1598600)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43521 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-11-19 14:44:30 +00:00
Vadim Zeitlin
373d466f85 changed last DrawButton() parameter from bool to int to allow for future extensions (patch 1595264)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-11-12 23:34:11 +00:00
Robert Roebling
4427c0a3ff [ 1585858 ] Fix wxDatePickerCtrlGeneric and wxComboCtrl kb navigation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-27 18:02:21 +00:00
Robert Roebling
30be036c6d Make animation of combo-popdown optional.
Replace wxMiniSleep() + wxYield() implemenation
    by wxTimer based one.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-26 20:35:57 +00:00
Robert Roebling
974a12f86a [ 1584680 ] wxComboCtrl Popup Animation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-25 19:48:46 +00:00
Vadim Zeitlin
06077aaf2c add alt popup window style allowing to use keyboard and comboboxes in the popup window and use it for the generic date picker (patch 1582391 from Jaakko)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-22 20:25:08 +00:00