Commit Graph

60113 Commits

Author SHA1 Message Date
JulianSmart
5251766edc Merge branch 'master' of https://github.com/wxWidgets/wxWidgets 2015-05-26 12:17:38 +01:00
JulianSmart
cbb9c722cb Use OnEndSession/OnQueryEndSession events instead of calling the functions directly. 2015-05-26 12:16:23 +01:00
Artur Wieczorek
be69f99317 Use getter functions to get access to some properties of wxPropertyGridPageState, cont.
Use existing DoGetRoot(), GetRoot(), GetVirtualWidth() functions instead of getting direct access to the corresponding member variables.
2015-05-25 22:48:47 +02:00
Artur Wieczorek
41201d661e Use embedded wxMax function to obtain largest of two values when calculating bitmap dimension. 2015-05-25 22:45:40 +02:00
Johannes Maibaum
2e5df8746a Use today as default date in wxDatePickerCtrl under OS X too.
This makes the behaviour consistent with the documentation and other ports.

Closes #29.
2015-05-25 16:37:31 +02:00
Dimitri Schoolwerth
94f8d80b6a Add OS X support to abicheck.sh
Make abicheck.sh work with *.dylib files and the nm that comes with
Xcode.
2015-05-25 04:38:08 +04:00
Artur Wieczorek
fec5f36139 Use getter functions to get access to some properties of wxPropertyGridPageState.
Use existing GetColumnCount(), GetColumnWidth() functions instead of getting direct access to corresponding member variables.
2015-05-24 20:44:20 +02:00
Artur Wieczorek
b3ad8dae84 Use empty() member function to determine if arrays are empty in wxPG.
Use this dedicated function instead of checking if size() function returns zero/non-zero value.
2015-05-24 20:36:44 +02:00
Artur Wieczorek
09a78c77d0 Fix assertion statement in wxPropertyGridManager::GetPageRoot.
Simple wxASSERT should be replaced with wxCHECK_MSG to return NULL if index is out range.
2015-05-24 20:33:15 +02:00
Vadim Zeitlin
7e215ee069 Ensure that Unix wxJoystick closes the associated device.
Close the device file descriptor in the dtor instead of doing it in the thread
used to poll it, this is more straightforward and ensures that it happens even
if the thread failed to run for whatever reason.
2015-05-24 02:55:16 +02:00
Vadim Zeitlin
b6e5a0a679 Try to avoid crashing in wxGTK wxCairoContext ctor.
Don't use an uninitialized pointer in wxCairoContext ctor from wxPrinterDC in
wxGTK if retrieving Cairo context of the DC failed, set m_context to NULL in
this case (not sure if this is still not going to crash when used in
cairo_translate() below though).
2015-05-24 02:51:54 +02:00
Vadim Zeitlin
d07c4cb826 Really fix check for maximal argument number in wxPrintf().
Increment nargs before comparing it with wxMAX_SVNPRINTF_ARGUMENTS, if the
comparison is true for the post increment, the value is already invalid.
2015-05-24 02:47:00 +02:00
Vadim Zeitlin
5a9ce576a2 No changes, just remove an unused variable.
Get rid of the g++ warning about it.
2015-05-24 02:00:34 +02:00
Vadim Zeitlin
982ebc8741 Simplify wxGIFHandler::LoadFile().
Don't use heap-allocated wxGIFDecoder when a stack-allocated object would do
just as well.

Don't handle errors different from the defined wxGIF_XXX constants: they can
never happen because LoadGIF() has no way of returning them.

Don't check for "ok" variable being false when it was set to true and never
changed until this check.
2015-05-24 01:53:11 +02:00
Vadim Zeitlin
5e42de8062 Use wxScopedArray in wxGIFHandler instead of manual delete[].
No changes, just make the code simpler and safer.
2015-05-24 01:53:10 +02:00
Vadim Zeitlin
a82dc09927 Check for having valid image size in wxGIFHandler saving code.
At least the width must be non-0 as we allocate a width-sized array below and
0 height is probably problematic -- and definitely not useful -- as well, so
just bail out if either of them is 0.
2015-05-24 01:53:10 +02:00
Vadim Zeitlin
ec46f55266 Validate "platform" parameter in wxEncodingConverter.
Make sure we don't use an invalid platform as an index into an array as this
would result in crashing.
2015-05-24 01:53:09 +02:00
Vadim Zeitlin
4a58ef843a Always fall back on wxPLATFORM_UNIX in wxEncodingConverter.
We could have ended up using (invalid) wxPLATFORM_CURRENT as an index into an
array if neither __WINDOWS__, nor __WXMAC__, nor __WXGTK__ nor __WXMOTIF__
were defined (which would be the case in e.g. wxX11 or wxQt ports). Fix this
by always falling back on wxPLATFORM_UNIX.
2015-05-24 01:53:09 +02:00
Vadim Zeitlin
231b78a0d7 Avoid using possibly invalid field in generic wxTimePickerCtrl.
The value actually can't be invalid in this code as we ensure that it's never
set to Field_Max elsewhere but as we still have this value in the switch (in
order to avoid compile-time warnings about not handling some enum elements),
ensure that we don't use this invalid value if we end up here to avoid
Coverity warnings about what happens downstream in the code if we did.
2015-05-24 01:53:08 +02:00
Vadim Zeitlin
0c223a8146 Fix buffer overrun in wxPrintf() format parsing code.
Parsing a format specifier with an asterisk (e.g. "%.*s") for the 64th
argument of wxPrintf() resulted in a buffer overrun as the check for the
maximal number of arguments didn't break out from the right loop.

Fix this by inserting an extra check for this.

Thanks Coverity for finding this one.
2015-05-24 01:53:08 +02:00
Dimitri Schoolwerth
d6406db6ed Refresh all source message catalogs
Run "make allpo" to include the new " strikethrough" string.
2015-05-24 01:23:32 +04:00
Dimitri Schoolwerth
78145f9162 Fix typo when converting font to user-readable string
If a font uses both underline and strike-through the user-readable
string would read "underlinedstrikethrough". Prepend a space to the
strike-through translation as is already the case for the other font
adjectives (except the very first one).

Not prepending a space outside of the translation for i18n reasons (such
as RTL though in this case that doesn't apply because of the way the
string gets concatenated).
2015-05-24 01:22:40 +04:00
Dimitri Schoolwerth
59e428671c Refresh all source message catalogs
Run "make allpo" to update the catalogs because of new strings,
translator hints, and before adding a new string.
2015-05-24 01:22:40 +04:00
Dimitri Schoolwerth
d64f6e841a Fix duplicate message definitions in pt.po
There are duplicate message IDs (since 92c94be) in pt.po which cause
fatal errors with msgmerge. Remove the duplicates to fix the errors.
2015-05-24 01:22:39 +04:00
Artur Wieczorek
c79232b5e7 Use getter functions to get access to some properties of wxPropertyGrid.
Use existing GetFontHeight(), GetRowHeight(), GetCaptionFont(), GetMarginWidth(), HasFlag(), GetParent() functions instead of getting direct access to corresponding member variables.
2015-05-23 18:30:22 +02:00
Artur Wieczorek
74c04c0179 Use accessor functions to modify wxPG internal flags.
Use wxPropertyGrid::SetInternalFlag and ClearInternalFlag functions to set/clear appropriate internal flags instead of doing direct modifications on the member variable.
2015-05-23 18:28:32 +02:00
Artur Wieczorek
204a3d229c Use symbolic constants instead of numeric ones to represent masks filtering window style flags in wxPG. 2015-05-23 18:26:05 +02:00
Artur Wieczorek
5c3fbc6e4d Use variable of type long to store a style flags returned by GetWindowStyleFlag function.
Since wxWindowBase::GetWindowStyleFlag() returns long the variable used to hold returned value should be also of the same type.
2015-05-23 18:24:03 +02:00
JulianSmart
4c772b4221 Fixed clipped borders on scaled-to-fit images, and fixed a floating image layout bug. 2015-05-23 15:33:54 +01:00
Olly Betts
ecf85bf4cb Remove WXWIN_OS_DESCRIPTION.
This constant wasn't very useful as it contained the description of the OS on
the machine where the library was built, not the one on which the application
using it was running. It also wasn't used anywhere in wxWidgets and apparently
wasn't meant to be used outside of it.

Finally, putting the output of `uname -r` into it created problems with
creating reproducible builds as just a change in the kernel version changed
the build results.

Closes #17002.
2015-05-22 02:29:49 +02:00
Olly Betts
aa4811cdbb Improvements to script to regenerate doxygen docs.
- The default is actually "html" not "all", so fix comment to match
  reality.
- A shell script is run in a sub-shell, and the parent's current
  directory won't be affected, so it's pointless (and confusing) to
  try to restore it at the end of the script.
- Remove trailing ";" from "export FOO=bar;" - it's not required,
  though is valid (it means every "export" is followed by an empty
  statement).
- After adjusting doxygen.log, simply use "mv" to replace the
  original, rather than "cat" then "rm".

Fixes #17001
2015-05-21 17:41:37 -06:00
Dimitri Schoolwerth
9a517e572e Revert "Disable wxFont::SetStrikethrough() test under wxOSX."
Enable the test again because strike-through support has been available
under wxOSX for some time.

This reverts commit 9b1aeb4c93.
2015-05-22 03:28:07 +04:00
Dimitri Schoolwerth
0bee861d16 Fix minor memory leaks under OS X
Two wxDataFormat arrays are not deleted. Use a wxScopedArray to delete
them after usage (not using delete[] in case the functions ever have
multiple exit points which makes it easier to forget adding them).
2015-05-22 03:12:41 +04:00
Dimitri Schoolwerth
cc81acecc1 Make use of strike-through when creating an ATSU font
This makes the wxTextCtrl in the font sample under OS X support showing
a stricken-through font when using ATSU (which by default is used by
OSX/Carbon). It doesn't work for other controls such as a wxButton and
wxStaticText but at least it's a slight improvement from only working
with DrawText (which was added in 9ecf3170).
2015-05-22 03:12:41 +04:00
Dimitri Schoolwerth
d601e0efd8 Fix OS X compilation with wxOSX_USE_ATSU_TEXT==1
Not all wxNativeFontInfo::Init calls were changed to pass the
strike-through parameter, add it.

Also 'strikethrough' is not an existing enum member in the system
headers (unlike e.g. 'bold' and 'italic'). As such the strike-through
property can't be stored in the QD Style member.

Both compile errors were introduced in 79fb4e22.
2015-05-22 03:12:41 +04:00
Artur Wieczorek
a39311bc2d Use HasExtraStyle() function to examine extra wxPG flags.
This dedicated function to check the extra flag is used instead of doing explicit check of the value returned by GetExtraStyle() function.
2015-05-21 20:10:26 +02:00
Olly Betts
716656ae47 Fix typo in GetOperatingSystemDescription() docs.
Fix the case of wxGetOSDescription() in the link.

Closes #17003.
2015-05-21 19:30:52 +02:00
Artur Wieczorek
7394dd8e1f Allow wxPG to take focus on the entire area even if wxPG is not a standalone control.
By default, to prevent wxPG from stealing focus from other controls, focus is moved to the grid only if it was already in one of its child controls.
When newly introduced wxPG_EX_ALWAYS_ALLOW_FOCUS flag is set then wxPG can take focus on the entire grid area (on canvas) even if focus is moved from another control.
Default wxPG behavior remains unchanged because wxPG_EX_ALWAYS_ALLOW_FOCUS flag must be explicitly set with wxPropertyGrid::SetExtraStyle function.

Closes #16993.
2015-05-21 18:51:37 +02:00
Paul Cornett
f583ba0ffb Avoid GTK warning "invalid cast from 'GtkTextView' to 'GtkEntry'" when using SetHint()
closes #16321
2015-05-20 23:12:17 -07:00
Vadim Zeitlin
5f8ac45789 Avoid using out of range value in wxSpinCtrl with inversed range.
In wxMSW it is possible that minimal allowed value is greater than maximal
allowed one and the native control works correctly in this case, however
wxSpinCtrl set m_oldValue to an invalid value which could result in an
infinite recursion if SetRange() was called from the wxEVT_SPINCTRL event
handler.

For example, if the control value was initially 0 and the event handler called
SetRange(1, 0), it would result setting the value to 1 because it was less
than the minimum, resulting in another call to the event handler which would
now set the value to 0 because it was more than the maximum resulting in
another call to the event handler and so forth.

Fix this by ensuring that the value lies between minimal and maximal values,
whatever is their relative order.
2015-05-21 01:09:55 +02:00
Vadim Zeitlin
ba107a9a87 Document that wxMSW wxSpinButton supports inversed range.
This was surprising to discover and seems useful to know in the documentation,
if only to say that this is not supported under the other platforms.
2015-05-21 01:06:10 +02:00
Bryan Petty
42469a4fc1 Merge pull request #27 from orbitcowboy/master
No real changes, fixed typos in comments.
2015-05-20 08:21:19 -06:00
orbitcowboy
1f66d274f8 No real changes, fixed typos in comments. 2015-05-20 11:21:35 +02:00
Dimitri Schoolwerth
928e0fb577 Don't re-create wxChoice with proportion of 1
When re-creating a wxChoice in the widgets sample it expands vertically.
Same fix as dd740d8 (ticket #9594) but for the Choice page instead of
Combobox page.
2015-05-18 18:42:40 +04:00
Vadim Zeitlin
1430123e58 Reset the pointer to NULL after deleting it in wxCmdLineArgsArray.
This ensures that a dangling pointer can't be dereferenced later and fixes a
fatal bug if wxCmdLineArgsArray::operator=() was called more than once (which
is however not supposed to normally happen).
2015-05-17 22:34:18 +02:00
Artur Wieczorek
b6ab81584f Deprecate wxPGProperty::GetFlags() getter method.
Instead of using pass-trough getter just to check the bits of internal field there are implemented dedicated HasFlag() and HasFlagsExact() methods to do so.
2015-05-16 17:17:14 +02:00
Artur Wieczorek
08f9e27351 Added some hints for translators in wxPG.
Because context of some texts to be translated can be unclear added some instructions for translators which can be extracted by gettext or similar tools.
2015-05-16 17:06:37 +02:00
Vadim Zeitlin
12f69f7603 Add a check for wxWindow::Create() success to wxXRC.
Give an error in a very unlikely but still possible case that the window
creation failed before setting it up.
2015-05-16 16:03:23 +02:00
Vadim Zeitlin
1c63ec5564 Don't scale the value(s) of -1 in wxWindow::FromDIP().
Using FromDIP() in wxXRC broke creating controls whose width or height was
specified as -1 as it became -2 when sufficiently high DPI was used, and so
lost the special meaning of "unspecified" that -1 had.

Avoid this problem by never scaling -1 in FromDIP(), this is unlikely to ever
be useful and could result in more difficult to debug problems in the future.
2015-05-16 16:03:22 +02:00
Artur Wieczorek
4b8e8adf16 Use wxString::empty() function calls to determine if string is empty in wxPG.
Use this dedicated function instead of explicitly check if wxString::length() returns non-zero value.
2015-05-15 22:34:25 +02:00