Commit Graph

174 Commits

Author SHA1 Message Date
Artur Wieczorek
c4f5fd3581 Move duplicated code to rescale the bitmap to the shared function 2020-04-10 20:45:34 +02:00
Artur Wieczorek
c7c3f337c2 Check index value with CHECK_MSG to avoid crashes 2020-02-09 20:39:06 +01:00
Maarten Bent
a1c3fa0468 Fix wxPropertyGrid row height on DPI change
Fix collapse button size of wxPropertyGrid in High DPI.
2019-10-07 00:54:59 +02:00
Paul Cornett
b200c661ed Fix wxPropertyGrid headers so they can be compiled independently
See #18465
2019-08-15 17:27:07 -07:00
Artur Wieczorek
eca1e857fe Remove unnecessary headers from wxPropertyGrid files
Currently there are included plenty of headers which are apparently not necessary.
2019-08-04 20:20:48 +02:00
Artur Wieczorek
c623d9cfc5 Remove references to unused internal flags 2019-08-04 20:20:48 +02:00
Artur Wieczorek
f4e37e57e4 Get rid of unnecessary const casts
A pointer to unqualified type are converted implicitly to a more cv-qualified type.
2019-06-16 19:50:57 +02:00
Artur Wieczorek
b064608c2a Use const_cast to change the constness 2019-06-16 19:50:08 +02:00
Artur Wieczorek
2ebdfb7a40 Remove obsoleted comments 2019-06-16 19:49:01 +02:00
Artur Wieczorek
d404ff02a1 Support tooltips in wxPropertyGrid if support for tooltips enabled is globally 2019-06-16 19:45:40 +02:00
Artur Wieczorek
6abf507923 Get rid of unused variables 2019-06-16 19:45:12 +02:00
Artur Wieczorek
908342e3ad Code cleanup: Define wxPGProperty and wxPropertyGridPageState functions in their own class files
Having definitions of several wxPGProperty and wxPropertyGridPageState functions in wxPropertyGrid header is misleading so they should be moved to the files with their own classes definitions for the sake of clarity.
2019-05-26 18:12:31 +02:00
Artur Wieczorek
7a29f5dd2c Don't set maximum text length for non-text wxPG properties
Setting the limit for the length of the text the user can enter in the text editor makes sense only for properties having text editors so in wxPGProperty::SetMaxLength() should be done a check whether to actually set a limit or not depending on the kind of editor used.
wxPropertyGridInterface::SetPropertyMaxLength() should be implemented on top of wxPGProperty::SetMaxLength() to proceed only if maximum length was actually set.
2019-05-26 18:06:53 +02:00
Artur Wieczorek
549acf6e80 Implement wxPropertyGrid as wxScrolled
Scrolling operations and related calculations are simpler when wxPG is implemented as wxScrolled instead of wxScrollHelper.
2019-05-26 17:57:31 +02:00
Artur Wieczorek
f39e70be15 Use dedicated event type to notify header about column width changes
Notification about changes of column widths needs to be sent locally from wxPropertyGrid to  wxPropertyGridManager (to update the header) so it would be good to use a dedicated non-public event type for these purposes.
2019-04-28 15:31:10 +02:00
Paul Cornett
365759753a Pass parameters by const reference rather than by value 2019-04-05 09:18:07 -07:00
Paul Cornett
7c3ce912e0 Use ctor-initializer rather than assignment for non-POD class members 2019-02-25 10:23:35 -08:00
Artur Wieczorek
a005391413 Use wxEventType instead of int
This parameter identifies the type of the event so it should be of type wxEventType.
2019-01-11 19:22:50 +01:00
Artur Wieczorek
8f8955b2b9 Use wxVector<wxObject*> instead of wxArrayPGObject 2019-01-11 19:22:47 +01:00
Artur Wieczorek
eb40eb4b84 Fix horizontal scrolling of wxPropertyGrid header
wxPropertyGridHeader associated with wxPropertyGrid has to be notified about every horizontal scroll of the grid.
New position is sent with dedicated wxEVT_PG_HSCROLL event being handled by wxPropertyGridManager which in turn scrolls the header accordingly.

See #18313.
2019-01-11 19:22:34 +01:00
Artur Wieczorek
42b1cca8f2 Fix repositioning editors for horizontally scrolled grid
New method of calculating of the new position/size of the editor (introduced in 95461c566d) doesn't work well in all cases so we have to go back to the (modified) old method. To get the correct position of the editor cell from the absolute position of the splitter 0 we have to shift it by the origin of the scrolled view area.

See #18313.
2019-01-04 21:31:39 +01:00
Artur Wieczorek
95461c566d Fix repositioning editors for horizontally scrolled grid
Closes #18313.
2018-12-28 14:01:34 +01:00
Artur Wieczorek
e7357eafa2 Declare array explicitly as a wxVector instead of using wxArrayPGProperty alias 2018-11-01 18:19:56 +01:00
Blake-Eryx
e1a7f56040 Fix spelling and punctuation errors in comments and documentation
Fix several occurrences of misspelling "trivial" as "trival"; use "from"
rather than "than"; add missing articles and commas.

Closes https://github.com/wxWidgets/wxWidgets/pull/874
2018-08-14 17:15:39 +02:00
Artur Wieczorek
892def066c Pass only relevant extra style bits to wxPropertyGrid
When extra style bits are set with the call to
wxPropertyGridManager::SetExtraStyle(), only those which are relevant
to wxPropertyGrid should be passed to the underlying property grid object.
Because it can happen that not all extra style bits of the underlying
wxPropertyGrid have been effectively changed by call to SetExtraStyle()
(e.g. wxPG_EX_NATIVE_DOUBLE_BUFFERING), we have to get the actual style
bits prior to storing them.
2017-10-18 22:58:21 +02:00
Takeshi Abe
0fea881f12 Fix recurrent "applicable" typo in wxPropertyGrid documentation
It was misspelt as "applicapple" in several places.

Closes https://github.com/wxWidgets/wxWidgets/pull/564
2017-10-06 15:28:58 +02:00
Artur Wieczorek
6395e7805a Fix repositioning of active property editor in wxPG
When there is open an editor for some property and in the same time
wxPropertyGrid layout is changed (due to the adding or removing a property,
sorting), it is necessary to recalculate the actual position of the active
editor to display it in the cell dedicated for the edited property. Under
some platforms the position of the edit control is shifted within the cell
and we have to take this shift into account in repositioning process.
Because actual value of the shift depends on the platform and on
the particular control, it is convenient to determine actual shift when
the editor is created and use this value whenever repositioning is done.

Close #17912.
2017-07-16 19:38:08 +02:00
Artur Wieczorek
cd96c664dd Updated documentation for some wxPropertyGrid classes.
Updated documentation for wxPGEditor, wxPropertyGridPage, wxPropertyGridManager, wx*Property classes.
Removed doxygen-style comments from header files.
2016-07-23 23:38:39 +02:00
Artur Wieczorek
9bee5e1e2b Updated documentation for several wxPG components.
Updated wxPropertyGrid, wxPropertyGridEvent, wxPropertyGridPopulator documentation and removed doxygen-style comments from propgrid.h header file.
2016-06-23 22:23:03 +02:00
Marek Temnyak
d4460435d9 Make source string const in wxPropertyGrid escape sequence methods
Source string is not changed in {Expand,Create}EscapeSequences() methods, so
make it const.

Closes https://github.com/wxWidgets/wxWidgets/pull/271
2016-04-14 16:05:10 +02:00
Artur Wieczorek
912eb6fef9 Use enum instead of macros to represent wxPropertyGrid internal flags. 2016-03-06 21:19:07 +01:00
Artur Wieczorek
403dd5673f Use enum instead of macros to represent wxPropertyGrid::DoSelectProperty flags. 2015-07-16 21:04:25 +02:00
Artur Wieczorek
6cc7811394 Fixed minor typos in comments.
Yet another iteration.
2015-06-09 20:04:27 +02:00
Artur Wieczorek
c9417c41f5 Fix PCH-less build after cb6efbd.
Add missing wx/settings.h inclusion.
2015-06-09 18:03:56 +02:00
Artur Wieczorek
cb6efbd3c3 Lay out various wxPG dialogs based on the current system screen design.
Currently, customizing some dialogs for small screen environment is done statically on the build stage by setting wxPG_SMALL_SCREEN to 1 (what is done for WXWINCE only).
Instead, we can do this for all platforms in a dynamic manner, based on the classification provided by wxSystemSettings::GetScreenType() function.
In order to do so there is introduced a static helper function wxPropertyGrid::IsSmallScreen() which is used to select right parameters (size, position) for several dialogs in order to display them correctly on the small screen.
2015-06-08 21:46:03 +02:00
Artur Wieczorek
65dee275f2 Fix minor typos in comments. 2015-05-30 20:12:02 +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
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
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
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
0bc20fee71 Non-PCH wxPG build fix after cc575a.
Include time.h to get wxMilliClock_t used now instead of wxLongLong for the timestamp.
2015-04-06 23:40:54 +02: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
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
1bac5cfbe0 Refactor property attribute names in wxPGProperty::GetAttribute calls.
Use attribute constants instead of strings in wxPGProperty and wxPGDefaultRenderer classes and in NumericValidation() function.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-01-21 17:06:16 +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
Artur Wieczorek
ffbee3a059 Remove unused wxPG member variable.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-24 16:11:19 +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
b2588d907e Remove unused wxPG member variable.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78105 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-11-08 18:17:24 +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