Improve main and extended messages handling in new wxMSW wxMessageDialog.
Don't use the main message if there is no extended message: this looks bad as
the main message is emphasized to contrast with the extended one which doesn't
make sense visually if there is no extended message.
Also recognize the common use of wxMessageBox() with a multiline text composed
of the first string that plays the role of the main message with the rest
being the extended one and handle this appropriately automatically. This
results in a better appearance by default for a lot of message boxes,
including even the one in our own minimal sample.
Add a link to Microsoft guidelines from wxICON_QUESTION documentation.
Microsoft documentation provides explanations as to how the icons should be
used in the message dialogs which can be useful for people wondering which
icon style to use an when.
Václav Slavík [Fri, 3 Sep 2010 19:33:18 +0000 (19:33 +0000)]
Fix wxOwnerDrawnComboBox keyboard navigation with duplicate items.
If the combobox contained duplicate strings (i.e. multiple items with the
same string value, but differing indexes), then navigating to the second
and subsequent ones skipped to the first occurence instead. We need to
preserve the index.
wxRichTextCtrl::ApplyStyle now applies a paragraph style at the cursor
without needing a selection, and setting the default style now avoids duplicating
character attributes in subsequently typed text when they exist in the paragraph style.
Václav Slavík [Wed, 1 Sep 2010 13:28:43 +0000 (13:28 +0000)]
Reduce flicker when removing wxNotebook page.
wxMSW implementation hides all pages except the selected one. But when
removing selected page from the control, this invariant is temporarily
broken and this results in visible flicker. Hiding the page as soon as
it gets removed fixes it.
Vadim Zeitlin [Mon, 30 Aug 2010 22:18:52 +0000 (22:18 +0000)]
Add wxGrid::RefreshAttr() method to force attribute refresh.
A cached attribute may continue to be used even though the attribute returned
by a custom wxGridCellAttrProvider has changed so add a method to force wxGrid
to update the attribute by forgetting the cached copy.
Vadim Zeitlin [Mon, 30 Aug 2010 21:48:25 +0000 (21:48 +0000)]
Don't center wxGenericMessageDialog elements.
Centering doesn't seem to be appropriate on neither of the major platforms and
makes wxGenericMessageDialog and wxGenericRichMessageDialog which uses it look
even less native than otherwise.
Simply don't do it neither for the text nor, especially, for the buttons where
wxStdDialogButtonSizer already exists to take care of their alignment.
Vadim Zeitlin [Mon, 30 Aug 2010 21:48:21 +0000 (21:48 +0000)]
Allow using custom labels for wxGenericMessageDialog buttons.
Custom labels set for wxGenericMessageDialog buttons were simply ignored as it
used CreateSeparatedButtonSizer() to create the actual buttons which in turn
always used the standard labels.
Fix this by explicitly creating the buttons with custom labels if necessary.
This also fixes custom label support in wxGenericRichMessageDialog deriving
from this class.
Vadim Zeitlin [Mon, 30 Aug 2010 21:48:11 +0000 (21:48 +0000)]
Fix button order in wxStdDialogButtonSizer in all cases under GTK.
The order of Yes/No/Cancel was recently fixed by the changes in r65346 but it
broke the order of the buttons in Ok/Cancel case. Ensure the correct order is
used in all cases now: the one described by GNOME HIG by default but different
order for the special case of Yes/No/Cancel which follows the native message
box.
Vadim Zeitlin [Mon, 30 Aug 2010 21:48:06 +0000 (21:48 +0000)]
Rewrite GTK section of wxStdDialogButtonSizer using wxSizerFlags.
Using wxSizerFlags makes the code shorter and more understandable but
otherwise there are no real changes in behaviour except for a minor fix to one
of the border which was wrong before.
Jaakko Salli [Thu, 26 Aug 2010 13:51:45 +0000 (13:51 +0000)]
Changed wxArrayStringProperty default delimiter to comma. It should allow for better looking and more easily editable property values for common cases.
Václav Slavík [Wed, 25 Aug 2010 15:02:30 +0000 (15:02 +0000)]
Fix wxListBox selection handling broken by r64500.
r64500 introduced tracking of previous selection in wxMSW's wxListBox so
that an event isn't sent when the user clicks already selected item
again. Unfortunately, it forgot to account for programatic changes of
selection (e.g. when all items are removed, so is the selection) and
didn't update selection book-keeping information in that case. The
result was that the event wasn't sent when it should be in some cases.
Fixed by using UpdateOldSelections() even in single-selection case in
wxMSW.
Vadim Zeitlin [Tue, 24 Aug 2010 11:36:43 +0000 (11:36 +0000)]
Remove unused wxDisplay implementation using DirectDraw from wxMSW.
Remove commented out version of DirectDraw-based wxDisplayFactory
implementation. It doesn't seem to have any advantages compared to the
currently used version and nobody uses it anyhow.
Vadim Zeitlin [Sun, 22 Aug 2010 23:46:02 +0000 (23:46 +0000)]
Use "C" locale for locale-dependent part of TextCtrlTestCase.
As we expect to get decimal points in the text control when we stream floating
point numbers into it, we must do it in a locale which uses decimal point,
e.g. "C" one. Otherwise the test failed when ran in e.g. French locale.
Vadim Zeitlin [Sun, 22 Aug 2010 22:15:42 +0000 (22:15 +0000)]
Merge wxUIActionSimulator fixes from SOC2010_GUI_TEST branch.
Correct a lot of problems with the initial implementation, notably make the
API consistent across all platforms, e.g. all keyboard-related methods now
take just a wxKeyCode.
Add some useful higher-level helpers such as Text() and MouseDragDrop().
Improve documentation.
wxUIActionSimulator now works under MSW, GTK and OS X and is enabled by
default.
Vadim Zeitlin [Sun, 22 Aug 2010 22:15:27 +0000 (22:15 +0000)]
Don't crash in wxOSX::wxClipboard::Clear() if initialization failed.
Creating the clipboard may fail (e.g. when running from a ssh session to an OS
X machine), don't crash by passing NULL pointer to PasteboardClear() if this
happens but assert and return instead.
Vadim Zeitlin [Sun, 22 Aug 2010 22:15:22 +0000 (22:15 +0000)]
Work around a crash on starting editing in wxGrid under wxOSX/Cocoa.
wxOSX/Cocoa currently generates unexpected focus loss events with the window
gaining focus being the same one as losing it. This is wrong and shouldn't
happen but as long as it does, filter these events out to at least allow
editing the grid to work.
Vadim Zeitlin [Sun, 22 Aug 2010 22:15:17 +0000 (22:15 +0000)]
Don't send event from wxMSW::wxListCtrl::DeleteAllItems() if it did nothing.
wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS should only be sent if the control hadn't
been empty before. Document this behaviour and adjust wxMSW to match the
other platforms.
Vadim Zeitlin [Sat, 21 Aug 2010 23:33:40 +0000 (23:33 +0000)]
Don't report spurious errors from wxSocket in "no wait" mode.
In wxSOCKET_NOWAIT mode wxSOCKET_WOULDBLOCK is not a real error as it's
expected and should be just discarded. Failing to do this could result in the
following scenario:
1. Try to read a big buffer with wxSOCKET_NOWAIT (setting wxSocket error to
wxSOCKET_WOULDBLOCK).
2. Process small part of it.
3. Read more data from wxSocket -- which now goes to the data containing
already cached data without going to the socket itself and this without
resetting the error.
4. Check wxSocket::Error() which turns out to be (still) true.
And this was exactly what happened in mysteriously failing unit test case
reading wxImage contents from a socket: the failure was difficult to reproduce
because it depended on how much data exactly did we read from the socket in
one go.
Fix this by resetting the error properly and reenable the unit test which was
previously disabled for the build bot, it should pass now.
Vadim Zeitlin [Thu, 19 Aug 2010 15:41:18 +0000 (15:41 +0000)]
Make the main message of wxGenericMessageDialog stand out.
Use larger bold font for the main message in wxGenericMessageDialog if the
extended message is also given to make it stand out similarly to how it
happens in the native GTK and MSW dialogs.
Vadim Zeitlin [Wed, 18 Aug 2010 22:49:02 +0000 (22:49 +0000)]
Use task dialog for wxProgressDialog implementation in wxMSW.
If available, the task dialog is now used for the wxProgressDialog under
Windows. This provides a much more native looking dialog which doesn't look
out of place under modern Windows versions, unlike the generic implementation.
The internals of the code had to be significantly changed as the task dialog
can only be shown modally so, to emulate wxProgressDialog modeless nature, a
separate thread is used for the progress dialog management.
Vadim Zeitlin [Wed, 18 Aug 2010 22:48:41 +0000 (22:48 +0000)]
Add wxRichMessageDialog class.
This is a generalization of wxMessageDialog based on the native task dialog
under recent (Vista and later) Windows versions and implemented generically
for the other ports for now.
It provides the possibility to use additional controls in the message boxes
(checkbox useful for the "Don't ask me again" kind of dialogs and collapsible
detailed explanations field) and better look and feel under Windows.
Vadim Zeitlin [Wed, 18 Aug 2010 22:48:28 +0000 (22:48 +0000)]
Provide a task-dialog based wxMSW wxMessageDialog implementation.
Use the task dialog instead of the legacy message box for wxMessageDialog
implementation under wxMSW on recent (Vista and later) Windows versions.
As part of this change, remove wxMessageDialogWithCustomLabels and integrate
its functionality in wxMessageDialogBase itself as it's now used by all
platforms.
Vadim Zeitlin [Wed, 18 Aug 2010 22:48:15 +0000 (22:48 +0000)]
Fix Yes/No/Cancel buttons order in wxGTK wxStdDialogButtonSizer.
"Yes" and "No" buttons should be positioned next to each other for consistency
with the native message box instead of separating them with the "Cancel"
button.
Robert Roebling [Mon, 16 Aug 2010 17:48:28 +0000 (17:48 +0000)]
Ignore non-existant string selection in wxComboBox::SetValue() in read-only mode, as per the very exact docs, fixes #12329: wxComboBox can set non-existing string in read only mode
Vadim Zeitlin [Sun, 15 Aug 2010 21:14:06 +0000 (21:14 +0000)]
Fix wxMSW compilation in wxUSE_STL==1 case.
A wxDECLARE_NO_ASSIGN_CLASS() was recently added to ClassRegInfo but storing
it in a vector requires it to be "Assignable" so this broke compilation in STL
case (wxVector<> doesn't enforce this requirement currently).
Vadim Zeitlin [Wed, 11 Aug 2010 16:04:00 +0000 (16:04 +0000)]
Handle wxDefaultSize correctly in wxNonOwnedWindow under wxOSX.
Creating a wxNonOwnedWindow with default size created tiny, practically
invisible windows because the default size was only taken care of at
wxTopLevelWindow level but not in wxNonOwnedWindow itself. In particular, this
broke creation of wxMDIChildFrames with the default size as this class only
derived from wxNonOwnedWindow and not from wxTopLevelWindow under OS X. It
also probably wasn't intentional as the code did use {Width,Height}Default()
functions but they were wxWindow methods and not the wxTopLevelWindow
(confusingly and error-pronely) named the same.
Fix this, remove the now redundant checks for the default size in
wxTopLevelWindow itself and also rationalize and condense the checks for the
default position and size components in wxNonOwnedWindow::Create().
Vadim Zeitlin [Wed, 11 Aug 2010 16:03:55 +0000 (16:03 +0000)]
Make wxTopLevelWindow::GetDefaultSize() public and document it.
This method is/will be needed by wxNonOwnedWindow in wxOSX but couldn't be
used as long as it was protected, so make it public. And as it seems that it
might be useful outside of wx itself, document it as well.