Commit Graph

6070 Commits

Author SHA1 Message Date
Artur Wieczorek
fc7d8090cf Put header into separate line in wxPG dump in propgrid sample 2019-04-21 23:39:34 +02:00
Artur Wieczorek
ecb711d2b3 Remove obsolete code from propgrid sample
This is code for v3.x so it doesn't make sense to check version against v2.8.
2019-04-21 23:39:33 +02:00
Vadim Zeitlin
aeef082e47 Update year in various copyrights to 2019
This is the equivalent of c8b6ca308b for
2019, except that it was produced by running misc/scripts/inc_year and
not manually now.

See https://github.com/wxWidgets/wxWidgets/pull/1302
2019-04-21 20:39:28 +02:00
Vadim Zeitlin
9a9c845289 Add wxSystemAppearance to check for dark mode under macOS
Provide a way to retrieve the name of the current system appearance
(mostly for diagnostic purposes) and check if it uses predominantly dark
colours.

Currently this class has a non-trivial (but still very simple)
implementation under macOS only and simply checks whether the default
text colour is brighter than the default background colour under the
other platforms, but other platform-specific implementations could be
added later.

Also update the drawing sample "system colours" page to show the system
appearance as well.
2019-04-21 02:11:07 +02:00
Vadim Zeitlin
b6477e0b9c Merge branch 'stcpopup'
Many usability and appearance improvements for autocompletion popups and
call tips in wxSTC.

See https://github.com/wxWidgets/wxWidgets/pull/1267
2019-04-21 02:03:32 +02:00
VZ
a5a44e8bae
Apply suggestions from code review
Co-Authored-By: NewPagodi <NewPagodi@users.noreply.github.com>
2019-04-18 20:57:01 -05:00
Paul Cornett
fe1737d399 Reduce the scope of some local variables 2019-04-05 10:44:02 -07:00
Paul Cornett
7cbe23830f Avoid truncation of expression assigned to larger type 2019-04-05 09:55:49 -07:00
Paul Cornett
67773f58f1 Avoid immediate destruction of temporary wxBusyInfo object 2019-04-05 09:23:40 -07:00
Paul Cornett
210e162302 Use newer wxDECLARE_* macros 2019-04-05 09:21:29 -07:00
Paul Cornett
365759753a Pass parameters by const reference rather than by value 2019-04-05 09:18:07 -07:00
Paul Cornett
90ce6a4334 Remove unused variables 2019-04-04 10:40:45 -07:00
Vadim Zeitlin
1f64877ca4 Merge branch 'msw-display-refresh'
Fixes for display information refreshing under MSW.

See https://github.com/wxWidgets/wxWidgets/pull/1282
2019-04-02 17:19:01 +02:00
Vadim Zeitlin
b0ad9ccffd Use control current, not best, size in wxMSW wxToolBar layout code
Avoid allocating too much space to the control in the toolbar, it may
have been made smaller than its best size on purpose and, in any case,
we don't resize the control, so it's useless to allocate more space to
it than it's going to use.

See #18294.
2019-03-31 13:39:57 +02:00
Vadim Zeitlin
8927d7b092 Update displays sample correctly when displays change
wxEVT_DISPLAY_CHANGED notifies not only about the change of resolution
of a display, but also about removal or addition of a new display, so we
need to completely repopulate the notebook showing the displays on
receiving it.
2019-03-31 13:04:43 +02:00
Vadim Zeitlin
9cbc1a5fbf Merge branch 'msw-tbar-resize'
Many fixes for wxToolBar (re)sizing in wxMSW, partially addressing
toolbar size changes since the previous wxWidgets versions.

See https://github.com/wxWidgets/wxWidgets/pull/1241

Closes #18294.
2019-03-29 19:16:40 +01:00
Vadim Zeitlin
9926619adf Don't use hard-coded size for wxSpinCtrl in the dialogs sample
This truncates the control with GTK+ 3 where 40 or 60 pixels is never
enough for its width (even without speaking about high DPI displays) and
results in tons of GTK+ warnings.
2019-03-26 13:57:21 +01:00
New Pagodi
79e16c78bc Demonstrate call tip clicks in the stc sample
This adds a demonstration of handling call tip clicks to the stc sample.
Instead of showing a single call tip, 3 different call tips can be
shown. The sample demonstrates how to move between the call tips
depending on if the up or down button was clicked in the call tip
window.
2019-03-18 22:24:43 -05:00
New Pagodi
518cdc5790 Demonstrate autocompletion in the stc sample
This adds a demonstration of autocompletion for C preprocessor
directives to the stc sample. It also shows how to register and use
small images with the autocompletion popup.
2019-03-18 22:24:34 -05:00
Stefan Csomor
f163578c94 macOS expose scroll invertion in event
applied patch from #18358, thanks for the patch Andy
2019-03-12 12:22:41 +01:00
Vadim Zeitlin
d841f7b34e Merge branch 'wxQt-memory-leaks' of https://github.com/catalinr/wxWidgets
Fix many memory leaks in wxQt port.

See https://github.com/wxWidgets/wxWidgets/pull/1243
2019-03-05 23:36:41 +01:00
Cătălin Răceanu
b91d2a93ee Set sizer to the main frame and avoid leaking it 2019-02-26 23:21:13 +02:00
Paul Cornett
1e753f97ba Remove initializations which are the default value 2019-02-25 10:49:04 -08:00
Paul Cornett
b5028f267d Remove unused variables, unused assignments 2019-02-25 09:12:43 -08:00
Vadim Zeitlin
23dee36ec3 Add accelerators for toolbar positioning menu items in the sample
This makes it much more convenient to quickly test different toolbar
orientations.
2019-02-24 22:33:33 +01:00
Vadim Zeitlin
62b4974bf0 Indentation fix in the toolbar sample
No real changes.
2019-02-24 22:33:33 +01:00
Vadim Zeitlin
85666cd22f Demonstrate vetoing wxEVT_SPIN_XXX events in widgets sample
Show that these events can be vetoed, which prevents the control value
from changing, and also that veto doesn't apply if the event handler
skips the event.

See https://github.com/wxWidgets/wxWidgets/pull/1232
2019-02-21 15:10:27 +01:00
Cătălin Răceanu
d9c8932188 Ensure a valid page is initially selected in the widgets sample
Select first page if an invalid one was restored which may happen if the
build of the library has changed (e.g. some previously disabled
wxUSE_XXX became enabled etc).

Closes https://github.com/wxWidgets/wxWidgets/pull/1235
2019-02-21 04:49:12 +01:00
PB
f8090263de Fix recently introduced mojibake in text sample
During the samples-wide removal of obsolete wxT macros in
f58ea62596, the macros were
accidentally removed also from the place where they were required
(string literal casted to void* and then retrieved as wxChar*). This led
to names for m_tab and m_enter controls displayed wrong when logging
text events.

Fix this by restoring wxS() in this particular place.

See https://github.com/wxWidgets/wxWidgets/pull/945

Closes https://github.com/wxWidgets/wxWidgets/pull/1226
2019-02-21 04:26:46 +01:00
Paul Cornett
7c75f46098 wxOVERRIDE 2019-02-17 22:42:26 -08:00
Vadim Zeitlin
21a7ff2aa3 Use wxScopedPtr instead of explicit delete in printing sample
No real changes, just make the code a bit safer.
2019-02-03 22:45:46 +01:00
Vadim Zeitlin
7a05aa6dc0 Don't pass unused arguments to GetTextExtent() in printing sample
No real changes, just remove the completely unused local variables and
parameters to wxGraphicsContext::GetTextExtent() call.
2019-02-03 22:42:55 +01:00
Maarten Bent
4aeb941c4c Demonstrate wxSlider::SetSelection() in widgets sample 2019-01-31 21:16:07 +01:00
Maarten Bent
53af5cb251 Some fixes for wxSlider in widgets sample
Correctly save the slider value before recreating the slider.
Layout the entire page instead of only the slider sizer.
Update the text controls after recreating the slider.
Always enable 'both sides' checkbox. It has additional effects in wxMSW.
2019-01-31 21:16:07 +01:00
Maarten Bent
56c7eadc0a Use wxSizerFlags for slider page in widgets sample
Don't set minimum size of right panel.
2019-01-31 21:16:06 +01:00
Maarten Bent
bf0a8ffd74 Improve guards in button pages of widgets sample
Add guards for wxCommandLinkButton.
Move CheckBoxes outside wxHAS_BITMAPTOGGLEBUTTON guard.
Remove wxHAS_ANY_BUTTON check, this is always defined with wxUSE_TOGGLEBTN.
2019-01-31 21:16:06 +01:00
Maarten Bent
8f3b87dce7 Fix wxSlider::SetThumbLength() on wxMSW
It requires TBS_FIXEDLENGTH style.
Call InvalidateBestSize because the size of the control might change.
Call Layout in the widgets sample to adjust to the changed size.
Use GetThumbLength() instead of the arbitrary defined THUMB size.
2019-01-31 21:16:06 +01:00
Vadim Zeitlin
8fbca5cb70 Remove all trailing spaces
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.

This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
2019-01-30 17:35:54 +01:00
Graham Dawes
6b11c372a1 Fix recently introduced build error in widgets sample
Make it compile again when wxHAS_BITMAPTOGGLEBUTTON is not defined,
which is notably the case in wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1189
2019-01-28 12:41:31 +01:00
Vadim Zeitlin
2c7489fffe Merge branch 'widgets-sample-buttons' of https://github.com/MaartenBent/wxWidgets
Several improvements to the buttons pages of the widgets sample:

- Use a valid font when creating the bitmap.
- Create the bitmap with an DPI independent size.
- Use different images for different button states, as described by the
  checkbox options.
- Add a checkbox to disable the bitmap.
- Recreate the button when changing label, so the bitmap is updated.
- Implement the 'fit exactly' option on ToggleButton page.
- Use more wxSizerFlags in widgets sample.

See https://github.com/wxWidgets/wxWidgets/pull/1188
2019-01-28 01:19:31 +01:00
Maarten Bent
ee752e2439 Use more wxSizerFlags in widgets sample 2019-01-27 17:04:08 +01:00
Maarten Bent
a6fbfacc62 Improve wxButton and wxToggleButton with bitmap in widgets sample
Use a valid font when creating the bitmap.
Create the bitmap with a DPI independent size.
Use different images for different button states, as described by the checkbox
options.
Add a checkbox to disable the bitmap.
Recreate the button when changing label, so the bitmap is updated.
Implement the 'fit exactly' option on ToggleButton page.
2019-01-27 17:04:07 +01:00
Maarten Bent
0d5ed276a4 Update radio page in widgets sample
Make the reset button work by binding to OnUpdateUIReset.
Use wxSizerFlags based API.
Remove minimum size of right panel so the minimum size of wxRadioBox can be
verified.
Use wxArrayString instead of manually creating and deleting an array of
wxString pointers.
Reapply disabling and hiding the test button, and check if test button is
available.
Layout the entire page instead of only the sizer, see #18100.
2019-01-27 15:26:17 +01:00
Maarten Bent
a377f0e5f0 Get rid of wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM styles
This was only used in wxUniv, wxRA_SPECIFY_[COLS/ROWS] can be used instead.
Do not remove them from the definitions, to not break user code.

Closes #18100.
2019-01-27 15:26:16 +01:00
Dummy
b0660cc87c Pass argument of proper type to wxPropertyGridInterface::SetPropertyBackgroundColour
The last argument passed to this function should be an int flag not a Boolean value.
Boolean value 'true' passed here is converted to int 1 so wxPG_RECURSE flag is never set and the background colour is never changed for sub-properties.

Closes #18333.
2019-01-23 20:08:57 +01:00
Artur Wieczorek
5261605a61 Use wxSizerFlags-based API in widgets sample
Make the code more clear by using wxSizerFlags.
2019-01-20 13:23:11 +01:00
Vadim Zeitlin
2a452c0b60 Fix widgets sample build when using precompiled headers
wx/artprov.h is not included from wx/wx.h, so it needs to be always
included from this header and not only when !WX_PRECOMP.
2019-01-19 23:02:09 +01:00
Artur Wieczorek
4fabf5238f Fix harmless signed/unsigned comparison warning in widgets sample
Cast WXSIZEOF to int before comparing it with int variables.
2019-01-19 22:51:44 +01:00
Artur Wieczorek
7a6200631a Extend wxHeaderCtrl demonstration in widgets sample
Added ability to show header columns with various style flags.
2019-01-19 22:09:11 +01:00
Artur Wieczorek
defae61c13 Extend wxHeaderCtrl demonstration in widgets sample
Added ability to show wxHeaderCtrl with various styles.
2019-01-17 21:51:56 +01:00