Commit Graph

66151 Commits

Author SHA1 Message Date
Vadim Zeitlin
8a1e679640 Remove another unnecessary call from MSW wxStaticBitmap
DeleteCurrentHandleIfNeeded() is already called from Free() which is
unconditionally called at the beginning of the function, so there is no
need to call it again.
2019-05-16 22:18:38 +02:00
Vadim Zeitlin
65e5c3dbc7 Avoid invalidating the best size in wxStaticBitmap unnecessarily
This is just a micro-optimization: there is no need to call
InvalidateBestSize() if the size of the bitmap doesn't actually change
(as will most often be the case when this method is called after the
control creation).
2019-05-16 22:17:06 +02:00
Vadim Zeitlin
6c59a4e7af Fix wxStaticBitmap auto-resizing under MSW
wxStaticBitmap tried to automatically resize itself to its new size, but
did it wrongly (since what looks like ever, or at least since the first
version in the VCS, which is 2bda0e1738,
from 21 years ago) because it assumed that the size of wxStaticBitmap
window is the same as the size of the bitmap it is showing, which is not
the case when it uses border style such as wxBORDER_RAISED.

Fix this by resizing it to the current size adjusted by the difference
between the old and new bitmap sizes. Alternative approach would be to
just use SetSize(GetBestSize()), as the other ports do, but keep the
changes to the minimum for now.

Closes #18398.
2019-05-16 22:16:47 +02:00
Hartwig
f668f5b36f Update wxImage used by Mac image graphics context in Flush()
Calling Flush() is supposed to make everything drawn so far immediately
visible, which means propagating it to the wxImage being drawn on in the
case of image-based graphics context, but wxMacCoreGraphicsImageContext
didn't do it, unlike Cairo and GDI+ version.

Fix this by overriding Flush() in it to explicitly update m_image.

Closes https://github.com/wxWidgets/wxWidgets/pull/1321
2019-05-13 16:49:57 +02:00
Artur Wieczorek
04cebe381a Remove unneeded privileged access as friends 2019-05-12 20:24:59 +02:00
Artur Wieczorek
d4df8119ee Remove from documentation references to nonexistent classes 2019-05-12 20:24:58 +02:00
Artur Wieczorek
8ba6173e21 Update wxFloatProperty documentation
DoGetAttribute() function is no longer implemented.
2019-05-12 20:24:57 +02:00
Artur Wieczorek
fde9bb6d41 Make wxPG_COLOUR_ALLOW_CUSTOM a Boolean property
So far it was implemented as property which could take int values 0/1 so it was acting essentially as a Boolean property. Implementing it explicitly as a Boolean one will make it more intuitive. Legacy code setting 0/1 int values shouldn't be affected because conversion from int to bool is implicit.
2019-05-12 20:24:57 +02:00
Artur Wieczorek
bb232f42c1 wxPGDoubleClickProcessor should be used only with wxBoolProperty
Using double-click processor makes sense only for wxBoolProperty so this constraint should be enforced in the declaration of the class.
2019-05-12 20:24:56 +02:00
Artur Wieczorek
1b977718d4 Make wxPG_FILE_xxx built-in attributes
All wxPG_FILE_xxx attributes are used only in wxFileProperty to set respective internal data members and don't have to be stored in the property's attribute store.
2019-05-12 20:24:55 +02:00
Artur Wieczorek
baaba42776 Refactor: display file selector dialog from within member function in wxFileProperty
By moving the code to display file selector dialog from wxPGFileDialogAdapter to wxFileProperty we can encapsulate the operation of showing the dialog because all required parameters are stored in the corresponding data members and there is no need to use call generic GetAttribute() function to retrieve them. This also helps in making wxFileProperty attributes built-ones in the future.
2019-05-12 20:24:55 +02:00
Artur Wieczorek
d9da2feaf2 Refer to predefined constants in documentation 2019-05-12 20:24:54 +02:00
Artur Wieczorek
b2ea56b4e9 Make wxPG_FILE_DIALOG_STYLE a built-in attribute
This attribute is used only internally in wxFileProperty so it can be considered as a built-in attribute which value can be stored in the local data member and not in the property's attribute store.
2019-05-12 20:24:53 +02:00
Artur Wieczorek
ca712c59fe Remove redundant assignment
This assignment to the temporary variable is not necessary.
2019-05-12 20:24:53 +02:00
Artur Wieczorek
8e726db667 Use dedicated function to check if wxPropertyGridPageState object is now displayed
There is implemented IsDisplayed() function to check whether wxPropertyGrid current state refers to this state.
2019-05-12 20:24:52 +02:00
Artur Wieczorek
e73183743a Fix creating wxPropertyGrid header when grid is horizontally scrolled
Horizontal scroll position of just created wxPGHeaderCtrl has to be the same as the scroll position of wxPropertyGrid.
2019-05-12 20:24:51 +02:00
Václav Slavík
560a81b913 wxDVC: Don't calculate hidden columns' widths
Don't call wxDataViewColumn::GetWidth() in OnPaint() for columns that
are hidden: they won't be drawn and their width won't affect anything.
The call looks deceptively simple, but may invoke best width
recalculation that can be very expensive on large models.
2019-05-10 18:18:20 +02:00
Vadim Zeitlin
f60dc84534 Try to make wxClipboard::Flush() test in sample actually useful
Calling Flush() before putting anything on the clipboard didn't make
much sense.

See https://github.com/wxWidgets/wxWidgets/pull/1316
2019-05-10 01:53:52 +02:00
oneeyeman1
28a84486bd Implement wxClipboard::Flush() in wxGTK
Update the documentation and also add a call of Flush() to the sample.

Closes #10515.

Closes https://github.com/wxWidgets/wxWidgets/pull/1316
2019-05-10 01:46:54 +02:00
Vadim Zeitlin
02adddfa1a Merge branch 'wxlistctrl-virtual-checkboxes' of https://github.com/MaartenBent/wxWidgets
Add support for checkboxes to virtual wxListCtrl too.

See https://github.com/wxWidgets/wxWidgets/pull/1315
2019-05-10 01:39:33 +02:00
NikitaFeodonit
910aaa3961 Fix include directories for built-in libraries in CMake build
This fixes ''wx/setup.h' file not found' error in CMake macOS build.

Closes https://github.com/wxWidgets/wxWidgets/pull/1314
2019-05-10 01:37:26 +02:00
Vadim Zeitlin
04689e9727 Merge branch 'utf8-text-stream'
Really fix reading from UTF-8 text streams.

Closes #14720.

See https://github.com/wxWidgets/wxWidgets/pull/1304
2019-05-10 01:35:55 +02:00
Vadim Zeitlin
998097b3a4 Merge branch 'col-dialog-current'
Add events for current colour change in wxColourDialog and
wxColourPickerCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1301
2019-05-10 01:31:18 +02:00
Maarten Bent
dd23722432 Demonstrate checkboxes in virtual wxListCtrl 2019-05-05 14:26:39 +02:00
Maarten Bent
c20060745f Support checkboxes in virtual wxListCtrl 2019-05-05 14:25:06 +02:00
Maarten Bent
353b0aabba Add virtual function to provide virtual wxListCtrl checkbox state 2019-05-05 14:24:30 +02:00
Maarten Bent
ceaf2aa803 Move virtual stub functions to wxListCtrlBase 2019-05-05 14:23:44 +02:00
Vadim Zeitlin
1a48c2d914 Fix harmless "unused parameter" warning in wxMSW wxFileDialog
See https://github.com/wxWidgets/wxWidgets/pull/1310
2019-05-04 16:25:18 +02:00
Maarten Bent
d262aa02d1 Remove obsolete wxOSX/Carbon listctrl header 2019-05-04 15:03:20 +02:00
Vadim Zeitlin
542aafff39 Ensure that we accept WXK_XXX in RegisterHotKey() in wxMSW
RegisterHotKey() wrongly expected to be given VK_XXX MSW virtual key
code constant, which couldn't work in portable code, so fix it to accept
WXK_XXX constants, while preserving compatibility by still accepting
VK_XXX values not clashing with them.
2019-05-02 20:53:18 +02:00
Vadim Zeitlin
12385d3586 Show the current file dialog filter index in the sample
Update the dialogs sample to show GetCurrentlySelectedFilterIndex() in
action.

See https://github.com/wxWidgets/wxWidgets/pull/1310
2019-05-02 20:07:45 +02:00
QuentinC
413abb066e Allow retrieving current filter from wxFileDialog extra controls
Add wxFileDialog::GetCurrentlySelectedFilterIndex() similar to the
existing GetCurrentlySelectedFilename(), which can be used to retrieve
the index of the currently selected filter and update the state of the
extra controls in wxFileDialog accordingly.

Implement this for wxMSW only by updating the internally stored value
from the native CDN_TYPECHANGE notification and also generating a
wxEVT_UPDATE_UI event to allow the extra controls to update themselves.

Closes https://github.com/wxWidgets/wxWidgets/pull/1310
2019-05-02 19:53:05 +02:00
PB
1916442956 Remove unused wxUSE_COMCTL32_SAFELY from documentation
This preprocessor symbol seems to be no longer used anywhere in the code.
2019-04-30 20:34:20 +02:00
Artur Wieczorek
92d2be5842 Resolve ambiguity in calling overloaded wxPropertyGrid::SendEvent()
The right overloaded SendEvent() function can be determined by explicitly
casting second argument of the call to (wxPGProperty*) type.
2019-04-28 18:34:36 +02:00
Artur Wieczorek
96e24e73d6 Use conditional operator instead of conditional statement
This notation is more intuitive in this context.
2019-04-28 17:14:25 +02:00
Artur Wieczorek
bdc9d8f772 Remove redundant assignments
These assignments to the temporary variables are not necessary.
2019-04-28 17:11:56 +02:00
Artur Wieczorek
9df9e32a70 Get rid of unnecessary casts to wxPGProperty*
These casts are unnecessary and can be removed.
2019-04-28 17:04:07 +02:00
Artur Wieczorek
d06d403136 Replace 'while' loop with 'for' loop for simple iterations
Using 'for' loop to do a simple iteration is more intuitive and makes the code simpler.
2019-04-28 16:48:32 +02:00
Artur Wieczorek
50b1cfd0b5 Use dedicated function to change wxPGProperty flags
Using wxPGProperty::ChangeFlag() function makes the code simpler and more readable.
2019-04-28 16:38:48 +02:00
Artur Wieczorek
bd313b64ab Fix copying wxPGAttributeStorage
We need implement copy ctor and assignment operator because we are going to do a shallow copy of wxPGHashMapS2P data member and therefore we have to manually update reference counters of the objects being referenced in this map.
2019-04-28 16:35:11 +02:00
Artur Wieczorek
57aeaa3823 Add some tests of wxPGAttributeStorage
Check obtaining list of wxPGProperty attributes as wxPGAttributeStorage and making a copy of this list.
2019-04-28 16:32:20 +02:00
Artur Wieczorek
3f1d4a7104 Add test of setting/getting wxPGProperty attributes through wxPropertyGridManager 2019-04-28 16:32:19 +02:00
Artur Wieczorek
fc04f31a2b Remove unused variable
wxPGComboBox::m_sizeEventCalled was never used.
2019-04-28 15:31:51 +02:00
Artur Wieczorek
f39e70be15 Use dedicated event type to notify header about column width changes
Notification about changes of column widths needs to be sent locally from wxPropertyGrid to  wxPropertyGridManager (to update the header) so it would be good to use a dedicated non-public event type for these purposes.
2019-04-28 15:31:10 +02:00
Artur Wieczorek
fa35fdc600 Preserve header and label editing mode while recreating the grid
For some operations when grid needs to be recreated currently selected options to show the header and to enable label editing are being ignored and it can be seen a discrepancy between the options selected (and shown) in the menu and the mode of just created wxPropertyGrid. To avoid this inconsistency respective flags can be stored and used to enable/disable features in just created grid.
2019-04-27 22:10:47 +02:00
Stefan Csomor
35ec8c519f only execute app-startup behaviour if we are not a plug-in 2019-04-27 19:07:57 +02:00
Vadim Zeitlin
9484d453a9 Merge branch 'fswatcher-test-modernize'
Modernize and clean up wxFileSystemWatcher unit test.

See https://github.com/wxWidgets/wxWidgets/pull/1307
2019-04-26 23:35:23 +02:00
Vadim Zeitlin
0b9041dd29 Remove macOS workaround unnecessary any longer
The workaround introduced by f0e098fa06
doesn't seem to be needed any more, the test passes just fine without
it, so remove it.

See #16969.
2019-04-26 13:36:00 +02:00
Vadim Zeitlin
1b7b79e1c2 Remove wxLog::AddTraceMask() call
This shouldn't be done unconditionally, trace mask can always be enabled
using WXTRACE environment variable from outside the test.

Also remove a useless tracing message.
2019-04-26 13:19:05 +02:00
Vadim Zeitlin
77645a1aad Replace legacy CppUnit macros with CATCH ones
No real changes.
2019-04-26 13:19:05 +02:00