- QQ图片20160216164311.png (21.48 KiB) Viewed 3745 times
How to write Unity style grid property?
How to write Unity style grid property?
Two float property can be in same row. with an extra button.
-
- Super wx Problem Solver
- Posts: 466
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: How to write Unity style grid property?
The closest out of the box tool included with wxWidgets is of course wxPropertyGrid. It only has 2 columns though.
Another option, although it will be a bit of a pain is to use something like the accordion control I wrote a while back. Using the builder sample, I was able to get this close:
You could then add panels with a flex grid sizer or a grid bag sizer to hold the labels and the controls for changing the properties to the accordion.
Another possibility would be to use a wxGrid and add the grid to the accordion. But you'll have to set custom renderers and editors for the grid to get the checkboxes and things.
If that seems close enough for you, here is the code from the builder sample to generate the accordion above:
Another option, although it will be a bit of a pain is to use something like the accordion control I wrote a while back. Using the builder sample, I was able to get this close:
You could then add panels with a flex grid sizer or a grid bag sizer to hold the labels and the controls for changing the properties to the accordion.
Another possibility would be to use a wxGrid and add the grid to the accordion. But you'll have to set custom renderers and editors for the grid to get the checkboxes and things.
If that seems close enough for you, here is the code from the builder sample to generate the accordion above:
Code: Select all
wxAccordion* m_accordion;
m_accordion = new wxAccordion( <insert parent here> );
m_accordion->SetAccordionPadding(0);
m_accordion->SetBackgroundColour( wxColour(56,56,56) );
m_accordion->SetCaptionRadius(5);
m_accordion->SetExpandButton( wxBitmap("<your file here>",wxBITMAP_TYPE_ANY) );
m_accordion->SetCollapseButton( wxBitmap("<your file here>",wxBITMAP_TYPE_ANY) );
wxImageList* m_imagelist = new wxImageList(16,16);
\Add icons to the image list here.
m_accordion->AssignImageList(m_imagelist);
m_accordion->GetCollapsedStyle().SetColour1( wxColour(87,87,87) );
m_accordion->GetCollapsedStyle().SetColour2( wxColour(87,87,87) );
m_accordion->GetCollapsedStyle().SetTextColour( wxColour(201,201,201) );
m_accordion->GetExpandedStyle().SetColour1( wxColour(87,87,87) );
m_accordion->GetExpandedStyle().SetColour2( wxColour(87,87,87) );
m_accordion->GetPageStyle().SetColour1( wxColour(60,60,60) );
m_accordion->GetPageStyle().SetColour2( wxColour(60,60,60) );
m_accordion->GetPageStyle().SetBorderColour( wxColour(40,40,40) );
Re: How to write Unity style grid property?
Hi,
The accordion control is very cool, it can resolve some of our problem for sure.
However, we have already heavily lean on property grid, so I have to find a way out in property grid.
Regards
The accordion control is very cool, it can resolve some of our problem for sure.
However, we have already heavily lean on property grid, so I have to find a way out in property grid.
Regards