The following is an example of a form definition, taken from the form demo. Here, a new form MyForm has been derived, and a new member EditForm has been defined to edit objects of the type MyObject, given a panel to display it on.
void MyForm::EditForm(MyObject *object, wxPanel *panel) { Add(wxMakeFormString("string 1", &(object->string1), wxFORM_DEFAULT, new wxList(wxMakeConstraintFunction(MyConstraint), 0))); Add(wxMakeFormNewLine()); Add(wxMakeFormString("string 2", &(object->string2), wxFORM_DEFAULT, new wxList(wxMakeConstraintStrings("One", "Two", "Three", 0), 0))); Add(wxMakeFormString("string 3", &(object->string3), wxFORM_CHOICE, new wxList(wxMakeConstraintStrings("Pig", "Cow", "Aardvark", "Gorilla", 0), 0))); Add(wxMakeFormNewLine()); Add(wxMakeFormShort("int 1", &(object->int1), wxFORM_DEFAULT, new wxList(wxMakeConstraintRange(0.0, 50.0), 0))); Add(wxMakeFormNewLine()); Add(wxMakeFormFloat("float 1", &(object->float1), wxFORM_DEFAULT, new wxList(wxMakeConstraintRange(-100.0, 100.0), 0))); Add(wxMakeFormBool("bool 1", &(object->bool1))); Add(wxMakeFormNewLine()); Add(wxMakeFormButton("Test button", (wxFunction)MyButtonProc)); AssociatePanel(panel); }