| 1 |
#include "grid_row_wrapper.h" |
| 2 |
#include "allocator_mgr.h" |
| 3 |
#include "wxgui_helpers.h" |
| 4 |
|
| 5 |
GridRowWrapper::GridRowWrapper() |
| 6 |
: wxcWidget(ID_WXGRIDROW) |
| 7 |
{ |
| 8 |
m_styles.Clear(); |
| 9 |
m_sizerFlags.Clear(); |
| 10 |
m_properties.DeleteValues(); |
| 11 |
|
| 12 |
SetPropertyString(_("Common Settings"), "wxGridRow"); |
| 13 |
AddProperty(new CategoryProperty(_("wxGrid Row"))); |
| 14 |
AddText(PROP_NAME, _("The Row Label"), _("My Row")); |
| 15 |
AddInteger(PROP_HEIGHT, _("Sets the height of the row\nDefault -1 fits to the label height"), -1); |
| 16 |
|
| 17 |
m_namePattern = "Row"; |
| 18 |
SetName(GenerateName()); |
| 19 |
} |
| 20 |
|
| 21 |
GridRowWrapper::~GridRowWrapper() {} |
| 22 |
|
| 23 |
wxcWidget* GridRowWrapper::Clone() const { return new GridRowWrapper(); } |
| 24 |
|
| 25 |
wxString GridRowWrapper::CppCtorCode() const { return ""; } |
| 26 |
|
| 27 |
void GridRowWrapper::GetIncludeFile(wxArrayString& headers) const { wxUnusedVar(headers); } |
| 28 |
|
| 29 |
wxString GridRowWrapper::GetWxClassName() const { return ""; } |
| 30 |
|
| 31 |
void GridRowWrapper::ToXRC(wxString& text, XRC_TYPE type) const |
| 32 |
{ |
| 33 |
wxUnusedVar(type); |
| 34 |
text << "<row>" |
| 35 |
<< "<name>" << wxCrafter::CDATA(GetName()) << "</name>" |
| 36 |
<< "<rowsize>" << PropertyInt(PROP_HEIGHT, -1) << "</rowsize>" |
| 37 |
<< "</row>"; |
| 38 |
} |
| 39 |
|
| 40 |
wxString GridRowWrapper::Code(int rowIndex) const |
| 41 |
{ |
| 42 |
wxString cppCode; |
| 43 |
cppCode << GetParent()->GetName() << wxT("->SetRowLabelValue(") << rowIndex << wxT(", ") |
| 44 |
<< wxCrafter::UNDERSCORE(GetName()) << wxT(");\n"); |
| 45 |
int height = PropertyInt(PROP_HEIGHT, -1); |
| 46 |
if(height != -1) { |
| 47 |
cppCode << GetParent()->GetName() << wxT("->SetRowSize(") << rowIndex << ", " << height << ");\n"; |
| 48 |
} |
| 49 |
return cppCode; |
| 50 |
} |