当前位置: 首页>>代码示例>>C++>>正文


C++ Fl_Input::maximum_size方法代码示例

本文整理汇总了C++中Fl_Input::maximum_size方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Input::maximum_size方法的具体用法?C++ Fl_Input::maximum_size怎么用?C++ Fl_Input::maximum_size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fl_Input的用法示例。


在下文中一共展示了Fl_Input::maximum_size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char **argv) {
    Fl_Window *window = new Fl_Window(300,150);

    Fl_Button *btn = new Fl_Button(20,80,120,25,"Simple dialog");
    btn->image(&dialog_pixmap_1);

    // using auto-layout
    input1 = new Fl_Input("First Name");
    input2 = new Fl_Input("Last Name");
    btn->callback(cb_test);

    input1->value("Jonh");
    input2->value("Doe");

    btn = new Fl_Button(170,80,120,25,"Config dialog");
    btn->image(&dialog_pixmap_2);
    btn->callback(cb_test2);

    window->end();
    window->show(argc, argv);

    dlg = new Fl_Dialog(400,300,"Demo dialog");
    dlg->new_group("default");
    // Using auto-layout
    Fl_Input *firstNameInput = new Fl_Input("First Name:");
    firstNameInput->field_name("first_name");
    Fl_Input *lastNameInput = new Fl_Input("Last Name:");
    lastNameInput->field_name("last_name");
    dlg->end();
    dlg->buttons(FL_DLG_OK|FL_DLG_CANCEL|FL_DLG_HELP,FL_DLG_OK);

    // User may add his own buttons. The button bitmap is optional,
    // and it should 20x20 or less if presented. The button id should
    // be unique inside the dialog.
    dlg->user_button(1024,"User Button",&smile_pixmap);

    // This is the callback for the whole dialog. In this test,
    // we process the user buttons in this callback function.
    dlg->callback(dialog_callback);


    // This part of the test illustrates the usage of the Dialog
    // as a 'preferences' dialog box. All the widgets with the defined
    // field names will be stored/restored in the defined config file
    // section.

    // First, define a config file
    Fl_Config my_config("dialog.ini");

    // Second, define a config datasource as a config file and a section
    Fl_Config_Dialog_DS my_config_ds(&my_config);

    // Third, create the dialog with the datasource
    config_dlg = new Fl_Dialog(400,300,"Config dialog",&my_config_ds);
    config_dlg->new_group("default");

    // Using auto-layout

    firstNameInput = new Fl_Input("First Name:");
    firstNameInput->field_name("first_name");

    lastNameInput = new Fl_Input("Last Name:");
    lastNameInput->field_name("last_name");

    Fl_Input *inp;

    inp = new Fl_Float_Input("Age:");
    inp->field_name("age");
    inp->maximum_size(5);

    inp = new Fl_Int_Input("Children:");
    inp->field_name("children");
    inp->maximum_size(3);

    Fl_Date_Input *dinp = new Fl_Date_Input("Date:");
    dinp->field_name("date");

    config_dlg->end();
    config_dlg->buttons(FL_DLG_OK|FL_DLG_CANCEL,FL_DLG_OK);

    return Fl::run();
}
开发者ID:GustavoMOG,项目名称:efltk,代码行数:82,代码来源:dialog.cpp


注:本文中的Fl_Input::maximum_size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。