Commit Graph

2411 Commits

Author SHA1 Message Date
Vadim Zeitlin
19caf034c3 Fix build problem with MSVS 2005 in wx/msw/uxtheme.h
Avoid conflict with the incomplete MENUPARTS enum defined in the SDK
header included with this compiler.

Closes #18217.
2018-09-13 00:08:36 +02:00
Josue Andrade Gomes
0bd8fe91e7 Fire wxEVT_WEBVIEW_NAVIGATING when redirecting
When using IE wxWebView backend, this event wasn't generated as expected
when the client was redirected.

Fix this by using DOCHOSTUIFLAG_ENABLE_REDIRECT_NOTIFICATION flag.

Closes https://github.com/wxWidgets/wxWidgets/pull/893
2018-09-11 14:32:14 +02:00
Vadim Zeitlin
967ff67459 Merge branch 'adv-merge'
Move the entire contents of wxAdv library into wxCore.

In the future, wxAdv will disappear entirely, but for now keep it as an
empty placeholder to allow the existing make/project files to work.

See https://github.com/wxWidgets/wxWidgets/pull/900
2018-09-02 15:43:02 +02:00
Stefan Csomor
4580cdb9ad
Extending wxFont API & OSX Core Text Implementation (#877)
* Switch to pure Core Text Implementation, Start extended Font API

* mac fixes

* First msw implementation

* Fixing paste error

* fixing typo

* Rearranging lines to former fallthrough order

* Blind fixes for covering new abstract methods

* Blind gtk implementations

* Fixing according to travis ..

* Removing method defined in base

* formatting adaptions

* Extending the schema definition for new weights

* fixing typo, using wxRound, other fixes according to comments

* changes according to suggestions

* fixing init order, before the init of m_info was overridden by Init()

* redo

* redo

* redo

* Cleanup

Removing obsolete code snippets, proper traces for font names

* Moving common code

Only the Get/SetNumericWeight calls should now be implemented in the native part, the ‚old‘ Get/SetWeight are common code and use the numeric counterparts.

* Updating docs

* commit wa missing changes.txt

* Doc fixes

* Full stops added
2018-09-01 19:42:18 +02:00
Vadim Zeitlin
3ffa651a34 Move wxAdv library contents into wxCore
This basically removes the "adv" library, even though it's still
preserved for compatibility with user make/project files referring to
it.

It is done because the distinction between "adv" and "core" was never
really clear (e.g. why wxTreeCtrl was in core but wxTreeListCtrl in
adv?) and it prevented some core classes from using adv ones.
2018-08-27 21:13:04 +02:00
Vadim Zeitlin
de5ba70203 Fix handling events from their items in submenu itself
This previously worked in wxGTK, but not in wxMSW and even under wxGTK
it could be surprising that the submenu got the event, but its parent
menu did not.

Make things consistent between the platforms and send the event to the
menu directly containing it first, but then also to its parent menu(s).

Document the new behaviour and verify that it works as intended with a
new unit test.

Closes #18202.
2018-08-25 02:36:45 +02:00
Steven Lamerton
b61123cd7d Allow distinguishing user- from script-opened wxWebView windows
Add wxWebViewEvent::GetNavigationAction() returning a value that can be
either wxWEBVIEW_NAV_ACTION_USER for the links opened by the user, or
wxWEBVIEW_NAV_ACTION_OTHER for the other ones (e.g. opened from
JavaScript code on the page).

Closes #15402.
2018-08-19 22:27:34 +02:00
Igor Korot
36d21ce6c8 Implement strike-through support for wxDataViewCtrl in wxGTK too
Previously it was supported in the generic version only, see #18180 and
the changes of 09124932eb

Closes https://github.com/wxWidgets/wxWidgets/pull/892
2018-08-19 12:06:32 +02:00
Vadim Zeitlin
617a15d418 Improve wxNotebook themed background drawing
Use GetThemeBackgroundContentRect() to properly draw the themed notebook
background in all configurations.

Closes #18156.
2018-08-18 15:44:43 +02:00
Vadim Zeitlin
65eb827c18 Merge branch '18195-sched-prio-other'
See https://github.com/wxWidgets/wxWidgets/pull/882
2018-08-18 15:04:40 +02:00
Vadim Zeitlin
48fc60609d Use more compatible "=" in test(1) instead of "=="
The latter is not supported in all shells and results in problems under
NetBSD for example.

Closes #18198.
2018-08-16 13:45:53 +02:00
wiz
99cb097f4d Install wx-config as a script, not as a binary program
Installing it using INSTALL_PROGRAM results in problems under NetBSD
where INSTALL_PROGRAM tries to strip it. Use INSTALL_SCRIPT instead.

Closes #18197.
2018-08-16 13:40:28 +02:00
Vadim Zeitlin
51c8496087 Don't change thread priority if it is default under Unix
Skip all the code dealing with the priority/scheduling parameters if the
priority is just wxPRIORITY_DEFAULT anyhow, as it's unnecessary to do
anything in this case and it can result in spurious errors.

Also extract this code into a separate SetThreadPriority() function to
make wxThreadInternal::Create() itself shorter and more clear.

Closes #18195.
2018-08-16 13:08:52 +02:00
approach
09124932eb Add strike-through support to wxDataViewItem attributes
Implement support for this attribute only in the generic version so far,
it will hopefully be implemented for the natives ones in the future.

Also add a new toggle column to the dataview sample to check how it
works: checking the items in this column enables using this attribute
for some other ones.

Closes #18180.
2018-08-14 18:04:31 +02:00
mill-j
148079c618 Fix building wxQt under HaikuOS and make it default
Recognize HaikuOS and work around several platforms with socket-related
functions there.

Also make wxQt the default port under this platform.

See #9168.
2018-07-31 18:43:10 +02:00
Vitaly Stakhovsky
a02efd1fc7 Implement wxFontDialog::SetTitle() in wxMSW
Base class SetTitle() implementation didnd't work for this class as it
used the (invalid) HWND of not yet existing dialog, so add a hook
procedure for the common font dialog, similar to the existing one for
wxColourDialog, which allows us to set the dialog title when the dialog
is really created.

Closes https://github.com/wxWidgets/wxWidgets/pull/865

Closes #18177.
2018-07-30 16:11:25 +02:00
Vadim Zeitlin
4af7d4e0d5 Also implement wxDataViewColumn::UnsetAsSortKey() for wxGTK
Allow to reset the sort order in native GTK+ implementation too.

See #18176.
2018-07-28 02:54:44 +02:00
Daniel Kulp
2a59c1fb20 Implement wxDataViewColumn::UnsetAsSortKey() in macOS version
It was impossible to stop sorting the control if it had been sorted
before, so implement UnsetAsSortKey() to allow doing it by destroying
the current sort descriptor.

Closes #18176.
2018-07-28 02:29:30 +02:00
Vadim Zeitlin
ef4494cdca Merge branch 'html-page-break-inside'
Add support for style="page-break-inside:avoid" to wxHTML.

See https://github.com/wxWidgets/wxWidgets/pull/837
2018-07-25 13:54:29 +02:00
Vadim Zeitlin
4e7b21cd72 Merge branch 'mac-def-bmpbtn-margins'
Stop using wxBU_AUTODRAW under Mac and everywhere else.

See https://github.com/wxWidgets/wxWidgets/pull/859

Closes #18170.
2018-07-24 15:17:32 +02:00
Vadim Zeitlin
566e401a3f Add support for style="page-break-inside:avoid" to wxHTML
Allow using this style to prevent page breaks inside the given <div>.
2018-07-22 00:43:25 +02:00
Vadim Zeitlin
5b703b6a24 Always use default margins for wxBitmapButton under Mac
Previously this was only done when wxBU_AUTODRAW was specified, making
this the only place in wxWidgets where this style was actually used.

This was not ideal, as the same code, not using wxBU_AUTODRAW, worked
just fine under MSW and GTK, but created ugly-looking buttons under Mac,
so do the right thing by default and let people call SetMargins(0, 0) if
they really don't want to have any margins.

Closes #18170.
2018-07-21 14:38:31 +02:00
Vadim Zeitlin
d605405ca1 Fix building wxMSW GDI+ graphics code in non-Unicode build
Use wc_str() with GDI+ function which always takes wide strings, even in
non-Unicode build.

Closes #18172.
2018-07-21 14:08:45 +02:00
Vadim Zeitlin
3e27a53e95 Make wxInfoBar actually appear when using GTK+ 3
Due to https://bugzilla.gnome.org/show_bug.cgi?id=710888 GtkInfoBar
wasn't shown if it had been hidden before -- which is exactly what
wxInfoBar did.

Fix this using the workaround proposed in the bug report, which makes
the info bar appear immediately, without any transition, which might be
not ideal, but markedly better than failing to show it at all.
2018-07-15 20:52:10 +02:00
Vadim Zeitlin
03a13591b9 Add wxDataViewToggleRenderer::ShowAsRadio()
This allows showing radio buttons in wxDataViewCtrl easily and natively.

Notice that this approach, adding an extra function to the existing
renderer class instead of creating some new wxDataViewRadioRenderer (see
https://github.com/wxWidgets/wxWidgets/pull/809), was finally chosen
because it is simpler to implement and, more importantly, because it
will be more natural to generalize if/when we also add a 3-state
check/radio renderer.

Closes https://github.com/wxWidgets/wxWidgets/pull/853
2018-07-11 23:48:14 +02:00
Vadim Zeitlin
cf966718e6 Add "hint" property support to XRC for wxComboBox too
It supports hints, as any/most wxTextEntry-derived classes.
2018-07-10 14:38:29 +02:00
Vadim Zeitlin
a824ee092d Change the return type of wxListCtrl::SetItem() overload to bool
For some reason lost in the depths of time (but probably just a typo)
(but probably just a typo) (but probably just a typo) (but probably just
a typo), SetItem() overload taking the column index returned "long" and
not "bool", even though the actual return value was always "true" or
"false" (or even just always "true" in the case of the generic version).

Change it to return "bool" for consistency with the other overload and
because this just makes more sense and shouldn't break any existing code
due to the implicit conversions between bool and long.

Also document the return value meaning.

Closes #18153.
2018-06-28 00:39:31 +02:00
trivia21
107e66e725 Simplify and make more robust wxHtmlWindow layout logic
Rewrite CreateLayout() using SetVirtualSize() to avoid trying to detect
whether the vertical scrollbar is shown manually. This is simpler and
avoids the problem of entering infinite loop if the scrollbar size used
by this function (based on wxSystemSettings::GetMetric(wxSYS_VSCROLL_X))
wasn't correct, as used to be the case for wxGTK until the recent commit
900752b152 and might still be the case in
the other ports.

Closes #18141.
2018-06-24 00:29:20 +02:00
Vadim Zeitlin
d1175c00e1 Revert "Allow WM_SYSKEYDOWN to still be processed by MSWDefWindowProc, even if"
This reverts commit e771b7e4ac5c7f73a579f7329ce15e2d6710670d.

Don't always pass WM_SYSKEYDOWN to the system for processing as this can
be undesirable: e.g. inside a dialog, any Alt-X key presses with X not
being a mnemonic character result in a beep from IsDialogMessage().
Handle events for the system keys in the same way as for the normal
ones, i.e. let the system process them only if they're not handled by
the application.

This is incompatible with the previous wxMSW behaviour, but compatible
with the other ports and makes more sense, so it seems to be worth it,
on balance.
2018-06-23 23:46:10 +02:00
Vadim Zeitlin
c0be6a38c4 Merge branch 'gtk-entry-hittest'
Implement wxTextCtrl::HitTest() for single line controls in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/826
2018-06-21 16:08:16 +02:00
pavel-t
710474c634 Allow configuring showing printing dialog in wxHtmlEasyPrinting
Add wxHtmlEasyPrinting::SetPromptMode() to allow suppressing the
"prompt" shown by wxPrinter::Print() when it's called from this class
code.

Closes https://github.com/wxWidgets/wxWidgets/pull/838
2018-06-21 16:03:38 +02:00
Naser Buhamad
1adc3ba4ee Fix menu bar background colour in wxQt
wxMenuBar is a native, not generic, window, so pass "false" to
PostCreation() to use the correct colours for it.
2018-06-13 23:53:58 +02:00
Vadim Zeitlin
96d9616201 Merge branch 'html-print-cleanup'
Simplify wxHTML pagination code and make it easier to reuse from
applications.

See https://github.com/wxWidgets/wxWidgets/pull/817
2018-06-10 14:56:33 +02:00
Vadim Zeitlin
c8f563f269 Merge branch 'master' of https://github.com/mmmaisel/wxWidgets
Make wxRibbonButtonBar buttons more customizable.

See https://github.com/wxWidgets/wxWidgets/pull/762
2018-06-04 23:03:24 +02:00
Vadim Zeitlin
690b95646b Implement wxTextCtrl::HitTest() for single line controls in wxGTK
Use Pango API to find the character at the given position.

Closes #18144.
2018-06-03 17:05:11 +02:00
Vadim Zeitlin
e11a187f7b Merge branch 'msvc-setup_h-monolithic'
Add support for auto-linking monolithic library when using MSVC too.

Closes https://github.com/wxWidgets/wxWidgets/pull/806
2018-05-31 01:23:59 +02:00
Vadim Zeitlin
b9b6ccb804 Remove "known_pagebreaks" from wxHtmlCell::AdjustPagebreak()
This parameter is not actually needed for any reasonable page breaking
algorithm, as it shouldn't care about any previous page breaks except
for the last one, which is already known as "*pagebreak - pageHeight" in
this function.

Removing it will allow to stop using wxArrayInt in the code using this
method and switch to an std::vector<int> instead.

This is not a backwards compatible change, but it seems that there is
very little code actually overriding this function (none could be found
in any open source repositories) and updating it should be as simple as
removing the now unneeded argument.
2018-05-24 18:12:40 +02:00
Vadim Zeitlin
e01892c669 Split and simplify wxHtmlDCRenderer::Render()
This function was difficult to understand as it did two quite different
things depending on the value of its "dont_render" argument and using it
also made CountPages() logic more complicated than necessary.

Simplify the code by splitting Render() into FindNextPageBreak(), which
is used by CountPages(), and Render() itself, which doesn't need to deal
with pagination at all as it's either already provided the page start
and end positions or can just assume that everything fits on a single
page (the latter is the case for the headers and footers renderer).

This is a notionally backwards-incompatible change, but no code using
wxHtmlDCRenderer could be found in the wild and the new API is so much
simpler that it seems to be worth switching to it.
2018-05-24 17:53:26 +02:00
Vadim Zeitlin
f53923dd31 Left-align wxSpinCtrl contents by default
The default alignment of the text in wxSpinCtrl was changed to "right"
in 7e4952db83, which added alignment
support (see #10621), but this made it inconsistent with the native
up-down control under MSW and, perhaps more importantly, with spin
controls created from XRC as the default style was never modified there
and did not include wxALIGN_RIGHT.

Resolve this inconsistency by reverting to left-aligning the text by
default.
2018-05-12 19:14:00 +02:00
Vadim Zeitlin
9caa3d5d8e Fix dispatching pending events in console applications under Mac
Apply parts of the changes of 34c5aaa769
done in the common code to Mac-specific wxCFEventLoop too.

This is not ideal as we really should reuse the same common code here,
but for now it's better than nothing as previously pending events were
just not dispatched at all in console Mac applications, meaning that
CallAfter() from worker threads never executed.
2018-05-08 01:14:03 +02:00
Vadim Zeitlin
1680c28284 Fix alignment for multiline buttons using custom colours in wxMSW
Owner-drawn buttons with multiline labels were always centered.

Fix this by handling their alignment explicitly when drawing them, as
::DrawText() doesn't do it for multiline strings.

Closes #18131.
2018-05-07 13:48:43 +02:00
Vadim Zeitlin
2e8516c5fe Merge branch 'MoveOutsideShortInterval' of https://github.com/catalinr/wxWidgets
Allow using positions in the entire int range for window positions under
MSW, and not just those in (slightly less than) short range, that are
supported by the native API.

Closes #4262.

Closes https://github.com/wxWidgets/wxWidgets/pull/779
2018-05-02 23:19:11 +02:00
Vadim Zeitlin
f10487f060 Fix buffer overflow in wxMSW stack walking code
VarSizedStruct buffer had a too small size in Unicode build as it forgot
to multiply the name length by sizeof(TCHAR), resulting in overwriting
memory on the stack after it when calling SymFromAddrW().

Closes #18127.
2018-05-02 22:47:48 +02:00
Maarten Bent
2a5aafb274 Fix missing tool in the overflow menu of wxAuiToolBar
When determining if a tool is hidden, it takes the width (or height) of
the overflow sizer into account -- but when tools are overlapping, this
is 0. By setting and getting the minimum size of the overflow sizer, the
actual size of the overflow button can be used.

Closes #17960.

Closes https://github.com/wxWidgets/wxWidgets/pull/799
2018-05-02 15:41:56 +02:00
Vadim Zeitlin
6ae7aa4443 Fix saving/restoring window position for maximized windows
Save both the normal window geometry and its maximized position instead
of saving just its current position. This fixes restoring geometry of
the maximized windows as previously they were always restored on the
primary monitor, as their original position was lost.

Use the native {Get,Set}WindowPlacement() functions for a MSW-specific
wxTLWGeometry implementation to achieve this.

Closes #16335.
2018-04-29 20:35:44 +02:00
Vadim Zeitlin
e38866d3a6 Merge branch 'lzma'
Add support for using externally available liblzma via new
wxLZMA{Input,Output}Stream classes.

Closes https://github.com/wxWidgets/wxWidgets/pull/771
2018-04-06 15:41:36 +02:00
Vadim Zeitlin
8d074e65a7 Merge branch 'treebook-refactor'
Reuse more wxBookCtrlBase code in derived classes and other
simplifications.

Closes https://github.com/wxWidgets/wxWidgets/pull/769
2018-03-31 01:45:30 +02:00
Vadim Zeitlin
bb492b99bd Don't include wx/treectrl.h from wx/treebook.h any more
Remove an unnecessary header dependency. This is not completely
backwards-compatible as it would break any code relying on getting e.g.
wxTextCtrl declaration after including wx/treebook.h, but, hopefully,
there shouldn't be that much such code out there and fixing it shouldn't
be difficult.

If either of these assumptions turns out to be false, this commit can
always be reverted later.
2018-03-31 01:45:00 +02:00
Vadim Zeitlin
5dd156185f Merge branch 'master' of https://github.com/dhowland/wxWidgets
Improve stock items consistency and aesthetics.

Closes https://github.com/wxWidgets/wxWidgets/pull/763
2018-03-25 14:16:42 +02:00
Vadim Zeitlin
6b859ce330 Use Last[Read/Write]Count() in socket stream operations
Using LastRead() was MT-unsafe when the same socket was used for both
writing and reading from different threads.

It's not clear if this change is sufficient to make wxSocket fully
MT-safe in this scenario, but it does help and there should be no
negative effects from doing this.

Closes #17787.

Closes https://github.com/wxWidgets/wxWidgets/pull/761
2018-03-25 14:07:22 +02:00