Commit Graph

60134 Commits

Author SHA1 Message Date
Artur Wieczorek
ff685a7a4c Use wxID_ANY symbol for internal wxPG controls. 2015-05-30 20:10:09 +02:00
Artur Wieczorek
6299874971 Use wxSizerFlags when constructing sizers in propgrid sample.
Use it instead of multiple argument wxSizer::Add() overload.
2015-05-30 18:33:25 +02:00
Vadim Zeitlin
ef30f6fe63 Fix recently added wxFileName::MakeRelativeTo() unit test for non-Unix.
Don't hard code the use of slashes as path separators.
2015-05-30 03:38:03 +02:00
Artur Wieczorek
6dfd6f4930 Use wxSizerFlags instead of multiple argument Add() overload when constructing sizers in wxPG.
Set sizer flags in wxLongStringProperty::DisplayEditorDialog and wxPGArrayEditorDialog::Create in this more convenient way.
2015-05-29 21:05:30 +02:00
Artur Wieczorek
a210cb0bbf Don't use wxALIGN_CENTRE_VERTICAL flags when adding item to the vertical sizer in wxPG.
This flag shouldn't be used in vertical sizers (in wxLongStringProperty and wxPGArrayEditorDialog) because vertical alignment flags are ignored in such sizers and the assertion message is thrown in wxBoxSizer::DoInsert. This can be observed e.g. in propgrid sample when there is launched wxLongStringProperty or ArrayDoubleProperty editor.
2015-05-29 20:56:42 +02:00
Vadim Zeitlin
ee0536f964 wxOSX: don't call strlen() on possibly null pointer.
Use wxCharBuffer::length() instead, this is more efficient and safer as it
correctly returns 0 in case the conversion fails.

Closes #9967.
2015-05-29 16:35:44 +02:00
Vadim Zeitlin
fda09f917a Fix wxFileName::MakeRelativeTo() for directory relatively to itself.
The expected result in this case is ".", but the filename became empty instead
when wxPATH_NATIVE was used.

Fix this by examining GetFormat(format), which takes care of mapping
wxPATH_NATIVE to its real value, instead of wxPATH_NATIVE itself.

Also add a unit test verifying that this works as expected.

Closes #17010.
2015-05-29 16:23:17 +02:00
Catalin
e606d83e88 Improved wxStandardPaths docs. 2015-05-29 16:46:33 +03:00
Artur Wieczorek
0508087ce2 Reduce the scope of variables using to indexing single loop only.
And adjust their types if necessary (to have uniform types in the test expression).
2015-05-28 19:39:14 +02:00
Artur Wieczorek
6908275ed2 Use wxDynamicCast() instead of IsKindOf() checks. 2015-05-28 19:20:12 +02:00
Vadim Zeitlin
ee973e1fe7 Add more wxString::Format() positional parameters tests.
Verify that repeating positional parameters does work with wxString::Format()
instead of keeping these tests commented out in wxVsnprintf() tests, which are
not run at all if we're using the compiler-provided vsprintf().

Closes #9367.
2015-05-28 14:12:48 +02:00
Artur Wieczorek
01cf62684c Use wxPGProperty::GetDepth() getter.
Use it instead of getting direct access to the corresponding member variable.
2015-05-27 21:15:28 +02:00
Artur Wieczorek
f740e5f784 Optimize wxNumericPropertyValidator::Validate method.
Remove second unnecessary casting from wxWindow to wxTextCtrl and use wxTextCtr::IsEmpty() function to check directly if the text control contains any text instead of examining retrieved string value.
2015-05-27 21:13:09 +02:00
Dimitri Schoolwerth
3f94084e29 Add DND move support on OS X
The drag mask passed by Cocoa is conservative and doesn't include
NSDragOperationMove which was added later. Override
draggingSourceOperationMaskForLocal to include that flag if it's wanted.

This also moving of text the default behaviour.

Closes #13819.
Closes #14726.
2015-05-27 20:20:17 +04:00
Dimitri Schoolwerth
143a8203bd Fix dragging always resulting in wxDragLink on OS X
Commit f40e8bf uncovered a problem with dragging where when the
NSDragOperationLink bit is set in the drag mask (which by default always
is the case) the result is a wxDragLink operation instead of wxDragCopy
or wxDragMove. To fix this give priority to move and copy instead when
converting the drag mask to a wxDrag result.

This fixes copying through DND in wxRichTextCtrl.

See #13819.
2015-05-27 20:20:12 +04:00
Dimitri Schoolwerth
f40e8bff69 Fix mouse cursor not changing on OS X during DND
The cursor almost always looks like the one used for copying. Add
missing breaks in a switch statement to fix this.

See #14726.
2015-05-27 20:10:39 +04:00
Dimitri Schoolwerth
ddbfe5720e Refactor some DND code in wxOSX/Cocoa
To reduce duplication of the same changes, merge the nearly identical
wxWidgetCocoaImpl::draggingEntered and draggingUpdated into private
function wxOnDraggingEnteredOrUpdated.
2015-05-27 19:08:22 +04:00
Dimitri Schoolwerth
35a68ef4ce Reduce height of frame in DND sample
Instead of moving the frame up every time to be able to reach the
dragging section at the bottom, change the sizer proportion of the log
control in the middle to reduce the frame's height.
2015-05-27 18:13:24 +04:00
Artur Wieczorek
bb27596219 Use wxPropertyGridPage::GetToolId() getter to get tool ID.
Use it instead of getting direct access to the corresponding member variable.
2015-05-26 21:15:19 +02:00
Artur Wieczorek
a6bdfa7fd0 Use variable of type wxEventType to store the value returned by GetEventType function.
Since wxEvent::GetEventType() returns wxEventType value the variable used to hold returned value should be also of the same type.
2015-05-26 21:13:13 +02:00
Artur Wieczorek
7e14b6e61f Fixed setting validation flags in the editor validation function (wxPropertyGrid::DoEditorValidate).
Currently, validation flags are initialized when post-process validation is invoked (in wxPropertyGrid::PerformValidation) and when first editing operation fails earlier on the pre-process validation (in wxPropertyGrid::DoEditorValidate) then these flags are not initialized and no validation error message is displayed.
Hence validation flags should be initialized in both validation functions.
2015-05-26 21:09:30 +02:00
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