Commit Graph

51164 Commits

Author SHA1 Message Date
Jaakko Salli
52999871ce In wxComboCtrlBase::DoShowPopup(), if the popup window is a generic TLW or a 'perfect' wxPopupWindow, then try to set focus to the popup control at the end of show
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64504 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-06 09:35:06 +00:00
Jaakko Salli
e9cc157957 Use ShowWithEffect() in the sample wxComboCtrlWithCustomPopupAnim instead of manual window manipulation in timer event
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-06 09:15:20 +00:00
Vadim Zeitlin
c07b0669cf Don't send selection events for an already selected item in wxMSW wxListBox.
Remember the last item for which a listbox notification event had been sent
and don't send it again if the user clicks on an already selected item. This
is consistent with wxGTK behaviour and generally makes more sense: why should
we send an event if the selection didn't really change?

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-05 22:58:13 +00:00
Vadim Zeitlin
f186bd4d40 Don't send listbox selection events when mouse wasn't clicked on an item.
Windows sends events even if the mouse is clicked in the area below the items,
filter them out by checking the item under the mouse ourselves.

Also use synchronous GetMessagePos() function to get the mouse position
instead of the asynchronous GetCursorPos() which was wrongly used by the old
code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-05 22:58:09 +00:00
Vadim Zeitlin
f2eb4ad226 Use mouse position to find the item for selection events in wxMSW listbox.
Using LB_GETCARETINDEX doesn't work when the mouse is used to make selection
because it always returns the index of the last item, even if the mouse is
clicked below it, on an area without any listbox items. So use the mouse
position to find the item in this case but still use LB_GETCARETINDEX to find
the item when the keyboard is used.

This required adding a flag to wxListBox storing the kind of the last input
message that it received as there doesn't seem to be any way to determine how
the message was generated otherwise.

This code will be refactored/improved further in the next two commits.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64498 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-05 22:58:05 +00:00
Vadim Zeitlin
096d544752 No changes, just refactor wxListBox initialization in wxMSW.
Extract member fields initialization in Init() method instead of duplicating
it in default ctor and Create().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-05 22:57:59 +00:00
Vadim Zeitlin
53f60d4ab6 Refactor listbox event sending code to avoid duplication.
wxMSW wxListBox implementation contained the same code as the private
LBSendEvent() function in lboxcmn.cpp, so make this function a (protected)
member of wxListBoxBase and reuse it instead.

Also change its and CalcAndSendEvent() return type to bool to be able to
return whether the event was processed or not.

As the result of this refactoring, the "is selected" flag is now set correctly
for the selection events under MSW (it was always off before).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-05 22:57:53 +00:00
Vadim Zeitlin
e052031692 Don't return true from DoTryChain() if the event wasn't really processed.
Correct the return value when an event handler didn't honour "process only in
this handler" flag: we shouldn't pass the event to the further handlers in
this case but we shouldn't return true neither as the event wasn't really
processed.

This corrects background painting of wxHtmlWindow broken by previous changes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-05 22:57:48 +00:00
Robin Dunn
3be6f59151 m_id was already set, don't set it to the passed in value again as then we lose the value which may have been calculated for wxID_ANY.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-05 01:23:18 +00:00
Vadim Zeitlin
f5a64bbab3 Correct EVT_LIST_BEGIN_LABEL_EDIT macro name in the documentation.
The "LIST" part was missing.

Closes #12124.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-04 22:04:23 +00:00
Francesco Montorsi
18c0369bcd no real change: just rename "near" into "onNearPart" (MSVC doesn't like 'near' as variable name)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64480 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-03 21:14:34 +00:00
Jaakko Salli
ce5f620a12 Greatly reduce rare animation garbage in wxOwnerDrawnComboBox drop-down animation (fixes #12087)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64476 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-03 15:16:25 +00:00
Vadim Zeitlin
7c3310596e Drop the column being dragged at the correct position in wxGrid.
The column was being always dropped after the column at drop position but this
was incorrect and didn't correspond to the visual feedback drawn by
wxHeaderCtrl: if the drop position is over the "near" part of the column, the
column should be dropped before it instead.

Do the check for this in wxGrid code too now.

Closes #12120.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64475 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-03 10:35:53 +00:00
Vadim Zeitlin
1b46c6697f Test for wxPen validity before testing for its style in wxGTK wxDC.
Calling wxPen::GetStyle() on an invalid pen resulted in an assert, breaking
the grid column drawing while reordering them, for example, because the code
in wxGrid uses wxDC::DrawRectangle() after calling SetPen(wxNullPen).

Fix this by testing for the pen validity first.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-03 10:35:49 +00:00
Vadim Zeitlin
e612dec202 Assert if an invalid column index is specified when inserting wxListCtrl item.
This also catches the case of inserting an item in a report mode wxListCtrl
without adding any columns to it first. Previously this did result in an
assert but with a less clear error message and, most importantly, still a
crash afterwards. Assert only now, don't crash.

The message could still be improved but hopefully people will be able to
understand that inserting items when no columns are defined is not the right
thing to do.

Closes #12119.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-03 10:35:41 +00:00
Francesco Montorsi
ffcd6cc61e fix StringTestCase::FromDouble: newer MSVC versions use three digits for the exponent width
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 14:56:58 +00:00
Francesco Montorsi
a05e050bd4 remove wxFileConfig tests: FileConfigTestCase already tests features tested by console sample and is much more complete.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64469 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 14:51:45 +00:00
Francesco Montorsi
3634064463 Move some wxPrintf() tests (taken from glibc) to VsnprintfTestCase. Other tests are more difficult to convert in CppUnit style and not worth the effort (since now we don't use wx's own vsnprintf implementation anymore typically).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 14:42:26 +00:00
Francesco Montorsi
7b8ccf3321 Move wxRegConfig tests from console sample to a new wxRegConfigTestCase class.
Remove wxRegKey tests from console sample: on newer Windows they only work when run with admin privileges; also we can expect wx[Reg]ConfigTestCase to already check a good number of wxRegKey features.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 14:12:07 +00:00
Francesco Montorsi
df693ed65c Make wxConfig ctor docs more readable.
Add a simple stub for wxRegConfig class so that Doxygen highlights it just like it does with wxFileConfig.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 13:53:12 +00:00
Vadim Zeitlin
bbdee10d5f Fix recently broken forwarding of events between event handlers.
After the recent changes to the event processing logic, forwarding an event
from one event handler to another one stopped working correctly because the
per-event "process here only" flag prevented it from following the event
handler chain after forwarding. This notably broke keyboard navigation in
wxComboCtrl under MSW in wx itself and probably quite a few of other things in
user code.

Fix this by replacing the boolean flag with a pointer to the handler to which
the processing of this event should be restricted. This allows the full
processing to still take place if an event is forwarded to another handler.
So wxEvent::ShouldProcessHereOnly() is now called ShouldProcessOnlyIn() and
takes a wxEvtHandler parameter.

This made appear a problem in wxScrollHelperEvtHandler code that was hidden by
the bug above: the events were still processed multiple times in it. To fix
this, also add wxEvent::DidntHonourProcessOnlyIn() and take it into account in
the base class code. Did I mention that wxScrollHelperEvtHandler must die?

Add another unit test checking that forwarding works correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 11:58:31 +00:00
Vadim Zeitlin
ce6b1014bf Fix drawing of scaled bitmaps in wxCairoContext.
We must offset the coordinate system before scaling it, otherwise incorrect
offset is used.

Add a test for drawing translated/scaled bitmaps to the drawing sample.

See #11097.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 11:58:25 +00:00
Vadim Zeitlin
5db56cd2e7 Don't hard code position of the drawing sample window and increase its size.
Hardcoding position to 50,50 is inconvenient, let the window manager position
the window as configured by user. Also, the vertical size of the sample was
too small to see the contents of most pages, increase it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 11:58:21 +00:00
Vadim Zeitlin
80d7019761 Remove unused GetTextExtent() call from wxProgressDialog.
This seems to be a left-over from the old, manual positioning code. As we use
sizers now, it's not needed any more.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 11:58:16 +00:00
Francesco Montorsi
20ba398d1a disable FTPTestCase by default.
Add a warning for the user when running --list without arguments: not all tests are listed, only those enabled by default (e.g. FTPTestCase doesn't appear there)!


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 10:49:44 +00:00
Jaakko Salli
87b3708781 Interpret arrow keys correctly in wxMSW wxComboCtrl::IsKeyPopupToggle() (fixes #12114)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-01 15:31:05 +00:00
Jaakko Salli
db3d75435a In wxComboPopupEvtHandler::OnMouseEvent(), when need to relay event to drop-down button, call HandleButtonMouseEvent() directly, if possible. This is less confusing for the platform-specific wxComboCtrl implementations, and fixes issue where the drop-down button could remain in pressed state after the mouse button was lifted.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-01 15:01:59 +00:00
Jaakko Salli
063155781d For clarity: wxComboPopupExtraEventHandler -> wxComboPopupEvtHandler (there is nothing particularly extra about it)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64456 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-01 14:17:32 +00:00
Jaakko Salli
4794626d03 Refactored wxComboPopupExtraEventHandler::OnMouseEvent(). Now block mouse events from the popup control until mouse button has been seen in 'up' state (ignoring first mouse up). This matches Windows native combo box behavior (fixes #12115).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-01 13:46:14 +00:00
Vadim Zeitlin
76e1326add Update AUI floating windows position and not just size on resize.
When a window is resized, its position can change as well as its size but it
wasn't updated before. Do it now.

Closes #11421.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 14:59:18 +00:00
Vadim Zeitlin
6695aca2e2 Regenerate wxstd.pot with the recently added translatable strings.
Simply reran "make wxstd.pot" in locale subdirectory.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 14:59:13 +00:00
Vadim Zeitlin
b27367a5bd Don't disable wxID_PRINT_SETUP even when there is no active document.
Printer can be setup without active document, remove the EVT_UPDATE_UI handler
for wxID_PRINT_SETUP.

See #11394.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64452 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 14:59:08 +00:00
Vadim Zeitlin
6c4da6d611 Translate strings used in doc-view printing code.
Simply use _() instead of wxT() for the user-visible strings.

Closes #12110.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 14:59:03 +00:00
Vadim Zeitlin
7e22c2bd02 Use C locale for numbers in wx(File)Config.
Using the current locale decimal point in config files results in problems
when moving the files to another machine or even using a different locale on
the same one, so don't do it.

Always write the numbers using C locale and try to read them in C locale too
first, but also try the current locale if we failed for backwards
compatibility and to be tolerant with users who edit their config files by
hand.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 11:55:53 +00:00
Vadim Zeitlin
951201d81c Add wxString::FromDouble() and FromCDouble().
wxString::FromCDouble() is needed inside wxWidgets itself to format numbers
independently of the current locale. FromDouble() was added for symmetry with
ToDouble/ToCDouble() functions.

Use std::locale for the implementation if available and manual wxLocale-based
fallback otherwise.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64449 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 11:55:48 +00:00
Vadim Zeitlin
105993f7b6 Make wxString::ToCXXX() methods always available.
We use these methods inside wxWidgets itself and so want to always have them,
even when wxUSE_XLOCALE==0. Provide replacement manual implementations for
this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 11:55:41 +00:00
Vadim Zeitlin
1a39b0131f No real changes, just avoid an unnecessary heap allocation in a test.
We don't need to allocate the locale object in StringTestCase::ToDouble() on
the heap (and then delete it -- or not, if an assertion fails before the
function end), it's enough and simpler to just create it as a local variable.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64447 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 11:55:37 +00:00
Vadim Zeitlin
cd49ac33b3 Fix wxFont::IsFixedWidth() under MSW to always return correct result.
This function worked erratically, returning the correct result or not
depending on the way it was created. Reimplement it using GetTextMetrics() to
get the correct result in any case.

Closes #4714.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64446 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 23:28:59 +00:00
Francesco Montorsi
7cfac8c83a Add a simple example to make it easier to get started (by copy&paste).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64445 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 23:28:51 +00:00
Francesco Montorsi
ed0dd9c1f0 implement * and / operators for wxPoint, not only wxSize.
Add to their documentation a note about the fact that the real operators are not class members but rather global functions.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 23:28:14 +00:00
Vadim Zeitlin
f68e16c5fc Add <span> tag and limited support for CSS styles to wxHTML.
Parse "style" attributes of the HTML tags and honour those of them that can be
mapped to the HTML 3 attributes.

Also add a handler for <span> tag.

Closes #10631.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64443 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 23:12:25 +00:00
Vadim Zeitlin
c9554803fa No changes, just rebaked and reran autoconf.
It seems that autoconf_inc.m4 hadn't been regenerated by a previous change as
rerunning bakefile_gen resulted in a lot of changes in it, do it now without
any other changes to ensure that the next commit only contains the changes due
to its modification of files.bkl.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64441 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 20:05:56 +00:00
Vadim Zeitlin
8325504f4b Activate the view of a newly created document.
This appears to be necessary under Mac where views are top level windows and
should do no harm elsewhere.

Also factor out the activation code in a new wxDocManager::ActivateDocument()
method to avoid duplicating it.

Closes #11417.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 20:05:44 +00:00
Vadim Zeitlin
b99017ce20 Store page setup data in wxDocManager.
Printing of documents from wxDocManager always used default page setup data,
allow the user to configure it now.

Add wxDocManager::m_pageSetupDialogData and add a handler for wxID_PRINT_SETUP
command to it.

Closes #11394.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 20:05:39 +00:00
Vadim Zeitlin
65052c6fa7 Don't generate AUINOTEBOOK_BG_DCLICK when clicking inactive arrow.
Clicking on a disabled arrow shouldn't do anything, in particular it shouldn't
generate a wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK event.

See #12084.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 20:05:34 +00:00
Robert Roebling
9c76b9afa9 Patch update, probably fixes #12090: wxGTK cursor handling revamp
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64437 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 20:01:36 +00:00
Robert Roebling
dec7b5a808 Use GTKXXX notation for some more wxGTK specific methods for consistency
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 17:45:40 +00:00
Václav Slavík
0d373eac1d wxrc -g should output filenames in Unix format.
It is customary in C source code and xgettext has problems with
backslahes in #line comments.

Fixes #10727.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64435 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 16:53:20 +00:00
Julian Smart
a216dfa2c1 Caret position corrected to end of selection
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 14:00:35 +00:00
Václav Slavík
4a0dcc87af Fix Shift+TAB navigation from wxNotebook.
When the focus was on a tab label, Shift+TAB didn't move it out of the
notebook to the preceding control, as it should. Instead, focus moved to
the last control in the current notebook page.

This change fixes it, TAB and Shift-TAB cycling through controls now
behaves identically modulo direction.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 12:21:49 +00:00