Commit Graph

66175 Commits

Author SHA1 Message Date
Artur Wieczorek
e45c6b0dd1 Use separate event handlers to handle individual wxPGHeaderCtrl events
The code to handle events split into separate functions dedicated to handle the events of specific type is more readable than the code concentrated in one function handling all kinds of events.
2019-05-26 18:06:52 +02:00
Artur Wieczorek
5fc0af423e Check wxPropertyGrid column widths against virtual size
In virtual width mode total width of columns cannot be lesser than virtual width.
2019-05-26 17:59:21 +02:00
Artur Wieczorek
a07c14a31d Fix calculation of column width after changing number of wxPropertyGrid columns
Because changing the number of columns may change their total width from value greater than current client size to the value less than this size or vice versa we need to know this total width prior to determining wxProperyGrid scrolled view in order to account this actual width in the calculations.
2019-05-26 17:59:20 +02:00
Artur Wieczorek
549acf6e80 Implement wxPropertyGrid as wxScrolled
Scrolling operations and related calculations are simpler when wxPG is implemented as wxScrolled instead of wxScrollHelper.
2019-05-26 17:57:31 +02:00
Igor Korot
f3e1f72f6d Test vetoing wxAuiNotebook page changing event in aui sample
Make it simpler to check whether vetoing the page changing event works
as it's supposed to.

See #4518.

Closes https://github.com/wxWidgets/wxWidgets/pull/1329
2019-05-26 16:47:23 +02:00
Maarten Bent
34efac1a21 Don't call unimplemented virtual wxListCtrl::OnGetItemIsChecked()
This method should only be called when checkboxes are enabled and
calling it unconditionally triggered an assert failure.

See #18393.

Closes https://github.com/wxWidgets/wxWidgets/pull/1330
2019-05-26 16:41:48 +02:00
New Pagodi
d18d979371 Improve checks in ScintillaWX::ModifyScrollBars
The ScintillaWX::ModifyScrollBars method is used to ensure that the
horizontal and vertical scrollbars are constantly up to date. It
computes the needed max and page size for the scrollbars based on a
combination of input data and internal state variables, compares the
needed values with the scrollbar’s current max and page size, and
updates the scrollbars if there is a difference.

Because of the current logic used, the method will try to update the
scroll bars in two cases where no updates are necessary. First, if a
scrollbar is not visible (or if word wrapping is on for the horizontal
scrollbar), ModifyScrollBars currently tries to set the max to 0.
However on some platforms, such as windows, this call can fail and
result in the max actually being set to 1. Consequently subsequent calls
to ModifyScrollBars will assume the value should be 0 but detect the
scrollbar’s max as 1 and try to update the value again. To avoid this,
instead set the scrollbar’s page size to 1 more than the max.

The second case is only for the horizontal scrollbar. Currently, the
function updates the scrollbar whenever the position is not 0. There
doesn’t seem to be any reason for this check, and so it has simply been
removed.

Closes https://github.com/wxWidgets/wxWidgets/pull/1327
2019-05-26 16:41:12 +02:00
Robin Dunn
629e52da5e Remove 'virtual' from some items that are not virtual in the real code 2019-05-24 13:33:41 -07:00
Robin Dunn
8d6198c59d DoEnable is protected everywhere else, not private 2019-05-24 13:32:52 -07:00
Robin Dunn
c30eb8f2ff Add missing and fix broken interface items for wxPython 2019-05-23 21:26:14 -07:00
Paul Cornett
08572d6077 Remove use of wxTheColourDatabase in a sample
Just pass the color name to the wxColour ctor
2019-05-22 09:50:34 -07:00
Paul Cornett
bc1295fbdc Allow Scintilla Ctrl-key shortcuts to work with non-Latin keyboard layouts on GTK
See #18370
2019-05-22 09:45:46 -07:00
Vadim Zeitlin
616b915119 Paint over larger part of MSW buttons with custom background
Don't use ExtFloodFill() to extend the custom background colour to the
edges as this results in weird problems due to an apparent bug in nVidia
drivers, see #18387.

Instead, just extend the rectangle passed to FillRect(), which doesn't
look quite as good under Windows 10, but is pretty close, and shouldn't
suffer from the nVidia bug while also slightly improving appearance
under Windows 7.

Closes https://github.com/wxWidgets/wxWidgets/pull/1319
2019-05-21 18:13:21 +02:00
Vadim Zeitlin
885d80ef22 Merge branch 'msw-statbmp-fix-and-opt'
A fix and some cleanup/optimizations for wxMSW wxStaticBitmap.

See https://github.com/wxWidgets/wxWidgets/pull/1322
2019-05-18 14:23:45 +02:00
Vadim Zeitlin
7fee108177 Merge branch 'formatmessage-ignore-inserts' of https://github.com/lanurmi/wxWidgets
Fix GetSysErrorMsg() (used by wxLogLastError() under MSW) to work with
error messages containing inserts.

See https://github.com/wxWidgets/wxWidgets/pull/1317
2019-05-18 14:21:20 +02:00
Vadim Zeitlin
a120673849 Merge branch 'doxygen_update' of https://github.com/a-wi/wxWidgets
Update instructions for using Doxygen.

See https://github.com/wxWidgets/wxWidgets/pull/1325
2019-05-18 14:14:57 +02:00
Artur Wieczorek
1965ca4296 Update doxygen readme about Graphviz
Mention that Graphviz visualization software is also required to generate
documentation properly.
2019-05-18 09:59:24 +02:00
Artur Wieczorek
fea3027488 Update reference to non-reachable website in doxygen readme file
Current website URL is no longer reachable so replace it with new one which
seems to refer to the same topic.
2019-05-18 09:41:18 +02:00
PB
357108d3cd Remove the last remnants of Windows CE related code
Remove the last few bits of code supporting Windows CE.
2019-05-18 08:40:03 +02:00
Vadim Zeitlin
2039d864ba Avoid updating wxStaticBitmap unnecessarily
If the kind of the bitmap/icon used by the control didn't change (which
will be most often the case, as using both an icon and a bitmap with the
same control is vanishingly rare), there is no need to update the window
style.

No real changes, this is just a micro-optimization.
2019-05-16 22:26:13 +02:00
Vadim Zeitlin
eb0fc45d92 Add a comment explaining why m_isIcon needs to be set early
No changes, just explain why we can't simply let SetImageNoCopy() set
m_isIcon to the correct value and need to do it here instead.
2019-05-16 22:24:07 +02:00
Vadim Zeitlin
f69c3c203e Remove redundant wxStaticBitmap::m_isIcon assignment
No need to set m_isIcon before overwriting it just 2 lines below.
2019-05-16 22:22:37 +02:00
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
Lauri Nurmi
d2eec4bd90 Fix occassionally failing FormatMessage call
Call FormatMessage with the IGNORE_INSERTS flag. Without the flag,
the FormatMessage() call will fail when the error message contains
inserts (such as %1), as we are not providing any arguments.

Various Windows system error messages contain inserts; e.g. error 193.

See also: https://devblogs.microsoft.com/oldnewthing/20071128-00/?p=24353
2019-05-13 10:44:38 +03:00
Lauri Nurmi
18e4cf9b80 Prefix unknown error's code with 0x, and log FormaMessage's error code 2019-05-13 10:44:28 +03: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