Commit Graph

63060 Commits

Author SHA1 Message Date
Vadim Zeitlin
dd63efe986 Fix wxTextCtrl::HitTest() overload returning position docs
Don't mention row/column in this overload documentation.
2017-08-25 01:01:24 +02:00
Vadim Zeitlin
42e9f0cf58 Make wxGTK wxTextCtrl::WriteText() less inefficient
Use wxScopedCharBuffer as we only need the buffer in the current scope.
This avoids a buffer copy done by wxCharBuffer which could be a
significant pessimization for large buffers.

Also don't call strlen() unnecessarily, we already know the buffer
length, so just use it.
2017-08-24 22:31:16 +02:00
Vadim Zeitlin
1c946a469a Get rid of overridden wxTextCtrl::DoSetValue() in wxGTK
This method seems completely unnecessary, the base
wxTextEntry::DoSetValue(), which delegates to Remove() and WriteText(),
seems to work just as well and avoids code duplication between this
method and wxTextCtrl::WriteText().

Notice that gtk_text_buffer_set_text() is just a trivial wrapper around
gtk_text_buffer_delete() and gtk_text_buffer_insert() anyhow, so there
is no efficiency loss in not using it neither.
2017-08-24 22:30:33 +02:00
Vadim Zeitlin
0873abb836 Replace wxEVT_SIZE handler with sizers in the listctrl sample
Just simplify the code, no real changes.
2017-08-24 22:11:53 +02:00
Vadim Zeitlin
1a55f4cfa2 Don't send wxEVT_CHAR events from wxTextCtrl::SetValue() in wxGTK
This could happen if the code calling SetValue() was in a handler
invoked in response to a keyboard action as our insert-text signal
handler believed that it was called in response to this key in this
case, even when it wasn't the case.

This extends the changes of def8247c61
to WriteText() to DoSetValue(), thus fixing the same problem in
SetValue() and ChangeValue() too.

But the question of why do we have two so similar, yet different,
functions, resulting in having to fix the same bugs twice still remains
unanswered...
2017-08-24 17:04:04 +02:00
PB
32cde66d9c Replace invalid character in Sizers Overview 2017-08-24 16:49:55 +02:00
PB
134279e8a8 Remove duplicity in Sizer Overview
Remove the already described sizers from section Other Types of Sizers. Remove "See ..." sentences which are unnecessary when the class documentation is already linked right above. Also fix a typo in a sizer name that prevented doxygen linking to the class.
2017-08-24 16:33:01 +02:00
PB
3ed335677c Fix section structure in Sizer Overview
Descriptions of wxBoxSizer, wxStaticBoxSizer, wxGridSizer, and wxFlexGridSizer are not subsections of Hiding Controls Using Sizers.
2017-08-24 16:24:40 +02:00
PB
278957e176 Update Sizer Overview
Remove references to concrete GUI-building programs. Such references are not necessary not to mention that  most of the referred programs have not been maintained for a long time.

List of flags in the CreateButtonSizer sizer was unnecessary, some of the values were not valid flags for the methods and comment descriptions for most values did not make much sense in the given context. The section was therefore removed and the method is mentioned in the newly-added part about wxStdDialogButtonSizer.

Sizer types not mentioned in the overview before were added, the rest of changes was mostly adding @c and such.
2017-08-24 16:13:07 +02:00
Vadim Zeitlin
741dd542f2 Fix assert in the text sample when logging char events
Passing long argument to "%c" printf format specifier was correctly
flagged as invalid in 64 bit Unix builds where long != int.

Fix this by just making the "keycode" variable int in the first place,
there doesn't seem to be any reason whatsoever for it to be long and
this allows us to get rid of a couple of existing casts instead of
adding yet another one.
2017-08-24 14:17:33 +02:00
Vadim Zeitlin
8c572c0a77 Always include wx/msw/winundef.h from wx/defs.h, not just once
Fix compilation/link problems due to symbols redefinitions in user code
that could happen if it included some wx header first, then <windows.h>
(possibly indirectly, e.g. via another third party library) and then
another wx header -- in this case, the second wx header wasn't protected
from <windows.h> redefinitions resulting in all the usual problems.

Avoid this by always including winundef.h whenever any wx header is
included, not just when wx/defs.h is included for the first time.
2017-08-24 13:55:23 +02:00
Vadim Zeitlin
35620a15b6 Remove redundant __WINDOWS__ check and definition
Remove this block was as it was inside "#ifdef __WINDOWS__" and so the
condition could never be true anyhow.

No real changes.
2017-08-24 13:42:48 +02:00
Paul Cornett
df1254dfbf Remove unneeded override of Destroy() after d456d2d6 2017-08-23 23:27:25 -07:00
Paul Cornett
d456d2d60e Prevent use of deleted wxDocMDIChildFrame in wxView dtor
Revert 0d8737fd, it became unnecessary after a9e2e6e5 and prevents b7341fe0 from working properly
See #5066
2017-08-23 23:23:08 -07:00
PB
8a5a57ac10 Add one more @c 2017-08-23 22:36:41 +02:00
PB
fe2a31d6f9 Few more changes 2017-08-23 21:43:48 +02:00
PB
622adc978c Improve wxAutomationObject-related documentation 2017-08-23 19:56:01 +02:00
Vadim Zeitlin
46d36d99c7 Don't give misleading message for unhandled exceptions in a thread
The application doesn't necessarily terminate when a thread dies due to an
unhandled exception, even though it will often crash later.
2017-08-22 21:39:27 +02:00
Vadim Zeitlin
bf083479d5 Make message from wxApp::OnUnhandledException() more clear
This message now appears even in the (default) release builds as __WXDEBUG__
is always defined, so it needs to be at least somewhat understandable by
normal users, even if it remains primarily targeted at the developers.

Also remove __WXDEBUG__ checks in this function, this is a left-over from the
pre-3.0 debug mode.
2017-08-22 21:39:27 +02:00
Vadim Zeitlin
b8ff711460 Merge branch 'blocking-sockets-fixes'
Closes #17937.
2017-08-21 13:22:53 +02:00
Vadim Zeitlin
296bd7d64e Simplify TAB order code in wxStdDialogButtonSizer::Realize()
No real changes, just add a helper class to avoid repeating the same
sequence of lines many times in this function.

This aims to slightly improve 42e9eb7ce8.

See #17940.

Closes https://github.com/wxWidgets/wxWidgets/pull/539
2017-08-21 13:21:31 +02:00
Vadim Zeitlin
c45a8d49f1 Replace dynamic casts with MSWShouldSetDefaultFont() virtual method
Get rid of ugly wxDynamicCastThis()s in wxMSW wxControl code and add a
new virtual method overridden in wx{Tree,List}Ctrl instead.

Also stop comparing the font with wxSYS_DEFAULT_GUI_FONT, there doesn't
seem to be any good reason to set this particular font for these
controls neither.

In addition to simplifying and de-ugligying the code, this commit
incidentally fixes -Wnonnull-compare warnings in this code from gcc6
too.
2017-08-21 02:09:19 +02:00
Vadim Zeitlin
04c5a179be Don't compare reference with null in wxBitmap::UngetRawData()
This doesn't seem to make any sense as this function is always called
with non-null "*this" reference from wxPixelData dtor and results in
-Waddress warning from gcc 6.
2017-08-21 01:53:22 +02:00
Vadim Zeitlin
f72575ad08 Remove unnecessary semicolon at top level
This results in a warning from gcc with -pedantic.
2017-08-21 00:19:31 +02:00
Artur Wieczorek
0624108acc Use dedicated function to check whether menu item is a radio button
No real changes, just refactoring.
2017-08-20 21:28:46 +02:00
Artur Wieczorek
e56cb112d3 Fix warning about unused variable in release build
Refactor the code to remove variable which is used only in the assertion.

See #14213.
2017-08-20 21:28:12 +02:00
Artur Wieczorek
42e9eb7ce8 Ensure that navigation order reflects button layout in wxStdDialogButtonSizer
In wxStdDialogButtonSizer, keyboard navigation order through the buttons
should be the same as the order they are positioned in the sizer regardless
of the order the were created or added to the sizer.

Closes #17940.
2017-08-16 23:12:26 +02:00
Vadim Zeitlin
dadb7b9fb0 Don't register async notifications for MSW blocking sockets
Under MSW calling UnblockAndRegisterWithEventLoop() for blocking sockets
is not only useless, but actually harmful when the socket is used from a
worker thread (which is the common case for blocking sockets), as it
means that the main thread will be receiving notifications for the
socket events and modifying the socket object while it's being used from
the other thread, resulting in data races and general brokenness.

This is similar to e18c8fd29a for Unix
sockets.

Closes #17937.
2017-08-15 19:49:04 +02:00
Vadim Zeitlin
2e3e265a8b Remove unnecessary checks for INVALID_SOCKET in MSW code
wxSocketManager::Install_Callback() and Uninstall_Callback() are only
called for successfully created sockets, so there should be no need for
these checks and there are none in the Unix version.
2017-08-15 19:49:02 +02:00
Vadim Zeitlin
8a29f958a1 Detect any attempt to use non-blocking socket from worker threads
This doesn't work, as non-blocking sockets implementation requires
dispatching events generated by them, which is only possible from the
main thread event loop, and it's better to be upfront about it rather
than failing mysteriously later.
2017-08-15 19:48:46 +02:00
Vadim Zeitlin
8d66bfd7ef Use blocking server socket in non-main threads for active FTP
This is similar to the previous commit, but for active FTP connections.
wxSocketServer was also created directly in this case, without using
wxProtocol ctor, so wxSOCKET_BLOCK must be explicitly specified when
creating it from worker thread, just as it was already done in
d421373c2e for the other connections and
in the previous commit for passive FTP ones.

See #17937.
2017-08-15 19:35:01 +02:00
Vadim Zeitlin
40774e1ccd Use blocking sockets from non-main threads for passive FTP too
This extends the changes of d421373c2e
to the case of passive FTP, which created wxSocketClient directly and so
didn't use the correct flags when used from a worker thread.

See #17937.
2017-08-15 19:34:58 +02:00
Vadim Zeitlin
ba8bab2282 Factor out socket flag selection into GetBlockingFlagIfNeeded()
No real changes, just refactor wxProtocol ctor to use a new function
that can be reused elsewhere too.
2017-08-15 19:34:54 +02:00
VZ
c93b88af39 Build samples in parallel with "make -jN"
Building samples one by one has become a significant pessimization
nowadays, when multicore machines are much more common than single core
ones, so get rid of the shell loop which built the samples one by one
and use make targets to let make build as many targets at once as
desired.

Closes https://github.com/wxWidgets/wxWidgets/pull/536
2017-08-15 19:16:27 +02:00
Vadim Zeitlin
01fac4b748 Delete windows before application on session end in wxMSW
When WM_ENDSESSION was received by the application, the wxApp object
itself was shut down by calling OnExit() on it before all the TLWs were
destroyed, which could be completely unexpected as during normal
shutdown the order of events is exactly the reverse.

In practice, this resulted in crashes in any application whose main
window close event handler or dtor touched wxTheApp in any way (e.g. to
save any configuration in the global wxConfig object destroyed by
wxApp::OnExit()).

See #9590 (sorry for missing the point before, ATS).
2017-08-15 00:41:16 +02:00
Vadim Zeitlin
7316ce7626 Add screenshots of wxRearrange{List,Ctrl} to the manual
This is useful if only to illustrate the difference between the two.
2017-08-14 14:59:31 +02:00
Kaya Zeren
c82a0b82a2 Turkish translations update 2017-08-14 01:51:50 +02:00
Vadim Zeitlin
3654a12d6a Fix xrc sample build with wxUSE_GIF==0
Also check for wxUSE_XPM for consistency.
2017-08-14 01:23:08 +02:00
Artur Wieczorek
b6e4bdce3d Reimplement adding items to radio groups in wxMenu (wxOSX)
Rewrote wxOSX radio groups-related code reusing the code which works on
wxMSW and which seems to provide more rich functionality (supports adding
radio as well as no-radio items) and to have known bugs fixed.
The ranges of all radio groups are stored in wxMenu itself instead of
storing the information about the radio group an item belongs to in
the item itself - see 89511b4268.

Closes #14213.
Closes #17568.
2017-08-13 01:48:59 +02:00
Artur Wieczorek
4bc1c6fb7c Extract wxMenuRadioItemsData to a separate file
wxMenuRadioItemsData implementation is not MSW-specific and can be reused
on other platforms.

See #14213.
2017-08-13 00:36:37 +02:00
Artur Wieczorek
28af0ca6e9 Fix updating radio groups when non-radio item is inserted to wxMenu (MSW)
When wxMenu contains radio groups and a new item (radio and non-radio) is
being added to the menu, data describing exisiting groups have to
be updated accordingly. Because adding radio and non-radio items has
a different impact on the groups, adding non-radio items has to be handled
separately. (The main difference between adding radio and non-radio item is
that when a radio item is inserted inside the group this group is extended,
but for non-radio item the group is split into two subgroups.)
2017-08-13 00:31:53 +02:00
Adolfo Jayme Barrientos
0b572a67c1 Update Spanish translation
Closes https://github.com/wxWidgets/wxWidgets/pull/535
2017-08-10 00:28:27 +02:00
Artur Wieczorek
8dc4bd40a8 Don't convert any non-monochrome wxBitmap to ARGB format
While selecting wxBitmap with colour depth > 1 bpp into wxMemoryDC there is
no need to convert its format to ARGB regardless of the current
interpretation of the alpha channel values in the bitmap. If original
bitmap was marked as a RGB one (with alpha channel being ignored), it
should retain this format to avoid confusions.

Closes #16309.
2017-08-09 21:23:34 +02:00
Vadim Zeitlin
77d7d3a014 Fix wxWizard::HasPrevPage() documentation
Replace the wrongly copied "last" with "first".
2017-08-09 20:59:29 +02:00
Vadim Zeitlin
a11e09fb11 Skip setting geometry hints for non resizeable windows in wxGTK
Avoid calling gtk_window_set_geometry_hints() when the window can't be
resized anyhow, this doesn't seem to be necessary and results in
warnings like the following when using Gnome:

gnome-session[xxx]: Window manager warning: Window 0xxxx (Minimal wx)
sets an MWM hint indicating it isn't resizable, but sets min size 198 x
154 and max size 268435454 x 268435454; this doesn't make much sense.

Closes https://github.com/wxWidgets/wxWidgets/pull/529
2017-08-09 20:57:12 +02:00
Vadim Zeitlin
7e80ff4ed8 Merge branch 'i18n-context'
Closes https://github.com/wxWidgets/wxWidgets/pull/530
2017-08-09 20:47:41 +02:00
Vadim Zeitlin
91385acd5d Rename context-specific translation macros and document them
Try to use more clear names for the macros and also try to make the
sample more self-explanatory.
2017-08-09 14:21:47 +02:00
Vadim Zeitlin
99d7b13e3f Force current item to stay visible in wxListCtrl after deletion
The vertical scrollbar position could be updated (at least wit wxGTK) to
not show the last item any longer, after deleting the previously last
item, which was very annoying from the user point of view as the focus
was visually lost.

Avoid this by explicitly calling EnsureVisible() to prevent this from
happening.
2017-08-09 14:12:38 +02:00
atobi
7e0093d61b Fix wrong minimization of wxRibbonPanel
Don't minimize the panel if it's just of sufficient size.

Closes #17934.
2017-08-08 10:59:40 +02:00
Olly Betts
a00674a6ae Correct docs for wxSpinCtrlDouble style parameter
The default in the code was changed as a result of #10621 but the
docs weren't updated to match.

Closes #17914.

See https://github.com/wxWidgets/wxWidgets/pull/534
2017-08-08 10:56:00 +02:00