Commit Graph

60546 Commits

Author SHA1 Message Date
Vadim Zeitlin
07380ba0b5 Copy fonts more faithfully and efficiently in wxGTK
Use pango_font_description_copy() to copy fonts instead of
pango_font_description_to_string() and pango_font_description_from_string()
via wxNativeFontInfo::{To,From}String() respectively.

This is not only more efficient but also preserves the original family whereas
wxNativeFontInfo::FromString() helpfully replaces any fonts it doesn't know
about with the normal font name. That behaviour is probably wrong on its own,
but for now at least avoid silently changing fonts when copying them.
2015-09-16 03:39:07 +02:00
Rick Nelson
7e8c2cc4a5 Fix handling of relative URLs starting with "/" in wxHTML
Don't interpret them relatively to the current path, so that an URL like
"/pictures/foo.png" in the file "/webpages/bar.html" is resolved correctly and
not as "/webpages/pictures/foo.png" as it was previously.

See #17148.
2015-09-16 00:26:33 +02:00
Vadim Zeitlin
7851535d02 Document wxAppConsole::Yield() and fix wxYield() documentation
Don't say that wxYield() is deprecated because it isn't.

Do document wxAppConsole::Yield() if only to redirect to
wxEvtLoopBase::Yield().
2015-09-15 21:09:07 +02:00
Vadim Zeitlin
f137753f28 Don't log drag events as well as move ones in the text sample
Dragging the mouse (even accidentally by a pixel or two) resulted in a
confusing "Unknown event" line in the log, so don't log these messages neither
just as we already don't log the mouse motion events.
2015-09-15 01:30:38 +02:00
Vadim Zeitlin
7f856bd633 Add a test for wxEVT_CONTEXT_MENU to the text sample.
Log a message if this message is received, which shows that it currently isn't
for the control with wxTE_RICH style under MSW.
2015-09-15 01:29:29 +02:00
Tim Kosse
3b047b58ce Escape filenames in wxFileDataObject::GetDataSize/GetDataHere
On wxGTK, wxFileDataObject::SetData calls g_filename_from_uri which
percent-decodes URIs. No corresponding percent-encoding was done in
wxFileDataObject::GetDataSize/GetDataHere. Use g_filename_to_uri instead in so
that filenames are properly escaped.

This commit also fixes the data being truncated if it contains non-ASCII
characters on wide-character builds, see the memcpy arguments in the original
code.
2015-09-14 11:42:38 +02:00
Artur Wieczorek
865c8565af Fixed setting colours of wxSlider and wxRadioBox in wxMSW.
Sibling windows (like labels and radio buttons) need to be explicitly
refreshed when foreground or background colour is changed. This is implemented
by invoking newly implemented method wxSubwindows::Refresh every time the
colour of the control is changed.

Note: Setting foreground colour of wxRadioBox still doesn't work correctly
when themes are enabled.

Closes #17142.
2015-09-12 03:01:30 +02:00
Vadim Zeitlin
7f08dbbf78 Another work around for VC8 compiler bug after ZIP64 changes
Apply the same fix as in ba851346b5 in another
place where the same bug occurs.
2015-09-11 14:59:32 +02:00
Paul Cornett
5905857dba Avoid bug in VS 2015 code generation
When using Whole Program Optimization, pItem->OnDrawItem() incorrectly calls the
base class wxOwnerDrawn::OnDrawItem() instead of the appropriate override, for
example wxCheckListBoxItem::OnDrawItem(). The problem can be avoided by not
using an unnecessary cast to wxListBoxItem*.
2015-09-09 22:38:42 -07:00
Vadim Zeitlin
ba851346b5 Try to work around VC8 compiler bug after ZIP64 changes
Add an explicit cast to ensure that both branches of the ternary operator have
the same type.
2015-09-09 03:39:17 +02:00
Paul Cornett
87202a9b02 Improve link color getters, and suppress deprecation warnings
Use default colors when link style is not set
2015-09-07 20:20:12 -07:00
Paul Cornett
8bceeba143 Show widget at GTK+ level regardless of "child visibility" status, see #17134, #4343 2015-09-07 09:43:18 -07:00
Vadim Zeitlin
2879ec5422 Fix wxiOS build after Enable{Max,Min}imizeButton() addition
Define stubs for pure virtual base class methods.

See #17133.
2015-09-07 12:47:38 +02:00
Paul Cornett
67fadfbbf1 Avoid GCC warning: base class should be explicitly initialized in the copy constructor 2015-09-06 21:27:37 -07:00
Paul Cornett
02f22eff71 avoid GCC warning: "__WXMSW__" is not defined 2015-09-06 21:24:32 -07:00
Paul Cornett
25b0ee43b8 add wx prefix in a couple places missed in 8f8d58d1 2015-09-06 21:07:06 -07:00
Paul Cornett
845444f35f Fix null pointer check from 198d7c6c (r40919)
operator '?:' has lower precedence than '+'
2015-09-06 20:56:59 -07:00
Paul Cornett
27a8d28029 more use of wxOVERRIDE 2015-09-06 17:20:42 -07:00
Vadim Zeitlin
4177593aef Fix vertical wheel scrolling direction in wxGenericCalendarCtrl
Make scrolling upwards (positive delta) go to the past (i.e. decrease the
date) for consistency with the native calendar controls.

See 50daf1feab (commitcomment-13087042)
2015-09-06 19:40:03 +02:00
Lauri Nurmi
50daf1feab Add mouse wheel handlign to wxGenericCalendarCtrl
Mimics the scrolling behaviour of native MSW and GTK calendars by allowing to
increment/decrement the month by scrolling anywhere on the generic calendar.

Additionally, use horizontal scrolling to increment/decrement the year.

Closes https://github.com/wxWidgets/wxWidgets/pull/88
2015-09-06 14:39:59 +02:00
Vadim Zeitlin
4d911fb059 Merge branch 'os_version'
Make strings returned by wxGetOsDescription() more readable for the users.
2015-09-06 14:24:57 +02:00
Vadim Zeitlin
8b2dc19dbb Don't translate OS X codenames in wxGetOsDescription()
OS X itself doesn't seem to do it.

See https://github.com/wxWidgets/wxWidgets/pull/76#issuecomment-138067426
2015-09-06 14:24:17 +02:00
John Roberts
fe9a5f47f4 Add wxTopLevelWindow::Enable{Maximize,Minimize}Button()
Allow to disable maximize and minimize buttons dynamically just as we already
allow to disable the "Close" button using EnableCloseButton().

Currently implemented for MSW and OSX only.

Closes #17133.
2015-09-06 14:17:46 +02:00
John Roberts
6055d8d0a5 Implement wxTopLevelWindow::EnableCloseButton() for wxOSX
Just forward this wx method to Cocoa standardWindowButton:NSWindowCloseButton.

See #17133
2015-09-06 14:16:39 +02:00
Vadim Zeitlin
8d6a2b3921 Don't send wxActivateEvent for minimized windows in wxMSW
Unexpectedly, minimizing the window by clicking on its taskbar icon resulted
in a wxActivateEvent. This broke the focus handling in wxTLW and resulted in
debug messages about ::SetFocus() failure whenever the window was minimized in
this way.

It also seems that other existing code doesn't take into account the
possibility of getting an "active" activation event when the window is
minimized and this doesn't happen in the other ports, so don't send this event
in wxMSW neither.

Closes #17128.
2015-09-04 16:23:13 +02:00
Tobias Taschner
dac9851f8d Add custom background colour and no XP theme to splitter sample.
Include menu items to toggle wxSP_NO_XP_THEME (on MSW) and to toggle between default background and custom wxBLUE background for the splitter sash.
2015-09-04 11:10:44 +02:00
Tobias Taschner
804f83b13a Fix SetBackgroundColour() for wxSplitterWindow.
Background colour was ignored even if wxSP_3DSASH was not included in the window flags. The OSX renderer already used the background colour.
2015-09-04 11:09:00 +02:00
Paul Cornett
2fbd2a7800 Implement SetVisited()/GetVisited()
and set the visited state when the link is clicked
2015-09-03 09:30:42 -07:00
Vadim Zeitlin
45767ff6d9 Merge branch 'autoconf-fixes'
Correction to m4 macros used in programs and libraries using wxWidgets.
2015-09-03 00:06:53 +02:00
Vadim Zeitlin
602783facb Merge branch 'dvc-type-check'
Various fixes to make wxDataViewCtrl behaviour more homogeneous across all
ports.
2015-09-03 00:01:24 +02:00
Artur Wieczorek
faffaaae29 Fix bug when a wxToolBar tool is deleted from its click handler
Deleting a tool from its own event handler resulted in at least in an assert
and could also lead to a crash as an already deallocated pointer was
dereferenced.

Fix this by checking if the tool with the same ID is still available after the
event handler finishes.

See #16762.
2015-09-01 18:51:19 +02:00
Vadim Zeitlin
a7e5dd0d2a Merge branch 'toolbar-sample-fixes'
Miscellaneous fixes to the toolbar sample.

Closes https://github.com/wxWidgets/wxWidgets/pull/84
2015-09-01 18:42:33 +02:00
Cătălin Răceanu
2e103dfe95 Explain toolbar sample actions better
Added messages to show that Copy tool intentionally influences Print tool and
Cut tool influences Help tool, as this is rather unexpected behaviour and
could be seen as a bug.
2015-09-01 18:39:55 +02:00
Cătălin Răceanu
0d45559975 Append log messages to the end of the text in the toolbar sample
This ensures that the messages always appear in the correct order, even if the
user clicked somewhere in the middle of the control -- which would previously
result in inserting the next message at the cursor position, not the end.
2015-09-01 18:39:49 +02:00
Cătălin Răceanu
826296efc3 Make the text control in the toolbar sample read-only
This text control is used only for logging messages, so don't allow modifying
it.
2015-09-01 18:36:37 +02:00
Cătălin Răceanu
57ec523b6f Fix "Print" tool handling in the toolbar sample
Ensure that the count of the Print tools is always correct, even if more tools
were inserted and then the toolbar was recreated (in a different position).
2015-09-01 18:34:49 +02:00
Tobias Taschner
e6b31adefe Fix OS X wxWebView ignoring JavaScript window.open() calls
On OS X (tested on 10.10.5) calls to window.open() with a different target
than _self were simply ignored. No navigation and no EVT_WEBVIEW_NEWWINDOW as
expected.

Unfortunately WebKit does not call the decidePolicyForNewWindowAction delegate
method in these cases. A new delegate method createWebViewWithRequest has been
implemented to handle this case and send EVT_WEBVIEW_NEWWINDOW as in other
ports.

Closes https://github.com/wxWidgets/wxWidgets/pull/85
2015-09-01 18:29:34 +02:00
Paul Cornett
83ce88402c Add gtk_cell_renderer_set_padding() compatibility function 2015-09-01 08:41:15 -07:00
Vadim Zeitlin
361c6357b4 Use wxDataViewRenderer::PrepareForItem() in all ports
wxOSX and wxGTK previously used their own methods for handling the enabled
state and the attributes of the items being rendered, change them to reuse the
same methods as the generic implementation, i.e. SetEnabled() and SetAttr()
and remove the port-specific GtkSetAttr(), OSXApplyAttr() and so on.

This has the advantage of ensuring that the logic is the same for all
platforms (e.g. item enabled status wasn't handled in the same way in wxGTK as
in the other ports previously) and hopefully makes the code simpler by cutting
down on the number of virtual methods.

Notice that GtkSupportsAttrs() optimization was removed as it didn't seem to
be worth the bother (we basically saved a call to a virtual model method at a
price of a virtual renderer method call) and preserving it would have
complicated things needlessly.
2015-08-31 22:20:33 +02:00
Vadim Zeitlin
d501395ee0 Fix handling of unspecified build options in wxwin.m4
There were many problems if some options selecting the build of wxWidgets to
use were not specified at all, i.e. if the corresponding string was not used
in WX_STANDARD_OPTIONS() argument or if WX_STANDARD_OPTIONS() was not used at
all (which is perfectly possible and allowed).

In this case, the output of WX_STANDARD_OPTIONS_SUMMARY_MSG() was corrupted
(e.g. it could output "WX_DEBUG is" without any value and "PORT:" value was
empty) and, worse, as that macro is only cosmetic, WX_LIKE_LIBNAME() didn't
work correctly neither, making it difficult to check for the libraries using
it to construct their name (as many libraries from wxCode do).

Get rid of all these problems by simply treating empty/undefined variables as
meaning "auto detect" instead of having to set them to the special "auto"
value first. This makes sense as now we have just 3 states: 0, 1 or null,
instead of previous 4 (+ "auto") and is much more robust.
2015-08-31 02:16:01 +02:00
Vadim Zeitlin
e36874d4f9 Fix nonsensical handling of TOOLKIT in wxwin.m4
The code set WX_PORT to $TOOLKIT only if the latter was empty which made no
sense and also set WX_PORT to the never used nor documented anywhere else
$PORT if $TOOLKIT was not empty which made even less of it.

Just assign $TOOLKIT to WX_PORT if the former has a valid value.
2015-08-31 01:57:48 +02:00
Vadim Zeitlin
6bfea22363 No real changes, just slightly simplify a macro in wxwin.m4
Remove the never used 4th and 5th arguments of _WX_SELECTEDCONFIG_CHECKFOR
macro.

Also update the comment to better explain what does the macro actually do: it
doesn't "output the message" but rather sets a variable, with the message
being an optional side effect.
2015-08-31 01:43:21 +02:00
Artur Wieczorek
5619e7f964 Use wxSwap function to swap values of array elements in wxPGArrayStringEditorDialog::ArraySwap. 2015-08-30 19:49:29 +02:00
Artur Wieczorek
d6f2264f8b Use Boolean variable to store Boolean value. 2015-08-30 19:48:09 +02:00
Artur Wieczorek
c63b1604b3 Use native renderer to draw rectangle indicating that wxPG category property is selected.
Because on some ports native renderers require a valid reference to the windows be drawn then it is necessary to implement and use new wxPGCellRenderer::DrawCaptionSelectionRect method which passes this  additional argument.
2015-08-30 19:46:34 +02:00
Vadim Zeitlin
a49567109a Consistently check for type mismatch in all ports in wxDataViewCtrl.
Move the checks for the type mismatch between the type of the value returned
by wxDataViewModel and the type expected by wxDataViewRenderer into common
code. This avoids duplicating the same code in wxGTK and wxOSX and, more
importantly, means that this check is also performed in wxMSW when using the
generic version, so that the problems such as the one fixed in 3ff8c3c ("add
missing wxDataViewDateRenderer::GetDefaultType()") would be visible there too.
2015-08-29 00:03:15 +02:00
Vadim Zeitlin
e8647b4751 No changes, just use an extra variable in wxGTK wxDataViewCtrl code.
Store the column index in a variable instead of accessing it several times
using the clumsy and unclear cell->GetOwner()->GetModelColumn() expression.
2015-08-28 23:37:51 +02:00
Vadim Zeitlin
bff235c918 Recognize GTK3 port in helper autoconf macros.
Allow "gtk3" as a value of --with-toolkit option and recognize it correctly
when auto-detecting toolkit from `wx-config --selected-config` output.
2015-08-28 18:58:25 +02:00
Artur Wieczorek
bbecebd4ba Use Boolean expression instead of conditional statement to get Boolean value. 2015-08-27 19:17:49 +02:00
Artur Wieczorek
d0eea355fa Fixed turning on/off 'Category Specific Colours' in propgrid sample.
When specific colours are turned on then custom colours are assigned to both category properties and their sub-properties. But when specific colours are turned off then only category properties are reverted to default colours what is misleading.
Now, all properties are reverted to default colours.
2015-08-27 19:16:29 +02:00