Improve the Property Panel description box.
Description:
I'm not sure this is possible, but the help panel for properties that have a drop down list have a very odd display. For example, the class access set to protected will display the following:
protected:
protected: Item is added as a protected: class member
Note that our help description does not begin with protected: -- that's added by the property grid manager.
We do sometimes call m_prop_grid->SetDescription in PropGridPanel so it's at least worth checking to see if we can improve the description.
Just as an aside, if we always set the description based on a selected property, it might ultimately give us access to wxWidgets help content if we add that.
Unfortunately, I think the only way to fix this would be to subclass the property panel and provide our own implementation. That would allow for adding a command that brings up a popup window where we could provide significantly more information about the property, potentially even linking to the wxWidgets documentation. It's a lot of work, so probably something to consider for wxUiEditor version 1.2.
The description box is maintained via two wxStaticText controls: m_pTxtHelpCaption and m_pTxtHelpContent. In the wxPropertyGridManager declaration (manager.h), these variables are protected: and there is no public: function to get them. You set their contents by calling SetDescription().
If we create a class derived from wxPropertyGridManager the class,we could bind to our own version of OnPropertyGridSelect() by override Init2():
Unbind(wxEVT_PG_SELECTED, &wxPropertyGridManager::OnPropertyGridSelect, this, wxID_ANY);
Bind(wxEVT_PG_SELECTED, &kwPropertyGridManager::OnPropertyGridSelect, this, wxID_ANY);
Construction of the two controls is handled by RecreateControls().
OnMouseMove() checks for the existance of m_pTxtHelpCaption, and dragging won't work if it is null.
UpdateDescriptionBox() calls m_pTxtHelpContent->Wrap(use_width), SetDescription() calls m_pTxtHelpContent->SetLabel(content).
I'd be inclined to use wxHtmlWindow as the control to use since it works on all platforms, and we could even add hyperlinks for more information to display in a popup window, or even our Docs window.