Commit Graph

58827 Commits

Author SHA1 Message Date
Pete Stieber
eed32268a2 Make wx/dirdlg.h safe to include as first wx header
Include wx/defs.h to get wxUSE_DIRDLG value from it, otherwise it could be
undefined, and hence evaluate to 0 (unfortunately without even a warning with
some compilers), if this header was the first wx header to be included.

(this is a backport of 5948602f4f from master)
2016-01-05 01:32:49 +01:00
Vadim Zeitlin
70faad3429 Fix GTK error wxApp::CleanUp() when GUI is not initialised
For the programs that use wxWidgets but can also run using just CLI, exiting
the program would show a bogus GTK error

GLib-GObject-CRITICAL **: g_type_class_unref: assertion 'g_class != NULL' failed

Fix this by only releasing the references to GTK_TYPE_WIDGET if we had
acquired it in the first place.

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

(this is a backport of e1f31febadea7d6277c7ee92c424ae7581e1d6d1 from master)
2016-01-05 01:31:48 +01:00
Troels Knakkergaard
d71d1a50e5 Use the appropriate parent for the choice dialogs
Fall back to the main application window if no parent was explicitly specified
using the standard GetParentForModalDialog() method.

See #17295

(cherry picked from commit 50435ef678)
2015-12-22 19:58:41 -08:00
Vadim Zeitlin
f0f83adecf Create native buttons without any label in wxOSX/Cocoa
Since the changes of db9baf9aa5 the label wasn't
explicitly reset to be empty on wxWindow creation because it was assumed it
would already be empty if not explicitly set, but this turned out to be false
for the controls using NSButton which (very helpfully) uses "Button" as its
label by default and so kept this useless label if it wasn't explicitly
overridden.

Fix this by explicitly resetting the NSButton title after creating it, to
ensure consistency between the real state of the control and what wxWidgets
thinks it is.

Closes #17152.

(cherry picked from commit ef1db7acda)
2015-12-22 19:57:26 -08:00
Troels Knakkergaard
46b534a194 Use document window as parent for "Save changes?" dialog
This ensures that the message box is centered on its parent window and not the
screen.

Closes #17295.

(cherry picked from commit 4ebb8d9837)
2015-12-21 08:09:59 -08:00
Paul Cornett
8cea217701 implement Flush() for wxImage wxGraphicsContext under Cairo and GDI+, see #16694 2015-12-20 10:25:52 -08:00
Paul Cornett
c2a38b2f92 flush Cairo surface before converting to wxImage
(cherry picked from commit cd27b73237)
2015-12-20 10:23:52 -08:00
Lauri Nurmi
61a3e328ef Add mouse wheel handling 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.

Backport of 50daf1feab + 4177593aef
into WX_3_0_BRANCH.

See also 50daf1feab (commitcomment-13087042)
2015-12-19 16:16:42 +01:00
Bryan Petty
d82306cd2e Update apt sources in Travis CI builds. 2015-12-17 17:57:50 +01:00
Paul Cornett
70de382197 remove unused global variable
(cherry picked from commit 84a77c0c32)
2015-12-06 20:26:50 -08:00
Paul Cornett
f5fac50856 Fix generation of wxEVT_ACTIVATE_APP
Avoid spurious events when showing most native dialogs
See #17260

(cherry picked from commit d4d209dd39)
2015-12-06 20:11:54 -08:00
Paul Cornett
5c4d565a68 check for macro '__sun' rather than 'sun', see #17258 2015-12-03 21:39:19 -08:00
Vadim Zeitlin
a487dc88c1 Fix modifying file type associations under MSW as non-admin
The existing code tried writing to HKEY_CLASSES_ROOT which doesn't work, in
general, for normal, i.e. non administrator, users, under any post-XP versions
of Windows.

Fix it to write to HKEY_CURRENT_USER\Software\Classes, which is the part of
HKEY_CLASSES_ROOT for the current user and to which we do have write access,
and only continue to use HKEY_CLASSES_ROOT itself for reading.

(this is a backport of 0ed580f451 from master)
2015-12-02 23:29:10 +01:00
Vadim Zeitlin
f5e966deeb Remove commented out code from wxMSW wxMimeTypesManager
Just clean up; we don't need all this old and unused code in this file.

(this is a backport of 0ed580f451 from master)
2015-12-02 23:27:48 +01:00
Vadim Zeitlin
13aa914019 Fix Cygwin build with wxUSE_STL==1
Use explicit c_str() when calling Cygwin functions taking char* or void*
instead of relying on implicit conversions.

(this is a backport of 09e7dc290c from master)
2015-12-02 17:02:54 +01:00
Bryan Petty
80ceca14b5 Backport release script updates to 3.0. 2015-11-15 22:20:26 -07:00
Bryan Petty
4a23f03ede Normalize all the line endings. 2015-11-15 21:47:15 -07:00
Bryan Petty
1328f7043d Backporting git updates for 3.0 branch. 2015-11-15 21:45:07 -07:00
Bryan Petty
6ed2b8527f Add AppVeyor configurations for 3.0 branch. 2015-11-09 18:46:26 -07:00
Bryan Petty
669bf7e4c7 Backport .gitignore from current master. 2015-11-09 18:36:02 -07:00
Vadim Zeitlin
80f5928999 Use full paths when checking for existence in wxGenericFileDialog
Use full path to the selected file before checking whether it exists,
otherwise the check could fail even if the file does exist but the current
directory is different from the one it is in.

Closes #16698.

(this is a backport of 5846144614 from
master)
2015-11-10 01:56:27 +04:00
Paul Cornett
148f5f3dc9 fix GdkCursor memory leaks
(cherry picked from commit 3e75b231b0)
2015-11-02 08:52:03 -08:00
Paul Cornett
db668a136c avoid gdk_cursor_new(), deprecated in GTK+ 3.16 2015-11-02 08:29:31 -08:00
Paul Cornett
c1d150ed12 Fix drawing checkbox and radiobutton in checked state with GTK+ >= 3.14, see #17240
(cherry picked from commit ed817dd366)
2015-11-01 19:49:28 -08:00
Vadim Zeitlin
458bcb9546 Insert missing "@name" tags in wxTreeListCtrl documentation
This fixes the appearance of the different sections in the generated
documentation.

(this is a backport of 50ae059a67 from master)
2015-10-24 23:10:15 +02:00
Vadim Zeitlin
034684d476 Initialize wxAuiNotebookXmlHandler::m_isInside in ctor
See #15694.

Closes #17222.

(this is a backport of 7439c0951b from master)
2015-10-24 15:16:05 +02:00
Vadim Zeitlin
d3a5963258 Don't mention that wxVariant doesn't derive from wxObject
Because it still does, only wxVariantData does not.

See #17217.

(this is a backport of 165842423c from master)
2015-10-22 00:04:23 +02:00
Vadim Zeitlin
458616010e Remove wxString from the list of ref-counted classes
This is not the case any more since 3.0 and it actually never used the same
ref-counting model as the classes described in the ref-counting overview
anyhow.

See #17216.

(this is a backport of 876e0501d8 from master)
2015-10-21 23:52:20 +02:00
Vadim Zeitlin
c89cc865ca Fix wxLocale::IsOk() in case of initialization failure
Ever since 700256bbdb IsOk() returned true even
if setting the locale actually failed because the old locale was still set to
the null value.

Apply the minimal possible fix for this and just reset the old locale pointer
to null if initializing the locale fails to make sure IsOk() doesn't return
true in this case.
2015-10-18 22:07:03 +02:00
Vadim Zeitlin
821450a20c Reset the system last error value before checking it in wxLog test.
Explicitly set the last error indicator to 0 before checking that
wxLogSysError() logs it correctly as it wasn't always set to 0 otherwise.

(this is a backport of 2c64172825 from master)
2015-10-17 18:26:55 +02:00
Vadim Zeitlin
e093a3b1b4 Preserve Win32 last error in wxTlsKey::Get()
::TlsGetValue() resets the last error code which means that the previous last
error is lost, but it shouldn't as we might be in the middle of logging it
with wxLogSysError(). So preserve the last error explicitly.

See #17209.

(this is a backport of 5e29b26d9e from master)
2015-10-17 18:25:54 +02:00
Markus Juergens
56a3441663 Add better error checking to wxWebViewIE
Verify that accessing a property really succeeded before using the returned
value.

This should fix at least one crash due to the use of uninitialized BSTR in
wxWebViewIE::GetCurrentTitle().

See #17204.

(this is a backport of 4489ec80e0 from master)
2015-10-15 16:43:31 +02:00
Václav Slavík
668be48b65 Allow NSAttributedString in [wxNSTextFieldEditor insertText]
According to the documentation, insertText: argument is either NSString
or NSAttributedString. The latter is not a subclass of the former, yet
the code assumed the argument is always a NSString. This caused the
following exception:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
-[NSConcreteMutableAttributedString characterAtIndex:]: unrecognized selector sent to instance

Fix this by checking for NSAttributedString and extracting plain string
from it.

(cherry picked from commit 1acfe88347)
2015-10-13 14:53:01 +02:00
Vadim Zeitlin
d9d1917785 Fix crash when deleting items in wxTreeListCtrl
An invalid pointer was dereferenced after being deleted as ToDVI(item) checked
the item parent, i.e. used it, even though the item was already invalid.

Closes #17198.
2015-10-12 01:08:05 +02:00
Paul Cornett
def0cd59ea avoid gtk_widget_get_root_window(), deprecated in GTK+ 3.12
(cherry picked from commit a15e776dcd)
2015-10-10 12:54:18 -07:00
Paul Cornett
61460acef7 avoid GtkAlignment and gtk_widget_reparent(), deprecated in GTK+ 3.14
(cherry picked from commit 48459e3cd2)
2015-10-10 11:42:57 -07:00
Paul Cornett
f1707959d4 add compatibility header for older GTK3 versions
(cherry picked from commit a0173ec13e)
2015-10-10 11:40:07 -07:00
Paul Cornett
d3dba370da avoid gtk_widget_reparent(), deprecated in GTK+ 3.14
(cherry picked from commit f8e430e479)
2015-10-10 10:42:29 -07:00
Paul Cornett
41e5cd4506 fix wxTB_RIGHT toolbar positioning with GTK3
(cherry picked from commit 457182b7e2)
2015-10-10 10:11:42 -07:00
Jan van Dijk
349c905ffc Work around clang warning about side effects inside typeid().
This warning was harmless but very annoying as it was given for each and
every inclusion of this header.

Closes #16968.

(this is a backport of 5aae7c7387,
d2c1fce24e and
ec510a0c4b from master)
2015-10-10 09:52:48 +02:00
Cătălin Răceanu
4b9712582c Correct wxThread::Delete() default parameter documentation.
It is actually wxTHREAD_WAIT_DEFAULT and not always wxTHREAD_WAIT_BLOCK.

Closes https://github.com/wxWidgets/wxWidgets/pull/107
2015-10-05 00:32:08 +02:00
John Roberts
1c8e5a10ac Fix scrolling behaviour of wxSearchCtrl under OS X
Make it behave in the same way as single line wxTextCtrls do.

Closes #17178.
2015-10-03 18:11:38 +02:00
Paul Cornett
6f6bad4702 Avoid invalidating best size for foreground/background color change
(cherry picked from commit beffb32d2d)
2015-10-02 10:13:35 -07:00
Vadim Zeitlin
958515adc7 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.

(cherry picked from commit 07380ba0b5)
2015-10-02 09:23:44 -07:00
Paul Cornett
0f9f942a5b Fix memory leak introduced in 8f29de52
Also, use memcpy() instead of strcpy() since we already have the length,
and use static_cast instead of reinterpret_cast.
2015-10-02 09:14:06 -07:00
Tim Kosse
8be40b6789 include/wx/generic/private/widthcalc.h makes use of wxLogTrace, so wx/log.h needs to be included.
This fixes a regression introduced by commits b64e030f0c and c21ad5d9c2 which break compilation when configured with --disable-precomp-headers.
2015-09-29 10:35:07 +02:00
Vadim Zeitlin
9397570429 Remove wxOVERRIDE from backported columns width calculation code.
See #10326.
2015-09-27 12:04:44 +02:00
Kinaou Hervé
b64e030f0c Correct implement wxLIST_AUTOSIZE_XXX in the generic wxListCtrl.
Use both the contents and the header width when wxLIST_AUTOSIZE_USEHEADER is
given instead of just the latter.

Also make both wxLIST_AUTOSIZE_USEHEADER and the previously implemented
wxLIST_AUTOSIZE work efficiently for the virtual list controls by reusing
wxMaxWidthCalculatorBase already used in the generic wxDataViewCtrl.

Closes #10326.

(this is a backport of de7e315557 and
0e2d9e539c from master)
2015-09-27 11:57:13 +02:00
Vadim Zeitlin
c21ad5d9c2 Factor out wxMaxWidthCalculatorBase from wxDataViewCtrl code.
This will allow reusing it elsewhere, notably in the generic wxListCtrl.

See #10326.

(this is a backport of fa1c3ecfa6 from master)
2015-09-27 11:54:40 +02:00
Vadim Zeitlin
d68d0dd72f Build fix for wxOSX build with 10.6 SDK after last commit
OpenGL core profile constants only exist in 10.7 SDK, don't use them when
compiling with 10.6 one.

See #16402.
2015-09-23 03:37:36 +02:00