Julian Smart [Fri, 14 Jan 2011 11:57:44 +0000 (11:57 +0000)]
Implemented text boxes and tables, and further editing pages for backgrounds, borders and margins.
wxRTC functions now operate on the currently focused object, which by default is the whole buffer.
Up to three property commands are now shown on the context menu, depending on
available objects in the current hierarchy.
Vadim Zeitlin [Thu, 13 Jan 2011 14:49:55 +0000 (14:49 +0000)]
Fixes for parsing invalid HTML without tag ends.
The code in wxHtmlParser supposed in many places that a '<' character must be
always followed by a '>' one and could create (and sometimes dereference)
invalid iterators if this wasn't the case resulting in asserts from MSVC debug
CRT and possibly crashes.
Fix this by ensuring that only valid iterators are used and add a trivial unit
test for wxHtmlParser which checks that it can parse invalid HTML without
crashing.
Vadim Zeitlin [Thu, 13 Jan 2011 14:49:44 +0000 (14:49 +0000)]
No changes, just remove a level of indentation in wxHtmlTagsCache ctor.
Get rid of characters not starting a tag immediately in the beginning of the
loop instead of putting the entire loop body inside an if statement. This
doesn't change anything (this becomes more apparent if the patch is viewed
with "ignore white space changes" option) except making the code easier to
read and modify.
Vadim Zeitlin [Wed, 12 Jan 2011 13:39:24 +0000 (13:39 +0000)]
Disable deprecation and other warnings in MFC sample.
VC8+ give tons of deprecation warnings for the standard functions which are
usually suppressed by wx headers but they need to be included first for the
suppression to be effective. In the MFC sample they were not resulting in many
useless warnings.
Fix this by pre-defining _CRT_SECURE_NO_WARNINGS to suppress them in the
sample itself.
Also suppress a warning about WINVER being undefined.
Vadim Zeitlin [Wed, 12 Jan 2011 13:39:16 +0000 (13:39 +0000)]
Fix entry point in Unicode build of the MFC sample.
MFC needs the entry point to be wWinMainCRTStartup() in Unicode builds but the
bakefile-generated projects use the default WinMain() so the sample didn't
link in Unicode.
Fix this by providing WinMain() which simply forwards to wWinMainCRTStartup()
as this seems to work for all MSVC/CRT versions.
Vadim Zeitlin [Mon, 10 Jan 2011 12:00:54 +0000 (12:00 +0000)]
Check index in wxItemContainer methods working with client data.
The test for index validity should be done by the base class public methods
themselves so that the protected methods in the derived classes don't need to
do it because this allows to have the check in one place only and not in every
port-specific derived class and also because a protected method can reasonably
expect to be called with already validated parameters.
This makes it unnecessary to perform the same check in many derived classes
and fixes the problem with those that forgot to check for item validity at all
before (like wxGTK wxChoice).
Also add a unit test checking for the correct behaviour. Unfortunately we
don't have any way to test for the precise assert being triggered so the test
passed for wxGTK wxChoice even before in debug builds because the expected
assert was raised by wxArray::Item() but the code crashed in release build --
whereas now it doesn't any more.
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.