The root wxPGProperty is not designed to be deleted so we should look
for a property to delete in the collection of its child properties.
Closes#18539.
This is always 0 for any still supported compiler, so remove the option
and configure checks for it.
Still define it as 0 for compatibility, just in case it's used outside
of the library.
To preserve layout, old wxComboBox should be replaced with the new one in the same location in the sizer. So we need to create a new combo box first, put in the sizer and only after that the old combo box can be deleted.
* Adapt xcodeproj for iPhone to generic imaglist.cpp
* Fix the installation error in the iPhone minimal sample
Fix "Failed to install the requested application" error.
Cast the dialog pointer to wxFileDialogBase to avoid failures when using
wxGenericFileDialog, which inherits from wxFileDialogBase, but not from
wxFileDialog itself.
Closes#18506.
Add wxGrid::DisableHidingColumns() method which can be used to prevent
wxHeaderCtrl from allowing the user to hide columns interactively, which
is something it allows to do by default, unlike the "built-in" wxGrid
header.
Also add EnableHidingColumns() and CanHideColumns() for consistency with
the other similar methods.
Closes https://github.com/wxWidgets/wxWidgets/pull/1554
This is useful to investigate inconsistencies in its behaviour between
the generic and the native GTK versions that can't be easily checked in
the automatic unit tests.
This didn't work any more since the changes done in the branch merged by
fb2c17c193 as using wxTE_PROCESS_ENTER
without actually handling the resulting event doesn't prevent Enter from
activating the default button any longer.
It's generally wxWidgets policy not to include platform-specific headers from our own
to avoid namespace pollution issues, in this case with names like "None" and "Window".
Update the documentation to reflect change to the GetMenu event
working for all 3 menu events. Also update the sample to give the
menu for the highlight event.
Draw the same shape in wxDC::DrawCheckMark() under all platforms and
provide wxRenderer::DrawCheckMark() for drawing the platform-specific
shape.
Also fix wxGCDC::DrawPoint() to use the default one point wide pen.
See https://github.com/wxWidgets/wxWidgets/pull/1471
Current wxPG_FILE_DIALOG_TITLE and wxPG_DIR_DIALOG_MESSAGE attributes can be used to customize editor dialog titles only for wxFileProperty and wxDirProperty, respectively. New wxPG_DIALOG_TITLE property is applicable to all properties derived from wxEditorDialogProperty so not only editor dialog titles for wxFileProperty and wxDirProperty can be set but also for wxFontProperty, wxLongStringProperty, etc.
wxPG_FILE_DIALOG_TITLE and wxPG_DIR_DIALOG_MESSAGE attributes are marked obsolete.
Add a new flag wxXRC_USE_ENVVARS for wxXmlResourceFlags that triggers a
call to wxExpandEnvVars() for bitmap, icon and animation paths.
This flag is not set by default to avoid silently changing the behaviour
of existing applications.
Closes https://github.com/wxWidgets/wxWidgets/pull/1445
Adobe have announced the official EOL for flash is 2020 so we're
now at the point where support for flash just isn't interesting
any more.
It doesn't make sense to support it for the upcoming 3.2.x release
series, and the sample .swf files are lacking source code.
Closes https://github.com/wxWidgets/wxWidgets/pull/1427Closes#15886.
Add wxGrid::FreezeTo() method which allows to freeze the given number of
columns and/or rows at the beginning of the grid, i.e. keep them pinned
in place while the rest of the grid is scrolled.
The main wxGridWindow (m_gridWin) now corresponds to the non-frozen part
of the grid, with up to 3 new similar windows for the frozen
rows/columns and the frozen corner cells (which only exist if both rows
and columns are frozen) being additionally used.
Doing this involved adding "wxGridWindow*" parameter to many functions
that previously only worked with m_gridWin itself and addressing
additional complications, such as mouse events that can now cross
different windows.
See https://github.com/wxWidgets/wxWidgets/pull/952 for the original
version of the changes.
Since wxDirsProperty derives from wxArrayStringProperty and new implementation of this class no longer passes this macro parameter to OnButtonClick() so wxChar* string is no longer required here.
The "Native" menu item actually only toggled drawing native-lookalike
labels, but didn't use wxHeaderCtrl as could be expected. Rename the
existing menu item to "Native-like" and add the new "Native" one which
really enables the use of wxHeaderCtrl.
Scrolling the item into view to make it visible didn't work since the
changes of badf6bc300, which suppressed
scrolling completely while frozen, any longer.
Work around it by remembering the item to make visible and actually
doing it when the control is thawed.
Also add menu item to call Freeze()/Thaw() on wxTreeCtrl in the sample
to make testing this and similar problems easier.
Closes#18435.
Add IsUsingLogWindow() that can be used to check if the log messages go
into the listbox instead of being shown in a message box, which was
annoying when starting or quitting the sample.
This is a bit more complicated than the hack previously used in
TextWidgetsPage::OnText(), but more general and can be easily reused for
the focus loss messages, for example.
This is useful for quickly checking that we're getting expected events
when modifying the control and/or not getting any unexpected ones and
was already done on wxComboBox page, but not for wxTextCtrl.
All numeric properties (wxIntProperty, wxUIntProperty, wxFloatProperty) share some features (like specific attributes, numeric validation, SpinCtrl editor support) so for the sake of clear design it would be good to derive them from the common base class (wxNumericProperty) in which all shared functions are implemented. This class is not intended to be instantiated so it's an abstract class.
The code was confusing as it used Bind() for some handlers, event table
for some others and, for the 3 buttons in the middle column, it actually
managed to use both.
Get rid of the event table completely to make this more clear.
Clicking on the "Generic wxStaticText" box resulted in several
assertions because the markup string contained both a single "&" and
a "&" used for the mnemonic. Double the former to avoid misinterpreting
it as a mnemonic character too.
RegisterHotKey() wrongly expected to be given VK_XXX MSW virtual key
code constant, which couldn't work in portable code, so fix it to accept
WXK_XXX constants, while preserving compatibility by still accepting
VK_XXX values not clashing with them.
For some operations when grid needs to be recreated currently selected options to show the header and to enable label editing are being ignored and it can be seen a discrepancy between the options selected (and shown) in the menu and the mode of just created wxPropertyGrid. To avoid this inconsistency respective flags can be stored and used to enable/disable features in just created grid.
If given attribute is not a built-in attribute handled by the current property it should be passed to the parent property because it may be handled there.
Provide a way to retrieve the name of the current system appearance
(mostly for diagnostic purposes) and check if it uses predominantly dark
colours.
Currently this class has a non-trivial (but still very simple)
implementation under macOS only and simply checks whether the default
text colour is brighter than the default background colour under the
other platforms, but other platform-specific implementations could be
added later.
Also update the drawing sample "system colours" page to show the system
appearance as well.
Send events from generic wxColourPickerCtrl when the currently selected
colour in the dialog shown by it changes and when this dialog is
cancelled.
Notice that currently this only works on wxMSW as it relies on
wxEVT_COLOUR_CHANGED support in wxColourDialog which is only available
there.
Based on work of Trylz, see https://github.com/wxWidgets/wxWidgets/pull/1219
Add support for a new event sent by wxColourDialog, currently only under
MSW, when the colour currently selected in it changes.
Based on work by Trylz, see https://github.com/wxWidgets/wxWidgets/pull/1219
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.