Vadim Zeitlin [Sun, 4 Nov 2012 23:50:05 +0000 (23:50 +0000)]
No real change, just make bezel setting code in wxOSX more clear.
Avoid code duplication between SetAcceleratorFromLabel() and
wxWidgetImpl::CreateButton(), generalize the former to handle the special
cases taken into account only in the latter previously.
Also use a switch on border flags instead of series of nested ifs as this
seems to be more clear.
Vadim Zeitlin [Sun, 4 Nov 2012 23:49:42 +0000 (23:49 +0000)]
Revert "Fix the pages range in the print dialog in wxOSX."
This reverts r72805 (leaving only the changes to printdlg.cpp which seem
harmless and potentially useful) as it resulted in crashes when using
wxHtmlEasyPrinting because we called wxPrintout::OnPreparePrinting() before
setting the DC to be used, which was wrong.
In fact it's not clear how can we get the correct range of pages at all
because we need a DC to paginate properly (i.e. taking into account its size)
but we need to show a dialog, in which we already want to show the pages
range, before choosing the DC. Perhaps we could create a dummy DC for
pagination purposes but how could this work with printers using different page
sizes?
The best would probably be to avoid setting any limits on the page range as
showing 9999 looks ugly but anything else would be wrong.
Vadim Zeitlin [Sun, 4 Nov 2012 23:49:19 +0000 (23:49 +0000)]
Update tree control layout in EditLabel() for wxOSX too.
A special preprocessor check for OS X prevented the control from being relaid
out correctly in EditLabel() there, which resulted in problems when trying to
edit a just added item.
Simply remove this check for OS X (and also MSW but this is less important as
this version of the control is almost never used there anyhow) to fix it.
Vadim Zeitlin [Sun, 4 Nov 2012 12:44:51 +0000 (12:44 +0000)]
Don't use "readlink -e" in docs generation script, it's not portable.
"readlink" command also exists under OS X but with a completely different
syntax than under Linux, so just use "pwd -P" to get the physical path name
instead, this should hopefully work everywhere as it's POSIX.
Václav Slavík [Thu, 1 Nov 2012 18:25:07 +0000 (18:25 +0000)]
wxCALL_FOR_EACH compilation fix for VC++.
VC++ has a bug where __VA_ARGS__ is incorrectly expanded as a single
token, contrary to C99. The solution is to pass the arguments to another
macro as a single token inside parenthesis.
See http://stackoverflow.com/questions/9183993/msvc-variadic-macro-expansion
for the gory details.
Vadim Zeitlin [Thu, 1 Nov 2012 17:15:19 +0000 (17:15 +0000)]
Always set the font to use in wxMSW wxTextMeasure when using a window.
The default window HDC font is not the same as the wxWindow font, so we need
to always set the font explicitly in this case (when using a wxDC, its HDC
does have the current wxDC font already selected into it, so doing it once
again would be unnecessarily wasteful).
Vadim Zeitlin [Thu, 1 Nov 2012 17:15:15 +0000 (17:15 +0000)]
Allow constructing wxGTK wxTextMeasure with NULL font.
The font is explicitly documented as being possibly NULL in the base class and
wxMSW handles NULL font just fine, so also handle it in the GTK version.
Vadim Zeitlin [Thu, 1 Nov 2012 17:14:54 +0000 (17:14 +0000)]
Deal correctly with wx directory being a symlink in docs generation script.
The script calling Doxygen is smart enough to strip the path of the wxWidgets
directory from the paths of the files, but it didn't do it correctly if this
directory was a symlink.
Fix this by using readlink, if available, to get the canonical name.
Vadim Zeitlin [Wed, 31 Oct 2012 00:17:17 +0000 (00:17 +0000)]
Define wxSOCKET_XXX flags as wxSOCKET_XXX_READ|wxSOCKET_XXX_WRITE.
The recently introduced (in r72591) wxSOCKET_{WAITALL,NOWAIT}_{READ,WRITE}
flags weere for some reason completely different and unrelated to the existing
bidirectional wxSOCKET_{WAITALL,NOWAIT} ones. Change this by defining the
bidirectional version simply as the sum of the two others. This makes much
more sense than testing for either wxSOCKET_XXX or wxSOCKET_XXX_READ or
wxSOCKET_XXX_WRITE being specified.
And it also fixes an assert in wxSocketWaitModeChanger where a sanity check
failed when this class was used with wxSOCKET_WAITALL|wxSOCKET_WAITALL_READ.
Vadim Zeitlin [Mon, 29 Oct 2012 14:50:42 +0000 (14:50 +0000)]
Get rid of wxAuiToolBar::m_style and just use base class m_windowStyle.
This fixes an assert exposed by the addition of wxAuiToolBar::Create() in
r72785: as m_style was not initialized before, calling GetWindowStyle() from
wxControl::Create() returned wrong flags.
Fix this by just removing m_style completely, there doesn't seem to be any
need for it nor for overriding GetWindowStyleFlag().
Vadim Zeitlin [Mon, 29 Oct 2012 01:20:21 +0000 (01:20 +0000)]
Avoid double destruction of wxTipWindow under wxOSX.
Hiding the window results in wxEVT_KILL_FOCUS under OS X and this destroys it
already, so when we call Destroy() from wxTipWindow::Close() later, it
triggers assert about destroying it twice.
Avoid doing this under OS X for now, even though the real problem is probably
the discrepancy in wxEVT_KILL_FOCUS event generation under different platforms.
Vadim Zeitlin [Sat, 27 Oct 2012 12:28:00 +0000 (12:28 +0000)]
Allow using wxTextMeasure::GetLargestStringExtent() with wxArrayString.
Change the signature of this method to take the number of strings and the
pointer to the first of them instead of wxVector<wxString> as this allows it
to be used with all of wxVector<wxString>, wxArrayString and raw arrays of
wxStrings.
Also return the computed size from it instead of filling output parameters.
Vadim Zeitlin [Sat, 27 Oct 2012 00:46:58 +0000 (00:46 +0000)]
Break implicit dependency of "core" on "adv" via wxXmlResourceHandlerImplBase.
wxXmlResourceHandlerImplBase::GetAnimation() returned wxAnimation by value
which created references to wxAnimationCtrlNameStr and wxNullAnimation
symbols, defined in the "adv" library, in "core" when using Sun CC even though
they were not referenced directly.
Fix this by returning wxAnimation by pointer to keep it opaque for "core" code.
Vadim Zeitlin [Thu, 25 Oct 2012 23:26:36 +0000 (23:26 +0000)]
Store the selected directory in wxGTK wxDirDialog.
This should help with the selected directory not being remembered since
GTK+ 2.24.11 as apparently gtk_file_chooser_get_filename() doesn't work any
more now after hiding the dialog -- so call it before doing this and save the
result.
Also get rid of the ugly and apparently completely unnecessary OnFakeOk().
Vadim Zeitlin [Thu, 25 Oct 2012 23:26:32 +0000 (23:26 +0000)]
Prevent pasting too much text into limited length wxTextCtrl in wxGTK.
Improve insert-text signal handler to block pasting text into the control,
which may overflow the specified max length in one action, and not only
entering individual characters.
Vadim Zeitlin [Thu, 25 Oct 2012 22:30:43 +0000 (22:30 +0000)]
Make wxFILE_EXISTS_SYMLINK work on its own, without wxFILE_EXISTS_NO_FOLLOW.
Include the wxFILE_EXISTS_NO_FOLLOW bit in wxFILE_EXISTS_SYMLINK definition to
allow using just wxFileName::Exists(wxFILE_EXISTS_SYMLINK) which used to never
work because the link was followed.
Vadim Zeitlin [Thu, 25 Oct 2012 22:19:20 +0000 (22:19 +0000)]
Include wx/xml/xml.h from the XRC handlers that need it.
Including this header from wx/xrc/xmlres.h itself only when WXMAKINGDLL_XRC is
defined doesn't work when we're building a static library and not a shared/DLL
one and we don't have any symbol defined in this case, so just don't try to be
smart and include this header from the files that need it.
Vadim Zeitlin [Wed, 24 Oct 2012 18:34:19 +0000 (18:34 +0000)]
Try to avoid accidental use of wxXmlNode in XRC handlers.
Now that the handlers can be defined outside of the XRC library, we can't use
wxXmlNode in them because this would create an (unsatisfied) link dependency
on the xml library.
To avoid this happening accidentally, don't include wx/xml/xml.h from the XRC
header, unless building the xrc library itself.
Vadim Zeitlin [Wed, 24 Oct 2012 18:33:57 +0000 (18:33 +0000)]
Disable dropdown menu support in wxRibbonXmlHandler.
The code handling it uses wxXmlNode directly as it's written now which isn't
allowed as it introduces a dependency of ribbon library on the xml one and so
currently breaks linking of the ribbon DLL under MSW.
Vadim Zeitlin [Wed, 24 Oct 2012 18:22:39 +0000 (18:22 +0000)]
Don't call wxSafeYield() from wxGenericListCtrl::EditLabel().
This could result in wxYield() reentrancy and while it could be avoided by
using wxSafeYield(NULL, true /* only if needed */) it seems that we don't
actually need to yield here at all and a simple Update() should be enough.
Vadim Zeitlin [Wed, 24 Oct 2012 00:25:09 +0000 (00:25 +0000)]
Don't use Shift-TAB in keyboard test.
This key combination seems to be intercepted by GTK now for keyboard
navigation purposes and we never get key up events for it. Just use a
different key.