本文整理汇总了C++中Fl_Pack::add方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Pack::add方法的具体用法?C++ Fl_Pack::add怎么用?C++ Fl_Pack::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Pack
的用法示例。
在下文中一共展示了Fl_Pack::add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv) {
window = new Fl_Window(400,300);
Fl_Pack* pack = new Fl_Pack(100,0,200,300);
pack->spacing(20);
counter = new Fl_Simple_Counter(0,0,100,20,"Размер поля");
counter->step(1.0);
counter->minimum(2);
counter->maximum(10);
counter->value(4);
rtype1 = new Fl_Radio_Round_Button(0,60,300,20,"Внутренняя устойчивость");
rtype2 = new Fl_Radio_Round_Button(0,100,300,20,"Внешняя устойчивость");
rtype1->value(1);
piece = new Fl_Choice(0,150,300,20);
for(unsigned int i=0; i < mylib::pieces_n; i++)
piece->add(mylib::pieces[i].name);
piece->value(piece->menu());
progress = new Fl_Progress(0,0,300,30,"Прогресс");
progress->minimum(0); progress->maximum(100);
progress->value(0);
progress->hide();
start = new Fl_Button(0,40,300,30,"Считать");
start->callback(&on_start);
full_dnf = new Fl_Check_Button(0,0,300,20,"Выводить промежуточные результаты");
pack->add(piece);
pack->add(rtype1);
pack->add(rtype2);
pack->add(counter);
pack->add(full_dnf);
pack->add(start);
pack->add(progress);
txt_window = new Fl_Window(500,500,"Результат");
txt_pack = new Fl_Pack(0,0,500,500);
txt_buttons = new Fl_Pack(0,0,500,30);
txt_buttons->type(Fl_Pack::HORIZONTAL);
txt_out = new Fl_Text_Display(0,0,500,470);
txt_out->textfont(FL_COURIER);
txt_close = new Fl_Button(0,0,100,30,"Закрыть");
txt_copy = new Fl_Button(0,0,100,30,"Копировать");
txt_save = new Fl_Button(0,0,100,30,"Сохранить");
txt_close->callback(&on_txt_close);
txt_copy->callback(&on_txt_copy);
txt_save->callback(&on_txt_save);
txt_pack->add(txt_out);
txt_buttons->add(txt_close);
txt_buttons->add(txt_copy);
txt_buttons->add(txt_save);
txt_window->callback(&on_txt_close);
txt_window->resizable(txt_pack);
txt_pack->add_resizable(*txt_out);
txt_pack->add(txt_buttons);
txt_window->add(txt_pack);
window->label("Дискретка");
window->add(pack);
window->show(argc, argv);
//Fl::scheme("windows");
Fl::lock();
while(Fl::wait() > 0)
{
std::stringstream* msg;
if((msg = (std::stringstream*)Fl::thread_message()))
{
end_calc_thread(msg);
}
}
return 0;
}