Commit Graph

371 Commits

Author SHA1 Message Date
Artur Wieczorek
1c292cfe2c Initialize data members in initialization lists 2022-05-21 22:01:58 +02:00
Artur Wieczorek
950f3ff34f Fix adjusting position of wxPGProperty editor
Position of the editor should be adjusted after setting new virtual size
because this operation can scroll wxPropertyGrid contents and scroll
position needs to be taken into account.

See #22428.
2022-05-21 21:59:51 +02:00
Artur Wieczorek
69f45b31a3 Use reference instead of pointer 2022-04-10 13:37:55 +02:00
Paul Cornett
3aad506c5b Avoid some -Wfloat-conversion warnings 2022-02-13 18:11:55 -08:00
Vadim Zeitlin
74424cbeb2 Rename wxBitmap::CreateWithLogicalSize() to CreateWithDIPSize()
The new name, recently introduced in 94716fd801 (Add
wxBitmap::CreateWithLogicalSize(), 2022-01-22), was perhaps more clear,
but also misleading and confusing because the postcondition

	CreateWithLogicalSize(size, 2).GetLogicalSize() == size

was not satisfied under MSW, so rename it once again, and hopefully
finally, because the new name is consistent with GetDIPSize() returning
the same size.

Also try to improve the documentation a bit more.
2022-02-11 17:30:57 +00:00
Artur Wieczorek
93365e02de Use more relevant macros in wxPropertyGrid 2022-01-30 12:06:27 +01:00
Vadim Zeitlin
94716fd801 Add wxBitmap::CreateWithLogicalSize()
The new function has a more clear name than CreateScaled() it replaces
and uses a more useful parameter order, with the scale factor, which
must always be specified when using it, coming before, and not after,
the depth, which almost never needs to be specified and so can be left
at its default value in 99% of cases.
2022-01-22 22:44:00 +00:00
Vadim Zeitlin
a81e0d83c1 Use wxBitmap::GetLogicalXXX() instead of GetScaledXXX()
Replace old functions with the new ones in the library code itself.

Note that wxSTC and wxRichText still use GetScaledXXX(), but they're
different functions that might need to be renamed/dealt with separately.
2022-01-22 18:57:31 +00:00
Maarten Bent
e2d34e982e Skip all wxDPIChangedEvent
So base classes will process the event too.
This is need for (at least) wxGenericColourButton It has its own handler,
but also needs to handle the DPI event in wxButtonImageData.
2022-01-05 22:47:32 +01:00
Artur Wieczorek
67752c3870 Validate the value in the first and last property of wxPropertyGrid
wxPGProperty value edited in the first or last property of wxPropertyGrid
should be validated while attempting to navigate to the previous/next
property.

Closes #19315.
2021-12-04 12:18:20 +01:00
Artur Wieczorek
87394856f5 Use wxBitmapBundle in wxPropertyGrid 2021-11-19 17:52:56 +01:00
Artur Wieczorek
2a536c359c Fix visual state of enabled/disabled wxPropertyGrid
wxPropertyGrid needs to be refreshed while enabling/disabling to display
proper visual states of all wxPGProperty items.
2021-03-12 21:41:40 +01:00
Artur Wieczorek
c175155bad Fix higlighting properties in wxPropertyGrid without focus
When wxPropertyGrid lost the focus all selected properties (not only
the first one) should be redrawn to present their non-focused state.

Closes #19094.
2021-03-11 20:20:54 +01:00
Maarten Bent
e3491fc537 Create a wxDisplay directly from wxWindow 2021-02-13 21:11:18 +01:00
Maarten Bent
9365df2322 Improve wxPropertyGridEditor position with multiple displays 2021-02-13 01:59:23 +01:00
Artur Wieczorek
914cc63d32 Fix navigating through wxPropertyGrid with wxPG_ACTION_EDIT
wxPG_ACTION_EDIT should not be considered done when wxPGProperty is
not editable (i.e. is disabled, read-only, is a wxPropertyCategory)
to prevent from blocking secondary actions (like
wxPG_ACTION_NEXT_PROPERTY) in this case.

Closes #19060.
2021-01-28 19:13:09 +01:00
Artur Wieczorek
9fe7e0a78e Get rid of unnecessary static casts 2021-01-16 23:01:50 +01:00
PB
f57f214122 Remove BCC-specific hdrstop pragma from everywhere 2020-10-12 21:58:37 +02:00
Pavel Tyunin
2d8d1ad9d0 Fix cropping detection for cells with custom font 2020-09-21 11:27:42 +02:00
Pavel Tyunin
ca1e086225 Show units in tooltips 2020-09-21 11:27:42 +02:00
Pavel Tyunin
4c11ab63c1 Fix cropping detection for properties with choice item-specific images 2020-09-21 11:27:42 +02:00
Pavel Tyunin
3d41fa1ac4 Fix cropping detection when wxPG_BOLD_MODIFIED is enabled 2020-09-21 11:27:42 +02:00
Pavel Tyunin
949cda937d Improve cropping detection for properties with images
Take into account images in >2 columns and custom sized images
2020-09-21 11:27:42 +02:00
Pavel Tyunin
47d8299c70 Make wxPG_TOOLTIPS work for >2 columns too 2020-09-21 11:27:42 +02:00
Pavel Tyunin
7d83c6cfe0 Take wxPG_XBEFORETEXT and splitter into account for cropping detection 2020-09-21 11:27:42 +02:00
Pavel Tyunin
e4607a243e Take subgroup margin into account when checking for property label cropping 2020-09-21 11:27:42 +02:00
Pavel Tyunin
075d964eae Fix wxPropertyGrid string cropping detection (wxPG_TOOLTIPS)
splitterHitOffset is only initialized when the mouse is near the splitter.
2020-09-21 11:27:42 +02:00
Vadim Zeitlin
1422991602 Add wxWindow::GetDPIScaleFactor()
This function replaces some uses of GetContentScaleFactor(), where a
factor greater than 1 must be used even under the platforms not doing
any logical/physical pixel mapping, such as MSW.

For now GetContentScaleFactor() is still unchanged, but it will return 1
for such platforms in the future and adding GetDPIScaleFactor() allows
to avoid changing the behaviour of the code which relied on its current
behaviour.
2020-07-18 23:42:44 +02:00
Artur Wieczorek
c4f5fd3581 Move duplicated code to rescale the bitmap to the shared function 2020-04-10 20:45:34 +02:00
Artur Wieczorek
f95d6463d3 Fix sizing wxBitmapButton used as wxPropertyGrid editor button
Since wxBitmapButton doesn't rescale embedded bitmap we need
to do this on our own to display entire bitmap even the button
is small.

Closes #18715.
2020-04-10 20:33:16 +02:00
Artur Wieczorek
c7b789d351 Increase wxPropertyGrid line height under wxGTK3
Line height calculation based on the font size is not right for wxGTK3
because native buttons (used as in-line editor buttons) don't scale down
well and they are not displayed properly within the line.
Minimal button size when the label is displayed properly is 35 so this
has to be minimal line height under wxGTK3.

Closes #18715.
2020-04-04 18:02:40 +02:00
Artur Wieczorek
5bc020e844 Implement getters for members of wxPGWindowList
There is no reason to expose wxPGWindowList member variables. They should
be set in ctors and retrieved with getters.
2020-02-12 17:09:25 +01:00
Artur Wieczorek
489cc1cb36 Fix drawing empty wxPropertyGrid
If wxPG doesn't contain any visible items it's entire area should
be erased so we need to return -1 as a last drawn line index to ensure
that painted area will be clared from 0 y-coordinate.

Closes #18666.
2020-02-12 17:03:58 +01:00
Paul Cornett
948ddc6e0f Eliminate -Wcast-qual warnings with GCC and Clang
Use const_cast, mutable, and various other changes to avoid -Wcast-qual
2020-02-02 22:50:32 -08:00
Artur Wieczorek
652e6fbadb Ignore focus events within composite editor control in wxPropertyGrid
Internal focused events of the subcontrols of the composite editor control should not be processed.

Closes #18555.
2019-11-08 18:52:27 +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
453999737f Simplification to avoid unreachable code 2019-08-25 21:03:21 -07:00
Vadim Zeitlin
7db13c7b93 Merge branch 'pm-dpi-aware-1-systemmetric' of https://github.com/MaartenBent/wxWidgets
Make GetSystemMetrics() and wxSystemParametersInfo DPI-aware in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/1407
2019-07-15 13:21:16 +02:00
Maarten Bent
f74d756ca5 Use DPI Aware wxGetSystemMetrics
If no wxWindow is known, use wxTheApp->GetTopWindow().
Also use a wxWindow for all wxSystemSettings::GetMetric calls.
2019-07-15 00:00:18 +02:00
Artur Wieczorek
a1dac5aa38 Show wxPGProperty editor dialog only in response to clicking main editor button
Properties with editor dialog (like those derived from wxEditorDialogProperty) should show it only in response to clicking the main editor button.
2019-07-14 21:32:38 +02:00
Artur Wieczorek
b064608c2a Use const_cast to change the constness 2019-06-16 19:50:08 +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
8c187ffc7a Get rid of commented out and unused macro definitions 2019-06-16 19:45:39 +02:00
Artur Wieczorek
6abf507923 Get rid of unused variables 2019-06-16 19:45:12 +02:00
Artur Wieczorek
a93713f7f8 Use long int literals to represent long constants 2019-05-26 18:51:37 +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
ca712c59fe Remove redundant assignment
This assignment to the temporary variable is not necessary.
2019-05-12 20:24:53 +02:00
Artur Wieczorek
92d2be5842 Resolve ambiguity in calling overloaded wxPropertyGrid::SendEvent()
The right overloaded SendEvent() function can be determined by explicitly
casting second argument of the call to (wxPGProperty*) type.
2019-04-28 18:34:36 +02:00
Artur Wieczorek
bdc9d8f772 Remove redundant assignments
These assignments to the temporary variables are not necessary.
2019-04-28 17:11:56 +02:00
Artur Wieczorek
9df9e32a70 Get rid of unnecessary casts to wxPGProperty*
These casts are unnecessary and can be removed.
2019-04-28 17:04:07 +02:00