Allow to keep the originally defined transparent pixels colour instead
of replacing it with bright pink (which is still the default behaviour).
Closes#18014.
Update MinGW versions used for the binaries and provide links to the
working compilers.
Add "-rc" to some links to make them work.
Also update the binaries file names.
For the release candidates, allow passing the version (e.g. "3.1.1-rc")
to post-release.sh on the command line and document this.
Also don't commit automatically, this is annoying, especially as the
script doesn't check for errors.
Finally, fix the problem with the CHM file name: it must be zipped,
presumably to avoid problems with some firewalls blocking downloading
CHM files (as there is really no advantage in compressing the already
compressed CHM file otherwise).
The custom scheme handling implementation had been inherited from the
original WebKit1 implementation. It attempted to intercept navigation
and resource load requests and then inject the resources. It seems that
this method doesn't work in WebKit2, but fortunately, there is native
support in WebKit2 for custom URI schemes through the
webkit_web_context_register_uri_scheme() API.
Also extend wxGtkError to allow creating it from an existing GError
object as a side-effect of these changes.
See https://github.com/wxWidgets/wxWidgets/pull/716
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.
Make GTKHandleFocusOut() virtual and override it in wxChoice in order to
avoid generating wxEVT_KILL_FOCUS events when the combobox dropdown
button is clicked.
This is important because it allows fatal problems when using a
combobox-based in-place editor in wxDataViewCtrl as getting these events
totally broke the UI before.
See #17034.
No event was sent if the selection was narrowed by clicking on an
already selected item without any key modifiers pressed.
Fix this by generating an event always on click and not only when
selecting a new item.
Closes#17881.
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.
TAB should be used for navigation by default and only should be inserted
into the control as a literal character if wxTE_PROCESS_TAB is specified
for consistency with wxMSW and because this behaviour is much more
useful by default.
Fix this by calling gtk_text_view_set_accepts_tab() as appropriate for
multiline text controls. For single line ones, the behaviour is
unchanged but it's more reasonable as TAB is always handled as if
wxTE_PROCESS_TAB were not specified and it doesn't seem really useful to
try to support wxTE_PROCESS_TAB for them anyhow, so just document this
limitation.
Also remove the outdated/misleading documentation of this style, notably
don't say that it is required to get char events for TAB presses as
these events are generated both with and without this style in both
wxGTK and wxMSW.
Closes https://github.com/wxWidgets/wxWidgets/pull/704
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).
Make it possible to bind to just wxEVT_SEARCHCTRL_SEARCH_BTN under all
platforms: previously, it was also necessary to bind to wxEVT_TEXT_ENTER
when using the generic implementation, as pressing Enter in the text
control didn't generate the dedicated SEARCH event.
It does now, and, to avoid any confusion, the control does not generate
wxEVT_TEXT_ENTER events at all any more. This is not really
incompatible, as wxOSX never generated these events anyhow and the
generic version only did for a couple of days, since the changes of
9816970797 which were, finally, misguided
and so are undone by this commit.
Closes#17911.
Overlong (and hence invalid) 4-byte encoding was used for this character
instead of the correct 3-byte 0xEF 0xBF 0xBF sequence.
Fix this by using 3 bytes for the code points up to 0xFFFF included,
instead of excluding it as was done before.
Closes#17920.
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
Several compilation fixes due to the fact that sizeof(long)==8 under
Cygwin in 64 bits.
This allows the library to compile, but there are still run-time
problems, notably the unit tests throw an unknown exception currently.
Allow specifying label="1" attribute in wxRadioBox <item> tags to
indicate that the usual translation of "_" to "&" should be done, as for
all the other labels.
This is still not the default behaviour to avoid breaking any existing
XRC files using "_", even though using labels="1" by default would make
more sense.
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.
We need to explicitly generate this event from the char hook handler as
we don't get the normal WM_CHAR for it, it is apparently intercepted by
the window proc installed by the auto-completing code, so check if
wxTE_PROCESS_ENTER is used for the text entry and call a special new
MSWProcessSpecialKey() method to do the right thing if it is.
Similarly, handle Tab presses correctly if wxTE_PROCESS_TAB is used.
Closes#12613.
Calling this function with an unseekable file, such as any file under
/sys on Linux systems, would previously just hang as the loop condition
was never satisfied when length was -1.
Fix this by checking for this case and using a different approach by
extending the buffer we read the data into as we go instead of
preallocating it all at once.
See #9965.
Just turn off background erasing to avoid having horrible flicker which
can be seen perfectly well simply by drag-resizing a column in a list
control with non-default background colour.
See https://github.com/wxWidgets/wxWidgets/pull/374
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
This will allow projects to use static wxWidgets libraries and zlib
(either directly or indirectly, as can heppen e.g. via Boost.IOStreams)
at the same time without link conflicts.
See #15314.
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.
Use "git submodule foreach" to run "git archive" in all of the
submodules as well.
Also document the requirement to have GNU tar which is needed to be able
to successfully extract several concatenated tar archives.
Update dates in various files before the release automatically.
Also automatically update SHA-1 of the release files both before the
release (to zero them) and afterwards (to use the correct values).
Closes https://github.com/wxWidgets/wxWidgets/pull/443
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.
Try to preserve most of the manual changes done to libtiff sources in
wxWidgets, dropping just some VC6-specific workarounds which are not
needed any more.
The text and background colours are now stored in the rgba array instead
of fg_color and bg_color as with GTK+ 2 (the latter ones seem to have
been repurposed for the underline and strike-through colours!).
Also make the unit test for this method more robust.
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.
Zip filenames containing non ASCII characters will be marked with
bit 11 in the general purpose flags and will use UTF-8 encoding.
By only setting the flag when non ASCII characters are used the
created archives should be binary identical to previous versions.
The old behavior can be achieved by explicitly using wxConvLocal
with the constructor. This should also ensure that
existing code using a custom wxMBConv should work as before.
If the window stored as m_winLastFocused in one TLW was reparented to
another one and then destroyed, this pointer to it wasn't updated and
became dangling.
Fix this by using a safe weak reference instead of raw pointer for
m_winLastFocused. This ensures that it can never be used when it becomes
invalid.
Closes#17980.
Position of wxProgressDialog cannot be changed directly because the dialog is created in another thread and may exist when SetPosition() is called. New position has be stored in the data structure used to share data between the main thread and the task dialog runner and the real update is done during the cyclic refresh in the dialog thread.
Closes#13546.
Export this class, which was only used internally by wxTreeListCtrl
before, so that user code can use it for its own columns with custom
wxDataViewCtrl models.
Starting with version 3.5, Scintilla implemented a newer method for
handling timers and used this method in its Windows, GTK+, Cocoa, and Qt
ports. This patch attempts to bring the timer handling for wxSTC in line
with those other ports.
Closes#17949.
It doesn't make much sense to require all the graphics backends to
create wxGraphicsPen from either wxPen or wxGraphicsPenInfo when the
former can be handled just once in the common code.
So do just this, leaving CreatePen() overload taking wxGraphicsPenInfo
where the real pen construction takes place and implementing
wxGraphicsPen creation from wxPen in the common wxGraphicsContext code.
This is not 100% backwards-compatible as any code inheriting from
wxGraphicsRenderer and overriding its CreatePen() will now be broken,
however this should be extremely rare (there is no good reason to
inherit from this class in the user code) and result in compile errors
if it does happen.
Some current input processing flags, like DLGC_HASSETSEL, should be retained because they are in use (in wxWindowMSW::SetFocusFromKbd() for instance).
Closes#17945.
Remove the already described sizers from section Other Types of Sizers. Remove "See ..." sentences which are unnecessary when the class documentation is already linked right above. Also fix a typo in a sizer name that prevented doxygen linking to the class.
Remove references to concrete GUI-building programs. Such references are not necessary not to mention that most of the referred programs have not been maintained for a long time.
List of flags in the CreateButtonSizer sizer was unnecessary, some of the values were not valid flags for the methods and comment descriptions for most values did not make much sense in the given context. The section was therefore removed and the method is mentioned in the newly-added part about wxStdDialogButtonSizer.
Sizer types not mentioned in the overview before were added, the rest of changes was mostly adding @c and such.
In wxStdDialogButtonSizer, keyboard navigation order through the buttons
should be the same as the order they are positioned in the sizer regardless
of the order the were created or added to the sizer.
Closes#17940.
Rewrote wxOSX radio groups-related code reusing the code which works on
wxMSW and which seems to provide more rich functionality (supports adding
radio as well as no-radio items) and to have known bugs fixed.
The ranges of all radio groups are stored in wxMenu itself instead of
storing the information about the radio group an item belongs to in
the item itself - see 89511b4268.
Closes#14213.
Closes#17568.
When wxMenu contains radio groups and a new item (radio and non-radio) is
being added to the menu, data describing exisiting groups have to
be updated accordingly. Because adding radio and non-radio items has
a different impact on the groups, adding non-radio items has to be handled
separately. (The main difference between adding radio and non-radio item is
that when a radio item is inserted inside the group this group is extended,
but for non-radio item the group is split into two subgroups.)
While selecting wxBitmap with colour depth > 1 bpp into wxMemoryDC there is
no need to convert its format to ARGB regardless of the current
interpretation of the alpha channel values in the bitmap. If original
bitmap was marked as a RGB one (with alpha channel being ignored), it
should retain this format to avoid confusions.
Closes#16309.
Apparently various text wrapping modes are not supported natively by
NSTextView (apart from word wrapping which is used by default) and
non-default wrapping has to be implemented in the custom code.
To wrap lines at any character, NSLineBreakByCharWrapping style should be
applied at any text change to the entire text stored in NSTextStorage
associated with NSTextView. This is done in DoUpdateTextStyle() method
which is called from controlTextDidChange() when text is modified by
the user, or SetStringValue() and WriteText() when text is set
programmatically.
Check if character position is not past the line.
When calculating (x,y) for given character position there is necessary
to take into account that for multi-line control each line (but last one)
is ended by 2-character end of line mark. Each character of this
2-character mark has a different position in the text buffer but is mapped
to the same (x,y) coordinates.
When calculating character position for given (x,y) there is necessary
to verify if passed coordinates are sane and return error status (-1) if
not. y-coordinate has to be in the range [0..numLines-1] and x-coordinate
cannot exceed the length of the text in the given line.
Apparently there is no native API to retrieve such information in a simple
way so all calculations have to be done with raw text stored in
the corresponding control(s).
Closes#4146.
See #17811.
wxPropertyGrid::ExpandEscapeSequences() function should convert all valid
escape sequences (\r, \n, \t, \\) to the corresponding single characters
(CR, LF, TAB, backslash, accordingly) and
wxPropertyGrid::CreateEscapeSequences() function should do the reverse
operation and convert these raw characters to the corresponding escape
sequences.
Closes#17896.
Ensure that the restored size is at least equal to the best size of the
window to avoid cutting off parts of it in (a common) case when a newer
version of the program adds new UI elements, thus increasing the window
best size and possibly making the previously stored size too small.
Creating a font with wxFONTSTYLE_SLANT results in a font whose
GetStyle() returned wxFONTSTYLE_ITALIC, so it was never found in the
cache, resulting in, effectively, leaking memory and GDI handles because
each new call to wxFontList::FindOrCreateFont(...wxFONTSTYLE_SLANT)
created a new font.
Fix this by just hardcoding that wxFONTSTYLE_SLANT is wxFONTSTYLE_ITALIC
under MSW, this is ugly but avoids backwards incompatible (and not
obviously correct) change of making wxFont::GetStyle() return
wxFONTSTYLE_SLANT if the font was created using this style.
Notice that wxFont::GetStyle() does behave like this in wxOSX currently,
so there is an inconsistency between ports here. It would arguably be
better to make wxOSX behave like wxMSW because the actual font is really
italic and not slant/oblique and if we do this, the preprocessor
condition in this commit should be extended to cover wxOSX too.
Closes#17903.
The logic in wxButton::{Set,Unset}TmpDefault() didn't work at all when
the temporary button was the same as the permanent default button as the
code made the same button non-default immediately after making it
default (or vice versa). In particular, this ensured that default button
was never highlighted correctly (at least after the first focus change)
in dialogs containing a single button only.
Fix this by simply skipping modification of the old default button if it
was the same one as the new default button.
This feature to show/hide alpha values and opacity selector (slider) is
already implemented under wxGTK and for generic wxColourDialog.
For the sake of backward compatibility, this feature is enabled here by
default (through the corresponding property of wxColourData).
Currently region given in device coordinates is decomposed into the stripes which are next transformed to the logical coordinates required by underlying wxGraphicsContext::Clip() function. Some of these stripes given in device coordinates can have 1-pixel height what after transformation to logical coordinates can give zero-height stripes (after rounding). This can lead to the situation that in the region transformed to logical coordinates some stripes can disappear and final transformed region shape is different from the source shape (it has gaps).
To fix this issue device coordinates of the region are not manually transformed to the logical coordinates but instead wxGraphicsContext's is temporarily set to the state where its logical coordinates are equivalent to device coordinates and thus clipping region can be applied directly.
Solution for wxMSW, wxGTK is implemented in ea8cb7a24a.
Closes#17609.
Transformation settings already applied to the source objects (CGContext, wxWindow) and inherited by wxGraphicsContext should be considered as a baseline transformation matrix for wxGC and shouldn't be exposed through e.g. GetTransform() function (like it's done in Cairo or Direct2D). To report only transformations explicitly applied to wxGC by calls to the corresponding wxGC functions, we need to store initial CTM (in a dedicated variable) and "subtract" it from the actual transformation settings.
See #17609.
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when existing wxGraphicsContext is associated with wxGCDC using SetGraphicsContext() or when wxGCDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale() or SetLogicalScale().
When any of these functions is called then clipping box data are marked as invalid and retrieved from underlying graphics context using wxGraphicsContext::GetClipBox() at nearest call to GetClippingBox().
Solution for wxMSW, wxGTK was implemented in 98714ea452.
See #17646.
Rename relatively new enum value wxTASKBAR_JUMP_LIST_DESTIONATION to
wxTASKBAR_JUMP_LIST_DESTINATION as well as a private function containing
the same typo.
Even though this function was private and not available in the default build
(in which wxUSE_OLE==1, while this function was only defined with
wxUSE_OLE==0), still mention its removal for completeness.
Handle "bitmap" and "bitmapposition" attributes in wxToggleButton XRC handler,
just as it's already done for wxBitmap and wxBitmapToggleButton.
Closes#17850.
This option didn't do anything for the last 14 years, ever since the switch to
bakefile-generated makefiles in fe0895cf82, so
remove it from configure and stop mentioning it in documentation.
Use --disable-dependency-tracking to do what this option used to be doing 15
years ago.
When using -jN, setup_h needs to be created first to avoid a bug due to
missing dependencies in the current makefiles which breaks the build
otherwise.
Dedicated wxDataObject::SetData() function can be used to import raw
clipboard data to the corresponding instances of wxDataObject and hence
there is no need to duplicate data retrieval code.
When CF_DIB object is placed to the clipboard, a handle to the memory
object containing a BITMAPINFO structure followed by the bitmap bits should
be passed to SetClipboardData(), not a handle to a DIB section.
Also, wxClipboard is the owner of the wxDataObject being added, so it
should release passed object.
Not all applications recognize properly 0RGB bitmap format so for the sake
of interoperability bitmaps in such format should be converted to plain
24 bpp RGB format prior to being copied to the clipboard.
Closes#17640.
In wxRearrangeList implementations (like wxMSW) where DoInsertItemsInLoop()
and DoInsertOneItem() are not used to insert multiple items, DoInsertItems()
has to be overriden to do this insertion.
See #17836.
Labels containing mnemonic prefixes (&) and literal underscore characters
have to be converted to the proper GTK labels where underscore
characters act as mnemonic markers. If label contains mnemonic then
dedicated function gtk_radio_button_new_with_mnemonic() should be used
to create radio button item.
Closes#17419.
Use wxPrintf() and remove the c_str() call which is redundant with it instead
of using printf() which can't be used with non-POD objects like wxCStrData
returned by c_str() in wx 3.0+.
Don't apply at best unnecessary, and actually harmful, as it uses a wrong
conversion, fn_str() when calling wxRmDir() which takes wxString.
Update unit tests to check that wxRmdir() now works with non-ASCII filenames
too.
Closes#17644.
Assert and return false instead, this is more developer-friendly.
Add unit tests to check that these functions really work as expected when
called on a closed file.
Closes#17828.
Draw pie, not arc, if current brush is not transparent.
Also simplify the code by invoking PostScript 'arc' operator only once if pie is drawn.
Closes#17805.
PostScript code to register (and re-encode) given font should be emitted only once. Once registered, the font is available in the entire document and there is no need to register it again.
Add wxCMD_LINE_HIDDEN wxCmdLineParser flag allowing to hide options and/or
parameters.
A hidden/unlisted argument is processed as usual, but not shown in the output
given by Usage(). A use case for such could be diagnostics switches that
should exist but are not useful to the end user.
Closes https://github.com/wxWidgets/wxWidgets/pull/390
EVT_STC_KEY and EVT_STC_URIDROPPED events are never generated so there is no need to reference them in the code and documentation. For backwards compatibility reasons their declarations are not entirely removed but marked as deprecated.
Closes#17688.
While we have to keep these conversions enabled by default, they are very
dangerous as they can result in silent data loss on any system not using a
locale with UTF-8 encoding, i.e. always under MSW.
Allow mitigating this by defining wxNO_UNSAFE_WXSTRING_CONV when compiling the
application code using the library, which makes these conversions invisible to
the user code, and so can be used without recompiling the library.
Also add wxUSE_UNSAFE_WXSTRING_CONV which can be set to 0 when compiling the
library to disable these conversions globally for all applications using it.
Closes#11830.
Although WXWIN_COMPATIBILITY_x_y macros were mentioned in the backwards
compatibility overview, it seems appropriate to also document them with all
the other macros on the page dedicated to them.
Draw underline relatively to the baseline and obtain line parameters using 'stringwidth' operator instead of calculating them manually based on the parameters returned by DoGetTextExtent(), which are not always accurate (e.g. if no AFM files are available).
Closes#17788.
Legacy API cairo_win32_surface_create() can create only 24 bpp RGB surfaces but new API cairo_win32_surface_create_with_format() introduced in 1.15.4 supports creating also 32 bpp ARGB surfaces.
So, this new API can be used to create ARGB surface directly from ARGB bitmap (HDC), superseding current implementation based on the access to the bitmap data with cairo_image_surface_create_for_data().
Unfortunately, 0RGB bitmaps are not supported by cairo_win32_surface_create_with_format() and for such bitmaps surface has to be still created from bitmap data.
VC++ compilers (at least up to VS 2015) seem to generate incorrect code for the dithering code taken from libjpeg (pass2_fs_dither() function), where it is known to create problems too.
Refactor the code to avoid invalid optimization in this function and turn optimization on.
Closes#17764.
Using "%20c" in scanf() doesn't work unless we really have exactly 20
characters, so use "%20[^)]" to take up to 20 characters until the closing
parenthesis instead.
Closes#17739.
Using Bind() with a method of the class deriving from wxEvtHandler
non-publicly used to result in a compile-time error, but at least with C++11
we can detect this case and allow the code to compile.
Closes#17623.
The native EDIT control doesn't handle this key combination, but RICHEDIT does
and people just expect it to work, so handle it at wxMSW level.
Closes https://github.com/wxWidgets/wxWidgets/pull/300
For some reason known only to Apple, NSSecureTextField allows pasting text
into it using its standard context menu, but not using the standard Cmd+V
keyboard shortcut. Moreover, apparently the control does something special to
disable it because pressing Cmd+V does result in a call to
-[NSSecureTextField control:textView:doCommandBySelector:], but with a dummy
"noop:" selector.
Detect this specific situation and check if we're called while handling Cmd+V
event and, if this is indeed the case, do paste the text into the control.
While it could be argued that this changes the platform behaviour, it seems
very hard, if not impossible, to imagine a situation in which this would be a
problem while not being able to easily paste into password fields is
definitely a real usability bug.
Don't make the controls with wxTE_DONTWRAP (a.k.a. wxHSCROLL) style
"infinitely" wide, but just "very" wide to allow alignment still work in it.
See #17529.
Disabled controls are not supposed to accept any input, so don't send any
mouse events to them.
This fixes the behaviour of wxSlider which could be moved (and generated the
corresponding events) even when it was disabled.
Closes#17194.
Don't unconditionally use wxWidgets' implementation of IAccessible for
all windows when wxUSE_ACCESSIBILITY is 1, because it is inferior to the
system provided one: it often lacks appropriate labels, doesn't fully
support navigation and wxIAccessible isn't fully implemented.
The approach, when using MSAA, recommended by Microsoft documentation is
to customize accessibility for custom controls only, by proxying to the
standard and overriding what is necessary. By making this change, user
code is still allowed to customize accessibility if needed, without
negatively impacting standard controls that don't need any custom code.
See also https://github.com/wxWidgets/wxWidgets/pull/340
The purpose of this method is to provide a textual description of the renderer's content to the class implementing accessibility framework in wxDVC (wxDataViewCtrlAccessible).
It is exposed if wxUSE_ACCESSIBILITY is set to 1.
By default double dashes are converted to en-dashes in the output (and triple
ones -- to em-dashes), but this is undesirable when double dashes are used not
as a punctuation mark but in command line options or as C++ decrement
operator, so escape them to avoid such conversion in this case.
Allow the user to customize smart quotes and dashes substutions on OS X
and also provide the OSXDisableAllSmartSubstitutions() method for
disabling them all at once.
This reverts ill-advised commits
c07523734f and
8d42890df4 that disabled native OS X
behavior of substituting dashes and quotes with typographically correct
characters if the user has this feature enabled.
This was a bad idea for two reasons:
1. It made wx applications behave non-natively, and thus be worse, in a
highly noticeable area.
2. It made it impossible for applications that want to behave correctly
to restore the native behavior, because once
setAutomaticDashSubstitutionEnabled or
setAutomaticQuoteSubstitutionEnabled is called (as wxTextCtrl
constructor does), it's no longer possible to obtain its original,
default setting.
It's not better to disable native functionality by default, it's better to
be native and make customizations possible. wxWindow API exposes access
to the native control and if an application desires to disable
substitution behavior, it can easily do so from user code.
See also #186 and #241.
wxIAccessible should return a NULL BSTR to the accessibility framework if strings returned from wxIAccessible::get_accName() and get_accValue() are empty because this convention is already applied to the other methods returning string values, like get_accHelp(), get_accDescription().
Because query for item rectangle is executed in the context of wxDataViewCtrl so coordinates of retrieved rectangle should be specified in wxDataViewCtrl client coordinates (not in wxDataViewMainWindow coordinates).
To return correct coordinates it is necessary to convert rectangle coordinates retrieved by wxDataViewMainWindow::GetItemRect() from wxDataViewMainWindow client coordinates to wxDataViewCtrl client coordinates (they can different due to the presence of the header in wxDataViewCtrl client area).
Point coordinates passed from wxDataViewCtrl::HitTest() to wxDataViewMainWindow::HitTest()
should be converted from wxDataViewCtrl client coordinates to wxDataViewMainWindow client coordinates because they can different due to the presence of the header in wxDataViewCtrl client area.
Since accessibility framework supports signaling E_INVALIDARG error, it would be good to have a corresponding flag indicating this error in wxAccessible functions.
In response to wxACC_INVALID_ARG returned by wxAccessible functions, wxIAccessible should return E_INVALIDARG to the framework.
Bounding box coordinates have to be calculated and stored internally in device units to be independent on changes of logical coordinates between calls to wxDC::CalcBoundingBox.
These stored coordinates are converted to the logical units on demand when they are retrieved with call to wxDC::MinX, MinY, MaxX or MaxY.
Closes#17667.
Don't bother with checking for some really obsolete compilers and just assume
that C++98 keywords "explicit", "{static,const,dynamic}_cast" and support for
partial template specialization is always available.
Closes#17655.
Graphics renderers (exposed through wxGraphicsContext) support arbitrary affine transformations so it is possible to add support for affine transformations in wxGCDC by implementing all wxGCDC::*TransformMatrix() functions with calls to respective wxGraphicsContext functions.
Additionally, this implementation adds support for affine transformations in wxDC under wxGTK3 because in this port wxDC is equivalent to wxGCDC.
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when wxDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale(), SetLogicalScale(), SetTransformMatrix() or ResetTransformMatrix().
When any of these functions is called then clipping box data are marked as invalid and updated by recalculating extents of the clipping region in new coordinates at nearest call to GetClippingBox().
Closes#17646.
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when existing wxGraphicsContext is associated with wxGCDC using SetGraphicsContext() or when wxGCDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale() or SetLogicalScale().
When any of these functions is called then clipping box data are marked as invalid and retrieved from underlying graphics context using wxGraphicsContext::GetClipBox() at nearest call to GetClippingBox().
See #17646.
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when existing HDC is associated with wxDC using SetHDC() or when wxDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale(), SetLogicalScale(), SetTransformMatrix() or ResetTransformMatrix().
When any of these functions is called then clipping box data are marked as invalid and updated using GetClipBox() Win API at nearest call to GetClippingBox().
See #17646.
When complex transformation (including e.g. rotation) is applied to DC then coordinates of the clip box return by GetClipBox() API can be inaccurate due to the rounding errors.
To compensate these errors we need to fill rectangle which is slightly larger then just retrieved clip box.
Closes#17636.
If underlying graphics context is rotated then drawing a rectangle with origin at (0,0) doesn't cover all the drawing area. To draw over entire area we need to get extents of the actual clipping region (with applied all transformations) and use it as coordinates of the drawn rectangle.
See #17636.
Width and height were exchanged in the loops, so the conversion code didn't
work correctly and overflowed the pixel buffer (due to extra padding in the
row stride) for non-square bitmaps. It also resulted in a completely wrong
bitmap appearance, but somehow this managed to go unnoticed, unlike the memory
errors.
Closes#17633.
When wxImage is rescaled with wxIMAGE_QUALITY_BILINEAR, wxIMAGE_QUALITY_BICUBIC or wxIMAGE_QUALITY_BOX_AVERAGE algorithm then for proper interpolation there is necessary to uniformly (linearly) map entire pixel range in the new image to the entire pixel range in the current image, i.e. pixels positions (integer values) in range [0..newDim-1] has to be mapped to "virtual" pixel positions (not necessary integer values) exactly in the range [0..oldDim-1].
[0..oldDim-1] range of target mapping is required because for proper interpolation every "virtual" pixel has to be located between two physical pixels in the current image.
Thus scaling ratio used to find corresponding pixels in the current image should be (oldDim-1)/(newDim-1) and not oldDim/newDim (which is used now).
When image is e.g. upsampled oldDim/newDim ratio then some new rightmost/botommost pixels are mapped to old pixels > (oldDim-1) and their values are improperly interpolated (in the current implementation their positions are just truncated to (oldDim-1) to bypass the problem and upsampled image looks like it was shifted left/up). The larger scaling ratio the effect is more visible.
Note:
Because reference images used currently in the unit tests were created with improper scaling there is necessary to upload new reference images created with fixed scaling.
Closes#17594
While setting a clipping region there is necessary to intersect it either with current clipping region location if such region exists or with wxDC surface extents if no clipping region is set. This way effective clipping box will be always inside the wxDC surface. Effective clipping box can be an empty region.
Clipping box parameters are calculated and stored in logical coordinates.
Focus rectangle was still drawn around the label when it was empty with some
themes, so hide it completely to ensure this doesn't happen.
Closes#17443.
Introduce a new type for XRC values imaginatively called just "pair of
integers" which can be used for values not expressed in pixels and hence for
which it doesn't make sense to use dialog units nor to scale them by the DPI.
Use this new type for wxGridBagSizer position and span elements to prevent
them from being changed when using higher than normal DPI.
Closes#17592.
This reverts commit 71dfb3b414 which fixed
appearance of the captions in high contrast mode but broke them for wxGTK.
Ideal would be to make this code work in wxGTK too or, in the worst, case only
use this code for wxMSW, but for now at least avoid breaking wxGTK appearance
by default.
See #16186.
Simplify the officialbuild.bat script by only checking for "vcXX" instead of
accepting both them and "vsYYYY".
Also add instructions for using it in the corresponding HOWTO.
Closes#17514.
This reverts 6c40531fb7 ("Make main thread wake
up code more efficient and less error-prone in wxMSW") as, while being more
efficient, the new code doesn't work at all when we're not running the message
loop ourselves as it happens when the user opens a menu or starts resizing a
window because in both cases Windows runs a local message loop dispatching the
messages itself and this message loop doesn't react to our event object being
signalled.
So this approach can't work and needs to be reverted, even if it reintroduces
the danger of overflowing the message queue (see #9053).
Closes#17579.
There is no way to show the hint without native support in a control with
wxTE_PASSWORD style, so simply ignore them completely in this case.
Closes#17078.
Only use TBSTYLE_AUTOSIZE, adjusting each button to the size it really needs,
for the toolbars with wxTB_HORZ_LAYOUT style as they don't have any uniform
button size anyhow.
The loop over the existing selection was buggy and took into account only one
corner of the block instead of the entire block and also skipped some blocks
entirely.
Closes#17572.
Many improvements in wxSVGFileDC to improve its support of wxDC API including:
- Enabled usage of clipping regions.
- Correctly draw polypolygons.
- Draw lines as one long line instead of many short lines.
- Drawing text improvements (position, multi-line, underlined, strike-through).
- Support more brush and pen styles.
- Add Saving as SVG to drawing sample.
- Implemented Clear().
- Set the SVG title.
- Produce valid svg/xml.
- Correctly draw ellipses and arcs.
See https://github.com/wxWidgets/wxWidgets/pull/215
Apply the appropriate style to any text being inserted, not just the text
added by the program. This not only fixes the bug with default style not being
used for the text entered by user, but also makes the code simpler.
Closes#17523.
Just return a reference to an empty wxString, as GetFirstLine() already does
(although this is actually questionable -- what if this string is modified?).
See #17283.
Vertical scrollbar didn't appear even when the number of lines in the control
became one greater than the maximal fitting number of lines, but only when one
more line was added.
This seems to have been a simple off-by-one error in SetScrollbar() calls, so
fix this by adding 1 to the upper end of the range.
Closes#17548.
Add a new class allowing to store passwords and other sensitive information
using the OS-provided facilities.
Add implementations for all the main platforms, documentation and a new sample
(which contains an ad hoc unit test as the real unit test for this class would
probably be a bad idea as it wouldn't run in non-interactive contexts and
could show OS level dialog boxes if it did).
Since 202f62b4c4 x64 configurations exist
for MSVC 8 and 9 projects. Because MSVC 7 is the minimal supported
version, and doesn't support 64-bit builds, remove the section in
install.txt about x64 configurations being available only in MSVC 10
project files and later.
Selection at wxAuiNotebook level was not updated, resulting in all attempts to
select the tab at the same index as the tab that was dragged elsewhere being
ignored, e.g. after dragging the first tab to the second position in the AUI
sample, the first tab couldn't be selected again.
Fix this by always changing the selection in OnTabEndDrag(). This might not be
the best thing to do as the selection is also changed later in the code and
the fact that the code returns without sending the event is probably a bug
too, but for now at least fix the user-visible problem.
Closes#15071.
This method can be used to change the list view header appearance.
Add the method declaration, documentation, show it in the sample and implement
it for wxMSW (only, for now).
Return the size of the entire virtual screen, possibly composed from multiple
monitors, rather than just the size of the primary monitor.
This makes this method consistent with wxScreenDC actually representing the
entire virtual screen and not just the primary monitor and also with wxGTK.
Closes#13279.
Expand() called ExpandAncestors() in the generic wxDataViewCtrl implementation
but not in the native ones, resulting in observable difference in the
behaviour: for example, the wxDataViewTreeCtrl in the dataview sample appeared
initially expanded under MSW, using the generic version, but collapsed under
GTK and OSX.
Harmonize this among all ports. This also has a nice side effect of making
Expand() less horribly inefficient as it is not recursively called by
ExpandAncestors() which it itself used to call: now ExpandAncestors() only
calls DoExpand() which is a simple function that only expands the item passed
to it and does nothing else.
Closes#14803.
The code handling background colour was commented out for some reason, simply
enable it as it seems to be working just fine -- and update the sample to show
that it does.
This class can be used even without SEH, provided debug help API is available,
so just make wxUSE_STACKWALKER dependent on wxUSE_DBGHELP instead of
unconditionally disabling it if SEH support is not available.
Add XRC handler for wxAuiManager and include the existing wxAuiNotebook
handler into it (but notice that wxAuiToolBar handler added by a later #15686
in f269f868d7 remains separate).
Also update the AUI dialog in the sample and stop hardcoding its size in
pixels.
See #13520.
It's confusing that wxLogInfo() and wxLogVerbose() are exactly the same and
the former, and not only the latter, doesn't do anything unless SetVerbose()
had been called, even if the log level is wxLOG_Info or higher.
Fix this by checking for GetVerbose() in wxLogVerbose() only and making
wxLogInfo() check the log level only. This makes it very similar to
wxLogMessage() but this is not such a bad thing.
Also improve wxLogVerbose() documentation.
Update misc/scripts/inc_release script: remove non-existent any more files and
update the version in the MSVS 200x project files not generated by bakefile
any more and MSVS 201x project files which were not previously taken into
account.
Run it and rebake.
The actual version from https://github.com/wxWidgets/wxWidgets/releases/tag/v3.1.0
with the correct SHA1 sums, a few other minor edits and without the line
breaks which don't seem to be handled correctly in the release announcements.
Disable ASCII quotes substitution with "more typographically accurate"
symbols, just as we already do it for the dashes substitution.
While disabling this unconditionally might not be perfect, it's better than
unconditionally leaving this enabled (and this is on by default since OS X
10.9).
Closes#15705.
Closes https://github.com/wxWidgets/wxWidgets/pull/241
Document the change of wxAppTraits::GetToolkitVersion which when
user-overridden in the best case leads to a compile error and worst case
when it already has been overridden (which is more likely) silently
fails as the user-override would not be called.
Also mention the micro version changes in general in changes.txt.
Previously the editor created by wxDataViewRenderer::CreateEditorCtrl() had to
be a native GTK+ widget implementing GtkCellEditable interface which prevented
using composite windows (e.g. a container for a text control and a button) as
editors.
Create a helper container wrapping them now and implementing GtkCellEditable
now to allow this.
Add wxGLAttribsBase, wxGLAttributes and wxGLContextAttrs replacing the old
untyped "int attributes[]".
Don't use global object for creating OpenGL > 3.0 contexts.
Closes#16909.
Ensure that the correct parent is used when no parent is explicitly specified
by calling GetParentForModalDialog().
This generalizes baff0c942b (see #17384) to the
rest of the modal dialogs (wxMessageDialog already did this).
Closes#17146.
Don't optimize the required length as this is a tiny gain resulting in big
problems with the strings containing surrogates for which the actual result is
shorter than the length returned, resulting in extra NUL bytes at the end of
the converted buffer.
This is similar to 3410aa372f (see #16298) but
for UTF-32 and not UTF-16.
Closes#17070.
Such strings are not really URIs as they should have been encoded if they were
but we can obtain them from e.g. wxFileSystem::FindFirst(), so handle them
correctly here as it's simpler than checking all the places where Unescape()
is called.
Add a unit test checking that decoding an URI containing both Unicode and
percent-encoded Unicode characters works correctly.
Some Windows8+ APIs are only accessible via WinRT which is based on COM. However there are a few dependencies to get to the interfaces via functions defined in roapi.h. Using RoInitialize, RoUninitialize, etc. directly from it's windows headers adds dependencies to the WinRT dlls leaving the resulting exe unable to launch on earlier Windows versions. The wxWinRT functions wrap this with dynamic loading. Additionally wxWinRT::TempStringRef adds a convenient wrapper to HSTRING which is used extensively in WinRT APIs.
MinGW-w64 (and apparently TDM too) defaults to using ANSI stdio functions
nowadays, which interpret format specifiers such as "%s" and "%c" in wide
string functions in the standard-conforming way, i.e. still expecting the
arguments of "char*" type, and not "wchar_t*" as MSVC and older MinGW did.
In practice, almost everybody using validators also seems to use this style,
so make it the default (this hadn't been done when it was originally
introduced because of compatibility concerns, but now, 15+ years later, it's
probably safe enough to change this).
Don't send a wxEVT_DATAVIEW_SELECTION_CHANGED event if an already selected
item is clicked, this is unexpected and inconsistent with the other platforms.
Split SelectAllRows(bool) method in a (trivial) SelectAllRows() and a more
useful UnselectAllRows() which now can check if a particular row is selected
and leave it selected in this case, helping implementing the correct logic and
also avoiding an extra unnecessary refresh due to deselecting the item first
and then selecting it again.
This is documented as being required in the MSDN and, in practice, is
necessary for Windows to update the icon cache and show the new icon.
Closes https://github.com/wxWidgets/wxWidgets/pull/195