Vadim Zeitlin [Wed, 15 Jun 2011 21:31:48 +0000 (21:31 +0000)]
Fall back to the valid normal bitmap if no state-specific bitmap is set.
After the recent changes we could try to use an invalid bitmap in wxMSW toggle
button code as GetNormalState() could return State_Pressed and then we used
the bitmap for the pressed state unconditionally even if it wasn't set.
It seems more correct to always fall back to the normal bitmap as the pressed
state is already taken into account by GetButtonState().
This fixes unit test failures under MSW after the button classes refactoring.
Vadim Zeitlin [Wed, 15 Jun 2011 13:33:10 +0000 (13:33 +0000)]
Fix keyboard navigation in wxGrid with reordered columns.
Don't mix up column internal indices and display positions in wxGrid keyboard
navigation code.
This ensures that pressing left/right cursor arrows always moves the cursor to
the previous/next column on the display, even if the columns were reordered.
Vadim Zeitlin [Wed, 15 Jun 2011 13:33:07 +0000 (13:33 +0000)]
Rename some parameters in wxGrid code to make them more clear.
No real changes, just call the variables containing display positions "pos"
and not "line" in wxGridOperations to avoid giving the impression that they
contain indices.
Vadim Zeitlin [Tue, 14 Jun 2011 13:00:42 +0000 (13:00 +0000)]
Refactor wxButton and wxToggleButton to derive from wxAnyButton.
Introduce wxAnyButton class, a common base class for wxButton and
wxToggleButton, allowing to reuse the same implementation for them.
This also allows to implement support for bitmaps in wxToggleButton for all
platforms and make wxBitmapToggleButton a trivial subclass of it everywhere,
similarly to wxBitmapButton and wxButton.
Vadim Zeitlin [Tue, 7 Jun 2011 22:49:51 +0000 (22:49 +0000)]
Update status bar fields widths from WM_SIZE handler.
Doing it immediately after calling ::SetWindowPos(), as we used to do, didn't
work correctly (presumably because the status bar fields widths were not
updated yet internally) and resulted in not updating the ellipsized fields
values when "Show window contents while dragging" Windows option was off.
Doing it when we get WM_SIZE works in this case too.
Vadim Zeitlin [Tue, 7 Jun 2011 22:27:35 +0000 (22:27 +0000)]
Handle colours with alpha channel correctly in wxSVGFileDC.
wxColour::GetAsString(wxC2S_HTML_SYNTAX) doesn't accept colours with alpha
channel as alpha is not representable in HTML syntax, so avoid calling this
function with such colours, remove the alpha component in the caller before
using it instead.
Also slightly simplify wxBrushString() and wxPenString() functions code in
wxSVGFileDC implementation.
Vadim Zeitlin [Tue, 7 Jun 2011 14:28:55 +0000 (14:28 +0000)]
Use DECLARE_DYNAMIC_CLASS instead of DECLARE_CLASS.
Correctly use DECLARE_DYNAMIC_CLASS for the classes that are supposed to be
dynamically creatable as using DECLARE_CLASS doesn't work any longer after the
last commit.
Vadim Zeitlin [Tue, 7 Jun 2011 13:06:17 +0000 (13:06 +0000)]
Make wxDECLARE_CLASS synonym of wxDECLARE_ABSTRACT_CLASS.
Previously wxDECLARE_CLASS was a synonym for wxDECLARE_DYNAMIC_CLASS which was
inconsistent with its documentation and wxIMPLEMENT_CLASS that was the same as
wxIMPLEMENT_ABSTRACT_CLASS.
Resolve this in the most backwards compatible and also arguably logical way.
Stefan Csomor [Mon, 6 Jun 2011 19:19:42 +0000 (19:19 +0000)]
turning off unconditional usage of filter-delegate, using native capabilities under 10.6, proper handling of empty default directories for dialogs by passing in nil to native calls,
Vadim Zeitlin [Mon, 23 May 2011 15:26:42 +0000 (15:26 +0000)]
Don't use native MSW wxHyperlinkCtrl implementation in wxUniv.
Move src/msw/hyperlink.cpp and include/wx/msw/hyperlink.h to
ADVANCED_MSW_NATIVE_SRC/HDR from ADVANCED_MSW_SRC/HDR respectively to ensure
that these files are not used in wxUniv build that uses its own, generic,
versions.
This should fix wxUniv/MSW build as the native files didn't even compile with
wxUniv.
Fixed wxMessageBox with only an OK button returning wxCANCEL under MSW.
Since r67620 when wxMessageDialog::ShowModal uses a native task dialog and only has an OK button it actually uses a Cancel button, this resulted in the function's return value wrongly changing to wxID_CANCEL. Fix this by handling the special case with only an OK button and return wxID_OK instead of wxID_CANCEL (and thus wxMessageBox, which uses wxMessageDialog::ShowModal, returning wxOK instead of wxCANCEL).
Vadim Zeitlin [Fri, 20 May 2011 14:29:07 +0000 (14:29 +0000)]
Avoid conversion from wxString to wxChar* and back in wxListBase::DoCopy().
Don't use temporary wxChar* variable to store the node string. This is not
only inefficient because we need to convert wxString to it only to convert it
back to wxString on the next line but also breaks compilation when
wxUSE_STD_STRING==1 and wxUSE_STD_CONTAINERS==0 as there is no implicit
conversion between wxString and wxChar* in this case.
Also modify the code for long keys in the same way just for consistency.
Vadim Zeitlin [Thu, 19 May 2011 14:14:58 +0000 (14:14 +0000)]
Make picker control at least as high as the associated text and square.
Ensure that the height of the picker control is at least as big as the height
of the associated text control and that it's at least as wide as it is high as
it looks bad otherwise.
Vadim Zeitlin [Tue, 17 May 2011 22:12:39 +0000 (22:12 +0000)]
Allow passing wxLongLong values directly to wx pseudo-vararg functions.
Allow passing wxLongLong objects when a "%lld" format specifier (or
equivalent) is used just as we already do for wxString objects when "%s" is
used. This is more convenient and makes wxLongLong closes to the native type.
Vadim Zeitlin [Tue, 17 May 2011 22:12:35 +0000 (22:12 +0000)]
Don't construct invalid wxDateTime in GTK calendar control callbacks.
GTK+ may momentarily return invalid date when switching the month in the
calendar control. Check for this and adjust the date ourselves to make it
valid if necessary in order to avoid the asserts from wxDateTime ctor.
Vadim Zeitlin [Tue, 17 May 2011 13:35:04 +0000 (13:35 +0000)]
Fix client to screen translation in wxWindowMSW::PopupMenu().
Use wxWidgets ClientToScreen() function for computing the screen coordinates
of the popup menu instead of Windows ::ClientToScreen() as the latter doesn't
know about the toolbar which may be present in wxFrame and excluded from the
client area.
Vadim Zeitlin [Mon, 16 May 2011 10:01:12 +0000 (10:01 +0000)]
No changes, just refactor the code in MSW wxGetOsDescription() slightly.
Construct the description string from several pieces: the OS name, its build
number and any extra information about it, instead of duplicating the code
appending the build number to the name in several places.
Vadim Zeitlin [Sun, 15 May 2011 16:16:11 +0000 (16:16 +0000)]
Allow dragging floating AUI frames by the gripper.
Previously starting to drag a pane by its gripper worked but once it undocked
it was impossible to drag it by the gripper any more which was annoying for
the user and unexpected.
Fix this by ensuring that we move the correct top level window and not the
child window when dragging floating panes.
Vadim Zeitlin [Sat, 14 May 2011 14:18:20 +0000 (14:18 +0000)]
Fix small error in floating AUI frames client size under wxMSW.
The client size of the floating frames ended up being wrong because we changed
the wxRESIZE_BORDER flag after setting it and this changed it (at least under
MSW).
Reset wxRESIZE_BORDER first now and set the client size correctly afterwards.
Vadim Zeitlin [Sat, 14 May 2011 14:18:17 +0000 (14:18 +0000)]
Fix restoring of wxAuiManager::m_has_maximized when restoring perspective.
If the perspective being loaded contains a maximized pane, set the
m_has_maximized flag to true. Otherwise the flag and the effective pane state
was out of sync resulting in several problems in the UI behaviour.
Vadim Zeitlin [Sat, 14 May 2011 14:18:09 +0000 (14:18 +0000)]
Reset the checked state of the first radio item in wxAuiToolBar too.
Fix the condition of the loop in wxAuiToolBar::ToggleTool() to also uncheck
the item with index 0 that was always excluded before because of "i > 0" check
in the loop.
Also exclude the item being turned on itself from the loops, it's useless to
reset its checked state only to turn it on again below.
Vadim Zeitlin [Sat, 14 May 2011 14:18:02 +0000 (14:18 +0000)]
Improve checking for the landing point when docking windows in wxAUI.
This is especially important for multiple monitor setups in which the old code
could result in false positives and suggest docking a window on a wrong
display.
Vadim Zeitlin [Sat, 14 May 2011 14:17:55 +0000 (14:17 +0000)]
Take the AUI floating title bar height into account when dragging it.
The cursor wasn't positioned correctly when a floating toolbar was dragged by
pressing the mouse over its gripper because its position didn't take into
account the difference between the client and window coordinates of the
floating window (which is basically the height of the window title bar).
Notice that the same problem still remains when starting to drag a docked
toolbar as it doesn't have the title bar initially but does have it later
so the same fix should probably be applied when we reparent the toolbar.