Václav Slavík [Wed, 13 Jul 2011 08:32:17 +0000 (08:32 +0000)]
Better sizing in wxDataViewSpinRenderer and wxDataViewChoiceRenderer.
Their GetSize() method used hardcoded size of (80,16). Instead, use
GetTextExtent() to compute the size from content, as should be done. Add
some extra room for editor control's extra parts. The space needed isn't
computed exactly, as that would be quite convoluted (and in the end,
most likely not 100% accurate even then), using a simple approximation
instead.
Use native hint wxTextCtrl support in wxSearchCtrl.
Instead of using broken emulation of the support for hints available in the
text control, use the real wxTextCtrl::SetHint() for SetDescriptiveText()
implementation in the search control.
This looks better and, more importantly, fixes the bug when searching for the
string equal to the current descriptive text searched for an empty string
instead.
No real changes, just make some wxSlider members local variables.
wxMSW wxSlider implementation stored the min and max labels widths as fields
of wxSlider object for some reason even though they were only used in one of
its methods (and can be easily computed anyhow).
Make them simple local variables instead and also rename an existing local
variable which started conflicting with their new names.
Don't handle "Return" key as "TAB" even when the default button is disabled.
wxMSW used to handle VK_RETURN in the same way as VK_TAB if it wasn't consumed
by the default push button but this didn't correspond to the native platform
behaviour which considers pressing Return when the OK button is disabled an
error and audibly notifies the user about it.
Fix this by passing VK_RETURN to IsDialogMessage() if we don't translate it to
a button click.
Also add a possibility to test what happens when the default (or all)
button(s) in the dialog are disabled to the dialogs sample.
Use the correct event handler in wxMenuBase::UpdateUI().
Use GetWindow() instead of GetInvokingWindow() to send the event to the
associated window for the menus that are part of the menu bar and not only the
popup ones. This was broken since r64127 because GetInvokingWindow() is now
only used for the popup menus.
Support float, double and file name values in wxGenericValidator.
Currently these values can only be read from/written to wxTextCtrl but support
for other controls (e.g. wxSpinCtrlDouble for float/double) could be added in
the future.
Check for GTK window parent, not wx one, when reparenting.
A notebook page removed from its notebook can have a non-NULL wx parent but
not have any parent at GTK level any longer, so test for the window parent at
GTK level before removing the widget from it, otherwise we were getting GTK
asserts when trying to remove a window from its no-more-parent.
Refresh the generic wxDataViewCtrl header if it was made too small.
Although normally the control header is not supposed to be resized below its
minimal vertical size, sometimes this can still happen and in this case ugly
artefacts were displayed because it wasn't refreshed properly. Do refresh it
to avoid them.
Output something from the console sample even if it's ran without arguments.
Running console sample without parameters didn't do anything by default and
didn't output anything neither which was presumably rather confusing. Do
output a welcome message at least to indicate that something happened.
Immediately update MSW cursor when ::SetCursor(wxNullCursor) is called.
The cursor was previously reverted to the default one only when a next mouse
event was received. Do it immediately now to e.g. avoid showing the busy
cursor when the program is not busy any more.
Fix wxMSW wxSlider best size calculation and label layout.
The best size calculation was wrong as the min/max labels height was
unnecessarily added to the slier total height even if though these labels are
positioned alongside the slider itself in horizontal layout case.
The slider also managed to position its value label completely outside the
space allocated to it (and the bug in DoGetBestSize() might have been an
attempt to work around this), don't do this any more. This also fixes the
wrongly centered vertical position of the min/max labels.
Make coordinates transformations in wxDC really maximally precise.
Use the maximal device space extent supported by Win32 GDI and only decrease
it if the scale is so small that keeping the device space extent maximal would
result in overflowing the int range for the logical space.
This makes coordinate translations exact even for huge coordinates, while they
could be significantly wrong before due to the integer rounding errors.
Steve Lamerton [Sat, 9 Jul 2011 14:31:29 +0000 (14:31 +0000)]
Add start of selection api, support for HasSelection, SelectAll and DeleteSelection along with documentation. Implement for IE and WebKitGTK and add stubs for OSX WebKit.
Steve Lamerton [Fri, 8 Jul 2011 19:34:56 +0000 (19:34 +0000)]
Add the ability to enable / disable and check for the editable property of a rendering engine. Implement for all three backends and extend the sample, document and unit test.
We finally didn't switch to using the standard containers by default so don't
leave misleading information in the change log (this should have been part of
r67735).
Steve Lamerton [Mon, 4 Jul 2011 18:27:14 +0000 (18:27 +0000)]
Filter out subframes from the ie backend history and the sample. Also document that many wxEVT_COMMAND_WEB_VIEW_LOADED events may be sent, one for each frame.
Fix warnings about implicit double to int conversions in propgrid.
Use wxRound() instead of implicit casts to convert double to int. This not
only avoids warnings (e.g. when using g++ with -Wconversion) but also should
be (marginally) more precise.
Fix crash in wxDataViewProgressRenderer in non-Unicode build.
We can't use the column pointer in wxDataViewProgressRenderer ctor as it's not
set yet, so postpone setting the renderer label until later in non-Unicode
build which needs the font used by this column to do the conversion to UTF-8.
Steve Lamerton [Sat, 2 Jul 2011 16:24:56 +0000 (16:24 +0000)]
Overhaul the wxWebView documentation. Split the documentation into sections and add documentation for clipboard and history functions. Add documentation for wxWebHistoryItem. Fix many spelling mistakes. Alphabetise the function names. Add missing svn properties.
Add wxCOMPOSITION_INVALID mode and use it to simplify the code.
Having an invalid element in wxCompositionMode enum allows to directly return
it from TranslateRasterOp() function instead of needing a separate bool
parameter to indicate that a ROP couldn't be translated.
This also incidentally fixes warnings about possibly uninitialized variables
in optimized g++ builds.
Avoid g++ warnings about breaking strict aliasing rules in wxTreeCtrl.
The standard TreeView_GetItemRect() macro resulted in warnings about breaking
strict aliasing rules as it passed a variable of one type via a pointer to
another one. Fix this by using a union and our own custom macro instead.
Steve Lamerton [Fri, 1 Jul 2011 10:01:45 +0000 (10:01 +0000)]
Use shared pointers throughout when managing history with the ie backend, simplifying memory management. Also add more comments explaining how the history is managed.
Steve Lamerton [Thu, 30 Jun 2011 15:07:52 +0000 (15:07 +0000)]
Only send a document complete event when the page is completely loaded, as opposed to with every frame. This brings the event in to line with what is emitted by webkit.
Vadim Zeitlin [Thu, 30 Jun 2011 12:20:54 +0000 (12:20 +0000)]
Initialize variable in UTF{16,32} conversion code to avoid warnings.
In optimized build g++ warned about the second element of two-element array
passed to encode_utf16() being possibly uninitialized. This wasn't really the
case but change the code just to avoid the warnings.
Vadim Zeitlin [Thu, 30 Jun 2011 12:20:47 +0000 (12:20 +0000)]
Work around bogus g++ warnings about possibly missing return.
OS X g++ warned that "control may reach end of non-void function" in
wxRichTextHelpInfo::ShowHelp(). This wasn't really the case but change the
function logic slightly to (hopefully) suppress the warning.
Vadim Zeitlin [Wed, 29 Jun 2011 17:50:32 +0000 (17:50 +0000)]
Change the loop condition to avoid comparing unsigned value with 0.
This resulted in (useful) g++ warning and didn't make any sense in any case.
Check for the loop variable value being 0 at the end of the loop instead now.
If the old code was correct it shouldn't change its behaviour and if not, this
might fix a bug.
Vadim Zeitlin [Wed, 29 Jun 2011 17:50:30 +0000 (17:50 +0000)]
Always initialize SelectInHDC::m_hgdiobj in wxMSW.
Leaving m_hgdiobj uninitialized probably didn't result in any problems
considering how this class is currently used but it did result in g++ warnings
about uninitialized member with aggressive warning flags and also could easily
become a problem in the future so just ensure that we always initialize it.