Add corner label orientation toggle to grid sample
This commit is contained in:
@@ -174,6 +174,7 @@ wxBEGIN_EVENT_TABLE( GridFrame, wxFrame )
|
|||||||
EVT_MENU( ID_COLLABELVERTALIGN, GridFrame::SetColLabelVertAlignment )
|
EVT_MENU( ID_COLLABELVERTALIGN, GridFrame::SetColLabelVertAlignment )
|
||||||
EVT_MENU( ID_CORNERLABELHORIZALIGN, GridFrame::SetCornerLabelHorizAlignment )
|
EVT_MENU( ID_CORNERLABELHORIZALIGN, GridFrame::SetCornerLabelHorizAlignment )
|
||||||
EVT_MENU( ID_CORNERLABELVERTALIGN, GridFrame::SetCornerLabelVertAlignment )
|
EVT_MENU( ID_CORNERLABELVERTALIGN, GridFrame::SetCornerLabelVertAlignment )
|
||||||
|
EVT_MENU( ID_CORNERLABELORIENTATION, GridFrame::ToggleCornerLabelOrientation )
|
||||||
EVT_MENU( ID_GRIDLINECOLOUR, GridFrame::SetGridLineColour )
|
EVT_MENU( ID_GRIDLINECOLOUR, GridFrame::SetGridLineColour )
|
||||||
EVT_MENU( ID_INSERTROW, GridFrame::InsertRow )
|
EVT_MENU( ID_INSERTROW, GridFrame::InsertRow )
|
||||||
EVT_MENU( ID_INSERTCOL, GridFrame::InsertCol )
|
EVT_MENU( ID_INSERTCOL, GridFrame::InsertCol )
|
||||||
@@ -332,6 +333,8 @@ GridFrame::GridFrame()
|
|||||||
cornerLabelMenu->AppendRadioItem( ID_CORNERLABELHORIZALIGN, wxT("&Horizontal") );
|
cornerLabelMenu->AppendRadioItem( ID_CORNERLABELHORIZALIGN, wxT("&Horizontal") );
|
||||||
cornerLabelMenu->AppendRadioItem( ID_CORNERLABELVERTALIGN, wxT("&Vertical") );
|
cornerLabelMenu->AppendRadioItem( ID_CORNERLABELVERTALIGN, wxT("&Vertical") );
|
||||||
|
|
||||||
|
viewMenu->Append( ID_CORNERLABELORIENTATION, wxT("Toggle corner label orientation") );
|
||||||
|
|
||||||
wxMenu *colHeaderMenu = new wxMenu;
|
wxMenu *colHeaderMenu = new wxMenu;
|
||||||
|
|
||||||
viewMenu->Append( ID_ROWLABELALIGN, wxT("Col header style"),
|
viewMenu->Append( ID_ROWLABELALIGN, wxT("Col header style"),
|
||||||
@@ -980,6 +983,25 @@ void GridFrame::SetCornerLabelVertAlignment( wxCommandEvent& WXUNUSED(ev) )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GridFrame::ToggleCornerLabelOrientation( wxCommandEvent& WXUNUSED(ev) )
|
||||||
|
{
|
||||||
|
int orientation = grid->GetCornerLabelTextOrientation();
|
||||||
|
|
||||||
|
switch(orientation)
|
||||||
|
{
|
||||||
|
case wxHORIZONTAL:
|
||||||
|
orientation = wxVERTICAL;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case wxVERTICAL:
|
||||||
|
orientation = wxHORIZONTAL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
grid->SetCornerLabelTextOrientation(orientation);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GridFrame::SetGridLineColour( wxCommandEvent& WXUNUSED(ev) )
|
void GridFrame::SetGridLineColour( wxCommandEvent& WXUNUSED(ev) )
|
||||||
{
|
{
|
||||||
wxColourDialog dlg( NULL );
|
wxColourDialog dlg( NULL );
|
||||||
|
@@ -56,6 +56,7 @@ class GridFrame : public wxFrame
|
|||||||
void SetColLabelVertAlignment( wxCommandEvent& );
|
void SetColLabelVertAlignment( wxCommandEvent& );
|
||||||
void SetCornerLabelHorizAlignment( wxCommandEvent& );
|
void SetCornerLabelHorizAlignment( wxCommandEvent& );
|
||||||
void SetCornerLabelVertAlignment( wxCommandEvent& );
|
void SetCornerLabelVertAlignment( wxCommandEvent& );
|
||||||
|
void ToggleCornerLabelOrientation( wxCommandEvent& );
|
||||||
void SetGridLineColour( wxCommandEvent& );
|
void SetGridLineColour( wxCommandEvent& );
|
||||||
|
|
||||||
void SetCellFgColour(wxCommandEvent &);
|
void SetCellFgColour(wxCommandEvent &);
|
||||||
@@ -158,6 +159,7 @@ public:
|
|||||||
ID_CORNERLABELALIGN,
|
ID_CORNERLABELALIGN,
|
||||||
ID_CORNERLABELHORIZALIGN,
|
ID_CORNERLABELHORIZALIGN,
|
||||||
ID_CORNERLABELVERTALIGN,
|
ID_CORNERLABELVERTALIGN,
|
||||||
|
ID_CORNERLABELORIENTATION,
|
||||||
ID_COLDEFAULTHEADER,
|
ID_COLDEFAULTHEADER,
|
||||||
ID_COLNATIVEHEADER,
|
ID_COLNATIVEHEADER,
|
||||||
ID_COLCUSTOMHEADER,
|
ID_COLCUSTOMHEADER,
|
||||||
|
Reference in New Issue
Block a user