Always set the LB_USETABSTOPS style flag to achieve behaviour more
compatible with other platforms and expand TABs to align them at tab
stops positioned at every 8 characters.
Also add MSW-specific MSWSetTabStops() method allowing to customize tab
stops.
Update the documentation and the sample to demonstrate using TABs.
Closes https://github.com/wxWidgets/wxWidgets/pull/1789
These methods do the same thing, so it seems better to use the same name
for them.
This is not really a backwards-incompatible change, as these methods
were just added in the parent commit, so nobody is using them yet.
Completely overhauled selection handling in wxGrid.
Make various ways of extending selection (using Shift-arrow keys,
Ctrl-Shift-arrows, Shift-click etc) work as expected from the user point
of view instead of producing various bizarre results. Also improve
row/column header click selection as well as Ctrl/Shift-Space handling.
Internally, store selection as just a vector of blocks, independently of
the selection mode, and provide a simple API for iterating over it which
remains usable even with selections containing millions of cells (as
long as they're still composed of only a few blocks, which is the case
in practice).
Add more tests and add display of the current selection to the sample.
See https://github.com/wxWidgets/wxWidgets/pull/1772
This seems to be more consistent with the existing functions and doesn't
create ambiguity with a grid range.
Also rename wxGridSelectionRange to just wxGridBlocks as, in principle,
this class could be used for iterating over any blocks, not just the
selected ones.
No changes in functionality, this is just a renaming.
Even though this is not really the case at the code level, this makes
more sense, as wxGenericAnimationCtrl adds methods to the interface
implemented by wxAnimationCtrl.
This also allows to avoid having notes indicating that some methods
don't work for the native version of the control -- by simply not having
them there.
Simplify and streamline animation classes relationship: wxAnimation is
the only public class representing an animation and it can be created by
both the native wxAnimationCtrl and wxGenericAnimationCtrl using the new
public CreateAnimation() method.
Replace wxAnimationImplType enum with more flexible type info based
check.
Change the return type of this function to a simple and clear bool
instead of 3-valued int requiring a special explanation. This is simpler
and not any less efficient as checking for whether one block contains
another or the other one contains this one are separate operations
anyhow.
Rename the function to a more grammatically correct name.
Also move it inline as it's now trivial enough for this to be worth it.
This class was a strange hybrid of a container/view/range and iterator,
as it both provided begin()/end() container-like methods and
iterator-like methods for dereferencing/advancing.
Simplify this by removing the latter part and making this class really
just a range, with its own iterator class in order to avoid leaking the
exact type of the iterator used in the API.
Note that while it's now completely trivial, it is still useful as it
isolates the application code from the vector used to store the selected
blocks currently and will allow to change internal representation in the
future without breaking the existing code.
Store all types of selection with an array of blocks instead of arrays of
cells, blocks, rows and columns.
It (hopefully) simplifies the code and allows us to implement editing of
the last selection block much easier.
This makes it possible to use wxObjectDataPtr inside functions returning
raw pointers owned by the caller, such as custom GetAttr() in the grid
sample.
In many case SetTable() is called with its takeOwnership parameter set
to true, as shown by the grid sample in which all 3 of the calls to
SetTable() set it to true, but calling it in this case is awkward, as
bare "true" in the caller is unreadable and almost invariably requires
an explanatory comment.
Improve the API by adding AssignTable(), which is the same to SetTable()
as the existing AssignImageList() to SetImageLabel(), which always takes
ownership of the table pointer.
It is convenient to have this function if only in order to be able to
call GetGridColHeader() safely, i.e. without triggering an assert if
native header is not being used.
The behaviour of these functions for the tools containing controls is
counter-intuitive but changing it now would silently break existing code
working around the current semantics, so just document it instead.
See #16552.
This doesn't work anyhow, so it's better to prevent the code doing this
from compiling instead of getting run-time asserts or worse.
Also simplify construction of these events inside wxWidgets by passing
the window itself to the ctor instead of passing just its ID and calling
SetEventObject() separately later.
For consistency, do the same thing for wxNcPaintEvent too.
This allows to give at least some explanation about why the secrets
can't be stored to the user, e.g. they could search for a message such
as
The name org.freedesktop.secrets was not provided by any .service files
to find out that gnome-keyring package needs to be installed on their
system.
Note that this change means that under Unix an attempt to connect to the
secret service is now made when wxSecretStore is constructed and not
just when it's used for the first time, as before.
Provide GetAttrPtr() and GetCellAttrPtr() convenience functions that can
be used instead of the original Ptr-less versions to avoid the need to
manually call DecRef() on the returned wxGridCellAttr pointers.
No real changes, just simplify the code and make it safer.
Don't store the buttons used by a pane separately, but take them
directly from the flags, as this ensures that updating the pane flags,
e.g. by calling CloseButton(false), really removes the corresponding
button.
This also makes wxAuiPaneButton helper completely unnecessary, so just
remove it to simplify the code.
Closes https://github.com/wxWidgets/wxWidgets/pull/1723Closes#18223.
Calling wxGridCellChoiceEditor::SetParameters() didn't have any effect
if the editor had been already used because this method only updated the
internally stored m_choices, used for creating the combobox, but not the
strings actually used by the combobox, if it had been already created.
Also mention that this works in the documentation.
Closes#10465.
This API is not implemented yet, i.e. ellipsization mode is not
respected for now. This commit just adds the API, documents it and adds
an example of using it in the sample.
Replace "bool overflow" flag with a class allowing to specify the same
overflow/clipping behaviour currently, but also allowing to extend it,
notable to add ellipsization support, in the future.
Preserve the existing API by reimplementing it in terms of the new one.
Also update the same to demonstrate a cell which always overflows,
independently of the default cell behaviour.
The documentation's notes about MSW limitations about setting priority
before creating the thread do not appear to be true (anymore). Thread
priority is already set by Create() if SetPriority() was called earlier.
Setting it immediately just failed, because the thread did not exist
yet, but this was fixed by the previous commit.
macOS 10.12+ implements automatic tabbing in the OS. This adds
entries to the menus and also adds a tab bar. Some applications
might want to disable this, so provide an interface for doing this.
Closes https://github.com/wxWidgets/wxWidgets/pull/1674
Add support for this attribute for text-like cells to the native macOS
version too, to bring it up to parity with the generic and GTK ones.
Closes https://github.com/wxWidgets/wxWidgets/pull/1673
Add ability to get the size of the checkbox without any margins by
passing wxCONTROL_CELL flag: this can be useful when the checkbox is
part of some "cell", e.g. wxGrid one, and doesn't need any extra margins
around it.
Currently wxCONTROL_CELL is only really used by wxGTK2 implementation.
Don't return RGB values if colour is not solid
and hence cannot be represented with these values.
Non-solid colour should be reported as an unknown
RGB value, e.g. '??????'.
Closes#18596.
Actually allow using wxWebVieWIE-specific methods for setting the
emulation level.
Make it possible to include wx/msw/webvieW_ie.h by removing inclusion of
the private headers from it, which was in turn achieved by moving all
the implementation details into a private class.
See https://github.com/wxWidgets/wxWidgets/pull/1647
Previously, the first monitor was created instead and while it was often
also the primary one, this wasn't always the case.
In particular, this makes wxGetDisplayPPI() always return something
reasonable instead of returning (0, 0) when the first monitor is not the
primary one, as expected by plenty of code, including our own printing
sample, which divides by the values returned from wxGetDisplayPPI()
without checking if they're zero.
Make wxEVT_MENU_HIGHLIGHT generation when there is no highlighted item
consistent across all the major ports: use wxID_NONE instead of wxID_ANY
in wxGTK and send these events, which were previously not sent at all in
this case, in wxOSX.
See https://github.com/wxWidgets/wxWidgets/pull/1637
First two paramaters of ctors of wxPGProperty and its derivates are named
'label' and 'name' so wxDirProperty ctor should conform to this convention.
Close#18547.
All OLE-related classes and enums were described
in interface header msw/ole/automatn.h which led
to incorrectly listed include files in the generated
documentation for those classes and enum that
were actually declared in different include header files.
The documentation in the interface files has now been
split into files with names matching the actual include files.
Closes#18536
Shaped windows have the size defined by the shape and it's not really
clear what calling SetSize() on them should do -- so just document that
it's not supposed to work.
Closes#9794.
Fixes to wxUIActionSimulator allowing the tests using it to work for
wxGrid in wxGTK.
And some improvements and bug fixes to wxGrid itself.
Closes https://github.com/wxWidgets/wxWidgets/pull/1609
Improve the class description.
Mention that one needs to call wxAutomationObject::SetConvertVariantFlags()
with wxOleConvertVariant_ReturnSafeArrays to actually receive a
wxVariant with SAFEARRAY (if possible).
Make better use of now-documented wxSafeArray in the code examples.
Closes https://github.com/wxWidgets/wxWidgets/pull/1611
This was sufficiently misleading that event our own wxGrid unit tests
used this function in an attempt to start editing a grid cell -- even
though it actually doesn't do it at all.
Unfortunately documenting the surprising semantics of this functions
looks like the best thing we can do because it appears to have always
behaved like this and changing it now to actually show the cell editor
control, i.e. starting to edit the cell, is almost certain to break some
existing code.
Instruct people to use GetContentScaleFactor() to convert between
logical coordinates used by wxWindow and physical ones used by
wxGLCanvas.
See https://github.com/wxWidgets/wxWidgets/pull/1485
This is its actual behaviour and it's the right thing to do, as it's
consistent with Now() -- even though the documentation wrongly stated
otherwise (since 324ab5e2db).
Also add a unit test checking that UNow() == Now(), except for the
milliseconds.
See #14148.
Closes#18524.
Closes https://github.com/wxWidgets/wxWidgets/pull/1594
Fix regression in wxDC::Clear() and make wxGCDC::Clear() consistent with
it by using white if the background brush hadn't been explicitly set.
See https://github.com/wxWidgets/wxWidgets/pull/1582
Notably mention that showing modal dialogs won't work in this case.
Also link to this explanation from wxListCtrl documentation as
wxEVT_LIST_ITEM_SELECTED is one of the perhaps less expected cases in
which this problem arises.
See #9973.
Check that adding a window to either the same, or different, sizer the
second time asserts -- but that it can still be moved to another sizer
if it is detached from the first one first.
Also document that SetContainingSizer() should never be called from
outside the library.
See #17166.
This makes it possible to get the appropriate column width from outside
the class, as GetColumn() itself is currently protected and so the
existing overload couldn't easily used.
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
For 32 bpp wxBitmap with both alpha channel and mask we have to apply mask on our own while drawing the bitmap because MaskBlt() API doesn't work properly with 32 bpp RGBA bitmaps. To do so we need to create a temporary bitmap with copy of original RGB data and with alpha channel being a superposition of the original alpha values and the mask.
See #18498.
This allows calling the base class version from the derived classes and
also, at least as importantly, make sure that the function is actually
documented as private functions are not extracted by Doxygen by default.
Closes#16749.
Closes https://github.com/wxWidgets/wxWidgets/pull/1543
Add UpdateText() and UpdateLabel() updating the text (i.e. possibly
containing markup) or the label (just plain text) shown in the window.
Closes#14743.
Closes https://github.com/Kvaz1r/wxWidgets.git BusyInfoUpdateText14743
Update the font of some buddy controls when the DPI changes. Fix the
position of the statusbar after a DPI change. Add some changes that were
suggested in https://github.com/wxWidgets/wxWidgets/pull/1499 but left
out from it.
Some sizes are cached to improve the speed of the library. These sizes
become incorrect when the DPI changes. And are incorrect when a window
is created on a display with a different DPI. Fix this by checking if
the current DPI is the same as the DPI that was used when calculating
the size, otherwise recalculate the size.
Closes https://github.com/wxWidgets/wxWidgets/pull/1530
It doesn't make sense to return anything else than an empty rectangle
when querying the icon rectangle of the sub-items that can't show any
icon.
Also document this behaviour, just in case it's not obvious.
Add preliminary support for per-monitor DPI awareness to wxMSW.
Individual controls still need to be fixed, so this support is still
experimental/unfinished for now.
See https://github.com/wxWidgets/wxWidgets/pull/1499
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.
This ensures that they are always available and can be used in
wxLaunchDefaultBrowser() in all build variants, whereas before this
function didn't handle file:// URLs correctly when the library was built
with wxUSE_FILESYSTEM==0.
Closes https://github.com/wxWidgets/wxWidgets/pull/1469Closes#10414.
Explain how these methods actually work, remove a very (from wx 1.x
days?) outdated reference to wxPanel always calling Layout() and mention
the special case of wxTopLevelWindow in the overview too.
This is simpler to use than wxDisplay(window).GetPPI() which was used
instead of it so far in all ports and can be implemented more
efficiently for wxMSW.
Remove wxGetWinTLW, GetDPI already tries to get the top window.
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
Correct the signature of wxArrayString::Insert():
the first parameter is "const wxString&", not "wxString".
Mention wxSortedArrayString in wxArrayString documentation.
The rest are just minor edits improving language, consistency, and formatting.
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
C++20 introduces these two functions, along with some overloads, to
std::string. Add similar functions to wxString, which simply call the
already existing StartsWith() and EndsWith().
Closes https://github.com/wxWidgets/wxWidgets/pull/1452
13068d3603 introduced code for stripping
CJK mnemonics (i.e. trailing " (&X)") from the menu items, but due to
the use of wxStripMenuCodes() in wxControl::GetLabelText(), it also
applied to the control labels, resulting in wrongly measuring their size
(because the text used for measurement didn't include the "(&X)" part)
and truncating them in display.
Fix this by adding an explicit wxStrip_CJKMnemonics and using it only in
the code dealing with the menu item labels. This requires more changes
than just modifying GetLabelText() to use some wxStrip_NoCJKMnemonics
flag, but is more compatible as it's not impossible that some existing
code using wxStripMenuCodes() could be broken by this change too, while
now the existing behaviour is preserved.
Also improve wxStrip_XXX documentation.
Closes https://github.com/wxWidgets/wxWidgets/pull/1439
See #16736.
Closes#18452.
Use special values of DisplaySection() and KeywordSearch() parameters to
open the table of contents (if section is -1) or search page (if the
keyword to search for is empty) when using CHM help controller.
This is less discoverable than having separate Display{TOC,Search}()
methods, but avoids introducing special API that couldn't be implemented
in the other wxHelpController implementations.
Closes#18445.
Add wxRendererNative::GetExpanderSize(), implement it using the
appropriate theme element and use it instead of hardcoding the expander
size to 3 character widths.
Closes https://github.com/wxWidgets/wxWidgets/pull/1431Closes#18449.
In wxGTK using negative coordinates with HitTest() happens to work and
it's useful to test that it does, as this test will run when the control
is scrolled even under Travis CI, unlike the test with positive
coordinates which doesn't work under Xvfb there and was disabled in the
previous commit.
Also document that passing negative coordinates to this function only
works in wxGTK.
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.
This parameter is not modified by wxColourDialog (this might have been
the case, or at least the plan, some long time ago) and so has no reason
not to be "const".
Just add the qualifier to ctor and Create() in all ports.
Closes https://github.com/wxWidgets/wxWidgets/pull/1421Closes#12511.
It may be surprising that calling GetWidth() after SetWidth(100) still
returns 0, so at least document this behaviour (fixing it doesn't seem
to be easily possible).
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.
This method can be overridden to indicate that the scrolled window
doesn't want its children to be scrolled into view when they're focused,
which is the default behaviour.
Also reuse this method for Mac-specific scrollbar workaround.
For the sake of consistency with documentation of other controls like e.g.
wxGrid, the list of events should be presented on the wxPropertyGridEvent
page so it should be moved there from the main wxPropertyGrid page.
wxFontProperty and wxMultiChoiceProperty use TextCtrlAndButton editor so they can be implemented as parents of wxEditorDialogProperty to share common functions and data.
Properties using TextCtrlAndButton editor (like wxLongStringProperty, wxDirProperty, wxFileProperty) share some features, like button triggering the editor dialog, and share a data, like dialog window attributes, so for the sake of the clear design it would be good to derive them from the common base class in which all shared functions/data are implemented. This class is not intended to be instantiated so it's an abstract class.
Explicitly mention that if no handler for wxEVT_TEXT_ENTER is defined
(or if a handler exists, but skips the event), the default handling of
"Enter" still takes place.
The current wxSTC documentation page currently has a bare listing of the
event types defined for wxStyledTextEvent. These event types are
completely documented on the wxStyledTextEvent page. However the bare
listing on the wxSTC page can lead to the conclusion that there is no
documentation for the event types.
Remove the bare listing from the wxSTC page and replace it with a
referral to the wxStyledTextEvent page. This is consistent with other
large classes such as wxGrid and wxRichTextCtrl that separate the
documentation for their methods and events.
The SCN_AUTOCSELECTIONCHANGE notification was added in Scintilla 4.0 to
notify an application when a new item is selected in an autocompletion
or user list. However the version of Scintilla currently used is 3.7.2,
so this potentially useful notification is not available.
These changes allow an event corresponding to this notification to be
generated completely in the wxWidgets portion of wxSTC. If the Scintilla
library is ever updated to 4.0 or later, only one method should need to
be modified let Scintilla generate the event instead.
The wxSTC methods AutoCompSetColours and AutoCompUseListCtrl were added
in fe7b332b7b to allow some configuration
of the autocompletion popup window. Based on subsequent discussion, it
was decided that a better method of configuring the popup and getting
information about the configuration is needed. For now, simply remove
the current methods while the better solution is created.
In addition, since the configuration options are being removed, set the
popup to have the appearance of a list control since that was the
appearance before any configuration options were added.
In the class description mention that in addition to RGB, an alpha value
is stored as well. Remove incorrect description of operator=(), clarify
meaning of "on" parameter in MakeMono(), and make few minor text edits.
Closes https://github.com/wxWidgets/wxWidgets/pull/1411
This class seems to be implemented in all the major ports, so remove
note saying that it supports dragging files from the applications only
under MSW.
Closes#18437.
Tick marks were not available for wxSlider under GTK+ 2 or GTK+ 3
implementations of wxWidgets. However, tick marks have been available
for the GtkScale widget since GTK+ 2 version 2.16.
This change adds similar functionality in relation to tick marks
as was already available in wxMSW builds.
Closes https://github.com/wxWidgets/wxWidgets/pull/1355
Document the discrepancy between constructing wxGCDC from
wxGraphicsContext directly or default-constructing it and calling
SetGraphicsContext() later.
Current behaviour is somewhat inconsistent, but useful, because it
allows to draw on wxGraphicsContext using wxDC API using any kind of pen
and brush, even those not supported by this API, while remaining
backwards-compatible (i.e. we can't change SetGraphicsContext() to not
re-apply font, pen and brush, as this would break any existing code
relying on this happening), so it seems like the best alternative.
When creating wxGCDC from an existing wxGraphicsContext, it is better to
keep using the attributes (such as font, pen, brush) already configured
for it rather than overwriting them with the default values, which is
not very useful, unlike the new behaviour, which allows to configure
wxGraphicsContext using features not supported by wxDC API (e.g. alpha
channel for pens/brushes) and then use it via wxDC API only (allowing
the existing legacy code to use alpha, for example).
wxUIntProperty::DoValidation() is already declared as private and the same access level should be applied to DoValidation() in other numeric properties because these functions are helpers intended for internal use only.
Move template function NumericValidation() to wxNumericProperty because all data necessary to validate the value are available here: acceptable value range, SpinCtrl editor value wrapping mode, etc.
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.
Use wxWindow instead of wxControl in wxGridCellEditor to allow using
any window as an editor control, as it doesn't need to be a wxControl.
Closes https://github.com/wxWidgets/wxWidgets/pull/1370