Describe the bug
If a property-grid contains a wxEnumProperty (e.q. values hide + unhide) and following other properties that are hidden or shown by this enum-property and the scroll-area is moved to the last possible position before, than a hide of just 1 property results in the enum-property is drawn at wrong position. And also the application crash some time later (sometimes), because of detached property.
Expected vs observed behaviour
No painting errors, no crashes when porperties hidden and shown again.
Patch or snippet allowing to reproduce the problem
To Reproduce
Steps to reproduce the behaviour, please make them as detailed as possible, e.g.
Platform and version information
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I cannot reproduce this issue with below sample app. On Ubuntu 20.04 (GTK 3.24.20) and Debian 11 (GTK 3.24.24) wxEnumProperty is positioned as expected and there are no crashes.
Could you check if it works for you?
#include <wx/wx.h>
#include <wx/aui/aui.h>
#include <wx/propgrid/propgrid.h>
#include <wx/propgrid/manager.h>
class FormMain : public wxFrame
{
public:
FormMain();
~FormMain();
private:
wxAuiManager m_auiManager;
};
class cxApplication : public wxApp
{
public:
virtual bool OnInit() wxOVERRIDE
{
FormMain* frame = new FormMain();
frame->Show(true);
return true;
}
};
wxIMPLEMENT_APP(cxApplication);
FormMain::FormMain() : wxFrame(NULL, wxID_ANY, "Sample", wxDefaultPosition, wxSize(600, 400))
{
m_auiManager.SetManagedWindow(this);
wxPropertyGridManager* pgman = new wxPropertyGridManager(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxPG_TOOLTIPS | wxPG_TOOLBAR);
wxPropertyGridPage* pg = pgman->AddPage("Page");
for (int i = 0; i < 9; i++)
{
pg->Append(new wxIntProperty(wxString::Format("Property %d", i), wxPG_LABEL, i));
}
wxPGChoices sel;
sel.Add("Item 1", 10);
sel.Add("Item 2", 20);
sel.Add("Item 3", 30);
sel.Add("Item 4", 40);
sel.Add("Item 5", 50);
pg->Append(new wxEnumProperty("EnumProperty", wxPG_LABEL, sel, 10));
for (int i = 9; i < 15; i++)
{
pg->Append(new wxIntProperty(wxString::Format("Property %d", i), wxPG_LABEL, i));
}
m_auiManager.AddPane(pgman, wxAuiPaneInfo().Center().Caption("Property Grid").
CloseButton(false).MinSize(wxSize(200,200)));
m_auiManager.Update();
}
FormMain::~FormMain()
{
}
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Maybe a combination of some things (e.q.: windows-size, status-bar enabled, clear-call on page-properties before).
Here is a test application that contains the buggy behaviour:
Here a video, what happens:
OffTopic:
Seems like, there is also some other bug with a message "Cannot obtain display info for detached property"(https://forums.wxwidgets.org/viewtopic.php?f=1&t=49258). Don't know what this is, it happens seldom, but kills the app. In my opinion some synchronization issue, but can't reproduce this and it's very problematical. But maybe the same origin.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
I cannot reproduce the issue with your code - positioning is OK, no crashes.
BTW, you call in your sample code wxPropertyGridPageState::DoClear() method but wxPropertyGridPageState documentation says Generally you should not use this class directly, but instead member functions in wxPropertyGridInterface, wxPropertyGrid, wxPropertyGridPage, and wxPropertyGridManager.
So, you should call wxPropertyGridPage::Clear() instead.
Please also note that DoSomething()
methods are generally for internal purposes only and they are publicly exposed only due to the technical reasons.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
DoSomething(): don't know this, thanks for the hint, but in my opinion not very meaningful to make such things public and if not possible otherwise to name such things for example 'Internal' (or somehing equivalent) that is visible to none-widget developer without reading the whole manual.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
How can I support you to find/fix the bug?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Eventually I've managed to reproduce the issue with positioning - thanks for the hints.
Please check with current master if it's fixed now.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Closed #22428 as completed via 92d7176.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.