Commit Graph

6264 Commits

Author SHA1 Message Date
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
Jay Nabonne
e8d39f3b5c No buttons image list support for Qt as for MSW. 2019-02-07 08:58:38 +00: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
Vadim Zeitlin
288d26598c Merge branch 'dvc-var-height'
Optimize generic wxDataViewCtrl performance with variable line heights.

Closes https://github.com/wxWidgets/wxWidgets/pull/1053
2019-01-16 01:25:06 +01:00
jensgoe
14ca16ffaf example for DataView with wxDV_VARIABLE_LINE_HEIGHT flag 2019-01-08 00:12:47 +01:00
ali kettab
36f6f8ad49 wxTextValidator improvements
Improve char inclusion/exclusion support; update the sample to show more
features of this class and add a unit test for it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1093
2019-01-05 23:33:35 +01:00
Pavel Kalugin
659ab78c6d Add support for editing dates (without time) to wxGrid
Add wxGridCellDateRenderer and wxGridCellDateRenderer which can be used
for the grid cells containing only dates, without times.

Also add wxGrid::SetColFormatDate() convenience function.

Refactor wxGridCellDateTimeRenderer slightly to reuse its code.

Closes https://github.com/wxWidgets/wxWidgets/pull/1101
2019-01-04 14:14:01 +01:00
Vadim Zeitlin
ee352d79c8 Merge branch 'ipc-dde-fixes'
wxIPC fixes when using DDE

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

Closes #17900.
2019-01-04 14:12:53 +01:00
Stefan Csomor
142234d009 macOS fix
otherwise CreateNewDocument is called twice
2019-01-03 17:04:13 +01:00
Artur Wieczorek
8dbe6ec69d Add to propgrid sample an option to change virtual width of the grid 2018-12-27 13:16:41 +01:00
Vadim Zeitlin
20cb47c1c4 Send Unicode data as UTF-8 text when using DDE-based IPC
This is a more hackish but more compatible solution to the problem of
data sent using wxIPC_UTF8TEXT format being simply lost when using DDE
for IPC classes. We must use CF_TEXT for the DDE to pass our data, but
we can try to decode it as UTF-8 in the client and assume it was sent in
this format if it worked. This obviously suffers from false positives as
any ASCII string will still be assumed to be UTF-8, but there shouldn't
be any real harm coming from this.

This change also makes sending data in wxIPC_UTF{16,32}TEXT formats work
as well by converting it to UTF-8.

Update the sample to call Advise() with both wxIPC_UTF{8,16}TEXT formats
and remove the now unnecessary wxDDEConnection::m_dataType member.

Closes #17900.
2018-12-27 00:26:29 +01:00
Vadim Zeitlin
09bf235a59 Revert "Fix passing Unicode strings via wxIPC when using DDE"
This reverts commit c657fd3d61 because
changing the format of DDE advise requests/replies is not a good idea:
other applications (those using previous versions of wxWidgets or even
not using wxWidgets at all) may rely on getting data in real CF_TEXT
format rather than in one of text formats preceded by the extra byte
containing the actual format and the previous commit would have silently
broken this.

Another fix for #17900 will be implemented instead.
2018-12-26 23:20:52 +01:00
Vadim Zeitlin
c657fd3d61 Fix passing Unicode strings via wxIPC when using DDE
wxIPC API doesn't map well onto DDE, as we don't have wxIPCFormat
parameter in StartAdvise() but do allow specifying the format when
calling Advise() itself, whereas DDE requires specifying the format when
establishing the advise loop and the data always must use this format
later.

Because of this, we have to pass the actual format with the data itself
instead of relying on DDE formats support. This has the advantage of
allowing wxIPC_UTF8TEXT to work, while previously it didn't and
couldn't, as DDE only supports the standard (or custom, but registered)
clipboard formats and it wasn't one of them. Of course, this also has a
disadvantage of having to make another copy of the data, but this seems
unavoidable.

This change allow Advise() overload taking wxString to work, including
for non-ASCII strings, as shown by the update to the IPC sample. It also
makes wxDDEConnection::m_dataType unnecessary, as we must always use the
format passed to DDE callback anyhow when handling XTYP_ADVREQ.

Closes #17900.
2018-12-24 01:42:12 +01:00
Artur Wieczorek
79b71cf4ff Scale bitmap to wxPropertyGrid's row height
By design only bitmaps lower than row height are displayed within the cells.
Because on every platform default row height can vary so bitmap has to be explicitly scaled to the row height to ensure that it will be initially displayed on every platform.

Closes #18310.
2018-12-24 00:00:14 +01:00
Vadim Zeitlin
b891fe1974 Remove misleading warning from the ipc sample
DDE code translates wxIPC_PRIVATE to wxIPC_TEXT internally since a
change done in 9d86099269, but same commit
also added a warning to the ipc sample stating that wxIPC_PRIVATE
doesn't work, which isn't really the case.

Remove the warning to avoid the confusion.

See #7470.
2018-12-23 22:01:50 +01:00
Artur Wieczorek
8432726ba8 Make string literal wxChar* string
This macro parameter is passed to wxArrayStringProperty::OnButtonClick() parameter of wxChar* type. char* string interpreted in this function as a wxChar* string results in obtaining invalid Unicode characters.
This fixes a regression introduced in b70ed2d8c8.

Closes #18307.
2018-12-23 11:00:35 +01:00
Vadim Zeitlin
2340a16d18 Allow increasing the size of the last column in wxDataViewCtrl
Previously, the last column couldn't be effectively resized at all, as
its size was always automatically set to the remaining width of the
window after subtracting the widths of all the previous columns. Now
this is only done if this remaining width is greater than the width
given to the column by the user or by the program.

Effectively, this means that the user can now drag-resize the column to
increase its size (at the price of showing the horizontal scrollbar).

See #18295.
2018-12-15 14:27:52 +01:00
Vadim Zeitlin
e1185d8bf0 Increment version number to 3.1.3
Done by running misc/scripts/inc_release, manually updating version.bkl,
rebaking and rerunning autoconf.
2018-12-10 19:06:18 +01:00
Maarten Bent
3bab07edcf Fix some build warnings
private field 'm_dwCookie' is not used
'return' will never be executed
result of comparison of unsigned enum expression < 0 is always false
'FlushDC' overrides a member function but is not marked 'override'
potentially uninitialized local variable 'bound' used
2018-11-25 21:29:38 +01:00
Maarten Bent
bcf53d6b96 Fix extra semicolon warnings 2018-11-25 21:29:37 +01:00
Maarten Bent
eb23d4735c Fix unannotated fall-through warnings 2018-11-25 21:29:37 +01:00
Maarten Bent
39ff5b90e5 Replace wxDeprecatedGUIConstants enum values 2018-11-25 21:29:32 +01:00
Artur Wieczorek
f71e8d077f Show read-only and not read-only wxODComboBox and wxComboBox in the sample
Extend the sample to compare disabled read-only and disabled not read-only combo boxes.

See #3383.
2018-11-20 21:11:57 +01:00
Vadim Zeitlin
303fa4b3ef Minor cleanup in the "artprov" sample after the previous commit
Use the standard wxWidgets camelCase naming convention instead of
snake_case and fix some style inconsistencies.

No real changes.
2018-11-18 20:55:09 +01:00
Markus Juergens
cb8b6009d5 Add a size selection choice to the "artprov" sample
This will allow to test support for larger icons when it is added in the
upcoming commits.
2018-11-18 20:49:34 +01:00
Vadim Zeitlin
8fb1152eee Fix error about duplicate PNG image handler in the drawing sample
Add the handler earlier, as creating the handler main frame uses
wxArtProvider::GetBitmap() which can add the PNG handler on some
platforms (e.g. macOS, when using wxTangoArtProvider), so calling
wxImage::AddHandler() again after creating the frame could result in a
debug error message about adding the same handler twice.
2018-11-13 16:11:24 +01:00
Vadim Zeitlin
463deb03c9 Merge branch 'gtk-dpi'
A bunch of improvements for per-monitor DPI support in wxGTK and
wxGraphicsContext more generally.

Closes https://github.com/wxWidgets/wxWidgets/pull/995
2018-11-10 12:15:27 +01:00
Mick Phillips
291a880d0c Synchronize joystick events between all ports
Generate wxJoystickEvent with the same fields under all platforms by
making the Linux and macOS versions follow MSW convention of using
"1 << N" for the changed button.

Add GetButtonOrdinal() accessor which can be used to retrieve just N.

Closes #18233.
2018-11-05 19:27:36 +01:00
Blake Eryx
65827a0572 Remove unnecessary c_str() calls from the samples
Pass wxStrings directly to wxString::Format("%s") and similar
pseudo-vararg functions, there is no need for c_str() there since
wxWidgets 2.9.

Closes https://github.com/wxWidgets/wxWidgets/pull/1009
2018-11-03 22:52:57 +01:00
Blake Eryx
c1a2d2c967 Show using dynamic splash screen contents in the sample
Demonstrate how dynamic information can be shown in the splash screen
overlaying the static bitmap.

Closes https://github.com/wxWidgets/wxWidgets/pull/958
2018-10-31 23:23:31 +01:00
Vadim Zeitlin
43d2b1db0e Simplify and fix layout of the display sample
Get rid of an unnecessary wxPanel and just create wxBookCtrl containing
pages showing information about the displays directly as a child of
wxFrame.
2018-10-29 17:40:14 +01:00
Vadim Zeitlin
5d5654742f Merge branch 'msw-popup'
Reimplement wxPopupWindow using WS_POPUP instead of WS_CHILD window in
wxMSW as the new approach allows using the controls inside the popup
normally, unlike the old one.

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

Closes #18243.
2018-10-27 15:08:22 +02:00
Vadim Zeitlin
67e51e7b6d Show the reason transparent windows can't be used in shaped sample
IsTransparentBackgroundSupported() may return more information about why
exactly are transparent windows not supported, show it if available.
2018-10-24 01:37:44 +02:00
Vadim Zeitlin
56c4191168 Reimplement wxPopupWindow as a WS_POPUP window under MSW
Don't use the child window of the desktop window for popup windows under
MSW, while this worked in simplest cases, it didn't allow having
functional controls inside a wxPopupWindow as e.g. wxTextCtrl didn't
accept input it at all if created as a child of such window.

Instead, switch to using a top-level window, with WS_POPUP style, and
fix the problem with the loss of activation by explicitly pretending to
still be active in the owner window when losing activation to our own
popup (thanks to Barmak Shemirani for providing this solution).

Also use an MSW-specific and much simpler implementation of detecting
when the popup should be dismissed in wxPopupTransientWindow: instead of
capturing mouse or tracking focus, just react to activation loss
directly.

Add a wxTextCtrl to the popup in samples/popup to show that editing it
works now.
2018-10-20 22:50:46 +02:00
Artur Wieczorek
028cfb1ba4 Refresh wxPropertGrid after resetting the status
This is to visualize the effect of the modification.
2018-10-13 23:33:27 +02:00
Artur Wieczorek
a33b364d84 Add tests of retrieving main parent of wxPGProperty
This is to test wxPGProperty::GetMainParent() function.
2018-10-13 23:33:25 +02:00
Vadim Zeitlin
54ef52fbd9 Merge branch 'display-funcs'
Implement all global functions in terms of wxDisplay and add
wxDisplay::GetPPI().

See https://github.com/wxWidgets/wxWidgets/pull/963
2018-10-09 16:31:54 +02:00
Vadim Zeitlin
aafb87b40d Set the column for wxEVT_DATAVIEW_ITEM_ACTIVATED in wxGTK
The column is available in the GTK+ callback, so just pass it along to
avoid gratuitous inconsistency with the generic version.

Also update the sample to show the column value for these events.
2018-10-09 15:21:08 +02:00
Vadim Zeitlin
ded2894b78 Add wxDisplay::GetPPI() to use instead of wxGetDisplayPPI()
While this is not done for all the ports yet, the new API allows
returning different PPI values for different monitors, unlike the old
(and still existing, but implemented in terms of the new one) global
function.
2018-10-08 13:04:38 +02:00
Vadim Zeitlin
24b5e256df Add wxDisplay::GetDepth() and use it for wxDisplayDepth()
Allow getting the depth of any display, not just the primary one, even
though this is not implemented for Unix ports currently.

Mostly do this for consistency with the other display-related functions.
2018-10-07 00:30:12 +02:00
Blake Eryx
4fb39beae1 Remove all wxS() macros from samples
The use of wxS() is an optimization which can be used to avoid an
implicit conversion from narrow to wide strings, but such optimizations
are not really needed in the samples and just make their code less
readable, so remove them.

Closes https://github.com/wxWidgets/wxWidgets/pull/956
2018-10-01 13:55:42 +02:00
Vadim Zeitlin
761f9f74fc Merge branch 'simplify-display'
Centralize all display-related code in wxDisplay class and avoid
duplicating or reimplementing it in wxDisplaySize() and
wxClientDisplayRect() functions.

See https://github.com/wxWidgets/wxWidgets/pull/955
2018-10-01 13:52:07 +02:00
Maarten Bent
7f0d7ef520 Fix several build errors in WXQT
Move declaration of wxOwnerDrawnBase::ms_defaultMargin to correct file.
Do not include headers when wxUSE_UIACTIONSIMULATOR is disabled.
Add guards for wxUSE_DRAG_AND_DROP.
Use a different wxFont constructor in printing sample, which is also available in WXQT.
2018-09-30 17:23:58 +02:00
Maarten Bent
40d57a33de Remove remnants of OS/2 from build system 2018-09-30 17:23:57 +02:00
Vadim Zeitlin
6883cd4b96 Fix harmless variable shadowing warning in the display sample
Use different names to avoid warning C4456 given by MSVC 14.
2018-09-30 15:37:46 +02:00
Vadim Zeitlin
58a1ee1633 Show the result of wxDisplay::IsPrimary() in the sample too
Just add a quick test of this function.
2018-09-30 15:36:40 +02:00
Vadim Zeitlin
1d40b629a2 Remove the unused msw.display.directdraw system option
This should have been part of 16e4586527
which removed the code this option pertained to.

See #12387.
2018-09-30 15:30:53 +02:00
Blake Eryx
b70ed2d8c8 Remove more wxT() macros from samples
Also use wxString instead of wxChar* strings.

Closes https://github.com/wxWidgets/wxWidgets/pull/950
2018-09-29 17:16:12 +02:00
Blake-Eryx
f58ea62596 Remove (most) occurrences of wxT() macro from the samples
Also replace wxChar* with wxString.

Closes https://github.com/wxWidgets/wxWidgets/pull/945
2018-09-23 01:15:08 +02:00
Stefan Csomor
e768046774 fixing iOS builds with new SKDs 2018-09-22 17:30:37 +02:00
Maarten Bent
7c1ab06ea5 Add more wxOVERRIDE 2018-09-22 14:44:07 +02:00
Vadim Zeitlin
455a45f5a8 Always create wxStaticBitmap in the widgets sample
Not creating it when the default image wasn't found resulted in a crash,
so always create wxStaticBitmap using a fallback bitmap if necessary.

Also add a wxCHECK_RET to prevent the crash from happening in a similar
situation in the future.
2018-09-22 14:33:29 +02:00
Vadim Zeitlin
698120c225 Merge branch 'cmake-dialogs-sample' of https://github.com/MaartenBent/wxWidgets
Proper fix for building dialogs sample for CMake.

See https://github.com/wxWidgets/wxWidgets/pull/934
2018-09-17 23:31:55 +02:00
Maarten Bent
d8211f389c Remove OS/2 remnants from bakefile of dialogs sample 2018-09-17 23:30:47 +02:00
Vadim Zeitlin
6401c2e956 Merge branch 'font-fixes'
Complete support for fractional point sizes and font weights other than
light/bold.

Also harmonize wxFont API and implementation among all ports (fixing
compilation of those of them that were broken by recent changes).

See https://github.com/wxWidgets/wxWidgets/pull/919
2018-09-17 22:58:56 +02:00
Vadim Zeitlin
6cbc661179 Merge branch 'grid-corner-label'
Add wxGrid::SetCornerLabelValue().

See https://github.com/wxWidgets/wxWidgets/pull/928
2018-09-17 22:57:05 +02:00
Simon Rozman
770e0bcd16 Improve high DPI support in wxAui
Window initial/minimum/maximum sizes are now treated as logical pixels.

Furthermore, many margins and paddings are now converted using
wxWindow::FromDIP() to allow their growth in accord with screen DPI.
This places buttons on toolbars more apart on high DPI screens providing
space for easier touch operations.

Closes https://github.com/wxWidgets/wxWidgets/pull/933
2018-09-17 22:54:29 +02:00
Vadim Zeitlin
f69dbaa1ae Introduce MSW ARM64 support
This is a preliminary ARM64 platform support for wxWidgets at "it
compiles" stage. This will allow building and testing wxWidgets based
apps for oncoming Windows 10 ARM64.

Requirements:
- Visual Studio 2017 Update 4 or later with Visual C++ compilers and
  libraries for ARM64 component installed

Building:
1. Open command prompt.
2. Change directory to build\msw subfolder.
3. Run "C:\Program Files (x86)\Microsoft Visual
   Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" once.
4. Use `nmake TARGET_CPU=ARM64 ...` to build required flavor of wxWidget
   libraries.

Notes:
1. Building of *.sln/*.vcxproj files does not support ARM64 yet. This
   requires to hardcode Windows SDK to 10.0.15063.0 or later in
   *.vcxproj files, which would render them non-compilable in older
   Visual Studio versions. Microsoft is aware of this issue and is
   planning a fix in the next version of Visual Studio.
2. wxmsw31ud_gl.dll does not build yet. Awaiting Microsoft to deliver
   missing opengl32.lib for ARM64. Please, specify USE_OPENGL=0.

Closes https://github.com/wxWidgets/wxWidgets/pull/923
2018-09-17 22:34:32 +02:00
Vadim Zeitlin
2cc44337c6 Use only wxFont ctor from wxFontInfo in the samples
Follow the documentation advice and prefer to use the ctor taking
wxFontInfo as it makes the code slightly shorter and more readable.
2018-09-17 15:29:42 +02:00
Vadim Zeitlin
f085981601 Add strikethrough support for fonts defined in XRC
Handle this attribute as well as "underlined" for completeness.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
ca164bb4ca Support fractional font sizes and numeric weights in XRC
Change the code to handle them, the XRC sample to test them, the schema
to accept them and the documentation to describe them.
2018-09-17 15:24:42 +02:00
Vadim Zeitlin
468545943a Remove unnecessary line from the font sample
This was mistakenly left over in the commit adding private fonts support
(547e40b114).
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
d002acfec6 Add "Apply" button to the font sample
Live changes don't work correctly in all ports, notably wxQt, which
doesn't seem to generate the events correctly for wxSpinCtrl, so add a
button to apply the changes.

This could be seen as a better UI anyhow.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
cb8dc4d745 Allow changing the values of font properties in the sample
Use new wxFontInfo methods to allow testing setting fractional font
sizes and arbitrary numeric weight values in the sample.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
cfa37fefae Fix initial size of the font sample main window
Don't hard code main frame size in pixels, this is simple but wrong.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
a79bbf7348 Show font properties in controls in the font sample
This is done in preparation for allowing to change these control values,
although for now this is not implemented yet.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
09fdd090fa Exchange the font and test panels in the font sample
No real changes, but it seems to make more sense to show the font
information first and less important text sample below.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
6415bd553f Partially revert "CMake: Fix building and running samples"
This reverts part of 573e887a4c, see
https://github.com/wxWidgets/wxWidgets/pull/666 because it broke the use
of the generic dialogs in the sample under MSW (they were not used any
more, even if they were supposed to) and the explanation in the original
commit message doesn't seem correct: the WXUSINGDLL check is precisely
supposed to check if we're using a static build of wxWidgets (presumably
because of DLL export complications when not using it) and seems to work
as expected.

This allows to test generic dialogs in the sample again under MSW.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
ad9ef5f24d Remove unused variable from the font sample
No real changes.
2018-09-17 15:24:41 +02:00
Maarten Bent
f3ab72ca55 Remove trailing spaces in dialogs sample 2018-09-14 21:33:56 +02:00
Pavel Kalugin
34416d7507 Add corner label orientation toggle to grid sample 2018-09-04 18:20:34 +03:00
Pavel Kalugin
ccc93c0cd9 Add corner label alignment command to grid sample 2018-09-04 17:51:01 +03:00
Pavel Kalugin
e07d27ce78 Add a command to set corner label to grid sample 2018-09-04 15:27:35 +03:00
Vadim Zeitlin
3ffa651a34 Move wxAdv library contents into wxCore
This basically removes the "adv" library, even though it's still
preserved for compatibility with user make/project files referring to
it.

It is done because the distinction between "adv" and "core" was never
really clear (e.g. why wxTreeCtrl was in core but wxTreeListCtrl in
adv?) and it prevented some core classes from using adv ones.
2018-08-27 21:13:04 +02:00
Blake-Eryx
6bd9bd18ec Remove wxT() and _() macros from dialogs sample
Make the code more readable by removing the unnecessary macros.

Closes https://github.com/wxWidgets/wxWidgets/pull/888
2018-08-27 02:14:10 +02:00
Vadim Zeitlin
3b75bce245 Fix annoying assertion failure in the treectrl sample
Don't pass invalid item to wxTreeCtrl::SelectItem(), just don't select
anything if there is no current item.
2018-08-25 22:30:46 +02:00
Vadim Zeitlin
de33f6715d Fix behaviour of menu items for wxTR_NO_LINES in the sample
It was getting wrongly updated because the menu item corresponded to the
absence of the style rather than its presence.

Fix this by inverting the menu item meaning, even if it's not very
natural, it should be good enough for the sample and preferable to
complicating its code.
2018-08-25 22:28:43 +02:00
Paul Cornett
86ab6de0c1 Use clear() instead of assignment to wxEmptyString 2018-08-22 09:45:20 -07:00
Steven Lamerton
b61123cd7d Allow distinguishing user- from script-opened wxWebView windows
Add wxWebViewEvent::GetNavigationAction() returning a value that can be
either wxWEBVIEW_NAV_ACTION_USER for the links opened by the user, or
wxWEBVIEW_NAV_ACTION_OTHER for the other ones (e.g. opened from
JavaScript code on the page).

Closes #15402.
2018-08-19 22:27:34 +02:00
Maarten Bent
ef7d203bf4 Fix building taskbarbutton sample with precompiled headers 2018-08-17 20:00:48 +02:00
approach
09124932eb Add strike-through support to wxDataViewItem attributes
Implement support for this attribute only in the generic version so far,
it will hopefully be implemented for the natives ones in the future.

Also add a new toggle column to the dataview sample to check how it
works: checking the items in this column enables using this attribute
for some other ones.

Closes #18180.
2018-08-14 18:04:31 +02:00
Blake-Eryx
e1a7f56040 Fix spelling and punctuation errors in comments and documentation
Fix several occurrences of misspelling "trivial" as "trival"; use "from"
rather than "than"; add missing articles and commas.

Closes https://github.com/wxWidgets/wxWidgets/pull/874
2018-08-14 17:15:39 +02:00
Vadim Zeitlin
1c9083fd49 Merge branch 'dvc-sort-unset'
Implement wxDataViewColumn::UnsetAsSortKey() for native versions too.

See https://github.com/wxWidgets/wxWidgets/pull/861
2018-07-30 00:09:50 +02:00
Maarten Bent
268f58855b Fix type cast and unused parameter warning in dll/sdk sample 2018-07-29 16:29:36 +02:00
Vadim Zeitlin
a3f6456f55 Test wxDataViewColumn::UnsetAsSortKey() in dataview sample
Add a checkbox to test the behaviour of SetSortOrder() and
UnsetAsSortKey() methods in the sample.
2018-07-28 02:17:15 +02:00
Vadim Zeitlin
1345b38c51 Merge branch 'gtk-datapick-focus'
Fix focus event generation for generic wxDatePickerCtrl and other
wxCompositeWindows.

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

Closes #18120.
2018-07-25 20:15:32 +02:00
Vadim Zeitlin
25a2bae836 Test focus event generation for all pages of the widgets sample
Previously this was done only for wxSearchCtrl, extend this now to all
the widgets in order to be able to check whether the expected events are
generated.
2018-07-25 18:18:18 +02:00
Vadim Zeitlin
ef4494cdca Merge branch 'html-page-break-inside'
Add support for style="page-break-inside:avoid" to wxHTML.

See https://github.com/wxWidgets/wxWidgets/pull/837
2018-07-25 13:54:29 +02:00
Vadim Zeitlin
542124aa95 Fix page-break-inside:avoid to work for nested tags too
The initial version was too naïve and didn't work correctly if the <div>
with this style had nested elements.
2018-07-25 02:23:02 +02:00
Vadim Zeitlin
a024c802b1 Avoid warnings from gtk.h in the widgets sample
Ignore -Wparentheses given by g++ 8 for some GTK+ 3 versions (e.g.
3.22.30 currently in Debian Sid).
2018-07-24 15:27:31 +02:00
Vadim Zeitlin
c482c2cb64 Make wxInfoBar in the dialogs sample more readable
As usual, when changing the background colour, we need to change the
foreground as well, otherwise the text risks becoming unreadable with
some default text colour values -- as was the case under GTK+ 3 with its
default theme.
2018-07-15 20:52:10 +02:00
Vadim Zeitlin
03a13591b9 Add wxDataViewToggleRenderer::ShowAsRadio()
This allows showing radio buttons in wxDataViewCtrl easily and natively.

Notice that this approach, adding an extra function to the existing
renderer class instead of creating some new wxDataViewRadioRenderer (see
https://github.com/wxWidgets/wxWidgets/pull/809), was finally chosen
because it is simpler to implement and, more importantly, because it
will be more natural to generalize if/when we also add a 3-state
check/radio renderer.

Closes https://github.com/wxWidgets/wxWidgets/pull/853
2018-07-11 23:48:14 +02:00
Vadim Zeitlin
f54ac4e243 Merge branch 'searchctrl-improve'
Closes https://github.com/wxWidgets/wxWidgets/pull/851
2018-07-10 14:40:58 +02:00
Vadim Zeitlin
4d4e95849a Fix size of wxSearchCtrl in the widgets sample in high DPI
Add missing FromDIP(), without it the control was too small.
2018-07-09 20:50:22 +02:00
Artur Wieczorek
54c5584c65 Don't set column title if wxPG header is going to be hidden
wxPropertyGridManager::SetColumnTitle() shouldn't be called when we going
to hide the header because it makes the header visible.
2018-07-07 20:29:37 +02:00
Stefan Csomor
2ab430965c Fixing wxGLCanvas under 10.14, preparing for layer based drawing
see https://github.com/wxWidgets/wxWidgets/pull/846 , thanks to dkulp
2018-06-30 16:57:57 +02:00
Vadim Zeitlin
c0be6a38c4 Merge branch 'gtk-entry-hittest'
Implement wxTextCtrl::HitTest() for single line controls in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/826
2018-06-21 16:08:16 +02:00
Vadim Zeitlin
64fc4dc6cd Merge branch 'aui-docview'
Make it possible to easily use AUI classes instead of the standard MDI
docview frames.

Also fix a few old and dirty hacks in AUI code.

See https://github.com/wxWidgets/wxWidgets/pull/808
2018-06-10 14:53:39 +02:00
Vadim Zeitlin
c8f563f269 Merge branch 'master' of https://github.com/mmmaisel/wxWidgets
Make wxRibbonButtonBar buttons more customizable.

See https://github.com/wxWidgets/wxWidgets/pull/762
2018-06-04 23:03:24 +02:00
Vadim Zeitlin
085e4c354a Show HitTest() result on left click in "Text" widgets sample page
Right clicking didn't work under wxGTK where it just showed the context
menu, so use left click handler instead and check whether "Alt" is
pressed.

Also add a note to make this test more discoverable.
2018-06-03 16:36:03 +02:00
Vadim Zeitlin
950b1a9d51 Merge branch 'replace-connect-bind'
Replace almost all occurrences of wxEvtHandler::Connect() with Bind().

See https://github.com/wxWidgets/wxWidgets/pull/820
2018-06-01 18:31:59 +02:00
Tim S
60b7bc037f Replace use of __WXGTK24__ with __WXGTK20__
Corrected the change to WXGTK by using WXGTK20 instead
2018-06-01 08:49:48 -04:00
Tim S
e3a9643d2a Replace use of __WXGTK24__ with __WXGTK__ 2018-05-31 19:30:53 -04:00
Vadim Zeitlin
5f7a6bd15b Replace Connect() with Bind() in all samples and utils too
Still use Connect() in unit tests which were written explicitly for it
and in EventConnector, which can't use Bind() as it uses a variable for
the event type.

No real changes, just use the newer and more convenient function.
2018-05-31 16:19:23 +02:00
Vadim Zeitlin
c0b0562533 Avoid many -Wparentheses warnings from gtk/gtk.h with gcc8
Add wx/gtk/private/wrapgtk.h wrapping gtk/gtk.h in pragmas disabling
these warnings and include it everywhere instead of directly including
gtk/gtk.h.

Also include wx/gtk/private/gtk2-compat.h from this wrapper header as it
was included by 90% of the files including gtk/gtk.h itself and it seems
to be better and simpler to just always include it.
2018-05-21 12:34:04 +02:00
Maarten Bent
c97963fce0 Fix size glitch of WidgetsBookCtrl in widgets sample
The entire control is hidden until the dialog is resized.
This seems to be caused by (recent changes in) the wxPersistentManager.
This is fixed by populating the frame before restoring persistence.
(as is described in docs/doxygen/overviews/persistence.h.)
2018-05-17 20:20:05 +02:00
Maarten Bent
5758832a6e Fix invalid image size in wxBitmapComboBox widgets sample
When the wxBitmapComboBox is empty, GetBitmapSize() returns size -1,-1.
Images can not be scaled to this invalid size. Use the size of the imagelist
instead.
2018-05-17 20:20:05 +02:00
Maarten Bent
e581b72955 Look in multiple paths when searching for resource files of samples
When using an out of source build, the files are not in the default wxWidgets directories.
Also search in the current directory, parent directory and sample sub-directories.

Closes https://trac.wxwidgets.org/ticket/18118
2018-05-17 20:20:04 +02:00
Vadim Zeitlin
c756d18bc4 Allow using AUI-based MDI classes in the docview sample
For testing, allow using wxAuiMDI{Parent,Child}Frame in the sample.

This change also shows that the AUI classes are now sufficiently
compatible with the standard ones for switching to them to be almost
trivial.
2018-05-13 02:45:40 +02:00
Vadim Zeitlin
ff023ef6b3 Don't show docview sample --mdi option in help if it's not supported
No real changes, just avoid describing the "--mdi" option in the help
message if it's not really supported in this library build.
2018-05-13 02:41:59 +02:00
Vadim Zeitlin
ff06e12ceb Remove unused and outdates samples/Info.plist file
This file was added in 4d524cdd0e a long
time ago but doesn't seem to have been ever actually used for anything
and is outdated, e.g. contains LSRequiresCarbon=true, which shouldn't be
used any longer.

Remove the file itself and all references to it.
2018-05-02 16:01:02 +02:00
Tobias Taschner
183ba1cb4c Set NSPrincipalClass to wxNSApplcation for CMake builds too
This setting is important for some functionality provided by
wxNSApplcation and most importantly without the setting all samples
where only shown scaled on high DPI displays.

Notice that it was already present in src/osx/carbon/Info.plist.in which
is used for the samples in autoconf build.

Closes https://github.com/wxWidgets/wxWidgets/pull/743
2018-05-02 15:53:09 +02:00
Maarten Bent
58a7339cb9 Show the mouse wheel axis in the text sample
This helps debugging these events generation.

Closes https://github.com/wxWidgets/wxWidgets/pull/798
2018-05-02 15:38:23 +02:00
PB
f9aeb2669b Fix memory leak in taskbarbutton sample
wxTaskBarButton::RemoveThumbBarButton() removes the button but does not
delete it. In the sample removed buttons must be deleted manually
because they are also removed from m_thumbBarButtons which automatically
deletes the stored buttons in its destructor.

Closes https://github.com/wxWidgets/wxWidgets/pull/778
2018-04-09 12:41:03 +02:00
Vadim Zeitlin
457ba4ace5 Merge branch 'filters-in-archive-sample'
See https://github.com/wxWidgets/wxWidgets/pull/770
2018-04-05 18:21:43 +02:00
Vadim Zeitlin
96f9a12898 Stop resizing widgets sample pages when first showing them
The size of wxBookCtrl pages is determined by wxBookCtrl and can't be
changed, yet the sample tried to do it, making them larger than the
actually available space and cutting them off as the result.

Just stop doing this and simply layout the page using the available
space -- if there is not enough of it, that's too bad, but the user can
always resize the main window in this case.

See #4379.
2018-03-31 01:45:08 +02:00
Vadim Zeitlin
6da3c3c34d Add support for using filter streams in the archive sample
Allow using wxZlib{Input,Output}Stream too, meaning that the sample can
now also work with .gz files, handling them as a degenerate (because
containing only a single file) special case of archives.

The changes here -- which should be viewed ignoring whitespace to be
actually readable -- don't modify the existing code and just add the
possibility to use a wxFilterClassFactory if there is no
wxArchiveClassFactory corresponding to the specified file extension.
2018-03-31 01:35:55 +02:00
Vadim Zeitlin
8de66bc753 Add error checks when copying data in the archive sample
Errors when writing the output data in CopyStreamData() were not
detected.
2018-03-31 01:34:35 +02:00
Vadim Zeitlin
36fe1e0f66 Initialize ArchiveApp members in ctor in the sample
No real changes, but initialize members of ArchiveApp class in its ctor
to avoid leaving them uninitialized.
2018-03-30 22:53:07 +02:00
Vadim Zeitlin
b9c10f215d Use wxScopedPtr<> instead of wxSharedPtr<> in archive sample
There is no need to use wxSharedPtr<> when ownership is not shared, use
simpler and overhead-free wxScopedPtr<> instead.
2018-03-30 22:38:03 +02:00
Vadim Zeitlin
a0cc236678 Fix typo in a message in the archive sample
No real changes.
2018-03-30 22:37:23 +02:00
Vadim Zeitlin
bf30fa7490 Include required headers explicitly in the widgets sample
Don't rely on wx/treebook.h pulling in wx/treectrl.h and wx/textctrl.h,
forward declare or include the headers declaring the classes from these
headers explicitly where needed.
2018-03-24 19:14:52 +01:00
Max Maisel
2be4724d53 Updated ribbon example program
Added Ribbon SetButtonIcon(), SetButtonText(),
SetButtonMinSizeClass() and SetButtonMaxSizeClass() examples.
2018-03-17 18:46:21 +01:00
Vadim Zeitlin
7e8fb1e294 Use border style consistently in the widgets sample
Use GetAttrs().m_defaultFlags everywhere when creating the widgets, it
was done for some but not all of them before, without any apparent
reason.

This should make setting various border styles work (for the widgets
supporting them).
2018-03-17 17:50:56 +01:00
Vadim Zeitlin
0acb119ccb Remove unnecessary empty dtors from the widgets sample
No real changes, just remove completely unnecessary lines and trailing
semicolons after them.
2018-03-17 17:24:07 +01:00
Maarten Bent
b3c25e57bc Fix warning for missing field initializers 2018-03-06 23:43:08 +01:00
Maarten Bent
3b9aeaeb2f More use of wxOVERRIDE 2018-03-06 23:31:01 +01:00
Vadim Zeitlin
2881d9875a Fix recently broken (re-)layout in the listctrl sample
This completes changes of 0873abb836 which
replaced manual layout code with sizers, but broke layout after
recreating the control in the process.

This change notably fixes the control becoming invisible, due to having
the default too small size, in non-report modes.
2018-03-04 22:42:18 +01:00
Tobias Taschner
f3f1819daf Add archive sample
This sample shows usage of wxArchiveStream and wxArchiveFactory.
It also allows for easy testing of wxArchiveStream implementations
outside of the unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/730
2018-02-20 14:39:27 +01:00
Vadim Zeitlin
2ec2837f6d Update version to 3.1.2
Run misc/scripts/inc_release and rebake.
2018-02-20 00:08:01 +01:00
Vadim Zeitlin
1dc1d66fe1 Stop using Fn keys as accelerators in the widgets sample
This prevented them from being used for their usual purposes, e.g. F4
didn't open the combobox dropdown under MSW, which was annoying as it
made testing more difficult.

Just stop using the accelerators, especially as they could be only used
for less than half of pages anyhow.
2018-02-17 14:49:54 +01:00
Vadim Zeitlin
0972dece27 Catch EDITING_{STARTED,DONE} for all pages in dataview sample
This is useful to allow checking that the expected events are sent for
the custom editor in the second page of the sample too, in addition to
the standard ones used in the first page.
2018-02-04 23:43:47 +01:00
Vadim Zeitlin
1e3e5b7253 Send wxEVT_DATAVIEW_ITEM_EDITING_DONE after cancelling too
Previously this event was not sent at all if editing the item was
cancelled, e.g. by pressing Esc.

Do send it now from the generic implementation and update the sample to
show this event.

See #17835.
2018-02-04 22:58:03 +01:00
Vadim Zeitlin
48fb2b42b1 Send wxEVT_DATAVIEW_COLUMN_REORDERED in generic wxDataViewCtrl
Simply translate wxEVT_HEADER_END_REORDER into this event, which was
previously only sent by the macOS version.

GtkTreeView doesn't seem to support column drag-and-drop at all, so this
event is still never generated by wxGTK.

Closes #14297.
2018-02-04 15:45:23 +01:00
Vadim Zeitlin
2600bc34ff Put column images on the right side in generic wxDataViewCtrl
For consistency with wxListCtrl under MSW (which is the only platform
where this change has any effect, as wxHD_BITMAP_ON_RIGHT is only
supported there), put the column images on the right side in
wxDataViewCtrl too.

Closes #13350.
2018-02-04 00:14:31 +01:00
Vadim Zeitlin
0d14dd8fe0 Test disabling wxDataViewCtrl in the dataview sample
Just make it simple to verify whether disabling the control works as
expected.

See #14186.

See #17887.
2018-02-04 00:14:13 +01:00
Vadim Zeitlin
5f8f60107a Allow using wxRendererNative::DrawGauge() for vertical gauges too
It was unexpected that this method could only be used for horizontal
gauges, so make it work for the vertical ones if wxCONTROL_SPECIAL flag
is specified.

Update MSW and generic implementations and the render sample to show a
vertical gauge as well.
2018-02-03 18:46:17 +01:00
Vadim Zeitlin
3284420b09 Add a menu option to use generic renderer in the sample
This makes it easier to compare the native and generic implementations
of the functions shown.
2018-02-03 18:14:12 +01:00
Vadim Zeitlin
359eda1359 Make render sample window bigger initially
It wasn't big enough to show all of its contents.
2018-02-03 18:14:12 +01:00
Vadim Zeitlin
65589e8c68 Remove unneeded wxRendererNative::GetDefault() in render sample
This method is used to illustrate the difference between the default and
the overridden GetHeaderButton() implementations, but doesn't need to be
used for any other methods, that are not overridden in MyRenderer.

No real changes, but just make the code shorter and less confusing.
2018-02-03 18:14:12 +01:00
Vadim Zeitlin
94620f6c59 Use simple wxEVT_SEARCH[_CANCEL] names for wxSearchCtrl events
The old wxEVT_SEARCHCTRL_{SEARCH,CANCEL}_BTN event names were unwieldy
and misleading because both of these events can be generated without
using the buttons, but by pressing Enter or Esc (the latter currently
works under macOS only, but this could change in the future).
2018-01-30 02:03:48 +01:00
Vadim Zeitlin
e5a1931b64 Log wxEVT_TEXT events for wxSearchCtrl in widgets sample
This is useful to check that these events are generated under all
platforms.
2018-01-29 23:14:44 +01:00
Vadim Zeitlin
f079f11736 Log EVT_TEXT_ENTER events for wxSearchCtrl in the widgets sample
This is convenient for checking that the behaviour is consistent among
different platforms.

See #17911.
2018-01-29 19:40:03 +01:00
Vadim Zeitlin
21823bd37a Log focus messages for the search control in the widgets sample
This makes it easier to test various issues related to focus events for
composite controls, such as wxSearchCtrl.
2018-01-29 18:29:34 +01:00
Vadim Zeitlin
4fcc6e15b0 Use all available size for the video in mediaplayer sample
wxMediaCtrl doesn't compute its best size correctly until a video is
available and this resulted in using the best size of (0, 0) for it and
nothing being shown at all on the screen, even after starting to play a
video.

This is almost certainly a problem on its own, as there is some existing
code for updating the best size and redoing the layout of the parent
sizer when a new video is loaded, but for now just make the control
visible in the sample again by always expanding it to fill up all the
available size, as this is the smallest possible fix and this is how it
used to behave before, until 9aaa38c7c8,
which allowed to meaningfully use wxALIGN_CENTER_HORIZONTAL and wxEXPAND
together: until then, this didn't work at all, but the sample still used
wxALIGN_CENTER_HORIZONTAL by mistake, so just remove it now to restore
the original behaviour.

Closes #17917.
2018-01-28 16:35:10 +01:00
Vadim Zeitlin
f063dde4f5 Merge branch 'gtk-dyn-autocomplete'
Implement dynamic wxTextEntry autocompletion for wxGTK.

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

Closes #18061.
2018-01-27 19:28:09 +01:00
Vadim Zeitlin
a14a3de5ce Refactor min autocomplete length handling in widgets sample
Call DoUseCustomAutoComplete() function instead of using an artificial
event.

Also move the menu item in the radio group with the other
autocomplete-related commands as it's exclusive with them.
2018-01-27 01:35:47 +01:00
AliKet
18983cf538 Implement dynamic auto-completion for wxGTK
Make completion using custom wxTextCompleter work in wxGTK too.

Closes #18061.
2018-01-26 23:43:34 +01:00
Vadim Zeitlin
aaabe1cb17 Improve validate sample UI a bit
Provide an accelerator for the menu command which contains all of the
test functionality to make it simpler to test it.

Also use CreateButtonSizer() instead of creating wxStdDialogButtonSizer
manually to make the code shorter and to also ensure that the "OK"
button is correctly set up as the default one, allowing to press "Enter"
in this dialog to accept the entry on any control, which didn't work
before.
2018-01-26 14:39:57 +01:00
Vadim Zeitlin
b1e59a6d60 Add wxFloatingPointValidator::SetFactor()
This allows displaying values in percents (or also currency units and
subunits, for example) without changing the actually stored value.
2018-01-26 14:39:57 +01:00
Robin Dunn
3b22d9a56b Test wxTreeListCtrl::DeleteAllItems() in the sample
Add a menu command to invoke this method for testing.
2018-01-24 17:59:25 +01:00
Vadim Zeitlin
4a37f2dd15 Merge branch 'win_uxtheme_restructure' of https://github.com/TcT2k/wxWidgets
Don't load theme functions dynamically as it's not necessary any longer.

See https://github.com/wxWidgets/wxWidgets/pull/572
2018-01-24 00:24:38 +01:00
Vadim Zeitlin
0d77df8af1 Merge branch 'dvc-update-fix'
See https://github.com/wxWidgets/wxWidgets/pull/674
2018-01-23 15:51:08 +01:00
Vadim Zeitlin
ff1fe53d66 Merge branch 'statbox-any-label'
Add support for using any wxWindow (and not just the equivalent of
wxStaticText) as wxStaticBox label.

See https://github.com/wxWidgets/wxWidgets/pull/650
2018-01-23 15:45:46 +01:00
Vadim Zeitlin
3cbfe25fa6 Merge branch 'mfc'
A bunch of improvements for applications using both wxWidgets and MFC.
2018-01-23 15:39:00 +01:00
Tobias Taschner
ddceaab001
Remove MSW wxUxThemeEngine class
This undocumented "private" class was used for various windows UxTheme
functions which are available since WinXP. As wxWidgets 3.1 is XP+ it
does not make sense anymore to load the theme functions dynamically.
2018-01-22 00:51:11 +01:00
Tobias Taschner
d6b88ca399 Add footer text and icon to wxRichMessageDialog
The underlying Windows TaskDialog supports adding an additional footer
to the message dialog. This makes the native functionality available
and implements it in the generic version.

See https://github.com/wxWidgets/wxWidgets/pull/573
2018-01-20 16:53:13 +01:00
Vadim Zeitlin
0a966eb145 Merge branch 'xrc-text-escape'
Miscellaneous improvements for handling mnemonics in XRC.

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

Closes #18033.
2018-01-18 00:23:18 +01:00
Vadim Zeitlin
77c7c80696 Update modified items in generic wxDataViewCtrl immediately
Recent optimizations avoiding resort on item change (see
https://github.com/wxWidgets/wxWidgets/pull/642) have also optimized
away refreshing the modified item, which was done implicitly, as a side
effect of resorting, before, so the changes were not reflected on
display immediately any longer.

Fix this by simply refreshing the item explicitly and also add a way to
test for the correct behaviour in the sample.
2018-01-16 13:12:43 +01:00
John Roberts
52e71680ea Fix grid sample OnGridRender()
Destroy current "frameRender" when creating a new render.

Make bitmap and frame size equal.

Closes https://github.com/wxWidgets/wxWidgets/pull/673
2018-01-15 13:24:18 +01:00
Vadim Zeitlin
ae4dd59719 Merge branch 'cmake-fixes' of https://github.com/MaartenBent/wxWidgets
Miscellaneous improvements to CMake build system.

See https://github.com/wxWidgets/wxWidgets/pull/666
2018-01-14 03:10:13 +01:00
Maarten Bent
573e887a4c CMake: Fix building and running samples
Add missing header, source and resource files.
Add missing data files (font), remove deleted data files (help).
Fix specifying xrc sample data files.
Remove WXUSINGDLL check from dialogs sample, it is not defined in e.g. static gui build.
2018-01-11 22:09:37 +01:00
Vadim Zeitlin
bc2c9ce2a3 Fix misspelling of a label in XRC docs and example
It was spelt in 2 different ways, neither of which was actually correct.
2018-01-11 01:19:16 +01:00
Vadim Zeitlin
6bd8cb964b Really remove removed files from the help sample
This does what 1c2e58cd85 tried to do
manually correctly, by updating bakefile and rebaking, and so finally
completing the changes of 961a1c2b39.

See #17962.
2018-01-10 23:44:08 +01:00
Tobias Taschner
c8b6ca308b Update year in copyright notices to 2018
Use 2018 instead of 2017 (mostly in version info files).

See https://github.com/wxWidgets/wxWidgets/pull/661
2018-01-05 19:51:47 +01:00
Vadim Zeitlin
d332ccfd6f Add support for wxStaticBoxSizer "windowlabel" property to XRC
Allow specifying arbitrary windows as labels for the static boxes
created from XRC.

Note that wxStaticBox XRC handler itself wasn't updated to support this,
as this handler seems to be quite useless because it's impossible to
define any box children with it, so only wxStaticBoxSizer XRC handler
really matters, anyhow.
2018-01-04 22:58:50 +01:00
Vadim Zeitlin
f32edbe1fc Test wxTE_PROCESS_TAB support on text page of widgets sample too
Do it for completeness and symmetry with the already existing checkbox
enabling wxTE_PROCESS_ENTER.
2017-12-25 18:45:06 +01:00
New Pagodi
a636141b56 Use consistent letter case in log message strings 2017-12-24 18:25:26 -06:00
New Pagodi
0fa033df61 Remove newline characters from log message strings 2017-12-24 18:24:45 -06:00
New Pagodi
d3fd17db04 Use wxAutoBufferedPaintDC to reduce flicker with wxMSW 2017-12-24 18:24:05 -06:00
New Pagodi
ca1b76ba49 Set a minimum size for MyGestureFrame 2017-12-24 18:23:13 -06:00
Vadim Zeitlin
4a4d164319 Keep attributes after recreating static controls in widgets sample
Preserve the colours, font etc after recreating the widgets to
facilitate testing.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
67225fb07e Remove borders from wxStaticBoxSizer items in the widgets sample
This allows to see better whether the borders returned by
wxStaticBox::GetBordersForSizer() are correct.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
7c849276f8 Add support for using arbitrary windows as wxStaticBox labels
This commit implements the new feature in wxGTK and updates the sample
and the documentation.
2017-12-24 22:38:10 +01:00
Paul Cornett
49db2dc315 Add wxART_CLOSE to sample 2017-12-14 20:34:20 -08:00
Vadim Zeitlin
15d22aed82 Merge branch 'cmake'
Closes https://github.com/wxWidgets/wxWidgets/pull/330
2017-12-15 00:33:07 +01:00
Jouk
47c0aed322 Add samples/event/gestures.cpp for compilation on OpenVMS 2017-12-14 08:59:26 +01:00
Rafael Kitover
21776b16f5 regen bakefile/autoconf files based on 3559d83bc4
Run `bakefile_gen` and `sh autogen.sh` to regenerate all bakefile and
autoconf generated files with GTK+4 support from 3559d83bc4.
2017-12-12 08:48:36 -08:00
Vadim Zeitlin
acf53800fc Extract reusable part of the MFC sample in a header
Allow reusing this functionality from outside the library, it can he
useful if an MFC window needs to be embedded into a wx application (or
vice versa).

Also use a better wxEntryStart() overload as a side effect, this should,
in particular, fix the problem with command line arguments processing in
mixed MFC/wx applications pointed out in a comment in the sample
previously.
2017-12-11 21:03:17 +01:00
Vadim Zeitlin
c66c9c5ae6 Merge branch 'build_cmake' of https://github.com/TcT2k/wxWidgets
Add CMake-based build system.

Merge the original branch without any changes except for resolving the
conflict due to moving the contents of .travis.yml to a separate file by
propagating the changes done in this file since then to the new script
and rerunning ./build/update-setup-h and ./build/cmake/update_files.py
to update the file lists changed in the meanwhile.

Closes https://github.com/wxWidgets/wxWidgets/pull/330
2017-12-09 15:09:47 +01:00
Vadim Zeitlin
3e0adbf541 Merge branch 'gesture-events'
Integrate GSoC 2017 work by Prashant Kumar implementing support for
gesture events.

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

Closes https://github.com/wxWidgets/wxWidgets/pull/565
2017-12-02 18:46:53 +01:00
Vadim Zeitlin
9655ca9e68 Close the gestures frame too in the event sample
Make "Exit" menu item really exit the sample again instead of just
closing the main window, but possibly leaving the gestures testing
window still open and thus not really exiting the program.

Also avoid creating more than one gesture window, use the existing one
if we had already opened it.
2017-11-30 21:40:24 +01:00
Jouk
ba58172987 change max to max_ to avoid %CXX-E-AMBIGUOUSNAME, "max" is ambiguous on OpenVMS 2017-11-27 09:00:29 +01:00
Maarten Bent
a96171def4 Fix unused variable and parameter warnings in samples
These variables are only used in debug builds, causing warnings in release builds.
2017-11-25 17:52:08 +01:00
Maarten Bent
afc02a34ee More use of wxFALLTHROUGH in MSW code and samples 2017-11-25 17:52:08 +01:00
Maarten Bent
cbf13e68a2 Replace deprecated std::auto_ptr with wxScopedPtr 2017-11-25 17:00:18 +01:00
Vadim Zeitlin
778340a286 Merge branch 'private-fonts'
Add support for using application-private fonts.

Closes #13568.

Closes https://github.com/wxWidgets/wxWidgets/pull/591
2017-11-24 22:58:09 +01:00
Vadim Zeitlin
b040dab0ca Add wxUSE_PRIVATE_FONTS and drop wxHAS_PRIVATE_FONTS
Handle this feature as all the other ones and provide a configure switch
and a setup.h option to disable it if necessary, as it may be desirable
to do it, especially under Linux, to avoid extra dependency on pangoft2
if this functionality is unnecessary.
2017-11-24 22:56:17 +01:00
Vadim Zeitlin
5f5c5b8f29 Remove hard TAB from event sample bakefile
No real changes.
2017-11-22 03:05:03 +01:00
Vadim Zeitlin
7535854ec4 Embed the image into the event sample
Don't load it from the image sample directory, this doesn't necessarily
work under Unix if the image sample hadn't been built.

Just embed an XPM image directly into the sample, this is good enough
for demonstration purposes.
2017-11-22 03:05:03 +01:00
Vadim Zeitlin
842dd1cfd9 Add wxWindow::EnableTouchEvents()
Don't request touch event generation for all windows by default, this
has an inherent overhead and is not needed for 99% of the application
windows, so require calling EnableTouchEvents() explicitly to do it
instead.

Note that this requires properly initializing gesture recognizers in
wxOSX now that they're not always allocated, otherwise releasing them
when destroying the window would crash.
2017-11-22 02:24:24 +01:00
Vadim Zeitlin
bb2887930f Use wxPoint instead of (x,y) pair in wxPanGestureEvent
Using higher level objects makes the code generating and using this
event shorter and more clear.
2017-11-21 17:45:34 +01:00
prashantkn94
261b04b5a3 Merge multi-touch gestures event branch
This is a squashed commit of the SOC2017_GESTURES branch from
https://github.com/prashantkn94/wxWidgets.git

Closes https://github.com/wxWidgets/wxWidgets/pull/551
2017-11-17 18:06:06 +01:00
Vadim Zeitlin
317470a39a Use "max" instead of 100 in the progress dialog sample code
No real changes, just don't hardcode 100 as we have a symbolic constant
for it here already.
2017-11-16 01:35:52 +01:00
Vadim Zeitlin
814a674531 Speed up the sample progress dialogs in the sample
Just make them finish faster, it's too boring to wait for them to do it
when testing when they take so long.
2017-11-16 01:35:50 +01:00
Vadim Zeitlin
3b4a71c4dc Allow testing wxGenericProgressDialog in the dialogs sample too
Add the possibility to test the generic implementation of the class when
we use the native one by default, this is useful to allow comparing the
behaviour of the two classes.
2017-11-16 01:35:49 +01:00
Vadim Zeitlin
0473d14ef1 Make wxProgressDialog::Fit() work in native MSW version
This method is supposed to adjust the dialog size to its contents and
while the dialog increases automatically when using native
implementation under MSW, it doesn't shrink back on its own and so it's
still useful to allow Fit() to do it.

Update the sample to test Fit() too.
2017-11-16 01:35:49 +01:00
Vadim Zeitlin
0736bdfb28 Prevent constant size changes in native MSW wxProgressDialog
MSW implementation of wxProgressDialog adjusted the dialog size to the
size of the message shown in it on each update, resulting in visually
unpleasant constant jumping around (this is the same problem that we
used to have in wxGenericProgressDialog long time ago, see #10624).

Minimize this by using TDM_UPDATE_ELEMENT_TEXT instead of
TDM_SET_ELEMENT_TEXT for changing the element text. This still increases
the dialog size if the new element text is longer than the old value,
but at least doesn't shrink it back if it is shorter, which is already
quite an improvement.

Notice that this change requires using TDF_EXPAND_FOOTER_AREA style, as
otherwise the expanded information can't be updated without a re-layout.
But this doesn't seem to be a big loss and it's not really clear why did
we explicitly clear this flag before anyhow.

Update the dialogs sample to make it easy to test for this behaviour and
the documentation to mention MSW version peculiarities.
2017-11-16 01:35:48 +01:00
Paul Cornett
21620da3e5 Move GTK3 wxNO_BORDER handling to wxControl
So wxNO_BORDER works with other controls, such as wxBitmapButton.
Also use GTK prefix on ApplyCssStyle(), and add an overload that
creates the GtkCssProvider.
2017-11-15 10:51:38 -08:00
Vadim Zeitlin
d3b033f432 Allow webview sample to build without wxSTC
There doesn't seem to be any special reason to use wxStyledTextControl
in this sample and doing it unconditionally breaks the build with
--disable-stc, so use wxTextCtrl instead in this case.

Closes #17998.
2017-11-14 00:09:08 +01:00
Vadim Zeitlin
283f5a4d56 Remove useless wxFont::ActivatePrivateFonts()
Just "activate" the font immediately when adding it using
AddPrivateFont(), nothing seems to be gained from having two functions
and it just makes things more complicated both when implementing and
when using the API.
2017-11-13 22:29:30 +01:00
Vadim Zeitlin
5d134711a1 Add BUNDLE_FONT_RESOURCES and use it in font sample
Allow copying font files to the Fonts subdirectory of the app bundle,
private fonts can only be loaded from there under macOS currently.
2017-11-13 22:29:29 +01:00
Vadim Zeitlin
4145a30e06 Report errors if using private font fails in the font sample
Give more information instead of just silently not showing the
corresponding menu item.
2017-11-13 22:29:28 +01:00
Arthur Norman
547e40b114 Add support for loading fonts from files.
wxFont::AddPrivateFont() can now be used to load a font from a file for the
applications private use. Update the font sample to show this.

Closes #13568.
2017-11-13 22:29:28 +01:00
Vadim Zeitlin
b130595975 Remove accidental global variable from the font sample
This variable was never used and appears to have been created
accidentally, so just remove it and avoid variable shadowing warnings
from MSVS 2015 when building the sample.
2017-11-07 18:28:54 +01:00
Tim S
1c2e58cd85 Remove cp commands copying removed files from help sample
Just remove the commands copying files that were removed in
961a1c2b39 themselves too.

See #17962.
2017-11-05 16:47:25 +01:00
Vadim Zeitlin
7e0b6d4d81 Merge branch 'webview-js-retval'
Integrate GSoC 2017 work by Jose Lorenzo on allowing returning values
from JavaScript code via wxWebView::RunScript().
2017-11-04 16:07:51 +01:00
Vadim Zeitlin
e70fc11ef1 Replace CppUnit with Catch for unit tests
Drop the legacy CppUnit testing framework used for the unit tests.
Replacing it with Catch has the advantage of not requiring CppUnit
libraries to be installed on the system in order to be able to run
tests (Catch is header-only and a copy of it is now included in the
main repository itself) and, in the future, of being able to write
the tests in a much more natural way.

For now, however, avoid changing the existing tests code as much as
[reasonably] possible to avoid introducing bugs in them and provide
the CppUnit compatibility macros in the new wx/catch_cppunit.h header
which allow to preserve the 99% of the existing code unchanged. Some
of the required changes are:

 - Decompose asserts using "a && b" conditions into multiple asserts
   checking "a" and "b" independently. This would have been better
   even with CppUnit (to know which part of condition exactly failed)
   and is required with Catch.

 - Use extra parentheses around such conditions when they can't be
   easily decomposed in the arrays test, due to the use of macros.
   This is not ideal from the point of view of messages given when
   the tests fail but will do for now.

 - Rewrite asserts using "a || b" as a combination of condition
   checks and assert macros. Again, this is better anyhow, and is
   required with Catch. Incidentally, this allowed to fix a bug in
   the "exec" unit test which didn't leave enough time for the new
   process to be launched before trying to kill it.

 - Remove multiple CPPUNIT_TEST_SUITE_NAMED_REGISTRATION() macros,
   our emulation of this macro can be used only once.

 - Provide string conversions using Catch-specific StringMaker for
   a couple of types.

 - Replace custom wxImage comparison with a Catch-specific matcher
   class.

 - Remove most of test running logic from test.cpp, in particular don't
   parse command line ourselves any longer but use Catch built-in
   command line parser. This is a source of a minor regression:
   previously, both "Foo" and "FooTestCase" could be used as the name of
   the test to run, but now only the latter is accepted.
2017-11-02 01:53:16 +01:00
Vadim Zeitlin
46fa106b10 Demonstrate using wxWebView::SetPage() in the sample
This allows to verify, at least interactively, that the expected events
are generated when using SetPage() too, and not only LoadPage().
2017-10-22 23:38:12 +02:00