本文整理汇总了C++中Fl_Button::argument方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Button::argument方法的具体用法?C++ Fl_Button::argument怎么用?C++ Fl_Button::argument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Button
的用法示例。
在下文中一共展示了Fl_Button::argument方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
Scheme_Object*
spark_fltk_button::fl_button(int argc, Scheme_Object** argv)
{
DEFAULT_RET_INIT;
int x = 0; int y = 0; int w = 0; int h = 0;
spark::Utils::int_from_scheme_long(argv[0], x);
spark::Utils::int_from_scheme_long(argv[1], y);
spark::Utils::int_from_scheme_long(argv[2], w);
spark::Utils::int_from_scheme_long(argv[3], h);
std::string title;
if (argv[4] != scheme_null)
{
Scheme_Object* str = scheme_char_string_to_byte_string(argv[4]);
title = SCHEME_BYTE_STR_VAL(str);
}
Fl_Button* button = 0;
if (argc == 5)
button = new Fl_Button(x, y, w, h);
else
{
if (!SCHEME_SYMBOLP(argv[5]))
scheme_wrong_type("fl-button", "symbol", 5, argc, argv);
std::string s = SCHEME_SYM_VAL(argv[5]);
if (s == "check")
button = new Fl_Check_Button(x, y, w, h);
else if (s == "light")
button = new Fl_Light_Button(x, y, w, h);
else if (s == "repeat")
button = new Fl_Repeat_Button(x, y, w, h);
else if (s == "return")
button = new Fl_Return_Button(x, y, w, h);
else if (s == "radio" || s == "round")
button = new Fl_Round_Button(x, y, w, h);
else if (s == "toggle")
button = new Fl_Toggle_Button(x, y, w, h);
else
{
DEFAULT_RET_FINISH;
}
}
if (title.length() > 0)
button->copy_label(title.c_str());
Fltk_tag t = FL_WIDGET_TAG;
spark_fltk::Widget* widget = new spark_fltk::Widget;
button->argument(reinterpret_cast<long>(widget));
{
Scheme_Object* tag = 0;
MZ_GC_DECL_REG(1);
MZ_GC_VAR_IN_REG(0, tag);
MZ_GC_REG();
tag = scheme_make_integer(t);
MZ_GC_UNREG();
_ret_ = scheme_make_cptr(button, tag);
}
DEFAULT_RET_FINISH;
}
示例2: buttons
void Fl_Combo_Box::buttons(int buttons_set) {
// Browse button is always shown
for (int i = 1; i < 5; i++) {
Fl_Button *b = m_buttons[i];
if (buttons_set & b->argument())
b->show();
else b->hide();
}
relayout();
}
示例3: ctor_init
// ctor initializer - used in both ctors
void Fl_Combo_Box::ctor_init()
{
align(FL_ALIGN_LEFT);
style(default_style);
layout_spacing(0);
end();
m_popup = new Fl_Popup_ListView(this);
Fl_Group::begin();
for (int i = 0; i < 5; i++) {
Fl_Button *b = new Fl_Combo_Box_Button(this);
m_buttons[i] = b;
b->layout_align(FL_ALIGN_RIGHT);
b->callback(cb_button);
b->argument(1 << i);
switch (i) {
case 0:
b->image(browse_pixmap);
b->callback(cb_browse);
break;
case 1:
b->image(add_pixmap);
break;
case 2:
b->image(edit_pixmap);
break;
case 3:
b->image(delete_pixmap);
break;
case 4:
b->image(refresh_pixmap);
break;
}
if (i == 0)
b->show();
else b->hide();
}
m_panel = new Fl_Combo_Box_Panel(this);
m_panel->layout_align(FL_ALIGN_CLIENT);
Fl_Group::end();
}