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.