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.
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.
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.
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.
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.
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
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
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
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.
Add guards for wxCommandLinkButton.
Move CheckBoxes outside wxHAS_BITMAPTOGGLEBUTTON guard.
Remove wxHAS_ANY_BUTTON check, this is always defined with wxUSE_TOGGLEBTN.
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.
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.
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
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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
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/986Closes#18243.
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.
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.
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.
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.
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
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
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.
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.
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
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
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
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.)
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.
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
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.
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.
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
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
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.
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.
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.
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).
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.
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
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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
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.
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.
This does what 1c2e58cd85 tried to do
manually correctly, by updating bakefile and rebaking, and so finally
completing the changes of 961a1c2b39.
See #17962.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
So wxNO_BORDER works with other controls, such as wxBitmapButton.
Also use GTK prefix on ApplyCssStyle(), and add an overload that
creates the GtkCssProvider.
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.
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.
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.
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.
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.