Instead of converting alpha to a mask an attempt is made to write a palettised PNG file with an ARGB palette using a maximum of 256 transparency values where formerly just up to one was supported. GIF images with 256 colours and transparency can now also be saved as a palettised PNG instead of true colour, making the image a lot smaller.
Applied (modified) patch by troelsk. Closes #12850.
Václav Slavík [Mon, 28 Feb 2011 21:23:10 +0000 (21:23 +0000)]
Toggle checkboxes in generic wxDataViewCtrl with single click.
Both GTK+ and OS X native controls use single click to toggle
checkboxes, instead of double-click activation used by the generic
version. So does wxCheckListBox on Windows, so make wxDVC
behave the same way.
Václav Slavík [Mon, 28 Feb 2011 21:23:04 +0000 (21:23 +0000)]
Get rid of WXGetAsCustom().
Instead, have WXOnActivate() and WXOnLeftClick() with same signatures as
their public API counterparts and just call Activate/LeftClick() from
them for wxDataViewCustomRenderer.
This accomplishes the same thing, but makes it easier to override
behaviour in wx's internal implementations of renderers.
Vadim Zeitlin [Sun, 27 Feb 2011 18:36:55 +0000 (18:36 +0000)]
Use single quotes in wxMarkupText unit test to work around VC6 bug.
VC6 seems to have a strange bug with escaped quotes used in strings passed to
macros and failed to compile the original code with nonsensical error messages.
Use single quotes to try to work around this issue. They are also somewhat
more readable as they don't need to be escaped inside C strings.
In case of a certain amount of whitespace at the bottom of a vertical toolbar it would not be drawn correctly: the more whitespace the more painting would be clipped starting from the left (covering the whole height of the toolbar) until the toolbar would look completely empty.
This was reproducible using the toolbar sample, setting the toolbar on the left or right edge of the window and then increasing the height of the window sufficiently.
Vadim Zeitlin [Sun, 27 Feb 2011 14:01:36 +0000 (14:01 +0000)]
Replace template function with template class to placate VC6.
VC6 has very poor support for template functions and in particular doesn't
understand explicitly choosing the type of the function to call so replace
template DoApplyToFont() function with FontModifier template class in
wxMarkupParserAttrOutput implementation.
Vadim Zeitlin [Sun, 27 Feb 2011 12:48:46 +0000 (12:48 +0000)]
Add markup support to wxOSX/Cocoa wxStaticText and wxButton.
Add wxMarkupToAttrString helper that converts wx markup to OS X attribute
strings and use it in wxStaticText and wxButton.
This required adding new SetLabelMarkup() method to wxWidgetCocoaImpl, it
seems to make sense to have it there as it could be implemented by more
controls in the future.
Vadim Zeitlin [Sun, 27 Feb 2011 12:48:38 +0000 (12:48 +0000)]
Add markup support to generic wxStaticText implementation.
wxMarkupText allows to easily support markup in the controls that we draw
ourselves so use it in wxGenericStaticText to have a possibility to use
markup on all platforms, even those where there is no native markup support in
wxStaticText itself.
Vadim Zeitlin [Sun, 27 Feb 2011 12:48:13 +0000 (12:48 +0000)]
Add wxDC::GetFontMetrics() and implement it for wxMSW.
Add a new wxDC method allowing to retrieve the font characteristics not
available from GetTextExtent(), notably the internal leading (and also the
average font width).
Currently this is implemented for wxMSW only, the internal leading is always 0
in the other ports.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:48 +0000 (12:47 +0000)]
Restore height tweaking in wxMSWButton::GetFittingSize().
The change of r66893 was wrong, we do need to adjust the button height here
because the increase to standard height is not enough if we use bigger fonts
that require making taller buttons.
The real problem was the use of EDIT_HEIGHT_FROM_CHAR_HEIGHT() which added too
much to the height, so replace it with something based on the actual font
height. This is still arbitrary but slightly better.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:43 +0000 (12:47 +0000)]
Initialize wxButton::m_authNeeded in ctor and not Create() in wxMSW.
Ensure that the member is always initialized as calling GetAuthNeeded() for a
default-constructed button would access a non-initialized variable before.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:36 +0000 (12:47 +0000)]
No changes, just do wxButton fields initialization in Init() in wxMSW.
Add a helper function called from ctors and initialize m_imageData in it
instead of doing it in each ctor -- this will be more important when we add
more wxButton members.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:26 +0000 (12:47 +0000)]
Replace wxST_MARKUP style with wxControl::SetLabelMarkup().
This is an incompatible change which removes the wxStaticText-specific
wxST_MARKUP style and adds wxControl::SetLabelMarkup() replacing it.
It doesn't actually change anything yet but it simplifies wxStaticText code a
lot by getting rid of many markup-related functions in it which had to behave
differently depending on whether wxST_MARKUP was used or not and also paves
way for adding markup support for the other controls in the future.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:15 +0000 (12:47 +0000)]
Don't call base class SetLabel() from GTKSetLabelForLabel().
Calling wxControlBase::SetLabel() only from GTKSetLabelForLabel() made its
behaviour inconsistent with GTKSetLabelWithMarkupForLabel() and also was
redundant in all but two places from which it was called, so remove this call
from this function itself and instead add it to its callers where it's really
needed.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:11 +0000 (12:47 +0000)]
Remove unnecessary use of RemoveMarkup() in wxMSW wxHyperlinkCtrl.
Only the ampersands need to be escaped when setting the text of a native hyper
link control in MSW and this is done by wxControl::EscapeMnemonics(), not by
wxStaticText::RemoveMarkup() which also removes any tags which is not wanted
at all here.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:05 +0000 (12:47 +0000)]
Add wxFont::SetSymbolicSize() and SetSymbolicSizeRelativeTo().
These methods allow to set the font size using CSS-like absolute size
specifications.
Notice that the factors used here are incompatible with (but better than) the
ones used in wxBuildFontSizes() in src/html/winpars.cpp. In the future it
would be nice to reuse the new wxFont functions in wxHTML code.
Vadim Zeitlin [Sun, 27 Feb 2011 12:46:55 +0000 (12:46 +0000)]
Use wxMarkupParser in wxStaticText for dealing with markup.
No real changes, just remove markup parsing code from wxStaticText
implementation and reuse wxMarkupParser methods there instead.
This makes include/wx/private/stattext.h file unnecessary as it is used only
in a single place now so remove it and move its remaining contents to
src/gtk/mnemonics.cpp.
Vadim Zeitlin [Sun, 27 Feb 2011 12:46:34 +0000 (12:46 +0000)]
Add a simple wxStack<> template class based on wxVector<>.
This is still simpler than std::stack<> which can be used with any container
and not just wxVector<> but better than the WX_DECLARE_STACK() macro which was
all that we had before.
Vadim Zeitlin [Sun, 27 Feb 2011 12:45:30 +0000 (12:45 +0000)]
Disable NumValidatorTestCase::Interactive() for build bot slaves.
This test consistently fails on the MSW build slave machines (see e.g.
http://buildbot.tt-solutions.com/wx/builders/XPSP2 VC9 wxMSW trunk release/builds/2084/steps/test/logs/stdio)
for unknown reason so disable it for them. Notice that it does pass when ran
locally so it looks like another instance of a problem with wxUIActionSimulator
on these machines rather than the problem with the class itself.
Vadim Zeitlin [Sun, 27 Feb 2011 12:45:24 +0000 (12:45 +0000)]
Only use wxBU_EXACTFIT for width calculations in wxMSW wxButton.
wxBU_EXACTFIT should affect the width of the button best size but not its
height which should be at least the same as the height of a standard button
even when wxBU_EXACTFIT is specified, otherwise buttons created with it (like
the one in generic wxCollapsiblePane implementation) look completely ugly.
This commit restores the old behaviour which was recently changed by wxButton
sizing code simplifications.
Vadim Zeitlin [Sun, 27 Feb 2011 12:45:19 +0000 (12:45 +0000)]
Specify correct size for disabled image list in wxMSW wxToolBar.
Use the real bitmap size instead of the default tool size when creating the
disabled image list as the actual bitmap size could be less than the default
one and in this case adding images to the image list later would fail (as
could be seen by using custom bitmaps in the toolbar sample).
Vadim Zeitlin [Sat, 26 Feb 2011 17:51:34 +0000 (17:51 +0000)]
Fix libraries order in screenshotgen bakefile.
The richtext library must come before the adv one as it depends on the classes
in the latter and with the old libraries order linking failed in static build.
Vadim Zeitlin [Sat, 26 Feb 2011 17:46:54 +0000 (17:46 +0000)]
Don't use wxTE_PROCESS_ENTER in wxSpinCtrlGeneric.
We don't need to catch Enter presses to generate spin control events as we do
it anyhow when we lose focus. So simply remove the Enter handling code
entirely (it could be used to generate wxEVT_COMMAND_TEXT_ENTER events but we
don't generate them nor wxEVT_COMMAND_TEXT_UPDATED at all currently in the
generic version).
Jaakko Salli [Fri, 25 Feb 2011 13:00:57 +0000 (13:00 +0000)]
In wxPGProperty::SetValueImage(), use wxImage::Rescale() for scaling down the bitmap instead of wx(Memory)DC functions. Results should look much nicer and also retains alpha channel with much less effert.
Vadim Zeitlin [Tue, 22 Feb 2011 13:26:00 +0000 (13:26 +0000)]
Test for cairo_push_group() in configure.
This function is required by wxGraphicsContext Cairo-based implementation but
is missing in old Cairo versions so check for it in configure and disable
wxGraphicsContext is it's not available.
Vadim Zeitlin [Tue, 22 Feb 2011 13:25:51 +0000 (13:25 +0000)]
Put storage class outside WXDLLIMPEXP_DATA_CORE() macros.
The storage class must come first in a declaration so put it in front of
WXDLLIMPEXP_DATA_CORE() and not inside it to avoid warnings from some
compilers (notably Intel one).
Václav Slavík [Sun, 20 Feb 2011 18:18:51 +0000 (18:18 +0000)]
Put normal space between Back and Next buttons in wxWizard.
Use regular space between these two buttons even on Windows, where they
were previously close together. This used to be done in older Windows
versions, but modern Windows HIG documents show wizards with equal
spacing between all buttons and that's what Windows OS itself does. In
other words, not treating this pair of buttons specially is more native.
Vadim Zeitlin [Sat, 19 Feb 2011 14:16:58 +0000 (14:16 +0000)]
Remove extra semicolons in Objective-C code.
The semicolons after the method signature in its implementation are useless
and, in fact, provoke warnings from the compiler used by Xcode 4. Simply
remove them.
Vadim Zeitlin [Sat, 19 Feb 2011 12:33:08 +0000 (12:33 +0000)]
Add wxAutomationInstance_SilentIfNone flag for wxMSW OLE code.
This flag allows to suppress the error message in case there are no currently
running instances of this object and can be useful if the caller doesn't know
in advance whether it's available or not.
Vadim Zeitlin [Sat, 19 Feb 2011 12:32:59 +0000 (12:32 +0000)]
Move "static" keyword out from wxDEPRECATED() macros to placate icc.
Intel compiler gives warnings if the static keyword is not at the beginning of
the declaration and this happened when using it inside wxDEPRECATED() and
related macros because the declaration started with __declspec(deprecated) or
__attribute__((deprecated)) instead.
To avoid this problem, simply move "static" outside the macro.
Vadim Zeitlin [Sat, 19 Feb 2011 12:32:53 +0000 (12:32 +0000)]
Correct signed/unsigned comparison in wxGridBagSizer code.
Casting a signed value to unsigned type is a recipe for disaster if it
actually turns out to be negative because the comparison remains always false
and the loop becomes practically infinite. So cast the unsigned value to
signed int instead, this should be perfectly safe as the number of columns or
rows in a sizer can't exceed INT_MAX anyhow.
Notice that after the changes of the previous revision the signed value
should actually be always positive so this change is not strictly needed but
it is still safer to write the comparison like this.
Vadim Zeitlin [Sat, 19 Feb 2011 12:32:48 +0000 (12:32 +0000)]
Don't accept invalid values for rows/columns in wxGBSpan ctor.
wxGBSpan must have strictly positive row and column span as otherwise the grid
bag sizer code could enter an infinite loop trying to exceed a negative number
which it casted to an unsigned one. And while the cast itself is incorrect too
the program still behaves undesirably (produces a lot of asserts in debug
build and then crashes or crashes directly in release) if a zero size span is
used so it seems better to prevent this from happening.
Vadim Zeitlin [Sat, 19 Feb 2011 00:30:32 +0000 (00:30 +0000)]
Fix out of bounds string access in wxMSW wxDirDialog.
Using the initial directory of "/" (or "\\" or in fact any string consisting
solely of slashes and backslashes) resulted in a crash as the code incorrectly
tried to read the character before the beginning of the string.
Fix this by checking that the string is not empty before using s.end()-1
iterator.