Add to propgrid sample an option to change virtual width of the grid
This commit is contained in:
@@ -422,6 +422,7 @@ enum
|
|||||||
ID_SETPROPERTYVALUE,
|
ID_SETPROPERTYVALUE,
|
||||||
ID_TESTREPLACE,
|
ID_TESTREPLACE,
|
||||||
ID_SETCOLUMNS,
|
ID_SETCOLUMNS,
|
||||||
|
ID_SETVIRTWIDTH,
|
||||||
ID_TESTXRC,
|
ID_TESTXRC,
|
||||||
ID_ENABLECOMMONVALUES,
|
ID_ENABLECOMMONVALUES,
|
||||||
ID_SELECTSTYLE,
|
ID_SELECTSTYLE,
|
||||||
@@ -522,6 +523,7 @@ wxBEGIN_EVENT_TABLE(FormMain, wxFrame)
|
|||||||
|
|
||||||
EVT_MENU( ID_CATCOLOURS, FormMain::OnCatColours )
|
EVT_MENU( ID_CATCOLOURS, FormMain::OnCatColours )
|
||||||
EVT_MENU( ID_SETCOLUMNS, FormMain::OnSetColumns )
|
EVT_MENU( ID_SETCOLUMNS, FormMain::OnSetColumns )
|
||||||
|
EVT_MENU( ID_SETVIRTWIDTH, FormMain::OnSetVirtualWidth )
|
||||||
EVT_MENU( ID_TESTXRC, FormMain::OnTestXRC )
|
EVT_MENU( ID_TESTXRC, FormMain::OnTestXRC )
|
||||||
EVT_MENU( ID_ENABLECOMMONVALUES, FormMain::OnEnableCommonValues )
|
EVT_MENU( ID_ENABLECOMMONVALUES, FormMain::OnEnableCommonValues )
|
||||||
EVT_MENU( ID_SELECTSTYLE, FormMain::OnSelectStyle )
|
EVT_MENU( ID_SELECTSTYLE, FormMain::OnSelectStyle )
|
||||||
@@ -2120,6 +2122,7 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size
|
|||||||
menuTry->AppendCheckItem(ID_BOOL_CHECKBOX, "Render Boolean values as checkboxes",
|
menuTry->AppendCheckItem(ID_BOOL_CHECKBOX, "Render Boolean values as checkboxes",
|
||||||
"Renders Boolean values as checkboxes");
|
"Renders Boolean values as checkboxes");
|
||||||
menuTry->Append(ID_SETCOLUMNS, "Set Number of Columns" );
|
menuTry->Append(ID_SETCOLUMNS, "Set Number of Columns" );
|
||||||
|
menuTry->Append(ID_SETVIRTWIDTH, "Set Virtual Width");
|
||||||
menuTry->AppendSeparator();
|
menuTry->AppendSeparator();
|
||||||
menuTry->Append(ID_TESTXRC, "Display XRC sample" );
|
menuTry->Append(ID_TESTXRC, "Display XRC sample" );
|
||||||
|
|
||||||
@@ -2943,6 +2946,26 @@ void FormMain::OnSetColumns( wxCommandEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
|
void FormMain::OnSetVirtualWidth(wxCommandEvent& WXUNUSED(evt))
|
||||||
|
{
|
||||||
|
long oldWidth = m_pPropGridManager->GetState()->GetVirtualWidth();
|
||||||
|
long newWidth = oldWidth;
|
||||||
|
{
|
||||||
|
wxNumberEntryDialog dlg(this, "Enter virtual width (-1-2000).", "Width:",
|
||||||
|
"Change Virtual Width", oldWidth, -1, 2000);
|
||||||
|
if ( dlg.ShowModal() == wxID_OK )
|
||||||
|
{
|
||||||
|
newWidth = dlg.GetValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( newWidth != oldWidth )
|
||||||
|
{
|
||||||
|
m_pPropGridManager->GetGrid()->SetVirtualWidth((int)newWidth);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
void FormMain::OnSetPropertyValue( wxCommandEvent& WXUNUSED(event) )
|
void FormMain::OnSetPropertyValue( wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxPropertyGrid* pg = m_pPropGridManager->GetGrid();
|
wxPropertyGrid* pg = m_pPropGridManager->GetGrid();
|
||||||
|
@@ -198,6 +198,7 @@ public:
|
|||||||
void OnCatColoursUpdateUI( wxUpdateUIEvent& event );
|
void OnCatColoursUpdateUI( wxUpdateUIEvent& event );
|
||||||
void OnCatColours( wxCommandEvent& event );
|
void OnCatColours( wxCommandEvent& event );
|
||||||
void OnSetColumns( wxCommandEvent& event );
|
void OnSetColumns( wxCommandEvent& event );
|
||||||
|
void OnSetVirtualWidth(wxCommandEvent& evt);
|
||||||
void OnMisc( wxCommandEvent& event );
|
void OnMisc( wxCommandEvent& event );
|
||||||
void OnPopulateClick( wxCommandEvent& event );
|
void OnPopulateClick( wxCommandEvent& event );
|
||||||
void OnSetSpinCtrlEditorClick( wxCommandEvent& event );
|
void OnSetSpinCtrlEditorClick( wxCommandEvent& event );
|
||||||
|
Reference in New Issue
Block a user