Commit Graph

344 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Artur Wieczorek
b7c4b51b41 Fix wxPropertyGrid::DoEndLabelEdit function, cont.
Explicit cell content handling for edited label is necessary only for column other then 0 because cell handling for label in column is 0 is done inside wxPGProperty::SetLabel() function.
2015-05-14 15:33:41 +02:00
Artur Wieczorek
d4440703b2 Fixed wxPropertyGrid::DoEndLabelEdit function
When label editing is finished then property label has to be always updated. If there is a text which is cached in the corresponding cell then it also needs to be updated.

See #16982.
2015-05-10 18:53:16 +02:00
Artur Wieczorek
7426497a4b Prevent sending wxEVT_PG_LABEL_EDIT_ENDING events recursively, cont.
Spurious wxEVT_PG_LABEL_EDIT_ENDING events shouldn't be generated also if wxPropertyGrid::DoEndLabelEdit() function is reentered multiple times (constraint for selected column should be removed from the guard because column index is set to 1 after first reentry and no longer reflects original value stored in the event object).

Closes #16864.
2015-04-28 20:59:25 +02:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Artur Wieczorek
cc575a7a89 Use in wxPG classes wxMilliClock_t variables to store values returned by wxGetLocalTimeMillis() function.
wxMilliClock_t is always mapped to the proper base type and hence can be used even if wxLongLong type is not defined (when wxUSE_LONGLONG is disabled).
2015-04-03 21:11:15 +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
Artur Wieczorek
821f5da314 Suppress sending spurious wxEVT_PG_SELECTED events.
Don't send wxEVT_PG_SELECTED event when wxPG is ordered to unselect current property but no property is actually selected.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-18 17:13:52 +00:00
Artur Wieczorek
f7fc873ec7 wxEVT_PG_SELECTED event object generated when property is unselected should refer to the property being unselected.
Currently, wxEVT_PG_SELECTED event object generated when property is unselected doesn't refer to the property being unselected (in fact it doesn't refer to any property; pointer to the property is NULL) and therefore it is not possible to determine unselected property or to check its state.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-15 23:23:25 +00:00
Artur Wieczorek
44dc3e20df Prevent sending wxEVT_PG_LABEL_EDIT_ENDING events recursively.
By preventing sending wxEVT_PG_LABEL_EDIT_ENDING events recursively (recursive generation can happen due to the calling wxPropertyGrid::RefreshProperty() directly or indirectly from within wxEVT_PG_LABEL_EDIT_ENDING event handler) spurious events are not sent to the application and wxPropertyGrid::DoEndLabelEdit() function is not reentered.

Closes #16864.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78500 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-15 22:21:56 +00:00
Artur Wieczorek
da0f4ce29e Use getter methods to get access to wxPGProperty member variables.
Use GetValueImage() getter to get access to m_valueBitmap data member.
Use GetMaxLength() getter to get access to m_maxLen data member.
Use GetAttributes() getter to get access to m_attributes data member.
Use GetChoices() to get access to m_choices data member.
Use GetDepth() to get access to m_depth member variable.
Use GetBaseName() method to get access to m_name data member
Use GetLabel() method to get access to m_label member variable.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78427 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-31 21:45:24 +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
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
Artur Wieczorek
e622cc3f18 Delete wxDC object when exiting from wxPropertyGrid::OnPaint
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78333 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-02 16:15:52 +00:00
Artur Wieczorek
1a4921b45a Fix typo in a comment
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-12 22:56:44 +00:00
Artur Wieczorek
6ba0f3016b Use wxBufferedPaintDC to implement double buffering in wxPG.
This also fixes drawing the PG when buffer is not available and there is necessary do draw directly on window DC.
wxPropertyGrid::DrawItems method is simplified and wxPropertyGrid::DoDrawItems method is reimplemented since its 3-rd argument (isBuffered) is unneeded anymore.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78266 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-12 22:36:28 +00:00
Vadim Zeitlin
c671950f72 No real changes, just fix some typos in comments.
Closes #16699.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-03 17:18:17 +00:00
Artur Wieczorek
161e8dcff2 Use Boolean variable to store Boolean values in wxPG.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-24 16:09:46 +00:00
Artur Wieczorek
1fd049988d Use a hash set instead of vector to hold dedicated keys in wxPG.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-24 16:04:53 +00:00
Artur Wieczorek
ed186d3ad8 In 3.0 compatibility mode member variable holding pending delete editor objects is emulated by hash map item.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-04 22:56:12 +00:00
Artur Wieczorek
f858486cec Fix deleting pending editor controls if wxPG is destructed from within its own event handler.
If wxPG dtor is invoked from within event handler then deleting its pending editor controls should be delegated to the global idle event handler.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-18 09:37:33 +00:00
Artur Wieczorek
c234f5078f Fix deleting editor controls associated with wxPG properties from within event handler.
Editor controls (and their event handlers) deleted from within wxPG event handler shouldn't by deleted in global idle event handler but only in local wxPG event handler because global idle events can be generated also by calling e.g. wxYield when wxPG is not in the real idle state.

Closes #16617

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-16 22:49:01 +00:00
Artur Wieczorek
b72eb78c96 Accept only real idle events in wxPropertyGrid::OnIdle()
Fake idle events generated e.g. by calling wxYield from within the event handler should be skipped to avoid problems.

See #16617

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-10-16 22:27:42 +00:00
Artur Wieczorek
89364e95b9 In wxPropertyGridPageState use Boolean member variables to store Boolean values.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-25 17:29:50 +00:00
Artur Wieczorek
329b59e263 Fix saving edited property value when wxPG property is in 'invalid value' state.
When wxPGProperty is loosing focus in 'invalid value' state its pending value should be stored before resetting property to 'normal' state  because this operation (wxPG::OnValidationFailureReset) also resets pending value.

Closes #16587


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77887 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-25 17:22:11 +00:00
Artur Wieczorek
7203fd5c6b When drawing wxPG items (with double buffering) use the same layout direction as the window uses.
Memory DC used for double buffering purposes should inherit layout direction from the window DC to ensure that texts are rendered correctly.

Closes #15797.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-15 16:02:05 +00:00
Artur Wieczorek
c16808c380 Adjust list of items for deferred deletion/removal if wxPG property item is actually deleted/removed.
When property is actually deleted/removed it must be also removed from the respective list of items for deferred deletion/removal in order to avoid crashes when it would be attempted to delete/remove it again at next wxPG idle state.
Because lists of items for deferred operations can be updated at every actual deletion/removal it is necessary to rearrange iteration through these lists in wxPG::OnIdle.

See #16222.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76889 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-07-11 17:01:28 +00:00
Paul Cornett
c6f8d54324 build fix for wxUSE_VALIDATORS==0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76313 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-11 15:53:41 +00:00
Vadim Zeitlin
33ad33d447 Add wxOVERRIDE and use it in common and wxOSX code.
Make overriding virtual methods more explicit and enable additional checks
provided by C++11 compilers when "override" is used.

Closes #16100.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-20 13:26:28 +00:00
Vadim Zeitlin
c2ac6643cc Avoid unused variable warning in wxUSE_VALIDATORS==0 build.
Closes #16076.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-13 16:17:15 +00:00
Vadim Zeitlin
69fe5785b6 Send events when toggling wxPropertyGrid nodes from keyboard.
Closes #15899.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-21 18:39:14 +00:00
Vadim Zeitlin
e3c7cd18d6 Remove unnecessary redundant assignments.
Don't assign values consecutively to the same variable without using it in
between the assignments, this is useless.

See #15893.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-20 14:45:41 +00:00
Vadim Zeitlin
fb730c32b4 Override Do{Freeze,Thaw}() instead of {Freeze,Thaw}() in wxPropGrid code.
{Freeze,Thaw}() themselves are not virtual any more, so overriding them
doesn't really work and it is unnecessary to reimplement the reference
counting already done by the base class anyhow, so override the DoXXX()
versions instead.

Closes #15877.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-17 18:56:13 +00:00
Vadim Zeitlin
a49d3f4161 Fix tons of warnings in wxMSW after deprecating wxPen/wxBrush int styles &c.
Replacement of FUTURE_WXWIN_COMPATIBILITY_3_0 with WXWIN_COMPATIBILITY_3_0 in
r75532 resulted in tons of warnings as all code using wxSOLID and similar
constants now uses the deprecated methods taking int instead of the preferred
ones taking wx{Pen,Brush}Style (and similarly for wxFont{Style,Weight,Family}).

Fix all of them but this also would seem to mean that this change might not be
such a good idea at all.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75547 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-04 22:20:36 +00:00
Vadim Zeitlin
9b31387508 Merge the changes from 3.0 branch.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-12 18:06:37 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Robin Dunn
58d1949f8c Call InitializeModules instead of just module->Init(). This is needed so the module will have the proper state and not cause an assert when the modules are cleaned up. Since InitializeModules will skip any that are already initialized it doesn't hurt to call it for modules loaded later.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-07 21:09:31 +00:00
Vadim Zeitlin
ce7fe42e84 Provide shorter synonyms for wxEVT_XXX constants.
Use the same short names as are used by the event table macros for the event
type constants themselves. This makes them much more comfortable to use, e.g.
Bind(wxEVT_BUTTON) compared to Bind(wxEVT_COMMAND_BUTTON_CLICKED).

The old long names are still kept for backwards compatibility and shouldn't be
removed as it doesn't really cost anything to continue providing them, but all
new event types should only use the short versions.

Closes #10661.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-25 10:11:03 +00:00
Paul Cornett
51623cc53f remove unused variable assignment, closes #14928
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-12-28 17:04:01 +00:00
Vadim Zeitlin
f33230391a Fix spelling in the comments in wxPropertyGrid code.
No real changes.

Closes #14645.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72486 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-09-14 22:26:54 +00:00
Vadim Zeitlin
9e4587114b Avoid unused variable warning in wxPropertyGrid code in non-wxGTK.
Put the variable only used in wxGTK inside "#ifdef __WXGTK__".

This fixes the warning but the real fix would be to get rid of this variable
completely and just fix whatever problem in wxWindow::Navigate() this was
supposed to work around.

See #14459.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-07 13:27:40 +00:00