wxFlexGridSizer的addgrowablerow方法

AddGrowableRow(idx, proportion)与AddGrowableCol(idx, proportion)表示指定的idx行或指定的idx列伸缩.

idx为从0开始数的正整数

代码片段

wxPanel *panel = new wxPanel(this, -1);
    wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL);
    wxFlexGridSizer *fgs = new wxFlexGridSizer(3, 2, 9, 25);
    
    wxStaticText *thetitle = new wxStaticText(panel, -1, wxT("Title"));
    wxStaticText *author = new wxStaticText(panel, -1, wxT("Author"));
    wxStaticText *review = new wxStaticText(panel, -1, wxT("Review"));
    
    wxTextCtrl *tc1 = new wxTextCtrl(panel, -1);
    wxTextCtrl *tc2 = new wxTextCtrl(panel, -1);
    wxTextCtrl *tc3 = new wxTextCtrl(panel, -1, wxT(""), wxPoint(-1, -1), wxSize(-1, -1), wxTE_MULTILINE);
    
    fgs->Add(thetitle);
    fgs->Add(tc1, 1, wxEXPAND);
    fgs->Add(author);
    fgs->Add(tc2, 1, wxEXPAND);
    fgs->Add(review, 1, wxEXPAND);
    fgs->Add(tc3, 1, wxEXPAND);
    
    fgs->AddGrowableRow(2, 1);
    fgs->AddGrowableCol(1, 1);
    
    hbox->Add(fgs, 1, wxALL | wxEXPAND, 15);
    panel->SetSizer(hbox);

上一篇: apt-get update报错(没有公钥)   下一篇: 安装内容过滤反垃圾邮件

提交疑问

回顶部