When explicitly requesting saving as a palettised image but then later on that turns out to not be possible (or desired) the image would be marked as PNG_COLOR_TYPE_GRAY or PNG_COLOR_TYPE_GRAY_ALPHA. Simply set the colour type to RGB if this occurs also updated the unit test to catch this case.
This is similar to the fix in r66590 but that one was related to wxUSE_PALETTE == 0 cases.
Paul Cornett [Fri, 7 Jan 2011 05:26:57 +0000 (05:26 +0000)]
Move wxColourData and wxFontData into separate files.
This eliminates a linking dependency that would drag in the printing
code for any program that used wxColourDialog or wxFontDialog (which
is currently all of them, due to more link dependencies...)
Vadim Zeitlin [Thu, 6 Jan 2011 22:02:07 +0000 (22:02 +0000)]
Add possibility to hide panels in wxRibbon.
Add wxRibbonBar::{Show,Hide}Panels() and ArePanelsShown() accessor.
Also add a toggle button to the sample to test the new functionality
(unfortunately it couldn't be done by a control in the ribbon itself as there
would be no way to show the panels back then).
These functions don't exist any more (they had been present initially but were
removed in r61484 and r61476 for Unix and MSW respectively) so don't document
them.
Vadim Zeitlin [Wed, 5 Jan 2011 23:52:56 +0000 (23:52 +0000)]
Correct measurement for owner drawn menu items with only unchecked bitmap.
Check for either checked or unchecked bitmap being specified for the item
instead of checking the checked/normal bitmap twice which was an obvious typo
and also resulted in items with unchecked bitmap only not being measured
correctly (although I'm not sure if this is actually a supported use case).
Allow loading 8-bit TGA images when wxUSE_PALETTE is set to 0.
Previously the image would only be loaded when wxPalette is available. This is unneccessary and probably not wanted. Instead decode as usual but use a plain memory buffer for the palette instead of wxPalette functions and don't set the image's palette.
Always save PNG as a true colour image instead of possibly a palettised image when wxUSE_PALETTE is set to 0.
With wxUSE_PALETTE set to 0 and the user forcing to want a wxPNG_TYPE_PALETTE format the image would (partially) be marked as PNG_COLOR_TYPE_GRAY or PNG_COLOR_TYPE_GRAY_ALPHA instead and also saving would fail later on. Instead detect this specific case and save in the wxPNG_TYPE_COLOUR format.
Vadim Zeitlin [Tue, 4 Jan 2011 21:33:16 +0000 (21:33 +0000)]
Disable wxCompositeWindow<> code for VC6.
Revert the attempt to work around VC6 bug from the last commit and simply
disable this code completely for VC6, it's not worth the trouble to try to fix
it for this compiler.
Vadim Zeitlin [Tue, 4 Jan 2011 16:21:42 +0000 (16:21 +0000)]
Remove duplicate IMPLEMENT_XXX_CLASS macros from wxUniv code.
The RTTI macros are now used in common code only and having them in wxUniv too
results in linker errors because of duplicate symbols. Just remove them to fix
this.
Vadim Zeitlin [Tue, 4 Jan 2011 14:13:29 +0000 (14:13 +0000)]
Use wxControl instead of wxControlWithItems with wxRTTI macros.
wxControlWithItems is just a convenient combination of wxControl and
wxItemContainer mix-in and it is not useful to include it in wxRTTI classes
hierarchy. Also, using wxControlWithItems as the base class for wxChoice and
wxListBox but not for wxComboBox is inconsistent but wxControlWithItems can't
be used for the latter so resolve this by not using it at all.
Ideally we'd have a way of retrieving the list of supported interfaces (such
as wxItemContainer or wxTextEntry) via wxRTTI too.
Vadim Zeitlin [Tue, 4 Jan 2011 14:13:17 +0000 (14:13 +0000)]
Use wxControl as wxComboBox base class for wxRTTI in all ports.
wxComboBox only derives from wxChoice in wxMSW but not in the other ports so
use wxControl as its base class in wxIMPLEMENT_DYNAMIC_CLASS_XTI() macro in
all ports.
Since upgrading to a newer libpng its structure members are marked as deprecated (probably as a way to discourage their direct usage). Replaced accessing them by using function calls instead.
Applied patch by troelsk which mostly makes the GIF decoder more readable by using named constants instead of magic numbers. Left out the edits that changed unsigned char to wxUint8. In addition removed unnecessary casts around wxInputStream.GetC() calls.
Vadim Zeitlin [Tue, 4 Jan 2011 11:33:19 +0000 (11:33 +0000)]
wxMSW compilation fix for wxCompositeWindow.
Not all ports override SetXXX() methods in their wxWindow class so use the
versions from wxWindowBase which are definitely known to exist. Notice that
the call itself is still virtual so it doesn't matter which base class do we
use.
Vadim Zeitlin [Mon, 3 Jan 2011 18:44:16 +0000 (18:44 +0000)]
Add "virtual" keywords to the overridden functions in the printing sample.
There are no real changes, just make it easier to understand that the sample
code overrides the base class virtual methods by reusing the virtual keyword
in the derived class.
Vadim Zeitlin [Mon, 3 Jan 2011 15:57:30 +0000 (15:57 +0000)]
Don't hardcode wxPreviewControlBar size in print preview code.
For some reason the control bar height was hard coded to 40 pixels which could
be not enough to use the buttons of the appropriate size. Don't hardcode its
size any more and let the sizer determine it instead.
Vadim Zeitlin [Mon, 3 Jan 2011 14:58:26 +0000 (14:58 +0000)]
Allow selecting any kind of file in the sound sample.
This is especially useful under Mac where wxSound can play files other than
.wav too (e.g. .aiff files which can be found under /System/Library/Sounds).
Vadim Zeitlin [Mon, 3 Jan 2011 11:24:13 +0000 (11:24 +0000)]
Add wxCompositeWindow<> and use it in wxDatePickerCtrlGeneric.
wxCompositeWindow<> is a convenient base class for composite windows, i.e.
windows consisting of several other wxWindows. Currently it just automatically
forwards various attributes setters calls to all of the composite window parts
but it could become more useful in the future.
Similarly, for now it is only used in wxDatePickerCtrlGeneric but it could
(and should) be used for other composite controls later and we probably should
even make this class public to allow its use in the client code.
Vadim Zeitlin [Mon, 3 Jan 2011 11:23:49 +0000 (11:23 +0000)]
No real changes, just remove an unneeded header dependency.
There was some commented out code in (core) valgen.cpp file using
wxDatePickerCtrl (from adv library). Also comment out the inclusion of
wx/datectrl.h header as it's not needed as long as this code remains commented
out and creates an unexpected dependency of a core library file on an adv
library header.
Only including wx/datectrl.h does not always include wx/generic/datectrl.h, for example it does not for MSW non-Universal. As a result when compiling datectlg.cpp wxDatePickerCtrlGeneric is unknown and compilation fails. Fixed by including wx/generic/datectrl.h again (regression since r66524).
Vadim Zeitlin [Sun, 2 Jan 2011 22:05:14 +0000 (22:05 +0000)]
Remove calls to wxApp::SetTopWindow() from the samples and documentation.
It is definitely not necessary to call SetTopWindow() when there is only a
single top level window and it is arguable whether it's useful to do it even
when there are many of them so don't encourage its use in the documentation
and also remove all its occurrences from the samples.