Commit graph

6878 commits

Author SHA1 Message Date
Vadim Zeitlin
d69ddb8656 Revert all recent wxUSE_DPI_AWARE_MANIFEST-related changes
This reverts 5d630caabd (Make it enough to predefine only
wxUSE_DPI_AWARE_MANIFEST, 2023-08-23) and all the commits which tried to
fix the breakage caused by it.

While the original change had merit, it seems to be too difficult to fix
all our build systems to avoid embedding manifest when defining this in
the code, like samples/sample.rc does, so revert this change for now.

Maybe it can be reintroduced in the future after switching to some other
build system.
2023-08-25 00:03:47 +02:00
Maarten Bent
026528f861
Fix CMake build issues after enabling manifest from rc file 2023-08-24 16:26:47 +02:00
Vadim Zeitlin
f6255e456b Don't embed default manifest in minimal samples MSVC project
This clashes with the wx manifest which is getting included now after
the changes of 5d630caabd (Make it enough to predefine only
wxUSE_DPI_AWARE_MANIFEST, 2023-08-23).
2023-08-24 03:28:12 +02:00
PB
61bae154d3 Improve samples appearance in dark mode
- caret: Use the system color for window background instead of
  hard-coded white.

- image: Use hard-coded black for the text drawing since all other
  drawings on the image canvas use hard-coded colours too. The default
  text colour was barely readable in dark mode.

- joytest: Use wxCYAN_PEN instead of wxBLACK_PEN to ensure the line is
  visible both in light and dark colour system mode.

- ownerdrw: Use such background colour that there is good contrast
  between text and background both in light and dark colour system mode.

- popup: Use such background colour for the pop up so that there is a
  good contrast between text and background both in light and dark
  colour system mode.

Closes #23773.
2023-08-24 02:22:19 +02:00
PB
9536583c0f Improve the combo sample
In the dialog, create the controls put in the static box sizer
with the sizer's static box as the parent instead of the dialog.

Improve appearance of custom drawn items in dark mode.

Closes #23765.
2023-08-23 23:08:52 +02:00
Vadim Zeitlin
ec4777bbbf Rebake after the previous commit
This just separates the automatically-generated changes from the manual
ones in the parent commit.
2023-07-29 18:13:29 +02:00
Vadim Zeitlin
b6ea233845 Fix missing "net" library in webrequest makefile.unx
"base" library must always come last in the samples bakefiles as the
list of wx libraries to link with is generated when processing it, so
putting the "net" library after it had no effect.

See #23723.
2023-07-21 20:37:00 +02:00
Vadim Zeitlin
626f781840 Link penguin OpenGL sample with GLU too when building out of tree
This sample is the only one to use a GLU function too.

It would probably be better to drop GLU dependency entirely, but until
this is done (see #23721), do link with it.

This commit is best viewed ignoring whitespace-only changes.
2023-07-20 15:14:10 +02:00
Vadim Zeitlin
0ab31edc17 Use flags required for using GTK in widgets sample
As we use GTK directly in this sample, we need to use the appropriate
compiler and link flags, so add them depending on the port in the
makefile.
2023-07-11 13:40:23 +02:00
Vadim Zeitlin
2e22666db8 Compile Cocoa control example in Unix "widgets" sample makefile
Previously this was never done, as we couldn't determine if we were
using Cocoa or not at generation time, but we can determine it in the
makefile itself.
2023-07-11 13:40:21 +02:00
Vadim Zeitlin
033dfd2d68 Don't use GUI settings for "archive" sample
This samples used "wx_append" in its bakefile, but should be using
"wx_append_base", as it's a console application.

This fixes its build with makefile.unx, as wxUSE_GUI wasn't properly
defined as 0 before.
2023-07-11 01:59:19 +02:00
Vadim Zeitlin
db785155aa Link OpenGL samples with GL library under Unix
This is not needed when building as part of the build tree, as it's
already part of EXTRALIBS_OPENGL then, but is required when building the
samples against installed libraries.

This commit is best viewed ignoring whitespace-only changes.
2023-07-10 19:47:14 +02:00
Vadim Zeitlin
121631514c Fix building non-GUI samples out of tree
Define wxUSE_GUI=0 for them.
2023-07-10 19:37:21 +02:00
ollydbg
25ff038c80 Remove unnecessary variable in dataview sample
No real changes, just simplify the code.

Closes #23687.
2023-07-08 01:28:00 +01:00
Vadim Zeitlin
e802eaa44d Suppress a warning for g_object_ref_sink() use in widgets sample
The glib macro always triggers this warning when -Wextra is on, so we
have no choice but to suppress it.
2023-07-04 02:19:14 +02:00
Vadim Zeitlin
4040e35f41 Use wxEVENT_HANDLER_CAST() in socket sample
This macro avoids a -Wcast-function-type from gcc 8+.
2023-07-04 02:19:07 +02:00
Vadim Zeitlin
d5ef9d4387 Add wxGenericAboutDialog::GetCustomControlParent()
This function should be used to get the parent for the custom controls
instead of relying on them being reparented under it by the code added
in the last commit.

Change the type of m_contents to be wxWindow and not wxPanel as it
doesn't really matter, but wxPanel is not fully declared in this header
while wxWindow is.
2023-06-20 19:19:49 +02:00
Bill Su
6ab144f9bf samples/mfc: disable composition to allow wxClientDC to work 2023-06-11 01:56:21 -04:00
Bill Su
6b1683757f samples/mfc: building with UNICODE requires wide strings 2023-06-11 01:56:21 -04:00
Bill Su
d970c8eeae samples/mfc: needs #define UNICODE
The header-order workaround for WINVER should also be used for
UNICODE and _UNICODE
2023-06-11 01:56:21 -04:00
Vadim Zeitlin
865def904b Merge branch 'html-dark-mode'
Fixes for wxHtmlWindow in dark mode.

See #23588.
2023-06-02 19:15:45 +02:00
PB
885c87d865 Fix storing DXF entities in penguin sample
The code in b76ebc6 switched from wxList to std::vector but the changes
did not account that we must store the pointers to derived classes in
the entity list, not just the struct they derive from.

Closes #23582.
2023-06-02 19:11:11 +02:00
Vadim Zeitlin
be4ec7b93d Fix default colours used by wxHtmlWindow in dark mode
Don't hardcode white background in wxHtmlWindow, but use
wxSYS_COLOUR_WINDOW, as was already done in wxHtmlWinParser in case when
wxHtmlWindow was not used at all.

Also use wxSYS_COLOUR_WINDOWTEXT for the default foreground and
light/dark-mode dependent link colour instead of hardcoded blue. As a
side effect, this uses a more appropriate colour for the links in the
light mode as well.

Add a link to the lists test page in the HTML test sample to allow
testing the links appearance easily (links present in the other pages of
this sample use fixed colours specified in HTML itself).
2023-06-01 17:00:14 +01:00
Vadim Zeitlin
f2f2868de5 Add support for dark mode colours to XRC
Allow specifying a different colour to use in the dark mode in XRC
colour properties.

Closes #23571.
2023-05-27 21:51:51 +02:00
Ivan Sorokin
8a01942f1a Add WXK_NUMPAD_CENTER to refer to numpad "5" in portable code
This key produces events with different key codes in wxMSW (WXK_CLEAR)
and the other ports (WXK_NUMPAD_BEGIN), so add a new constant to allow
to refer to it under the same name everywhere.

Also generate a key event for it in wxOSX where it previously wasn't
generated at all.

Closes #23478.

Closes #23491.
2023-05-06 21:57:47 +01:00
Vadim Zeitlin
cd65c312d3 Merge branch 'use-std-in-samples'
Use standard containers in samples.

See #23490.
2023-04-28 15:32:34 +02:00
Vadim Zeitlin
9257d36af6 Stop using legacy wxSTD macro in the library code
Just use "std::" directly instead.

No real changes.
2023-04-28 15:26:46 +02:00
Vadim Zeitlin
8f4c9f41a4 Use std::map<> instead of wxHashMap in webview sample
No real changes, just use the standard class.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
ac854d3718 Use std::vector<> instead of wxArray in widgets sample
No real changes, just use the standard container instead of macro-based
array.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
58168736a0 Use std::vector<> instead of wxArray in regtest sample
No real changes, just use the standard container instead of macro-based
array.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
20e521348b Use std::vector<> instead of wxArray in exec sample
No real changes, just use the standard containers instead of macro-based
arrays.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
d161905856 Remove unnecessary includes of wx/dynarray.h from the samples
No changes at all, just prune the unnecessary header.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
b9787c6754 Use std::vector<> instead of wxArray in thread sample
No real changes, just use the standard container instead of macro-based
array.
2023-04-24 22:47:18 +01:00
Vadim Zeitlin
ae13d70ddc Merge branch 'use-std-hash'
Use std::unordered_foo instead of wx hash maps.

See #23462.
2023-04-18 14:38:12 +02:00
mcorino
3849111100 Fix wxRibbonToolBar::GetToolByPos() and DeleteToolByPos()
These functions didn't correctly account for the indices beyond the
first group.

Fix this and add tests for these functions to the sample.

See #23458.

Closes #23457.
2023-04-18 14:37:04 +02:00
Vadim Zeitlin
f5920de681 Use standard containers in dataview sample
Update the sample to use std::vector<> and std::unordered_map<> for
storing the model data, this should be much more useful for the people
trying to write their own model.

Also use std::unique_ptr<> to avoid manual memory management.
2023-04-18 00:54:12 +02:00
Vadim Zeitlin
9935a29c7f Stop using "NULL" in the minimal sample
This should have been part of 4f4c5fcfdf (Use nullptr instead of NULL in
the code and documentation, 2022-10-16).
2023-04-17 18:36:33 +02:00
Vadim Zeitlin
83773cec9a Merge branch 'SampleIDs' of https://github.com/Blake-Madden/wxWidgets
Use wxID_HIGHEST instead of hard-coded numbers in samples.

See #23456.
2023-04-17 17:03:49 +02:00
Vadim Zeitlin
7824391f64 Merge branch 'use-std-containers'
Remove avoidable uses of legacy container classes by replacing them with
the standard containers.

See #23440.
2023-04-17 17:02:27 +02:00
Blake-Madden
62bb66fc3a
Update toolbar.cpp 2023-04-17 06:36:10 -04:00
Blake-Madden
d75cb381b7
Update xti.cpp 2023-04-17 06:35:30 -04:00
Vadim Zeitlin
d65eed50fa Replace some occurrences of wxUSE_STL with wxUSE_STD_CONTAINERS
The latter option will remain, while the former one won't be used at all
any longer soon, so prefer using the latter whenever possible.
2023-04-15 15:14:41 +01:00
Vadim Zeitlin
b76ebc61d9 Stop using wxList in OpenGL penguin sample
Use std::vector instead, there is no need for linked lists here.
2023-04-12 18:09:48 +01:00
Vadim Zeitlin
d4f592c2a4 Stop using object array for wxGridCellCoordsArray
This type is part of the public API, so it can't be just replaced by a
std::vector<>, but it can at least be replaced by wxBaseArray<> which
inherits from std::vector<>.

Also accept just a vector, unimaginatively called wxGridCellCoordsVector
in the code, on input, as this is backwards-compatible with passing in a
wxGridCellCoordsArray.

Finally, simplify the code a bit by using range-for loop.

No real changes.
2023-04-12 18:09:47 +01:00
PB
02cba46643 Fix memory leak in the art provider sample
The list client data must be destroyed not only when closing the
resource browser dialog (see 754f75c1cd (Fix memory leaks in artprov
sample, 2022-01-28) but also whenever the art client is changed.

Closes #23417.

Closes #23418.
2023-04-04 15:29:37 +02:00
Vadim Zeitlin
13ebaee247 Stop using enum for integer constants in image sample
This always wasn't the best and started to result in CI failures now as
recent versions of gcc (e.g. 11.3 in Ubuntu 2.2.04) started giving
-Wdeprecated-enum-float-conversion when using REAL_SIZE in the
expressions.
2023-03-30 21:18:02 +02:00
Vadim Zeitlin
e187667e6b Merge branch 'msw-print-dialog-pages'
Add support for printing "selection" and "current page" in wxMSW and
printing code cleanup.

See #23338, #23372.
2023-03-29 12:20:38 +02:00
Stefan Ziegler
d75956d3e6 Add support for printing only the current page
Add wxPrintDialogData::EnableCurrentPage() and implement support for it
under MSW, where it enables selecting the "Current page" radio button in
the pages selection area of the native dialog.

Update the sample to show the new function.
2023-03-29 01:15:06 +02:00
Tobias Taschner
e15a1ac18e
Add wxWebViewWindowFeatures and event
This replaces the previously implemented wxWebViewWindowInfo.

It explicitly breaks the previous API to enable WebKitGTK
integration and to make the usage in application code less error prone.

A new event wxEVT_WEBVIEW_NEWWINDOW_FEATURES is added to allow
access to the window features and the child web view.
2023-03-24 15:10:21 +01:00
Blake Madden
11358d7dcc Don't expose internal strings to translation in samples
Remove _() around string which it doesn't make sense to translate in the
sockets sample.

This doesn't actually change anything as this sample doesn't use
translations in any case, but still show a good example.

Closes #23362.
2023-03-22 18:26:05 +01:00