Stefan Csomor [Tue, 11 Jun 2013 17:56:27 +0000 (17:56 +0000)]
notify the event loop that synthesized events are on the queue, wait for them to be available, also on OSX a double click has to be synthesized slightly differently
Václav Slavík [Tue, 11 Jun 2013 16:46:49 +0000 (16:46 +0000)]
Use correct extensions in wxDynamicLibrary::CanonicalizeName() on OS X.
Contrary to the documentation, this function incorrectly appended the
.bundle extension on OS X for libraries as well as modules.
Fixed to use .dylib for libraries (wxDL_LIBRARY) and continue to use
.bundle for loadable modules (wxDL_MODULE). Change GetDllExt() to take optional wxDynamicLibearyCategory argument.
Vadim Zeitlin [Mon, 10 Jun 2013 15:53:29 +0000 (15:53 +0000)]
Add wxMouseEvent::GetColumnsPerAction().
This is similar to the existing GetLinesPerAction() but is for, surprise,
columns.
Also change the documentation to say that the value returned by both of these
methods is 3 under "most platforms" as some wxOSX currently uses 1 and not 3.
Vadim Zeitlin [Mon, 10 Jun 2013 15:52:17 +0000 (15:52 +0000)]
Link with libjbig when using built-in libtiff under Unix.
If libjbig is available, the built-in libtiff build process picks it up and
uses it, requiring all the code linking with libtiff to link with it too, so
add it to the list of the libraries in this case.
This is the same change as was already done for liblzma dependency in r74033,
see #14963.
Vadim Zeitlin [Sat, 8 Jun 2013 02:29:06 +0000 (02:29 +0000)]
Exclude src/msw/version.rc from svn pre-commit hook checks.
This file must be remain in CP1252 encoding and not UTF-8 because this is what
Windows uses for showing the strings in it, so exclude it from this check.
Vadim Zeitlin [Sat, 8 Jun 2013 02:27:50 +0000 (02:27 +0000)]
Undo MIME type change of r74120.
Undo the temporary hack which was required to commit the non-UTF-8 file. In
the future the commit hook will be updated to relax the check for this file so
it won't be necessary any longer.
Vadim Zeitlin [Sat, 8 Jun 2013 02:23:52 +0000 (02:23 +0000)]
Simplify the version information resource definition a little.
Put the correct data into FileVersion and InternalName fields and remove
LegalTrademarks, PrivateBuild and SpecialBuild completely as they are optional
and shouldn't be present if the corresponding flags are not set, see
http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058(v=vs.85).aspx
Vadim Zeitlin [Fri, 31 May 2013 23:21:40 +0000 (23:21 +0000)]
Document that wxRadioBox::SetSelection() doesn't accept wxNOT_FOUND.
A radio box always has selection and it can't be unset (at least not under all
platforms), so document that the item passed to its SetSelection() must be
valid, unlike with SetSelection() methods in some other classes.
Vadim Zeitlin [Fri, 31 May 2013 23:21:36 +0000 (23:21 +0000)]
Change wxMSW wxTreeCtrl::DoFreeze() to not hide the tree any more.
Hiding the tree when it's frozen, as done in r72665, results in its own
problems, e.g. loss of focus. So don't do this but resize the control to a
very small size when freezing it and restore it to its old size afterwards.
Vadim Zeitlin [Fri, 31 May 2013 23:21:27 +0000 (23:21 +0000)]
Add wxFileDialog::GetCurrentlySelectedFilename().
Also send wxEVT_UPDATE_UI events for the extra controls in wxFileDialog.
The combination of these changes allows extra controls to update their state
depending on the current selection in the dialog. Show a simple example of
doing it in the dialogs sample.
Vadim Zeitlin [Fri, 31 May 2013 23:21:21 +0000 (23:21 +0000)]
Don't create multiple parent-less top level frames in layout sample.
This resulted in unexpected behaviour if the main frame was closed while the
other ones were still shown as they remained shown and had to be hunted and
closed one by one to make the application exit.
Fix this simply by creating all the other frames as children of the main one.
This also results in better UI when minimizing and restoring the main frame.
Also get rid of unused position parameters in child frame constructors and get
rid of the title parameter which is not really needed as it's always the same
too.
Vadim Zeitlin [Fri, 31 May 2013 23:21:16 +0000 (23:21 +0000)]
Fix wxStyledTextCtrl::SetInsertionPointEnd().
This relied on SetInsertionPoint(-1) working like in wxTextCtrl but it didn't.
Add an explicit check to it for consistency with the other classes and to make
SetInsertionPointEnd() work.
Vadim Zeitlin [Fri, 31 May 2013 23:21:11 +0000 (23:21 +0000)]
Improve horizontal scrolling in wxRibbonControl.
Scroll by entire "sections", i.e. panes of the ribbon, instead of scrolling by
a fixed number of pixels as it's much more useful and user-friendly to uncover
the next section entirely instead of asking the user to press on the arrow
several times before being able to use it.
Vadim Zeitlin [Fri, 31 May 2013 23:21:06 +0000 (23:21 +0000)]
Use deferred window positioning in wxWindow::Layout() in wxMSW.
Ensure that {Begin,End}RepositioningChildren() are called before/after
changing the positions of multiple children, whether we're using sizers or
constraints.
This fixes display corruption which could happen under Windows 7 and a child
resized first became bigger, pushing off the children resized later.
Vadim Zeitlin [Fri, 31 May 2013 23:20:58 +0000 (23:20 +0000)]
Make wxSharedPtr::Release() really MT-safe.
Using wxAtomicDec() is not enough, its result also must be checked as it will
return 0 only in one of the threads if multiple threads call it in parallel,
while the old test for m_count==0 could pass for more than one thread,
resulting in deleting the same pointer more than once.
Vadim Zeitlin [Fri, 31 May 2013 23:20:48 +0000 (23:20 +0000)]
Fix assert when adding columns to wxGrid using native header.
Change the order of updating m_colWidths array and the native header control
in wxGird::Redimension() to ensure that we can test whether the column is
shown (which results in accessing m_colWidths element at this column index)
from the wxGridHeaderCtrl::SetColumnCount().
Vadim Zeitlin [Sun, 26 May 2013 13:14:48 +0000 (13:14 +0000)]
Reset row and columns count in wxRichTextTable::ClearTable().
No real changes, just update the internal variables in ClearTable() to avoid
inconsistent internal state, even if this doesn't seem to result in any
problems for now.
Vadim Zeitlin [Sun, 26 May 2013 13:14:43 +0000 (13:14 +0000)]
Ensure that detached menus don't keep focus grab in wxGTK.
A widget being hidden must remove its focus grab with GTK+, otherwise GTK+
would continue sending all input messages to it but fail to process them
because the widget is not realized any more, resulting in a complete freeze of
the entire program.
Do it when detaching menus from menubar and menubar from the frame to fix just
such a problem in case SetMenuBar() was called while the previous menubar was
opened.
Vadim Zeitlin [Sun, 26 May 2013 13:14:38 +0000 (13:14 +0000)]
Fix printing multiple copies in wxMSW.
If wxPrinterDC was created by the native "Print" dialog for a printer that
supports printing multiple copies, we must not manually print multiple copies
ourselves as this results in too many copies being printed. However we still
need to loop explicitly for wxPrinterDC objects created manually or for the
printers without support for multiple copies (supposing they still exist).
Vadim Zeitlin [Wed, 22 May 2013 13:36:14 +0000 (13:36 +0000)]
Fix regression in wxGTK wxFilePickerCtrl due to wxFileDialog changes.
Revert the changes of r72979 and fix wxFileDialog::GetDirectory() return
value bug (see #14786) differently to avoid breaking wxFilePickerCtrl which
relies on getting wxEVT_BUTTON event when the associated dialog is dismissed.
Vadim Zeitlin [Wed, 22 May 2013 13:36:10 +0000 (13:36 +0000)]
Fix GTK+ errors during wxFilePickerCtrl destruction after recent changes.
We do need to destroy the dialog (see #15156), but we must not destroy its
GtkWidget as it is owned by GtkFileChooserButton itself, so amend the changes
of r74030 to only destroy the C++ object, not GTK+ one.
Vadim Zeitlin [Tue, 21 May 2013 23:47:20 +0000 (23:47 +0000)]
Use the best instead of current page size in OS X preferences dialog.
The page, which is typically just a wxPanel, is usually not created with the
correct size, so resize it to its best size before showing it in the
preferences dialog.
This makes OS X behaviour consistent with MSW and GTK and is generally more
useful.
Vadim Zeitlin [Tue, 21 May 2013 23:17:29 +0000 (23:17 +0000)]
Fit modeless preferences dialog to its contents too.
When a preferences dialog is shown non-modally, it should still fit to the
contents of its pages, so move the code added for the modal case in r73624
to the base wxGenericPreferencesEditorImplBase class.
Vadim Zeitlin [Mon, 20 May 2013 15:26:22 +0000 (15:26 +0000)]
Fix last count value after ReadAll() and WriteAll().
This corrects the bugs introduced when applying the patch adding these
functions in r74034: we can't simply use m_lastcount directly in them because
it's also modified by each call to Read() and Write(), so do use the temporary
variable.
Vadim Zeitlin [Mon, 20 May 2013 13:15:41 +0000 (13:15 +0000)]
Add a public wxModalDialogHook class for intercepting modal dialogs.
Extract wxModalDialogHook from wx/testing.h into its own wx/modalhook.h,
extend it to allow to be notified not only about showing modal dialogs but
also about dismissing them and document it and show its use in the dialogs
sample.
Also replace all the WX_TESTING_SHOW_MODAL_HOOK macros occurrences with
WX_HOOK_MODAL_DIALOG.
Vadim Zeitlin [Mon, 20 May 2013 13:15:26 +0000 (13:15 +0000)]
Fix return value of wxCountingOutputStream::LastWrite().
Don't reuse m_lastcount in wxCountingOutputStream to store the stream length,
this doesn't make any sense and results in LastWrite() returning completely
wrong results as it expects m_lastcount to be the number of bytes written by
the last operation.
Add m_lastPos member to store the stream length instead.
Also correct wxCountingOutputStream documentation.
Vadim Zeitlin [Mon, 20 May 2013 13:15:21 +0000 (13:15 +0000)]
Make code reading BMP files more robust.
Check that we did correctly read the requested amount of data instead of
blindly assuming that the needed (from the point of view of BMP format
specification) number of bytes are always available -- this doesn't work so
well with corrupted or truncated files.
Vadim Zeitlin [Sun, 19 May 2013 12:47:34 +0000 (12:47 +0000)]
Propagate wxEVT_COMMAND_TEXT_UPDATED renaming to the real stc.cpp.
wxEVT_COMMAND_TEXT_UPDATED was renamed to wxEVT_TEXT in the generated stc.cpp
but not in stc.cpp.in it was generated from. Do it there too to prevent the
correct version in stc.cpp from being overwritten during the next regeneration.
Vadim Zeitlin [Sun, 19 May 2013 12:38:22 +0000 (12:38 +0000)]
Trigger wxLog auto-creation when getting old logger in wxLogChain ctor.
This ensures that a program that uses wxLogChain or one of the classes
deriving from it, such as wxLogWindow, can do it directly without worrying
about the standard logging being completely suppressed if the default log
target hadn't been instantiated yet.