ctlSQLGrid::ctlSQLGrid(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size) : wxGrid(parent, id, pos, size, wxWANTS_CHARS | wxVSCROLL | wxHSCROLL) { // Set cells font wxFont fntCells(settings->GetSQLFont()); SetDefaultCellFont(fntCells); // Set labels font wxFont fntLabel(settings->GetSystemFont()); fntLabel.SetWeight(wxBOLD); SetLabelFont(fntLabel); SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTER); SetRowLabelSize(50); SetDefaultRowSize(fntCells.GetPointSize() * 2); SetColLabelSize(fntLabel.GetPointSize() * 4); SetDefaultCellOverflow(false); Connect(wxID_ANY, wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEventHandler(ctlSQLGrid::OnLabelDoubleClick)); }
GLIDebugVariableGrid::GLIDebugVariableGrid(wxWindow *parent, wxWindowID id, uint displayFlags, const wxPoint& pos, const wxSize& size, long style, const wxString& name): wxGrid(parent, id, pos, size, style, name), gridFlags(displayFlags), internalCellEditCounter(0) { //Create a drag target SetDropTarget(new GridDnDText(this)); //Create the grid of 3 columns CreateGrid(0, 3, wxGrid::wxGridSelectRows); //Set the label values SetColLabelValue(NAME_COLUMN_INDEX, wxT("Name")); SetColLabelValue(VALUE_COLUMN_INDEX, wxT("Value")); SetColLabelValue(TYPE_COLUMN_INDEX, wxT("Type")); SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_TOP); SetColLabelSize(17); //Set the column sizes SetColSize(NAME_COLUMN_INDEX, 125); SetColSize(VALUE_COLUMN_INDEX, 200); SetColSize(TYPE_COLUMN_INDEX, 115); //Turn off row labels SetRowLabelSize(0); //Turn off cell overflowing SetDefaultCellOverflow(false); //Setup default colours SetDefaultCellBackgroundColour(*wxWHITE); SetDefaultCellTextColour (*wxBLACK); SetGridLineColour (gridGrey); SetLabelBackgroundColour(gridGrey); SetLabelTextColour (*wxBLACK); }