Commit Graph

16557 Commits

Author SHA1 Message Date
kkrev
2349bce2c4 Add wxTreeListCtrl::EnsureVisible().
Just forward this to the wxDataViewCtrl method with the same name.

Closes #16937.
2015-03-31 21:57:16 +02:00
Artur Wieczorek
5353a00180 Use wxVariant::IsType() function to check the type of variant values in wxPG.
Since there is a dedicated function to check the type of variant then there is not necessary to call wxVariant::GetType() function and perform explicit comparisons of returned strings.
2015-03-29 21:41:52 +02:00
Vadim Zeitlin
94c4d37c82 Disable wxUSE_ACTIVITYINDICATOR for non-MSVC compilers under MSW.
Don't give errors in the default configuration for MinGW makefile builds in
which wxUSE_GRAPHICS_CONTEXT is disabled, but wxUSE_ACTIVITYINDICATOR is
enabled.

Instead, disable wxUSE_ACTIVITYINDICATOR implicitly for them, this is not
ideal but better than broken build.
2015-03-24 13:18:47 +01:00
Artur Wieczorek
ecbfa2c122 Disable wxUSE_ACTIVITYINDICATOR if wxUSE_GRAPHICS_CONTEXT==0.
wxActivityIndicatorImpl requires wxGraphicsContext to compile successfully (it
is used to implement anti-aliased drawing of the control).

Add a check to enforce this.

Closes #16921
2015-03-22 00:56:53 +01:00
Vadim Zeitlin
d2ddb2c7c0 Add XRC handler for wxActivityIndicator control.
The only attribute for this control is a boolean "running" which can be set to
start the indicator on load.

Update the schema, documentation and the XRC sample.
2015-03-20 00:08:38 +01:00
Vadim Zeitlin
3f84cb17ca Add wxActivityIndicator control.
This is a simple animated control indicating some program activity.

Provide native GTK+ (for > 2.20) and OS X implementations as well as a generic
one used under MSW.

Update the sample and the documentation.
2015-03-20 00:08:37 +01:00
Vadim Zeitlin
00748bbaef Add wxWindow::FromDIP() for simpler high DPI support.
This method allows to scale a pixel value by a DPI-dependent factor to the
value used by the underlying toolkit only if necessary, i.e. when not using
GTK+ 3 or OS X which already do this internally.
2015-03-20 00:08:37 +01:00
Vadim Zeitlin
bc492a9e6e Make wxWindow::GetContentScaleFactor() useful for non-OSX platforms.
Return the ration of the current DPI to the standard one to allow using this
function to scale pixel values for the current screen resolution.
2015-03-20 00:08:37 +01:00
Artur Wieczorek
fad1ec7ce8 Determine whether a new element is added to the list in wxPGArrayEditorDialog when its editing is started.
New element can be added to the list not only by clicking "New item" button but also by clicking under the last element of the list and we need to determine its index in both cases because it is used later on in wxPGArrayEditorDialog::OnEndLabelEdit event handler.

Closes #16905.
2015-03-18 19:04:29 +01:00
Vadim Zeitlin
4f846f72de Don't attempt using <type_traits> with g++ 4.9.2 in C++98 mode.
g++ 4.9.2 added support of __has_include() but, unlike clang, refuses to
compile the <type_traits> header that is detected as existing now in C++98
mode, so the build was broken with it when not using configure (i.e. under
MSW).

Fix this by, first, testing for C++11 compilers separately (which seems like a
good idea anyhow as it will allow using these headers with other compilers)
and, second, not trusting g++ __has_include() for C++11 headers in C++98 mode.
2015-03-17 23:55:46 +01:00
Vadim Zeitlin
6b84e6e1b9 Slightly improve out of memory handling in wxMemoryBuffer.
Reset not only m_data but also m_size and m_len to 0 if we run out of memory.

Closes #4500.
2015-03-13 16:58:37 +01:00
Vadim Zeitlin
b8f6cb417c Fix PCH-less build after the last commit.
Add missing wx/log.h inclusion.
2015-03-11 23:53:59 +01:00
Kinaou Hervé
de7e315557 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.
2015-03-11 22:03:14 +01:00
Vadim Zeitlin
fa1c3ecfa6 Factor out wxMaxWidthCalculatorBase from wxDataViewCtrl code.
This will allow reusing it elsewhere, notably in the generic wxListCtrl.

See #10326.
2015-03-11 22:03:14 +01:00
Vadim Zeitlin
fe33cfc83f Add wxProcess::Activate() and implement it for MSW.
When launching child processes it can be convenient to be able to switch to
them later, provide a method in wxProcess to do it.

Currently this is only implemented in wxMSW but could almost certainly be done
for wxOSX too (it can be done using Apple Script, so presumably there is a way
to do it programmatically as well) and could be also made to work at least
under some Unix systems by emulating what wmctrl does (or just launching it?).
2015-03-10 20:31:24 +01:00
Václav Slavík
94fc40b7ea Make semantic wxICON_XXX styles the canonical ones
Make wxICON_WARNING and wxICON_ERROR the primary constants for their
purpose and define their visual Windows-based synonyms wxICON_HAND and
wxICON_EXCLAMATION in terms of the semantic ones, instead of the other
way around.
2015-03-07 16:15:51 +01:00
Vadim Zeitlin
b7388f36f2 Change wxFD_MULTIPLE value to avoid conflict with wxDIALOG_NO_PARENT.
This avoids GTK+ warnings about creating a dialog without parent when a
wxFileDialog with wxFD_MULTIPLE style is created.

Closes #16863.
2015-03-02 14:32:53 +01:00
Bryan Petty
3fb1827c93 Merge pull request #19 from lanurmi/spelling-fix-occurrrrrrrr
Fix spelling of occur* in random files.
2015-02-27 12:06:28 -07:00
Artur Wieczorek
5068dddb17 Remove obsolete comments regarding wxPGEditor::CreateControls.
Constants which are mentioned in the comment are not used since r76882.
2015-02-26 19:29:05 +01:00
Lauri Nurmi
8a2ccd9cf7 Fix spelling of occur* in random files. 2015-02-21 20:01:23 +02:00
Bryan Petty
29eb2a71c0 Update SVN references to git, mostly in docs. 2015-02-20 20:07:15 -07:00
Julian Smart
0df45db7f6 Now uses the correct font and text effect when drawing bullet text.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-18 17:37:12 +00:00
Julian Smart
8cf3e90650 Now allows space for a bullet even if no left subindent was specified; added a MeasureBullet function to support this.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-18 12:18:27 +00:00
Dimitri Schoolwerth
f9876c519e Fix exception when creating a wxGauge.
Platforms that don't make use of wxGaugeBase::Create when creating a
wxGauge (such as GTK and MSW) access the uninitialised
m_appProgressIndicator. Fix by initialising m_appProgressIndicator to NULL
in the wxGaugeBase constructor. Regression since r78499.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78512 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-17 06:19:22 +00:00
Dimitri Schoolwerth
11a5b83e2c Add OS X implementation of wxAppProgressIndicator.
Closes #16638.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-15 20:09:10 +00:00
Dimitri Schoolwerth
0e6af4ac39 No code changes, fix some typos.
Change several occurrences of "it's" where "its" is meant, as well as a few other minor typos.



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78497 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-15 17:11:44 +00:00
Artur Wieczorek
b37d50db1d Initialize wxPGChoices object properly in its copy ctor if source object has no data.
Internal data must be always initialized whether the source object contains choices data or not.

Closes #16855

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78484 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-13 19:42:07 +00:00
Vadim Zeitlin
a82152f7e3 Use non-static reentrancy guard in wxScrollHelper::AdjustScrollbars().
This prevented calls to AdjustScrollbars() of another window from doing
anything if they were called due to a size change from AdjustScrollbars() of
an outer window.

Closes #16852.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-13 19:36:06 +00:00
Vadim Zeitlin
67f2950cb1 Add convenient wxST_ELLIPSIZE_MASK constant.
This is simply a combination of all 3 different wxST_ELLIPSIZE_XXX styles and
makes it simpler to test if any of them is specified.

No real changes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78477 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-11 21:16:08 +00:00
Mariano Reingart
c3543d4f39 Re-introduce private mbstowcs/wcstombs for wxQt-Android
These functions are needed due Android NDK lacking wide character support, 
as wchar_t == char according to Android NDK bionic libc/include/wchar.h

WARNING: They are minimally functional (provided provisorily until proper 
         workaround is found, specially maybe using Qt built-in functionality).

         "Basically they produce complete garbage with non-ASCII characters"

For more info see discussion in wx-dev list:

https://groups.google.com/d/msg/wx-dev/71qtIFcujgM/Q-lbwl59vOIJ

Thanks @seandepagnier (modified a bit the comments, added #warning and 
restructured #if blocks to be only specific for __ANDROID__)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-11 06:12:33 +00:00
Mariano Reingart
744ea8a618 For Android (wxQT), add private wcstol, wcstoul and wcstod
These functions are needed by wxString::ToLong wxString::ToDouble etc..
They do exist in the android library, but do not work corretly.

This change implements them using strtol strtoul and strtod

For more info see discussion in wx-dev list:

https://groups.google.com/d/msg/wx-dev/71qtIFcujgM/TRCfCjGHUhEJ

Thanks @seandepagnier (modified a bit the comments)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78472 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-11 04:36:24 +00:00
Vadim Zeitlin
6ad2d4f264 Fix handling of disabled cells in wxGTK wxDataViewCtrl.
The original code (see r66404 and r66416) didn't work because it used
wxDataViewRenderer::SetMode() to make the renderer inactive but then used its
GetMode() to restore the previous state -- which was lost. The result of this
was that if the overridden IsEnabled() in the model ever returned false for
any row, all the cells in this column, in all the rows, became insensitive, as
could be seen by the inability to edit any rating in the first page of the
dataview sample (even though it was disabled for a single row only) and any
checkboxes on its third page (even though only the last two of them were
supposed to be disabled).

Fix this simply by making the renderer insensitive at GTK level only, but do
not change the mode at wx level.

See #12686.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-10 23:14:48 +00:00
Vadim Zeitlin
48c6d036f9 Add check for wxUSE_ADDREMOVECTRL being defined.
This should have been part of r78462.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78469 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-10 23:14:44 +00:00
Vadim Zeitlin
453897149f Add wxAddRemoveCtrl class.
This is a simple high level helper combining an arbitrary control showing
multiple items with the buttons allowing to add items to and remove items from
this control, but using the buttons and the layout appropriate for the current
platform.

Add the implementation itself, an example of using it to the dialogs sample
and the documentation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-09 00:26:11 +00:00
Vadim Zeitlin
adb339078e Add an accessor for GtkToolbar widget of wxToolBar.
This can be used to customize the toolbar beyond the capabilities of wx API.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-09 00:25:51 +00:00
Artur Wieczorek
35b53a8c30 Replace WX_PG_IMPLEMENT_PROPERTY_CLASS macro with simplified wxPG_IMPLEMENT_PROPERTY_CLASS macro.
New macro have no obsolete parameters and its name conforms to the naming standard (prefixed with wx).

Closes #15541

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-04 16:46:34 +00:00
Artur Wieczorek
1127820164 Encapsulate wxPGProperty::m_children member variable.
Implement RemoveChild and SortChildren methods to perform operations on m_children member variable.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-31 21:49:01 +00:00
Artur Wieczorek
9698181b45 Use getter/setter methods to get access to wxPGProperty::m_flags.
Use dedicated wxPGProperty::HasFlags, wxPGProperty::SetFlag methods to check or modify wxPGProperty::m_flags member variable.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78426 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-31 21:42:17 +00:00
Vadim Zeitlin
ad72c3429f Improve wxThread::SetPriority() comment and documentation.
Don't claim that SetPriority() can only be called before the thread is
created, this is just wrong.

Do document that it must be done after creating the thread in wxMSW (this is a
limitation of this port as POSIX implementation allows calling it at any
moment and could be lifted in the future).

Closes #16809.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78418 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-27 11:03:08 +00:00
Vadim Zeitlin
0eca25d395 Clarify wxExpectModal<> use and implementation.
The only change in this commit is the omission of the primary wxExpectModal<>
template as it's not needed and it's enough to just forward declare it,
otherwise the changes are to the comments only and try to better explain how
this class should be used, i.e. that it's not required, although it may be
convenient, to specialize it, and also how it is implemented, notably the need
for the CRTP in wxExpectModalBase<>.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-24 22:09:04 +00:00
Vadim Zeitlin
9ae625518d Use C++ RTTI in dialog testing code if wxRTTI is not available.
This allows to get the best possible description of the dialog: if its class
uses wxRTTI macros, its user-readable name will be used, but otherwise we now
fall back on possibly unreadable but still informative mangled C++ class name
rather than showing just "wxDialog" which is not useful at all.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-24 22:09:00 +00:00
Vadim Zeitlin
826320ca7b Cosmetic change to wxTestingModalHook error message.
Don't include the word "dialog" in it, by default the description is just the
class name and so typically already includes "dialog" in it, e.g. we could
have "Expected wxFileDialog dialog" which was redundant.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-24 22:08:57 +00:00
Vadim Zeitlin
677eb37619 Provide better description of the expected message boxes.
While the example in the previous commit message, with two identical
expectations, still requires a custom description to be have unambiguous
failure messages, in other cases it's enough to show the expected message box
buttons in the error to make it possible to immediately see which expectation
failed, so include the information deduced from the expected button into the
description.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78413 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-24 22:08:54 +00:00
Vadim Zeitlin
9099ae2ded Allow providing descriptions for dialog tests expectations.
This makes test failure errors much more intelligible, e.g. in the following
case

	... some code ...
	wxTEST_DIALOG(wxYield, wxExpectModal<wxMessageDialog>(wxID_OK));
	... some more code ...
	wxTEST_DIALOG(wxYield, wxExpectModal<wxMessageDialog>(wxID_OK));

it was previously impossible to distinguish the first test failure from the
second one from just the failure description (it could be done by looking at
the line numbers since the recent change however), but with

	...
	wxTEST_DIALOG(wxYield, wxExpectModal<wxMessageDialog>(wxID_OK).
		Describe("first warning message box"));
	...
	wxTEST_DIALOG(wxYield, wxExpectModal<wxMessageDialog>(wxID_OK).
		Describe("successful completion message box"));

the failure becomes immediately clear.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-24 22:08:51 +00:00
Vadim Zeitlin
95177f3876 Allow predefining wxTEST_DIALOG_HOOK_CLASS before wx/testing.h inclusion.
Although it already was (and remains) possible to #undef and re-#define
wxTEST_DIALOG_HOOK_CLASS after including wx/testing.h, it should also be
possible to just define it globally in the testing code before including
anything else and not have to bother with the #undef part.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78411 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-24 22:08:48 +00:00
Vadim Zeitlin
7231f2fdf5 Improve error reporting from wxTEST_DIALOG() macro.
Give the location (i.e. file name, line number and the name of the function)
at which this macro itself appears instead of the location of ReportFailure()
method inside wxTestingModalHook which was quite useless as it was the same
for all the tests.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78410 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-24 22:08:44 +00:00
Vadim Zeitlin
3dff63b563 Add wxASSERT_MSG_AT() and wxFAIL_MSG_AT() macros.
These macros are useful for functions called from other macros to allow
pretending that an assert inside such function actually happens at the point
in the sources where the macro itself appears.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78409 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-24 22:08:41 +00:00
Vadim Zeitlin
54d2b38643 Define wxTrap() as a macro for gcc on Intel platforms too.
It is more convenient to break into the debugger at the exact location of the
assert instead of inside a nested wxTrap() function.

This does the same thing for gcc/x86 as was done for MSVC in r73124.

See #11184.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-24 22:08:36 +00:00
Vadim Zeitlin
0499b8375f Fix typo in a comment for NewCloseButton().
s/common/current/

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-24 22:08:32 +00:00
Artur Wieczorek
cafff4405a Use constant variables to store cached constants in wxPGGlobalVarsClass.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-22 17:32:48 +00:00