Commit Graph

5927 Commits

Author SHA1 Message Date
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