Vadim Zeitlin [Mon, 14 Mar 2011 11:55:05 +0000 (11:55 +0000)]
Show wx{Note,Tool}book-specific styles in the notebook sample too.
Demonstrate the use of styles such as wxNB_FIXEDWIDTH or wxTBK_HORZ_LAYOUT
specific to particular controls and not only the ones common to all of them.
Vadim Zeitlin [Mon, 14 Mar 2011 11:55:01 +0000 (11:55 +0000)]
Don't generate wxEVT_CHAR_HOOK events while the mouse is captured.
This prevents the parent TLW from interfering with the keyboard handling of
the window that captured the mouse which very often needs Escape for itself to
cancel the capture.
In particular, this fixes the problems with Escape closing the entire dialog
containing the controls instead of closing just the combobox drop down or a
popup menu in wxMSW.
Also modify wxGTK for consistency and update the documentation.
Vadim Zeitlin [Mon, 14 Mar 2011 11:54:51 +0000 (11:54 +0000)]
Don't intercept Escape key while IME is active.
Escape is used by IME and intercepting it at wxWidgets level to generate
EVT_CHAR_HOOK breaks the IME UI and may result in unexpected loss of data
entered by user.
To work around this, don't generate EVT_CHAR_HOOK for Escape while IME is
active by checking for the special semaphore variable (which could be also
used for other things in the future, see #9102) value.
Vadim Zeitlin [Mon, 14 Mar 2011 11:54:43 +0000 (11:54 +0000)]
Produce correct SVG files in all locales.
Using wxSVGFileDC in locales using comma as decimal separator resulted in
invalid SVG files being created as a decimal period should always be used in
them.
Fix this by replacing "%g" format specification with wxString::FromCDouble()
call (wrapped in a convenient NumStr() helper function).
Vadim Zeitlin [Mon, 14 Mar 2011 11:54:39 +0000 (11:54 +0000)]
Fix changing the size of the bitmaps in wxMSW wxButton.
The size of the wxImageList used to store the bitmaps wasn't updated before
and so the old bitmap size continued to be used even after changing the actual
bitmaps.
Recreate wxXPButtonImageData to ensure that the image list size does change.
Vadim Zeitlin [Mon, 14 Mar 2011 11:54:35 +0000 (11:54 +0000)]
Print everything by default in non-interactive mode.
IF we don't show the dialog allowing the user to select the pages range, we
should print everything by default instead of printing nothing at all as we
used to do.
Vadim Zeitlin [Mon, 14 Mar 2011 11:54:32 +0000 (11:54 +0000)]
Allow wxThread::Wait() and Delete() to block, even under wxMSW.
Add "wait mode" parameter to these methods which can be used to make them
block even under wxMSW where they currently dispatch messages when called
which can be totally unexpected.
Do keep the old behaviour for compatibility however, although it will change i
3.2.
Vadim Zeitlin [Mon, 14 Mar 2011 11:54:26 +0000 (11:54 +0000)]
Respect alignment flags for owner-drawn buttons in wxMSW.
Honour wxBU_{LEFT,RIGHT,TOP,BOTTOM} flags for owner drawn buttons too, this
ensures that you can both change the colour and align the text differently for
buttons under XP and later.
Vadim Zeitlin [Sun, 13 Mar 2011 13:53:54 +0000 (13:53 +0000)]
Added precision parameter to wxString::From[C]Double().
Optionally support fixed precision in wxString::FromDouble() and FromCDouble()
methods. This is mostly useful for the latter to be able to format numbers in
portable way (using dot as decimal separator) without loss of precision but
also do it for the former for consistency.
Vadim Zeitlin [Wed, 9 Mar 2011 16:35:56 +0000 (16:35 +0000)]
Make brush hatches in wxGTK consistent with wxMSW.
The cross, vertically and horizontally hatched brushes used 4 pixels between
the hatches in wxGTK but 7 in wxMSW which was very noticeable. Use the same
pattern in wxGTK as MSW uses (as we can't change it there anyhow).
Vadim Zeitlin [Wed, 9 Mar 2011 16:35:43 +0000 (16:35 +0000)]
Don't pop up annoying message box in the drawing sample.
The rubber banding selection message box was shown even after a simple click,
i.e. when nothing was actually selected which was quite annoying, so don't do
this.
Also remove unnecessary casts and use wxLogMessage() instead of
wxString::Printf() + wxMessageBox().
Vadim Zeitlin [Wed, 9 Mar 2011 10:07:58 +0000 (10:07 +0000)]
Corrections to wxTextCtrl::HitTest() documentation.
Fix the signature of the overload returning row and column which got corrupted
during transition to Doxygen and document the overload returning the position
as well. Also document all the parameters.
Vadim Zeitlin [Wed, 9 Mar 2011 09:28:41 +0000 (09:28 +0000)]
Fix search for item by text in wxMSW wxListCtrl.
LVN_ODFINDITEM handler could enter infinite loop if its selection was 0 and a
key not matching any of the items first letters was pressed.
Rewrite the loop in a simpler form to ensure that it is correct. Also clarify
some comments. Finally, fix the behaviour when no matching item was found (if
it didn't hang in infinite loop, it used to select the first item in the
control).
Vadim Zeitlin [Wed, 9 Mar 2011 09:28:34 +0000 (09:28 +0000)]
Don't assert if starting search position in LVN_ODFINDITEM is invalid.
Just use wxLogDebug() if this happens, asserting here is not the right thing
to do as it doesn't indicate an error in the program but rather invalid
external input and, moreover, we can recover from it easily.
Jaakko Salli [Mon, 7 Mar 2011 13:02:33 +0000 (13:02 +0000)]
To prevent wxPropertyGrid from stealing frocus from other controls, only let SetFocusOnCanvas() move focus to the main grid 'canvas' if focus was already in on the grid's child controls
Václav Slavík [Sun, 6 Mar 2011 18:22:28 +0000 (18:22 +0000)]
Don't directly include GTK+ semi-public headers.
Only the main headers (e.g. gtk/gtk.h) should be included and GTK+ 3 is strict about this. Enable compile-time checks for this that work with GTK+ 2.24.
Václav Slavík [Sun, 6 Mar 2011 18:22:23 +0000 (18:22 +0000)]
Include gdk/gdkkeysyms-compat.h.
GTK+ 2.22 changed GDK_* keysym constants to GDK_KEY_* and introduced a new header for the old names. This header must be explicitly included in GTK+ 3, so do it for now. In the long run, we should migrate to the new names.
Vadim Zeitlin [Wed, 2 Mar 2011 10:15:35 +0000 (10:15 +0000)]
Add missing wxUSE_MARKUP checks in wxOSX code.
Don't define wxWidgetImpl::SetLabelMarkup() when wxUSE_MARKUP is off and
definitely don't reimplement it in wxButtonCocoaImpl as this code doesn't
compile without markup support.
Instead of converting alpha to a mask an attempt is made to write a palettised PNG file with an ARGB palette using a maximum of 256 transparency values where formerly just up to one was supported. GIF images with 256 colours and transparency can now also be saved as a palettised PNG instead of true colour, making the image a lot smaller.
Applied (modified) patch by troelsk. Closes #12850.
Václav Slavík [Mon, 28 Feb 2011 21:23:10 +0000 (21:23 +0000)]
Toggle checkboxes in generic wxDataViewCtrl with single click.
Both GTK+ and OS X native controls use single click to toggle
checkboxes, instead of double-click activation used by the generic
version. So does wxCheckListBox on Windows, so make wxDVC
behave the same way.
Václav Slavík [Mon, 28 Feb 2011 21:23:04 +0000 (21:23 +0000)]
Get rid of WXGetAsCustom().
Instead, have WXOnActivate() and WXOnLeftClick() with same signatures as
their public API counterparts and just call Activate/LeftClick() from
them for wxDataViewCustomRenderer.
This accomplishes the same thing, but makes it easier to override
behaviour in wx's internal implementations of renderers.
Vadim Zeitlin [Sun, 27 Feb 2011 18:36:55 +0000 (18:36 +0000)]
Use single quotes in wxMarkupText unit test to work around VC6 bug.
VC6 seems to have a strange bug with escaped quotes used in strings passed to
macros and failed to compile the original code with nonsensical error messages.
Use single quotes to try to work around this issue. They are also somewhat
more readable as they don't need to be escaped inside C strings.
In case of a certain amount of whitespace at the bottom of a vertical toolbar it would not be drawn correctly: the more whitespace the more painting would be clipped starting from the left (covering the whole height of the toolbar) until the toolbar would look completely empty.
This was reproducible using the toolbar sample, setting the toolbar on the left or right edge of the window and then increasing the height of the window sufficiently.
Vadim Zeitlin [Sun, 27 Feb 2011 14:01:36 +0000 (14:01 +0000)]
Replace template function with template class to placate VC6.
VC6 has very poor support for template functions and in particular doesn't
understand explicitly choosing the type of the function to call so replace
template DoApplyToFont() function with FontModifier template class in
wxMarkupParserAttrOutput implementation.
Vadim Zeitlin [Sun, 27 Feb 2011 12:48:46 +0000 (12:48 +0000)]
Add markup support to wxOSX/Cocoa wxStaticText and wxButton.
Add wxMarkupToAttrString helper that converts wx markup to OS X attribute
strings and use it in wxStaticText and wxButton.
This required adding new SetLabelMarkup() method to wxWidgetCocoaImpl, it
seems to make sense to have it there as it could be implemented by more
controls in the future.
Vadim Zeitlin [Sun, 27 Feb 2011 12:48:38 +0000 (12:48 +0000)]
Add markup support to generic wxStaticText implementation.
wxMarkupText allows to easily support markup in the controls that we draw
ourselves so use it in wxGenericStaticText to have a possibility to use
markup on all platforms, even those where there is no native markup support in
wxStaticText itself.
Vadim Zeitlin [Sun, 27 Feb 2011 12:48:13 +0000 (12:48 +0000)]
Add wxDC::GetFontMetrics() and implement it for wxMSW.
Add a new wxDC method allowing to retrieve the font characteristics not
available from GetTextExtent(), notably the internal leading (and also the
average font width).
Currently this is implemented for wxMSW only, the internal leading is always 0
in the other ports.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:48 +0000 (12:47 +0000)]
Restore height tweaking in wxMSWButton::GetFittingSize().
The change of r66893 was wrong, we do need to adjust the button height here
because the increase to standard height is not enough if we use bigger fonts
that require making taller buttons.
The real problem was the use of EDIT_HEIGHT_FROM_CHAR_HEIGHT() which added too
much to the height, so replace it with something based on the actual font
height. This is still arbitrary but slightly better.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:43 +0000 (12:47 +0000)]
Initialize wxButton::m_authNeeded in ctor and not Create() in wxMSW.
Ensure that the member is always initialized as calling GetAuthNeeded() for a
default-constructed button would access a non-initialized variable before.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:36 +0000 (12:47 +0000)]
No changes, just do wxButton fields initialization in Init() in wxMSW.
Add a helper function called from ctors and initialize m_imageData in it
instead of doing it in each ctor -- this will be more important when we add
more wxButton members.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:26 +0000 (12:47 +0000)]
Replace wxST_MARKUP style with wxControl::SetLabelMarkup().
This is an incompatible change which removes the wxStaticText-specific
wxST_MARKUP style and adds wxControl::SetLabelMarkup() replacing it.
It doesn't actually change anything yet but it simplifies wxStaticText code a
lot by getting rid of many markup-related functions in it which had to behave
differently depending on whether wxST_MARKUP was used or not and also paves
way for adding markup support for the other controls in the future.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:15 +0000 (12:47 +0000)]
Don't call base class SetLabel() from GTKSetLabelForLabel().
Calling wxControlBase::SetLabel() only from GTKSetLabelForLabel() made its
behaviour inconsistent with GTKSetLabelWithMarkupForLabel() and also was
redundant in all but two places from which it was called, so remove this call
from this function itself and instead add it to its callers where it's really
needed.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:11 +0000 (12:47 +0000)]
Remove unnecessary use of RemoveMarkup() in wxMSW wxHyperlinkCtrl.
Only the ampersands need to be escaped when setting the text of a native hyper
link control in MSW and this is done by wxControl::EscapeMnemonics(), not by
wxStaticText::RemoveMarkup() which also removes any tags which is not wanted
at all here.
Vadim Zeitlin [Sun, 27 Feb 2011 12:47:05 +0000 (12:47 +0000)]
Add wxFont::SetSymbolicSize() and SetSymbolicSizeRelativeTo().
These methods allow to set the font size using CSS-like absolute size
specifications.
Notice that the factors used here are incompatible with (but better than) the
ones used in wxBuildFontSizes() in src/html/winpars.cpp. In the future it
would be nice to reuse the new wxFont functions in wxHTML code.