Commit Graph

33832 Commits

Author SHA1 Message Date
Artur Wieczorek
da0f4ce29e Use getter methods to get access to wxPGProperty member variables.
Use GetValueImage() getter to get access to m_valueBitmap data member.
Use GetMaxLength() getter to get access to m_maxLen data member.
Use GetAttributes() getter to get access to m_attributes data member.
Use GetChoices() to get access to m_choices data member.
Use GetDepth() to get access to m_depth member variable.
Use GetBaseName() method to get access to m_name data member
Use GetLabel() method to get access to m_label member variable.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-31 21:45:24 +00:00
Artur Wieczorek
9698181b45 Use getter/setter methods to get access to wxPGProperty::m_flags.
Use dedicated wxPGProperty::HasFlags, wxPGProperty::SetFlag methods to check or modify wxPGProperty::m_flags member variable.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-31 21:42:17 +00:00
Václav Slavík
3c0b17d4b5 Avoid unneeded use of wxLocale in wxDateTime::Format()
On OS X, wxDateTime::Format() uses wxString::Replace() to
unconditionally replace locale-specific %c, %x and %X specifiers in the
format string if present. Doing so causes three wxLocale::GetInfo()
calls that are often not necessary.

Check for the presence of these  specifiers before calling GetInfo().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-30 15:53:05 +00:00
Václav Slavík
f81d6f68c6 Handle 5+ letter codes in TranslateFromUnicodeFormat()
Unicode TR #35 v26 allows for five-letter (MMMMM) or even six-letter
(EEEEEE) forms of some of the fields, but TranslateFromUnicodeFormat()
asserts in these situations.

Fix it to fall back to short forms for MMMMM and EEEEEE that are used in
practice e.g. on OS X if the user has custom formatting settings.

Consulting the table of sensible specifiers from
http://userguide.icu-project.org/formatparse/datetime, it appears these
two were the only omissions in this function.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-30 15:53:02 +00:00
Vadim Zeitlin
041f9a4cf2 Fix wxEVT_TREE_STATE_IMAGE_CLICK generation in wxMSW wxTreeCtrl.
Use GET_{X,Y}_LPARAM() to extract them from the event position, which handle
negative coordinates (and coordinates can perfectly well be negative when
using multiple displays) correctly, unlike {LO,HI}WORD().

Closes #16812.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78420 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-27 11:51:27 +00:00
Vadim Zeitlin
a3747ac959 Don't leave too much blank space in wxDatePickerCtrl under XP.
In our efforts to account for the longest possible string we made the control
too wide by default which didn't look very good, so reduce the amount of space
added to it, this still seems to be (just) enough for all the reasonable date
formats (tested under Windows XP SP3 with default DPI).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-26 15:10:45 +00:00
Artur Wieczorek
cafff4405a Use constant variables to store cached constants in wxPGGlobalVarsClass.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-22 17:32:48 +00:00
Vadim Zeitlin
5699e20e4e Remove accidentally left over wxLogMessage() from wxGTK wxWebViewWebKit.
This resulted in a message box being shown each time Find() was called and was
clearly undesirable.

Closes #16801.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-22 16:24:13 +00:00
Artur Wieczorek
5788b4b3d9 Use polymorphism to differentiate behaviour of wxEnumProperty and wxEditEnumProperty.
Override OnSetValue(), StringToValue(), ValidateValue() methods instead of using RTTI in conditional statements to check if wxEditEnumProperty object is actually handled.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-21 17:28:43 +00:00
Artur Wieczorek
1bac5cfbe0 Refactor property attribute names in wxPGProperty::GetAttribute calls.
Use attribute constants instead of strings in wxPGProperty and wxPGDefaultRenderer classes and in NumericValidation() function.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-21 17:06:16 +00:00
Artur Wieczorek
3100258aa1 Refactor wxPGSpinCtrlEditor.
Declare and use attribute constant instead of explicit string "MotionSpin".


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-21 16:59:46 +00:00
Julian Smart
4a5ae79a36 Remove selection before container is deleted or it could cause a crash later.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-21 14:31:28 +00:00
Václav Slavík
8af006cfd8 Use wxNB_MULTILINE in wxPreferencesEditor
The size of the dialog in wxPreferencesEditor's generic implementation
is determined from notebook pages alone and doesn't account for label
size, which may be significantly longer in some languages (German,
Danish). If the labels don't fit into the window, some of the tabs are
hidden behind scroll buttons that are easy to overlook.

Improve usability by using wxNB_MULTILINE, which will use multiple rows
of tabs in this situation. This is what e.g. Internet Explorer does in
its preferences as well.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-20 15:26:39 +00:00
Tim Kosse
9396ae004b Fix memory leak introduced in r78179: wxMenuItemBase::SetAccel does not take ownership of the passed pointer nor keeps it for later use.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-20 15:00:28 +00:00
Artur Wieczorek
42a1064ea8 Implement deprecated wxPGProperty::GetValueString function only in wxPG 1.4 compatibility mode.
This function was marked as deprecated in 2008.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 19:58:32 +00:00
Artur Wieczorek
752938cecd Fix a hack implemented in wxEnumProperty::ValueFromString_ and wxEnumProperty::ValueFromInt_ functions.
wxEnumProperty code is refactored in order to fix a hack which purpose was (apparently) to bypass constness of these functions by caching determined indices in wxEnumProperty::ms_nextIndex static member variable for further processing. (Unclear concept of using this static member was referred in http://trac.wxwidgets.org/ticket/12779#comment:9)
Now, determined index is returned to the caller and processed there if necessary and hence caching of this index is not necessary.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 17:22:29 +00:00
Vadim Zeitlin
eec7ef7232 Use logical operations instead of bit-wise ones for booleans.
wxUniv "Windows" theme code wrongly used bitwise operations on boolean values,
fix this.

Closes #16796.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 12:18:47 +00:00
Mariano Reingart
e59e6abe7d remove wxMISSING_IMPLEMENTATION because wxQtDCImpl::DoBlit is implemented
Thanks @seandepagnier


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78388 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 03:05:09 +00:00
Mariano Reingart
e01005e27c Fix problem with scrollbar events in wxQT
the local variable event shadowed the parameter which caused
the incorrect value to be sent

Thanks @seandepagnier


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 03:03:59 +00:00
Mariano Reingart
c8e56fa2cf Fix crash from possible NULL pointer in wxQT list ctrl
Thanks @seandepagnier


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 03:02:23 +00:00
Mariano Reingart
0476cf3791 Fix problem with clipping region in wxqt.
QPainter cannot set the clipping region when it is not active.

Thanks @seandepagnier


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 03:01:18 +00:00
Mariano Reingart
e67fbf1579 wxQT: move destroyed debug log into class method
(remove global function to handle destroyed signal)
This is needed for applications because the global function is not exported, yet it
is used by the opengl library.  An alternative is to add utils.cpp to the opengl library

Thanks @seandepagnier


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 02:57:06 +00:00
Mariano Reingart
3be53c43d7 wxQt: Fix compiler error for ambiguous call
(when compiling without unicode support)

Thanks @seandepagnier

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 02:44:11 +00:00
Mariano Reingart
bb2db9d890 wxQT: Add guard to wxWindowQt for building without unicode support
Thanks @seandepagnier

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 02:41:44 +00:00
Mariano Reingart
eab495c496 wxQt: fix performance issue with font comparisons
Thanks @seandepagnier

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 02:39:52 +00:00
Mariano Reingart
f4c0e0c342 Added wxUSE_XLOCALE ifdef guard to wxTimePickerGenericImp
Allow to compile wxQT when configure with --disable-xlocal

Thanks @seandepagnier

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 02:38:19 +00:00
Mariano Reingart
437af7bcff Fix building for wxQT-android with sockets enabled
The bionic library on android does not have gethostbyname_r even
though it has gethostbyname_r.  The configure script in wxwidgets
assumes if it has one it has the other.   This change does the right
thing for android, but perhaps the script should instead test for both?

Thanks @seandepagnier

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 02:31:49 +00:00
Mariano Reingart
aeb68ff500 Fix Select on wxQT DC implementation
Need to set the underlying qt painter up with the current pen, brush and font when a new object is selected
Thanks @seandepagnier


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 02:29:38 +00:00
Mariano Reingart
fe3998c3c9 Specify needed header files more correctly (needed for wxqt-android)
Thanks @seandepagnier

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78377 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 02:22:41 +00:00
Mariano Reingart
98c49c9cc5 Correct wxWindowQt::DoSetSize() for possible NULL member de-reference.
Thanks David Register

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-19 02:18:02 +00:00
Julian Smart
1d1f045f11 Bullet no longer gets the attributes from the first object in the list paragraph, so we can control it via paragraph attributes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-13 17:05:14 +00:00
Artur Wieczorek
7a9ae4aecf Fix using WXWIN_COMPATIBILITY_3_0 in conditional blocks in wxPG code.
Check the value of WXWIN_COMPATIBILITY_3_0 instead of checking whether it is defined.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78369 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-13 16:41:33 +00:00
Artur Wieczorek
630b7fd5d7 Preserve alpha channel flag when rescaling bitmap in wxPGProperty::SetValueImage (when wxUSE_IMAGE == 0).
Rescaled bitmap must have the same alpha channel flag as the source bitmap flag in order to be properly displayed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-12 20:37:34 +00:00
Artur Wieczorek
66e48fd84b Let system decide about required depth of rescaled bitmap in wxPGProperty::SetValueImage.
There is not necessary to fix the color depth - everything is determined internally when converting wxImage to wxBitmap.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78367 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-12 20:32:14 +00:00
Artur Wieczorek
be9c92f6f2 Sanity check regarding DC in wxPropertyGrid::OnComboItemPaint
Ensure that wxDC used by drawing functions in wxPropertyGrid::OnComboItemPaint is valid.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78366 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-12 20:29:02 +00:00
Artur Wieczorek
a90597a355 Don't attempt to draw element-specific bitmap when drawing wxPGChoices element inside the control field of wxEnumProperty with wxPGComboBox.
The only bitmap which can be drawn in the control field is a "general" value bitmap (assigned to the property).

Closes #16781


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-12 20:23:58 +00:00
Vadim Zeitlin
9f5af0a494 Fix selection of items inserted in virtual generic wxDataViewCtrl.
Call wxSelectionStore::OnItemsInserted() explicitly instead of just using our
UpdateCount() to update the count of items managed by the selection. This
needs to be done to ensure that the newly added items have the correction
selection, i.e. are always unselected, as previously this wasn't the case: if
wxSelectionStore was in the "selected by default" state as it happened e.g.
after selecting all the items in the control, the new items also ended up
being selected.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-11 22:49:21 +00:00
Vadim Zeitlin
87a44937ff Fix selection in virtual generic wxDataViewCtrl after deleting items.
The number of items managed by selection was first decremented by our own
UpdateCount() and then, again, by an explicit call to wxSelectionStore::
OnItemDelete(), which resulted in the selection ending up in an invalid state.

Fix this by not calling UpdateCount(), and hence wxSelectionStore::
SetItemCount(), at all, just OnItemDelete() is enough.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-11 22:49:15 +00:00
Stefan Csomor
606838b515 removing overridden ProcessIdle, reverting that part of r75289
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78362 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-10 09:13:50 +00:00
Vadim Zeitlin
510ae4e0b4 Send deactivation events to MDI children frame in wxMSW too.
For some reason, the code only forwarded activation events to the current MDI
child, but not the deactivation ones. And even though this was literally
always the case (the check for the event being the activation one is there
since r9), it is clearly wrong as the focus restoring code in wxTopLevelWindow
in wxMSW doesn't work if the focus hadn't been previously saved.

This fix hopefully completes the changes started by r78340 and r78341 and
ensures that the focus is always properly restored to the last focused window
inside an MDI child.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-09 03:30:13 +00:00
Vadim Zeitlin
a6d74d8176 No changes, just fix a slightly misleading comment in wxMSW focus code.
DefWindowProc() never preserves the focused window actually, whether we use
WM_NEXTDLGCTL (which is only handled by DefDlgProc() anyhow) or not.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-09 03:30:10 +00:00
Vadim Zeitlin
b6f741c6b1 Make specifying minimal size for "unknown" XRC controls work.
At least since the changes of r44456 (see #8378), minimal size specified in
the XRC for unknown controls didn't have any effect as it was set on
wxUnknownControlContainer itself and was overridden by the subsequent call to
SetSizerAndFit() which reset the minimal size to the best size of the control
contained in it, meaning that it was impossible to make this contained control
bigger by specifying min size greater than its best size in the XRC.

Fix this by honouring both the min size of the container and of the control
contained in it (and do the same thing for the max size for good measure).
To avoid not totally obvious interaction of overriding GetMinSize() and
DoGetBestClientSize() with sizer code, also position the child control
manually instead of using a sizer for it, it's an overkill for such a simple
case anyhow.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-09 03:30:06 +00:00
Vadim Zeitlin
6fad9cf2d9 Make generic wxDataViewCtrl initially usable from keyboard.
This control doesn't react to the keyboard at all if it doesn't have a current
row and as it doesn't have it initially, it means that there is no way to do
anything with the control without clicking it with the mouse first.

Fix this by giving it a current row, if possible, whenever it gains focus.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-09 03:30:02 +00:00
Vadim Zeitlin
5c9d7e139d Always invalidate wxStaticText best size after changing its label.
wxST_NO_AUTORESIZE style only affects whether the control is actually resized
when its text changes, but its best size should always change, so that if the
window containing it is explicitly relaid out the size does change.

Moreover, in wxMSW and wxOSX the best size was never invalidated at all when
the label was ellipsized, so it was never updated for them, preventing, for
example, comparing the best size with the current one to check if the text is
effectively ellipsized (and so needs to be shown in a tooltip, for example).

Fix this by calling InvalidateBestSize() unconditionally, this should make
these ports behave in the same was as wxGTK already did.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78357 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-09 03:29:58 +00:00
Vadim Zeitlin
ee5ab1fffa Fix wxBitmap conversion to wxImage in 64-bit wxOSX builds.
Don't assume that sizeof(long) == 4, this is just wrong.

Closes #16770.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-06 20:20:19 +00:00
Mariano Reingart
772d42cad1 Added new ctor for wxBitmap using wxCursor for wxQT (similar to wxGTK)
This is the implementation that should had been included in r78348

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78353 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-06 07:12:17 +00:00
Tim Kosse
984238305b On wxMac, modal event loops avoid deleting pending events. Hide the text control after editing a label in the generic tree control so it does not remain visible e.g. if the tree control is used in a dialog.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-05 12:48:45 +00:00
Vadim Zeitlin
308e20a74e Fix wxFileDialog::GetFilterIndex() when opening files in wxOSX.
Update m_filterIndex in the "opening" case, just as we already did in the
"saving" one (see #13158 and r67550).

Closes #16764.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78346 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-03 20:45:37 +00:00
Artur Wieczorek
56edecab94 Optimize wxPGChoices::Add methods.
Remove unnecessary variables, limit the scope of variables and implement some sanity checks.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-03 15:20:19 +00:00
Vadim Zeitlin
f3833aa067 Don't change MDI children order after showing a file dialog in wxMSW.
Don't use the generic focus saving/restoring code for wxMDIParentFrame in
wxMSW as it already saves and restores the active MDI child on its own and we
should let it do it, as our code could change the active child when restoring
focus if it hadn't been saved correctly previously.

The fact that it is isn't saved is another bug, but even if it is fixed, we
should let MSW MDI implementation handle activation as we can't do it any
better -- but can do worse, as the bug described in #16635 shows.

Closes #16635.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-03 01:07:53 +00:00