Commit Graph

66201 Commits

Author SHA1 Message Date
Matthew Griffin
5c169c0cf2 Update function names, indentation and added comments 2019-10-02 15:40:16 +01:00
Matthew Griffin
531e988e5d Refactor to do custom qt clipboard actions without dynamic cast 2019-10-02 13:22:16 +01:00
Matthew Griffin
aa786e813b Use QtClipboard image functions instead of setting mime type 2019-06-25 11:21:37 +01:00
Matthew Griffin
73c51b1250 Change bitmap mime type so other apps can read it 2019-06-25 10:01:09 +01:00
Matthew Griffin
a4e0c2cc34 Implement Copy to Clipboard for images 2019-06-24 16:30:29 +01:00
Tomay
1bb4404527 Make ribbon tab active/hover label colour customizable
Allow changing the colour of the label in the active and hover states to
make it possible to improve its contrast with the tab background in
these states.

Closes #18406.
2019-06-04 23:23:04 +02:00
PB
4ad780d6d3 Add missing semicolon to examples using wxDECLARE_XXX() macros
Such macros must be followed by semicolons but a couple of examples were
missing them.

Closes https://github.com/wxWidgets/wxWidgets/pull/1337

Closes #18408.
2019-06-04 23:11:02 +02:00
Vadim Zeitlin
b58c5aea83 Try to accept 8-bit data in wxProtocol::ReadLine() too
Even though the data is supposed to be 7-bit here, we can make an effort
to decode 8-bit data if we get any as it can't be worse than just
throwing it away.

Closes https://github.com/wxWidgets/wxWidgets/pull/1336

Closes #2793.
2019-06-03 22:35:56 +02:00
Jan Knepper
a4f2303361 Use closesocket() for closing sockets under MSW
If accepting a socket connection failed, wxSocketImpl::Accept() used
close() to close the socket even under MSW, but it can be only used for
the file descriptors there and closesocket() must be used instead for
the sockets.

Add new (private) wxCloseSocket define and use it both here, to fix the
bug, and elsewhere to make the code more clear.

Closes #18407.
2019-06-03 22:31:37 +02:00
Artur Wieczorek
b309868930 Fix implementation of wxScrolled<wxControl>
wxControl::Create() has a different signature than wxWindow::Create()
(its 6-th parameter is of const wxValidator& type instead of
const wxString&) so it cannot be invoked from the the general template of
wxScrolled<T>::Create() method. We need to move a call to T::Create()
function to a dedicated template function wxCreateScrolled() responsible
for actual creation of the scrolled window and overload it for custom
classes if necessary.
This has to be done for wxControl and from this overloaded function
wxControl::Create() can be called with rearranged parameters.
2019-06-02 22:34:01 +02:00
Vadim Zeitlin
8caa379490 Merge branch 'sys-theme-fixes'
Fix disabling system theme for wxMSW wxListCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1332
2019-05-28 17:17:49 +02:00
Vadim Zeitlin
65fdda7a35 Document that wxDC::GetPixel() doesn't work under Mac
See #4473.

Closes https://github.com/wxWidgets/wxWidgets/pull/1333
2019-05-28 00:38:17 +02:00
Vadim Zeitlin
b04f199cd0 Correct wrong XDG note in wxStandardPaths::GetUserDir() docs
Unlike the older functions, this one doesn't care about backwards
compatibility and so always uses XDG specification.

Closes #18403.
2019-05-27 17:27:55 +02:00
Vadim Zeitlin
551dfea59a Fix wrong appearance of selected unfocused items in wxListCtrl
Items using wxSYS_COLOUR_BTNFACE (light grey in the default theme) for
their background are, for some reason, drawn using the colour of active
selection (blue) even when the control doesn't have focus.

This is wrong, but there just doesn't seem to be any way to prevent this
from happening when using the native drawing logic other than not using
wxSYS_COLOUR_BTNFACE for the background (modifying any colour channel by
1 is enough to work around the issue). So to draw the item ourselves in
this case and hope that it remains indistinguishable from the native
appearance when not using the system theme.

Closes #17988.
2019-05-26 23:20:21 +02:00
Vadim Zeitlin
d9684e1ceb Allow calling EnableSystemTheme(false) before creating the window
This is important as enabling the system theme results in changes to the
native ListView control appearance that are not undone later even if the
system theme is disabled. Notably, the item rectangle width is reduced
by 2 pixels when system theme is enabled and it's not increased to its
original value even when it's disabled later, resulting in gaps between
items through which the control background shows, for example. This also
makes items drawn using our own HandleItemPaint() slightly, but
noticeably, larger than the items using standard appearance, which looks
bad.

All these problems can be avoided if we skip enabling the system theme
in the first place if EnableSystemTheme(false) had been called before
creating the control, so support doing it like this and document that
this is the preferred way of disabling the system theme use.

Closes #17404, #18296.
2019-05-26 23:20:21 +02:00
Artur Wieczorek
50330b3a26 Use long int literals to represent long constants in propgrid sample 2019-05-26 18:52:43 +02:00
Artur Wieczorek
a93713f7f8 Use long int literals to represent long constants 2019-05-26 18:51:37 +02:00
Artur Wieczorek
1943a9f38d Update wxPG documentation to get rid of doxygen warnings 2019-05-26 18:22:49 +02:00
Artur Wieczorek
58fdf77c9b Add descriptions of enum values in documentation 2019-05-26 18:22:14 +02:00
Artur Wieczorek
1a5526e0ad Remove unused type definition from documentation
It's not used since 3.1.
2019-05-26 18:20:38 +02:00
Artur Wieczorek
b55ff7c3b5 Fix typo in documentation
To generate the link to wxPG_FILE_DIALOG_TITLE.
2019-05-26 18:19:13 +02:00
Artur Wieczorek
d225d2c099 Remove unnecessary section from wxPG documentation
Documentation of macros looks better without using the section.
2019-05-26 18:17:42 +02:00
Artur Wieczorek
908342e3ad Code cleanup: Define wxPGProperty and wxPropertyGridPageState functions in their own class files
Having definitions of several wxPGProperty and wxPropertyGridPageState functions in wxPropertyGrid header is misleading so they should be moved to the files with their own classes definitions for the sake of clarity.
2019-05-26 18:12:31 +02:00
Artur Wieczorek
d8f04a7bb1 Add test of setting and getting maximum text length of wxPG properties 2019-05-26 18:10:34 +02:00
Artur Wieczorek
0bdc9bedbe Enable setting maximum length of the entered text in wxLongStringProperty editor
Editor used by wxLongStringProperty is wxTextCtrl-based and it should be possible to set the limit of the length of the entered text just like it's done for such editors in another properties like wxStringProperty.
2019-05-26 18:06:54 +02:00
Artur Wieczorek
7a29f5dd2c Don't set maximum text length for non-text wxPG properties
Setting the limit for the length of the text the user can enter in the text editor makes sense only for properties having text editors so in wxPGProperty::SetMaxLength() should be done a check whether to actually set a limit or not depending on the kind of editor used.
wxPropertyGridInterface::SetPropertyMaxLength() should be implemented on top of wxPGProperty::SetMaxLength() to proceed only if maximum length was actually set.
2019-05-26 18:06:53 +02:00
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