Ensure a row is visible in wxProprtyGrid Topic is solved
Ensure a row is visible in wxProprtyGrid
Is there a way to ensure that an adjacent row/property in a wxPropertyGrid is visible after deleting the currently selected property?
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
MSVC Express 2019/2022
wxWidgets 3.2.2
Re: Ensure a row is visible in wxProprtyGrid
Hi,
What is the scenario where you want it?
The property grid has a scrollbar so user can always scroll to the appropriate property...
Thank you.
What is the scenario where you want it?
The property grid has a scrollbar so user can always scroll to the appropriate property...
Thank you.
Re: Ensure a row is visible in wxProprtyGrid
Did you try wxPropertyGrid::EnsureVisible(wxPGPropArg id) ?
https://docs.wxwidgets.org/trunk/classw ... 5991c7ae27
https://docs.wxwidgets.org/trunk/classw ... 5991c7ae27
Use the source, Luke!
Re: Ensure a row is visible in wxProprtyGrid
@doublemax I have looked at the function, but my problem is to get the appropriate xPGPropArg id
I have a property grid with a variable number of entries in a variable height window, a user might/will decide to delete any one of the properties, from the first to the last. I can find out which he selected and I can delete it, but I have not yet figured out how to ensure that the scrolled position is such after the delete, such that one of the adjacent properties is visible. ( Border case: delete the only entry. Unlikely case, but ought to be handled as well, though that might be the easier one, although I have not found even a way to get the count of entries)
There seems to be no way to select the next or previous sibling of a specific property at least I have not found any.
I have considered one option, which is to force a recreation of the contents. That would not be too difficult, but I was curious if there was a different way.
I have a property grid with a variable number of entries in a variable height window, a user might/will decide to delete any one of the properties, from the first to the last. I can find out which he selected and I can delete it, but I have not yet figured out how to ensure that the scrolled position is such after the delete, such that one of the adjacent properties is visible. ( Border case: delete the only entry. Unlikely case, but ought to be handled as well, though that might be the easier one, although I have not found even a way to get the count of entries)
There seems to be no way to select the next or previous sibling of a specific property at least I have not found any.
I have considered one option, which is to force a recreation of the contents. That would not be too difficult, but I was curious if there was a different way.
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
MSVC Express 2019/2022
wxWidgets 3.2.2
Re: Ensure a row is visible in wxProprtyGrid
You can create a wxPGPropArgCls from a wxPGProperty.
https://docs.wxwidgets.org/trunk/classw ... g_cls.html
wxPGPropArg is just a reference to wxPGPropArgCls:
If you call on EnsureVisible() on the item before you delete it, shouldn't that have the same effect?
https://docs.wxwidgets.org/trunk/classw ... g_cls.html
wxPGPropArg is just a reference to wxPGPropArgCls:
Code: Select all
typedef const wxPGPropArgCls& wxPGPropArg
Use the source, Luke!
Re: Ensure a row is visible in wxProprtyGrid
For my current test cases, that actually works!
Thank you
Environment: Win 10/11 64-bit & Mint 21.1
MSVC Express 2019/2022
wxWidgets 3.2.2
MSVC Express 2019/2022
wxWidgets 3.2.2