"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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
Allow using Ctrl-P to bring up the "Print" dialog instead of having to
select it from the menu every time. And also add an accelerator for the
"Page Setup" menu command.
And specify both the new accelerators and the existing one for "Print
preview" command using the menu items labels instead of calling
SetAcceleratorTable() explicitly, as there doesn't seem to be any reason
to do it.
Finally, slightly improve the help messages for these menu items.
While the user could select to print only the selection in the dialog,
there was no way for the program to specify which pages were selected,
making this choice impossible to handle.
Add new IsPageSelected() function which is now used to query which pages
are selected and should actually be printed.
Update the printing sample to show how this function is used.
Add new class wxWebViewWindowInfo:
This new class returned by wxWebViewEvent::GetTargetWindowInfo() allows
to get information about the window that is about to be opened and to
set the window that will be used to display the content.