Commit Graph

51731 Commits

Author SHA1 Message Date
Vadim Zeitlin
323d36e452 Add wxHAS_BITMAPTOGGLEBUTTON and test for it in the unit test.
Not all ports define wxBitmapToggleButton class currently, so add a special
symbol which is defined only if this class is indeed available and test for it
in the unit test for this class.

This fixes the tests compilation under wxX11.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-01 13:05:36 +00:00
Vadim Zeitlin
e2032c2e21 Disable ItemClick() unit test for wxListCtrl under wxMSW.
This test just doesn't want to work on MSW buildbot slaves even though it
works perfectly locally. No idea why but disable it when running on a build
bot slave for now to let the entire test suite pass.

Also add a comment explaining why the test is disabled for wxGTK.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-01 13:05:30 +00:00
Vadim Zeitlin
0c6a98a443 Disable wxEVT_COMMAND_LIST_ITEM_FOCUSED test for wxMSW.
This test fails on MSW buildbot slaves for unknown reasons so disable it to
make the test suite pass. The failure is irreproducible locally so no idea how
to debug this unfortunately.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 17:35:01 +00:00
Stefan Csomor
4a473abaf2 opening ATSU Font info for Ulrich Telle's wxPDFContext
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 17:30:48 +00:00
Vadim Zeitlin
51b729af92 Add default value for GetPopupMenuSelectionFromUser() position argument.
Let the menu be popped up at the system-determined position, just as it can
already be done with PopupMenu() itself.

Closes #12530.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 14:33:53 +00:00
Vadim Zeitlin
0e555c213d Correctly convert wxPrintf() to a buffer even when it doesn't fit.
ConvertStringToBuf() helper function was defined incorrectly for converting
wxString to a char* buffer as it didn't fill the buffer at all if the string
didn't fit into it entirely instead of putting as much of the string into it
as possible as was already done for the conversion to wchar_t* buffer. This
broke wxSprintf()-related functions in when the ASCII output buffer was not
big enough as it was not filled at all.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65691 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 14:30:41 +00:00
Vadim Zeitlin
37513b6715 Correct handling of %hs and %ls in our wxPrintf() implementation.
The strings corresponding to %hs and %ls are always narrow/wide independently
of the build so using wxArgNormalizedString which is defined differently in
different builds doesn't make sense in wxPrintf().

Instead, simply expect the parameter of the appropriate matching type for
these conversion specifications. Any conversions to it, if necessary, had been
already done before by wxFormatString.

This fixes some VsnprintfTestCase::BigToSmallBuffer() unit test failures.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 14:30:35 +00:00
Vadim Zeitlin
e2dd624761 Fix handling of asterisks in wxPrintf() implementation.
Count the number of asterisks before modifying the string we use to do this,
otherwise we were off by one for the format specifications containing two of
them.

This really fixes the handling of asterisks (used for width/precision) in
wxPrintf() format string, it wasn't done correctly by r60120 but now
VsnprintfTestCase::Asterisk() test does pass.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 14:30:28 +00:00
Vadim Zeitlin
cdd233ef81 Expect an assert in wxVsnprintf() test with too many parameters.
The call to wxPrintf() should provoke an assert if there are too many
parameters, so update the test to expect it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 14:30:23 +00:00
Vadim Zeitlin
32f6c515fd Disable test failing under VC6 only.
Somehow the expected assert is not generated by wxString::Format("%d", ptr)
with VC6. Disable this test to make the test suite pass for VC6 for now to at
least be able to monitor the appearance of the new errors in it.

Of course, this one should ideally be debugged (by someone who is interested
in VC6 support) as well...

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 14:30:18 +00:00
Vadim Zeitlin
1cef35cad3 Insert another item in the list control in its unit test.
For some reason the test fails with a single item in the control when running
on the buildbot slave, check if this is still the case if we add another item
to the control.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65686 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 14:30:13 +00:00
Vadim Zeitlin
66955cc284 Remove out of date code in DoStringPrintfV().
We can't clear a NULL buffer, the code didn't make any sense any more because
it wasn't updated when the function was changed as part of UTF-8 transition.

Closes #12529.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65685 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 14:30:06 +00:00
Michael Wetherell
348a9a6ff2 A couple of fixes for wxChm
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65682 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 13:09:04 +00:00
Vadim Zeitlin
3a3349f518 More compilation fixes for new wxRTC image code without PCH.
Add more headers needed when not using PCH.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 12:30:02 +00:00
Vadim Zeitlin
ce00f59b5b No changes whatsoever, just remove trailing whitespace.
There are no real changes in this commit but it removes all trailing white
space from our source files. This avoids problems when applying patches and
making diffs and it would be nice to prevent it from reappearing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 11:44:45 +00:00
Vadim Zeitlin
6255fac96f Use Unix EOL format for the new files.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 11:31:57 +00:00
Vadim Zeitlin
7132641de7 Include correct headers from richtextimagedlg.*.
Include or forward declares the classes used by the header to make it
self-contained. Do not include wx/wx.h from the source file to make compiling
it faster when not using PCH.

This fixes compilation under Unix after SOC2010_RTC_IMAGES branch merge.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 11:31:04 +00:00
Vadim Zeitlin
00fe363361 Remove interface/implementation #pragmas from richtextimagedlg.*.
These pragmas are not necessary and may actually be harmful, no idea why were
they added in the first place to a new file.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 11:30:58 +00:00
Vadim Zeitlin
cdaed652d7 Merge of SOC2010_RTC_IMAGES branch.
Added floating images and image property dialog to wxRichTextCtrl, by Mingquan
Yang as part of GSOC 2010. Also changed image block creation to use a memory
stream instead of creating a temporary file.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-30 10:27:07 +00:00
Vadim Zeitlin
9bc95da04c Correct printf() format specifiers for long variables in life demo.
Fix asserts in 64 bit builds due to using %u (expecting 32 bit values on a
typical Unix LP64 platform) for 64 bit long values.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65675 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-29 22:01:18 +00:00
Vadim Zeitlin
a65b84f434 Add EVT_RIBBONBAR_TAB_LEFT_DCLICK event.
Generate a special event when a ribbon bar is double clicked.

Closes #12399.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-29 13:46:35 +00:00
Vadim Zeitlin
4267872212 Fix crash in wxWebKitCtrl when using JavaScript.
Ignore the unknown types of the script result, in particular don't crash
trying to dereference an uninitialized pointer if the script didn't return
anything.

Closes #12361.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-29 13:46:24 +00:00
Vadim Zeitlin
c85a79963d Preserve page size when changing increment in wxGTK wxSpinCtrlDouble.
The page size was wrongly reset when changing the increment before.

See #12342.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65672 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-29 13:46:19 +00:00
Vadim Zeitlin
63fb690734 Fix wrong return value of wxGTK wxSpinCtrlDouble::GetIncrement().
Due to confusion in gtk_spin_button_get_increments() parameters order the page
size was returned instead of the increment.

See #12342.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65671 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-29 13:46:14 +00:00
Vadim Zeitlin
59b7da02ff Return wxFONTFAMILY_DEFAULT, not UNKNOWN, from wxFont::GetFamily().
Although returning wxFONTFAMILY_UNKNOWN when the font family is not recognized
makes more sense, it breaks a lot of existing code including all the
font-related code generated by DialogBlocks, so prefer to return
wxFONTFAMILY_DEFAULT instead -- which can't be confused for a valid font
family neither but can be passed to wxFont ctor or SetFamily() without
problems.

To ensure that this behaviour is correctly implemented by all ports, rename
the existing wxFont::GetFamily() to DoGetFamily() and call the new method from
wxFontBase::GetFamily() which adjusts the return value if needed.

Closes #12330.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-29 13:46:09 +00:00
Vadim Zeitlin
4a21ea9d9e Improve mouse handling code in wxAuiToolBar.
Capture the mouse to handle mouse input on the buttons to ensure we always
reset the button when the mouse leaves it.

Closes #11784.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65669 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-29 13:45:56 +00:00
Vadim Zeitlin
bb4acdc085 Include wx/defs.h before testing for wxUSE_RADIOBOX.
We need to include wx/defs.h that (indirectly) defines wxUSE_RADIOBOX
before testing for it in wx/radiobox.h, otherwise the test may fail if the
latter header is the first wx header included by the user code.

This is similar to r65210 fix for wxUSE_CHECKLISTBOX.

Closes #12526.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65668 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-29 13:45:51 +00:00
Jaakko Salli
1e005ad1fd Reset wxPGEditor singleton instance pointers in dtors. This is useful if wxPropertyGrid is being accessed from an external main loop.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65666 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-28 18:59:41 +00:00
Vadim Zeitlin
490e22fdd0 Replace some stray _T()s with wxT().
We use wxT() exclusively now so replace some _T()s which crept in unnoticed.

This also fixes compilation using Sun CC.

See #12452.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-27 12:55:28 +00:00
Vadim Zeitlin
8cb2c49f7d Fix wx/event.h compilation with Sun CC compiler.
Move wxObjectEventFunctor::operator() definition after wxEvtHandler
declaration as it uses call through a pointer to member of this class and Sun
CC refuses to compile this without having the full class declaration.

Closes #12452.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65658 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-27 12:55:22 +00:00
Vadim Zeitlin
0b2a860f0d Use wxString methods for UTF-8 conversions in wxX11 code.
Use wxString::utf8_str() and FromUTF8() to convert to and from UTF-8. This is
more efficient than using wxConvUTF8 as the code did before as it avoids the
conversion entirely when wxString uses UTF-8 internally (as it does by default
in wxX11) and also has the advantage of compiling in STL build unlike the old
code.

Closes #12518.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-27 12:48:21 +00:00
Vadim Zeitlin
02e2609962 Small clean up in wxX11 Pango code.
Don't use unnecessary explicit casts of wxCharBuffer to "const char *".

Use wxCharBuffer::length() instead of strlen().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-27 12:48:14 +00:00
Vadim Zeitlin
80f4c79642 Fix wxX11 compilation when using PCH.
wx/unix/utilsx11.h is not included by wx/wxprec.h so we need to include it
when using PCH too.

Closes #12517.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-27 12:48:07 +00:00
Vadim Zeitlin
ba81782ac3 Document wxSpinDoubleEvent class.
Add documentation for the class itself and the associated EVT_SPINCTRLDOUBLE
macro.

Patch by Carsten Fuchs.

Closes #12520.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-27 11:57:03 +00:00
Vadim Zeitlin
ffc71ce59d Close a modal dialog even when it doesn't have any buttons.
The close button in the dialog title bar should work even if there are no
buttons in the dialog itself (unlike the Escape key which works as an
accelerator for a button), so close the dialog explicitly if the emulated
button click wasn't processed in wxDialogBase::OnCloseWindow().

Closes #12513.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65653 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-27 11:52:06 +00:00
Vadim Zeitlin
f1b08e84a1 Fix typo in wxStandardPathsBase::ResourceCat description and document it.
Document the enum itself and also correct GetLocalizedResourcesDir()
documentation which didn't specify the default value for the category
parameter.

Closes #12523.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-27 11:51:50 +00:00
Vadim Zeitlin
b93f4239bb Compilation fix for MinGW STL build.
std::tr1::unordeded_map<T *>::find() doesn't accept "const T *" pointer, at
least with MinGW 4.4.0 standard library version, so add an explicit
const_cast<> to fix compilation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65651 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-26 22:11:32 +00:00
Vadim Zeitlin
4d5d3cb924 Compilation fix for MinGW 4.x in new keyboard code.
Explicitly choose the comparison operator to use when comparing wchar_t and
int values, otherwise MinGW (correctly) complains about ambiguity between
(int, int) and (wchar_t, const wxUniChar&) overloads.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-26 22:11:27 +00:00
Vadim Zeitlin
5ed8879eaf Make wxDateTime::Tm::yday public and document it.
There doesn't seem any reason to allow access to all the other struct Tm
fields but not yday so make it public, fill it in correctly when creating Tm
without using its ctor from struct tm and document struct Tm itself including
its yday field.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65649 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-26 22:11:21 +00:00
Vadim Zeitlin
fdb44eb24f Initialize wxDateTime::Tm::yday in the ctor.
Set Tm::yday to a fixed value in the ctor as well instead of not initializing
it at all.

This bug actually didn't have any visible consequences as yday is currently a
private member of struct tm and didn't seem to be used anywhere but it at
least avoids MinGW 4.x warnings about possibly uninitialized variable and
might become important in the future if we allow accessing this field.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65648 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-26 22:11:16 +00:00
Vadim Zeitlin
784a3130f8 Correct g++ 4.x warnings about suggested explicit braces.
Several warnings were generated for wxLogLastError() calls inside
CALL_CARET_API macro by MinGW 4.4. Fix them by adding the extra braces.

See also r61475.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65647 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-26 22:11:10 +00:00
Jaakko Salli
36b7e3a2ec Correct empty space drawing
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-24 17:44:20 +00:00
Jaakko Salli
fb296a697d Removed debug log message
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-24 17:40:06 +00:00
Jaakko Salli
248a4ec0f2 Fixed PCH-less build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65629 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-24 15:22:52 +00:00
Jaakko Salli
2e2e62def1 Have wxPropertyGrid inherit from wxControl and wxScrollHelper instead of wxScrolledWindow. This is the approach other scrolled controls use.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65628 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-24 14:47:20 +00:00
Robin Dunn
ff94c563ed Fix sending a size event for the displayed page when the notebook is sized
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65627 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-23 21:12:40 +00:00
Robin Dunn
53ba4eb40a Use the wx version of the wxDECLARE_EVENT_TABLE_ENTRY macro
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65626 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-23 21:11:47 +00:00
Robin Dunn
a2d0722f48 Avoid an endless recursion situation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-23 21:10:34 +00:00
Robin Dunn
a12482a357 Allow the renderer to also work with wxMemoryDCs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65624 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-23 21:09:24 +00:00
Robin Dunn
e6933ff911 SetUserScale(1.0, 1.0) in Unmask() so the image will not be scaled again when blitted
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-23 21:08:26 +00:00