FidMarkTable::FidMarkTable(Project *project)
	: wxGridTableBase()
	, m_project(project)
	, m_fidmark(project->GetFidMark())
	, m_component(project->GetComponent())
{
	wxGridCellAttrProvider *attrProvider = new wxGridCellAttrProvider;
	SetAttrProvider (attrProvider);

	wxGridCellAttr *ro_attr = new wxGridCellAttr();
	ro_attr->SetReadOnly();
	SetColAttr (ro_attr, COL_DESIGNATOR);
	SetColAttr (ro_attr, COL_NAME);
	SetColAttr (ro_attr, COL_LAYER);
	SetColAttr (ro_attr, COL_SUBPCB_INDEX);

	wxGridCellAttr *ro_float_attr = new wxGridCellAttr();
	wxGridCellFloatRenderer *float_rend = new wxGridCellFloatRenderer(5, 3);
	ro_float_attr->SetRenderer(float_rend);
	ro_float_attr->SetReadOnly();
	SetColAttr (ro_float_attr, COL_LOCATION_X);
	SetColAttr (ro_float_attr, COL_LOCATION_Y);

	wxGridCellAttr *choise_on_subpcb_attr = new wxGridCellAttr();
	wxGridCellChoiceEditor *choise_on_subpcb_edit = new wxGridCellChoiceEditor(G_array_on_subpcb);
	choise_on_subpcb_attr->SetEditor(choise_on_subpcb_edit);
	SetColAttr (choise_on_subpcb_attr, COL_USE_ON_SUBPCB);

	wxGridCellAttr *choise_global_attr = new wxGridCellAttr();
	wxGridCellChoiceEditor *choise_global_edit = new wxGridCellChoiceEditor(G_array_global);
	choise_global_attr->SetEditor(choise_global_edit);
	SetColAttr (choise_global_attr, COL_USE_GLOBAL);
}
Example #2
0
bool wxDbGridTableBase::CanHaveAttributes()
{
    if (!GetAttrProvider())
    {
        // use the default attr provider by default
        SetAttrProvider(new wxDbGridCellAttrProvider(m_data, m_ColInfo));
    }
    return true;
}