Don't mix signed/unsigned integers in arithmetic operations when normalizing
wxDC scale factors: variable holding GCD value should be of the same type as
variables holding devExt and logExt to avoid wrong results of /= operation
when dividend is a negative value.
Closes#16908.
This is useless at best and resulted in GTK+ warnings because we ended up
(somehow -- is there another bug lurking here?) with negative items height in
this case.
Closes#16862.
When the TZ offset specified in the RFC 822 string was equal to the local TZ
offset but the date fell in the DST period, the result was one hour off.
Fix this by converting the date to the UTC explicitly, and then converting it
back to the local TZ to ensure that the DST is taken into effect.
See #15370.
This was broken due to a wrong cast from WPARAM (i.e. 32 bit unsigned int in
Win32) value containing the ID to WORD (i.e. 16 bit unsigned short) which
truncated the ID value.
Notice that MSDN documents the requirement for the IDs to be positive, but
negative IDs seem to work, at least with Windows 7, after this fix.
Closes#16880.
This avoids failing to set the host name if the system /etc/hosts file has any
host names that wouldn't fit in our buffer: at least under Linux/glibc,
gethostname_r() returns error if any such names exist even if we don't ask for
them.
Closes#16641.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78505 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use GET_{X,Y}_LPARAM() to extract them from the event position, which handle
negative coordinates (and coordinates can perfectly well be negative when
using multiple displays) correctly, unlike {LO,HI}WORD().
Closes#16812.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78419 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Second click can result in a double click event instead of the usual simple
click if it happens quickly enough after the first one, so handle double
clicks in the same way as simple clicks instead of ignoring them.
Closes#16551.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78322 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The cached widths need to be invalidated whenever an item is expanded or
collapsed, whether it's done programmatically (which was already handled) or
interactively by the user (which wasn't).
Closes#16678.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The text control was left empty if the string value was not specified, but
it should use the numeric initial value instead in this case.
This notably affected wxSpinCtrlDouble under non-GTK platforms.
Closes#16621.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78117 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Creating the status bar before the menu bar but associating it with the frame
after creating the menu bar resulted in a status bar of completely wrong height.
Fix this by enforcing the default height on the status bar when it's attached
to the frame.
Closes#10956.
[This is the backport of r76417 from trunk.]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This ended up being broken due to an interplay between different unrelated
changes (at least r15120 and r41134) which were both correct, but didn't work
well together and resulted in not only preventing IsDialogMessage() from
handling ESC, but also our own accelerator tables.
Fix this by doing the check for IsDialogMessage() brokenness in
MSWProcessMessage() itself, just before calling it, instead of doing it in
MSWShouldPreProcessMessage() which is (and must be) called before
MSWTranslateMessage() which checks for accelerators using ESC.
Closes#3813.
[This is the backport of r77071 from trunk.]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't use mask and alpha together, this results in visual artefacts and masks
are unnecessary with RGBA bitmaps anyhow.
The only potentially problematic remaining case is mixing bitmaps with alpha
and mask inside the same image list (as we need to indicate whether we use the
mask or not when creating it), but this should probably be rare and in the
meanwhile we can at least RGBA bitmaps with image lists, which includes doing
this implicitly when they are used as button bitmaps.
Also refactor wxBitmap code to extract part of CopyFromIconOrCursor() to allow
reusing it in the newly added MSWUpdateAlpha().
See #11476.
[This is the backport of r75567 from trunk.]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Override DoGetBestClientSize() instead of DoGetBestSize(), as we're really
computing just the size of our contents and like this we don't need to hard
code platform-dependent border sizes in this control itself.
Also use the client size in LayoutControls() for the same reason. This also
makes it unnecessary to pass it the width and height as it can find them on
its own. And x and y were never used in the first place, so remove them too.
Finally, center the bitmaps vertically.
Closes#16422.
[This is the backport of r77083 from trunk.]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use position, not the ID, to find the native menu items to allow the code in
wxMenuItem::SetItemLabel() and DoSetBitmap() to also work with submenus and
not just the normal items.
Closes#16246.
[This is the backport of r76676 from trunk.]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxFileName::MakeRelativeTo() is only supposed to change the path of the file,
not its name, but it was doing the latter for the shortcuts as it implicitly
resolved them to the name of their target.
Fix this by ensuring we do not use wxPATH_NORM_SHORTCUT in MakeRelativeTo().
Closes#16239.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77515 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If it isn't, the function doesn't risk to work. This is especially pernicious
because OLE is initialized on startup in GUI applications, but not in the
console ones only using wxBase, so this function can, completely unexpectedly,
give different results in them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77514 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Ensure that the order of stops is consistent with the documentation and other
platforms behaviour, i.e. they are counted from inside to outside of the
circle and not vice versa, which happens to be the GDI+ convention.
Closes#16443.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Passing an invalid initial directory to wxDirDialog resulted in using the old
style Windows directory selector dialog instead of the new style (file dialog
like) one, which was unintentional, as incorrect initial directory shouldn't
prevent the dialog from being shown.
Fix this by handling ERROR_FILE_NOT_FOUND error specifically and still showing
the new dialog, just without the (non existent) initial directory value, in
this case.
Closes#16430.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77081 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxCommandEvent::GetString() could return empty string for the
programmatically-generated wxEVT_TEXT events from a wxComboBox.
Fix this by extending the on-demand string retrieval in wxCommandEvent to
wxComboBox as well (it was done only for wxTextCtrl).
Closes#3901.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77056 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Similar to wxNotebook but even simpler as wxSimplebook doesn't use images.
Also add wxSimplebook::Create() as the version inherited from wxBookCtrlBase
didn't _quite_ work: we need to add wxBK_TOP style to prevent asserts due to
unknown alignment in the base class when creating wxSimplebook.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77007 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775