Vadim Zeitlin [Fri, 17 Jun 2011 21:53:28 +0000 (21:53 +0000)]
Use GdipStringFormatCachedGenericTypographic hack for MinGW as well.
When using GDI+ with MinGW, the same hack as for Cygwin is needed (see r66787)
as it uses the same w32api headers and libraries for GDI+ support (if it has
them at all).
Vadim Zeitlin [Fri, 17 Jun 2011 21:53:26 +0000 (21:53 +0000)]
Don't use __declspec(dllexport) for MinGW gcc 4.5 and later.
Due to the changes in gcc 4.5, copies of dllexported inline functions are now
generated in all object files including their declarations, increasing their
sizes tenfold, and they are also now instantiated in the DLL itself increasing
its size fourfold. Moreover, linking such a gigantic DLL requires inordinate
amounts of memory and takes a very long time, see some statistics at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601.
To avoid all these problems, don't use dllexport at all any more but rely on
binutils support for auto export/import which seems to work fine and results
in much smaller DLLs which are created much faster.
Vadim Zeitlin [Fri, 17 Jun 2011 21:53:22 +0000 (21:53 +0000)]
Avoid problems with conflicting UINT16 definitions in Cygwin headers.
UINT16 is incorrectly defined inside Gdiplus namespace in w32api gdiplus.h
used by Cygwin and MinGW resulting in compilation errors about ambiguous
symbols.
Fix this by forcefully redefining UINT16 in our own code.
Vadim Zeitlin [Thu, 16 Jun 2011 16:22:15 +0000 (16:22 +0000)]
Fix wxStringOutputStream in wxUSE_UNICODE_UTF8 build.
For some reason the conversion of the bytes written to this stream to Unicode
was only done in wxUSE_UNICODE_WCHAR build but not in wxUSE_UNICODE_UTF8 one.
Do it in any wxUSE_UNICODE build now.
This allows to use wxStringOutputStream under Unix again, in particular it
fixes an assert in samples/html/zip when trying to load the raw contents of a
ZIP file in wxHtmlWindow.
Vadim Zeitlin [Thu, 16 Jun 2011 15:19:55 +0000 (15:19 +0000)]
Disable wxFileSystemWatcher in configure if threads are disabled.
wxFileSystemWatcher requires threads under MSW so disable it automatically in
configure if --disable-threads was used to avoid compilation errors in
wx/msw/chkconf.h later.
Vadim Zeitlin [Thu, 16 Jun 2011 15:13:59 +0000 (15:13 +0000)]
Make wxUIActionSimulator mouse move events marginally more precise.
Round the values instead of truncating them when converting from pixel values
to Win32 ::mouse_event() 0..65535 scale. This probably doesn't make any real
difference in practice but seems more correct and also avoids g++ warnings.
Vadim Zeitlin [Thu, 16 Jun 2011 15:13:52 +0000 (15:13 +0000)]
Round the values in wxDC coordinate calculations.
Make the conversion of logical coordinates to the device ones more precise by
avoiding errors due to truncation of floating point values to integer ones.
Vadim Zeitlin [Thu, 16 Jun 2011 15:13:49 +0000 (15:13 +0000)]
Round font sizes in AdjustToSymbolicSize() instead of truncating.
This was mainly done to suppress g++ warning about implicit float to int
conversion but it also seems to make more sense to round the value here
instead of truncating it to int.
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.