user interface - Code::Blocks beginner issue with UI design -
i new c::b , wxwidgets. i've tried create simple screen this:
but when it's run:
i have changed few properties following i'm not sure if right thing do.
- i placed flex grid on form. made 1 column , 3 rows
- placed 3 boxsizers. they're 1 under other. set expand property true.
- placed statictext , textctrl elements (one each) in first 2 boxer sizers
- placed spacer , button in 3rd box sizer
- for address text box, set multiline property true (check box) 5.
but when run, not seem grow. button missing @ bottom.
any ideas on how fix please... thanks!
here's (part of) default code generated form.
kbond::kbond(wxwindow* parent,wxwindowid id,const wxpoint& pos,const wxsize& size) { //(*initialize(kbond) wxboxsizer* boxsizer2; wxboxsizer* boxsizer1; wxflexgridsizer* flexgridsizer1; wxboxsizer* boxsizer3; create(parent, wxid_any, wxemptystring, wxdefaultposition, wxdefaultsize, wxdefault_dialog_style|wxresize_border, _t("wxid_any")); setclientsize(wxsize(520,300)); flexgridsizer1 = new wxflexgridsizer(3, 1, 0, 0); boxsizer1 = new wxboxsizer(wxhorizontal); statictext1 = new wxstatictext(this, id_statictext1, _("enter name"), wxdefaultposition, wxsize(90,27), 0, _t("id_statictext1")); boxsizer1->add(statictext1, 1, wxall|wxshaped|wxalign_left|wxalign_center_vertical, 5); textctrl1 = new wxtextctrl(this, id_textctrl1, _("text"), wxdefaultposition, wxsize(148,27), 0, wxdefaultvalidator, _t("id_textctrl1")); boxsizer1->add(textctrl1, 2, wxall|wxalign_center_horizontal|wxalign_center_vertical, 5); flexgridsizer1->add(boxsizer1, 1, wxall|wxexpand|wxalign_center_horizontal|wxalign_center_vertical, 5); boxsizer2 = new wxboxsizer(wxhorizontal); statictext2 = new wxstatictext(this, id_statictext2, _("address"), wxdefaultposition, wxsize(122,22), 0, _t("id_statictext2")); boxsizer2->add(statictext2, 1, wxall|wxalign_top|wxalign_center_horizontal, 5); textctrl2 = new wxtextctrl(this, id_textctrl2, _("text"), wxdefaultposition, wxsize(113,98), wxte_multiline, wxdefaultvalidator, _t("id_textctrl2")); boxsizer2->add(textctrl2, 2, wxall|wxalign_center_horizontal|wxalign_center_vertical, 5); flexgridsizer1->add(boxsizer2, 1, wxall|wxexpand|wxalign_center_horizontal|wxalign_center_vertical, 5); boxsizer3 = new wxboxsizer(wxhorizontal); boxsizer3->add(0,0,2, wxall|wxalign_center_horizontal|wxalign_center_vertical, 5); button1 = new wxbutton(this, id_button1, _("label"), wxdefaultposition, wxsize(62,29), 0, wxdefaultvalidator, _t("id_button1")); button1->setmaxsize(wxsize(0,0)); boxsizer3->add(button1, 1, wxall|wxshaped|wxalign_right|wxalign_center_vertical, 5); flexgridsizer1->add(boxsizer3, 1, wxall|wxexpand|wxalign_center_horizontal|wxalign_center_vertical, 5); setsizer(flexgridsizer1); flexgridsizer1->setsizehints(this); connect(wxid_any,wxevt_init_dialog,(wxobjecteventfunction)&kbond::oninit); //*) }
this looks give trouble:
button1->setmaxsize(wxsize(0,0));
Comments
Post a Comment