本文整理汇总了C++中Fl_Button::align方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Button::align方法的具体用法?C++ Fl_Button::align怎么用?C++ Fl_Button::align使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Button
的用法示例。
在下文中一共展示了Fl_Button::align方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddStructure
void FolderWindow::AddStructure(const char* filename, const int index)
{
Fl_Pack* pack = folderPack;
pack->begin();
int vertPosn = pack->children() * 30 + pack->y();
Fl_Group* group = new Fl_Group(pack->x(), vertPosn, pack->w(), 30);
group->begin();
Fl_Button* label = new Fl_Button(pack->x() + 10, vertPosn, pack->w() - 40, 30, filename);
label->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
label->callback(FolderWindow::ShowFileCallback);
label->user_data((void*)index);
Fl_Button* removeButton = new Fl_Button(pack->x() + pack->w() - 20, vertPosn + 5, 20, 20);
removeButton->callback(FolderWindow::RemoveCallback);
removeButton->user_data((void*)index);
removeButton->label("@1+");
//printf("Added file: %s\n",label->label());
group->resizable(label);
group->end();
pack->end();
folderScroll->redraw();
}
示例2: window
window(int x, int y, int w, int h, const char *label = 0)
: Fl_Window(x, y, w, h, label)
{
Fl_Box *o = new Fl_Box(10, 10, 300, 25,
"Open CSV file to convert to HTML -->");
o->box(FL_BORDER_BOX);
o->align(FL_ALIGN_INSIDE | FL_ALIGN_WRAP| FL_ALIGN_CENTER);
o->color((Fl_Color)215);
o->labelfont(FL_HELVETICA_BOLD);
Fl_Button *but = new Fl_Button(320, 10, 80, 25, "Pick Files");
but->callback(on_pick_button_click, this);
encode_check = new Fl_Check_Button(10, 40, 280, 25,
"Escape special HTML characters.");
encode_check->value(1);
open_file_check = new Fl_Check_Button(10, 65, 280, 25,
"Open HTML in browser.");
open_file_check->value(1);
Fl_Button *author = new Fl_Button(320, 65, 80, 25, "Mingjie Li");
author->box(FL_FLAT_BOX);
author->align(FL_ALIGN_INSIDE | FL_ALIGN_RIGHT);
author->labelsize(12);
author->labelcolor(fl_rgb_color(128, 128, 128));
author->callback(on_author_click, this);
}
示例3: make_about_panel
Fl_Window* make_about_panel(const char *copyright) {
Fl_Window* w;
{Fl_Window* o = about_panel = new Fl_Window(330, 276, _("About eFluid"));
w = o;
o->type(240);
o->selection_color((Fl_Color)47);
o->shortcut(0xff1b);
{Fl_Group* o = display_group = new Fl_Group(0, 0, 330, 240);
{Fl_Group* o = new Fl_Group(5, 5, 320, 55, _("eFluid"));
o->box(FL_ENGRAVED_BOX);
o->label_font(fl_fonts+1);
o->label_type(FL_EMBOSSED_LABEL);
o->color((Fl_Color)0xb3b3be00);
o->label_color((Fl_Color)32);
o->selection_color((Fl_Color)47);
o->label_size(40);
o->align(FL_ALIGN_INSIDE);
o->end();
}
{Fl_Button* o = new Fl_Button(5, 165, 320, 70, _("\302\251""2002-2003\nClick here for more information"));
o->box(FL_ENGRAVED_BOX);
o->label_font(fl_fonts+1);
o->color((Fl_Color)0xb3b3be00);
o->label_color((Fl_Color)32);
o->highlight_color((Fl_Color)0x9d9da700);
o->highlight_label_color((Fl_Color)55);
o->label_size(14);
o->callback((Fl_Callback*)cb_2002);
o->align(FL_ALIGN_WRAP);
}
{Fl_Box* o = new Fl_Box(5, 60, 320, 105, _("EFLTK User Interface Designer\nVersion 2.0.3"));
o->box(FL_ENGRAVED_BOX);
o->label_font(fl_fonts+1);
o->label_type(FL_EMBOSSED_LABEL);
o->color((Fl_Color)0xb3b3be00);
o->label_color((Fl_Color)32);
o->selection_color((Fl_Color)47);
o->label_size(18);
}
o->end();
}
{Fl_Box* o = copyright_box = new Fl_Box(0, 0, 330, 240);
o->label_size(10);
o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP|FL_ALIGN_WRAP);
o->hide();
o->label(copyright);
}
{Fl_Return_Button* o = new Fl_Return_Button(5, 245, 320, 25, _("OK"));
o->label_size(10);
o->shortcut(0xff0d);
o->callback((Fl_Callback*)cb_OK);
}
o->end();
}
return w;
}
示例4: Fl_Button
void
make_window_banks ()
{
int i, j, x, y, num;
int elw, elh;
elw = 176 * gui.BankWindow->w () / 800;
elh = 24 * gui.BankWindow->h () / 600;
gui.ob->begin ();
x = 40;
y = 10;
num = 0;
for (i = 1; i < 21; i++)
{
y += elh + 2;
for (j = 1; j < 5; j++)
{
Fl_Button *butX =
new Fl_Button (x + 1, y + 1, elw, elh, Banco[num].Name);
butX->type (0);
butX->color (FL_BLUE);
butX->box (FL_FLAT_BOX);
butX->selection_color (FL_RED);
butX->labelsize (14);
butX->align (68 | FL_ALIGN_INSIDE);
butX->user_data ((void *) (num));
butX->value (0);
butX->callback ((Fl_Callback *) preset_click);
gui.ob->add (butX);
x += elw + 4;
num++;
}
x = 40;
}
gui.ob->end ();
gui.made = 1;
}
示例5: AddStructure
void FolderWindow::AddStructure(const char* filename, const int index)
{
Fl_Pack* pack = folderPack;
pack->begin();
int vertPosn = pack->children() * NAVBUTTONS_BHEIGHT; //+ pack->y() + 15;
Fl_Group* group = new Fl_Group(pack->x(), vertPosn, pack->w(), NAVBUTTONS_BHEIGHT);
group->begin();
Fl_Button* label = new Fl_Button(pack->x() + 10, vertPosn, pack->w() - 40, 30, filename);
label->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_LEFT);
label->callback(FolderWindow::ShowFileCallback);
label->user_data((void*)index);
label->labelcolor(GUI_BTEXT_COLOR);
char labelWithIcon[MAX_BUFFER_SIZE];
std::string spaceBuffer = string(" ");
int curLabelLen = 0;
char filePrefix[MAX_BUFFER_SIZE];
size_t fileNameBytes = strlen(filename);
snprintf(filePrefix, MAX_BUFFER_SIZE, "%-.20s%s", filename,
fileNameBytes > MAX_FOLDER_LABEL_CHARS ? "..." : "");
snprintf(labelWithIcon, MAX_BUFFER_SIZE - 1, "@filenew %s%s",
filePrefix, spaceBuffer.substr(0,
MAX(0, MAX_FOLDER_LABEL_CHARS - ((int ) strlen(filePrefix)))).c_str());
//strcat(labelWithIcon, " @|>");
label->copy_label(labelWithIcon);
label->tooltip(filename);
Fl_Button* removeButton = new Fl_Button(pack->x() + pack->w() - 20, vertPosn + 5, 20, 20);
removeButton->callback(FolderWindow::RemoveCallback);
removeButton->user_data((void*)index);
removeButton->label("@1+");
removeButton->labelcolor(GUI_TEXT_COLOR);
group->resizable(label);
group->end();
pack->end();
folderScroll->redraw();
}
示例6: show_header
// Regenerate and display header
void EDE_Browser::show_header() {
int button_x=0;
char *hdr = column_header_;
const int* l = Fl_Icon_Browser::column_widths();
cleanup_header();
for (int i=0; i==0||l[i-1]; i++) {
// If the button is last, calculate size
int button_w = l[i];
if (button_w == 0) button_w = totalwidth_-button_x;
// Get part of header until delimiter char
char *delim = 0;
Fl_Button *b;
if (hdr) {
delim = strchr(hdr, Fl_Icon_Browser::column_char());
if (delim) *delim='\0'; // temporarily
b=new Fl_Button(button_x,heading->y(),button_w,buttonheight,strdup(hdr));
} else {
b=new Fl_Button(button_x,heading->y(),button_w,buttonheight,"");
}
b->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT|FL_ALIGN_CLIP);
b->callback(header_callback);
b->labelsize(12); // FIXME: hack for label size
//b->labelcolor(FL_DARK3);
heading->add(b);
button_x += l[i];
if (delim) {
*delim=Fl_Icon_Browser::column_char(); // put back delimiter
hdr=delim+1; // next field
}
}
if (!heading->visible()) resize(x(),y()+buttonheight,w(),h()-buttonheight);
heading->resizable(0); // We will resize the heading and individual buttons manually
heading->show();
heading->redraw(); //in case it was already visible
}
示例7: _addMenu
void onelabGroup::_addMenu(const std::string &path, Fl_Callback *callback, void *data)
{
Fl_Tree_Item *n = _tree->add(path.c_str());
_tree->begin();
int ww = _baseWidth - (n->depth() + 1) * _indent;
int hh = n->labelsize() + 4;
Fl_Group *grp = new Fl_Group(1, 1, ww, hh);
Fl_Button *but = new Fl_Button(1, 1, ww, hh);
but->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
but->callback(callback, data);
but->box(FL_FLAT_BOX);
but->color(_tree->color());
but->selection_color(_tree->color());
grp->end();
if(!_enableTreeWidgetResize) grp->resizable(0);
_treeWidgets.push_back(grp);
std::string label = path;
std::string::size_type last = path.find_last_of('/');
if(last != std::string::npos) label = path.substr(last + 1);
but->copy_label(label.c_str());
n->widget(grp);
_tree->end();
}
示例8: strdup
// add parameter string to tree
Fl_Widget *onelabGroup::_addParameterWidget(onelab::string &p, int ww, int hh,
Fl_Tree_Item *n, bool highlight, Fl_Color c)
{
char *path = strdup(getPath(n).c_str());
_treeStrings.push_back(path);
// macro button
if(p.getAttribute("Macro") == "Gmsh"){
Fl_Button *but = new Fl_Button(1, 1, ww / _widgetLabelRatio, hh);
but->box(FL_FLAT_BOX);
but->color(_tree->color());
but->selection_color(_tree->color());
but->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE | FL_ALIGN_CLIP);
//TODO but->callback(onelab_string_button_cb, (void*)path);
if(highlight) but->color(c);
return but;
}
// non-editable value
if(p.getReadOnly()){
Fl_Output *but = new Fl_Output(1, 1, ww, hh);
but->value(p.getValue().c_str());
but->align(FL_ALIGN_RIGHT);
if(highlight) but->color(c);
return but;
}
// simple string (no menu)
if(p.getChoices().empty() && p.getKind() != "file"){
Fl_Input *but = new Fl_Input(1, 1, ww, hh);
but->value(p.getValue().c_str());
//TODO but->callback(onelab_string_input_cb, (void*)path);
but->when(FL_WHEN_ENTER_KEY);
but->align(FL_ALIGN_RIGHT);
if(highlight) but->color(c);
return but;
}
// general string input
Fl_Input_Choice *but = new Fl_Input_Choice(1, 1, ww, hh);
std::string multipleSelection = p.getAttribute("MultipleSelection");
if(multipleSelection.size())
;//but->menubutton()->callback(multiple_selection_menu_cb, but);
std::vector<Fl_Menu_Item> menu;
for(unsigned int j = 0; j < p.getChoices().size(); j++){
char *str = strdup(p.getChoices()[j].c_str());
_treeStrings.push_back(str);
bool divider = (p.getKind() == "file" &&
j == p.getChoices().size() - 1);
int choice = multipleSelection.size() ? FL_MENU_TOGGLE : 0;
if(multipleSelection.size() > j && multipleSelection[j] == '1')
choice |= FL_MENU_VALUE;
Fl_Menu_Item it = {str, 0, 0, 0, divider ? FL_MENU_DIVIDER : choice};
menu.push_back(it);
}
//if(p.getKind() == "file"){
// Fl_Menu_Item it = {"Choose...", 0, onelab_input_choice_file_chooser_cb, (void*)n};
// menu.push_back(it);
// Fl_Menu_Item it2 = {"Edit...", 0, onelab_input_choice_file_edit_cb, (void*)n};
// menu.push_back(it2);
// if(GuessFileFormatFromFileName(p.getValue()) >= 0){
// Fl_Menu_Item it3 = {"Merge...", 0, onelab_input_choice_file_merge_cb, (void*)n};
// menu.push_back(it3);
// }
//}
Fl_Menu_Item it = {0};
menu.push_back(it);
but->menubutton()->copy(&menu[0]);
but->value(p.getValue().c_str());
but->callback(onelab_string_input_choice_cb, (void*)path);
but->input()->when(FL_WHEN_ENTER_KEY);
but->align(FL_ALIGN_RIGHT);
if(highlight) but->input()->color(c);
return but;
}
示例9:
/*
============================================================================
Class constructor
============================================================================
*/
VTTpddServerLog::VTTpddServerLog(int w, int h, const char* title) :
Fl_Double_Window(w, h, title)
{
Fl_Box* o;
Fl_Button* b;
Fl_Group* g;
// Initialize everything
m_pServer = NULL;
m_enabled = TRUE;
m_lastWasRx = FALSE;
m_rxCount = m_txCount = 0;
m_maxLogEntries = 8192;
m_nextRef = 1;
m_callbackActive = FALSE;
m_autoScroll = TRUE;
// Define our default colors
m_colors.background = FL_BLACK;
m_colors.ref = FL_WHITE;
m_colors.rxLabel = FL_YELLOW;
m_colors.txLabel = (Fl_Color) 221;
m_colors.rxHex = fl_color_average(FL_DARK_GREEN, FL_WHITE, (float) 0.8);
m_colors.txHex = fl_color_average((Fl_Color) 221, FL_WHITE, (float) 0.5);
m_colors.rxAscii = FL_GREEN;
m_colors.txAscii = (Fl_Color) 221;
m_fontSize = 14;
fl_font(FL_COURIER, m_fontSize);
m_height = fl_height();
m_width = (int) fl_width("W");
// ===============================
// Now create the controls we need
// ===============================
// Create a menu
m_pMenu = new Fl_Menu_Bar(0, 0, w, MENU_HEIGHT-2);
m_pMenu->menu(gServerLog_menuitems);
// Create a window for the log
m_pLog = new Fl_Double_Window(10, MENU_HEIGHT+10, w-20-15, h-MENU_HEIGHT-50, "");
//m_pLog->color(FL_BLACK);
m_pLog->end();
m_pLog->hide();
// Create a scrollbar
m_pScroll = new Fl_Scrollbar(w-10-15, MENU_HEIGHT+10, 15, h-MENU_HEIGHT-50, "");
m_pScroll->callback(cb_scroll_log, this);
// Create a resizing group
g = new Fl_Group(0, h-35, w, 35, "");
// Create an auto scroll checkbox
m_pAutoScroll = new Fl_Check_Button(20, h-37, 110, 20, "Auto scroll");
m_pAutoScroll->callback(cb_autoscroll, this);
// Create a disable log checkbox
m_pDisable = new Fl_Check_Button(20, h-21, 110, 20, "Disable log");
m_pDisable->callback(cb_disable_log, this);
// Create a Save button
b = new Fl_Button(150, h-30, 80, 20, "Save");
b->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE);
b->callback(cb_save_log, this);
// Create a Load button
b = new Fl_Button(250, h-30, 80, 20, "Load");
b->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE);
b->callback(cb_load_log, this);
// Create a clear button
b = new Fl_Button(350, h-30, 80, 20, "Clear");
b->align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE);
b->callback(cb_clear_log, this);
// Make the group resizable
o = new Fl_Box(440, 350, 5, 5, "");
g->resizable(o);
g->end();
// Make the window resizable
o = new Fl_Box(20, MENU_HEIGHT + 30, 5, 5, "");
resizable(o);
// Set the scrollbar size
SetScrollSizes();
}
示例10: main
int main (int argc, char **argv) {
Fl_Window* w;
fl_init_locale_support("ewmconf", PREFIX"/share/locale");
readConfiguration();
{Fl_Window* o = new Fl_Window(320, 370, _("Window manager settings"));
w = o;
{Fl_Tabs* o = new Fl_Tabs(2, 5, 318, 325);
o->color((Fl_Color)16);
{Fl_Group* o = new Fl_Group(1, 29, 316, 295, _("&Titlebar"));
o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
{Fl_Choice* o = new Fl_Choice(83, 13, 105, 22, _("Text align:")); o->begin();
o->callback((Fl_Callback*)cb_Text);
new Fl_Item(_("Left"));
new Fl_Item(_("Right"));
new Fl_Item(_("Center"));
o->value(title_align);
o->end();
}
{Fl_Value_Input* o = new Fl_Value_Input(243, 13, 60, 22, _("Height:"));
o->minimum(10);
o->maximum(50);
o->step(1);
o->value(20);
o->callback((Fl_Callback*)cb_Height);
o->value(title_height);
}
{Fl_Button* o = titlebarLabelColorButton = new Fl_Button(85, 55, 60, 20, _("Titlebar label color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_titlebarLabelColorButton);
o->align(132);
o->color((Fl_Color)title_normal_color_text);
}
{Fl_Button* o = titlebarColorButton = new Fl_Button(85, 120, 60, 20, _("Titlebar color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_titlebarColorButton);
o->align(132);
o->color((Fl_Color) title_normal_color);
}
{Fl_Group* o = new Fl_Group(153, 45, 160, 110);
{Fl_Button* o = titlebarActiveLabelColorButton = new Fl_Button(90, 10, 60, 20, _("Titlebar active label color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_titlebarActiveLabelColorButton);
o->align(132);
o->color((Fl_Color) title_active_color_text);
}
{Fl_Button* o = titlebarActiveColorButton = new Fl_Button(90, 75, 60, 20, _("Titlebar active color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_titlebarActiveColorButton);
o->align(132);
o->color((Fl_Color)title_active_color);
}
o->end();
}
{Fl_Choice* o = titlebarDrawGrad = new Fl_Choice(85, 157, 163, 23, _("Box type:")); o->begin();
o->callback((Fl_Callback*)cb_titlebarDrawGrad);
o->align(132);
new Fl_Item(_("Flat"));
new Fl_Item(_("Horizontal shade"));
new Fl_Item(_("Thin down"));
new Fl_Item(_("Up box"));
new Fl_Item(_("Down box"));
new Fl_Item(_("Plastic"));
o->value(title_draw_grad);
o->end();
}
{Fl_Check_Button* o = useThemeButton = new Fl_Check_Button(8, 220, 300, 20, _("&Use theme"));
o->callback((Fl_Callback*)cb_useThemeButton);
o->value(use_theme);
}
{Fl_Input* o = themePathInput = new Fl_Input(65, 247, 210, 23, _("Path:"));
o->callback((Fl_Callback*)cb_themePathInput);
o->deactivate();
themePathInput->value(theme_path);
}
{Fl_Button* o = browse_btn = new Fl_Button(280, 247, 25, 23, _("..."));
o->callback((Fl_Callback*)cb_browse_btn);
o->deactivate();
}
{Fl_Divider* o = new Fl_Divider(8, 190, 300, 25, _("label"));
o->color((Fl_Color)16);
}
{Fl_Divider* o = new Fl_Divider(8, 85, 297, 25, _("label"));
o->color((Fl_Color)16);
}
o->end();
}
{Fl_Group* o = new Fl_Group(3, 20, 310, 305, _("&Resizing"));
o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
o->hide();
{Fl_Check_Button* o = animateButton = new Fl_Check_Button(10, 10, 300, 20, _("Animate size changes"));
o->value(1);
o->callback((Fl_Callback*)cb_animateButton);
o->value(animate);
}
{Fl_Value_Slider* o = animateSlider = new Fl_Value_Slider(70, 35, 235, 20, _("Speed:"));
o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE);
o->box(FL_DOWN_BOX);
o->text_size(10);
o->minimum(5);
//.........这里部分代码省略.........
示例11: Fl_Box
edisplayconf::edisplayconf() {
Fl_Window* w;
{Fl_Window* o = win = new Fl_Window(265, 335, _("Display configuration"));
w = o;
o->callback((Fl_Callback*)cb_win, (void*)(this));
{Fl_Tabs* o = new Fl_Tabs(5, 5, 255, 285);
{Fl_Group* o = group_mouse = new Fl_Group(0, 20, 255, 265, _("Mouse"));
o->align(FL_ALIGN_LEFT);
{Fl_Value_Slider* o = slider_accel = new Fl_Value_Slider(25, 25, 220, 18, _("Acceleration"));
o->type(Fl_Value_Slider::HORIZONTAL);
o->maximum(10);
o->step(1);
o->value(2);
o->align(FL_ALIGN_TOP);
}
{Fl_Value_Slider* o = slider_thresh = new Fl_Value_Slider(25, 65, 220, 18, _("Threshold (pixels)"));
o->type(Fl_Value_Slider::HORIZONTAL);
o->maximum(20);
o->step(1);
o->value(4);
o->align(FL_ALIGN_TOP);
}
o->end();
}
{Fl_Group* o = group_bell = new Fl_Group(0, 20, 255, 265, _("Bell"));
o->hide();
{Fl_Value_Slider* o = slider_volume = new Fl_Value_Slider(25, 25, 220, 18, _("Volume in %"));
o->type(Fl_Value_Slider::HORIZONTAL);
o->maximum(100);
o->step(1);
o->value(50);
o->align(FL_ALIGN_TOP);
}
{Fl_Value_Slider* o = slider_pitch = new Fl_Value_Slider(25, 70, 220, 18, _("Pitch in Hz"));
o->type(Fl_Value_Slider::HORIZONTAL);
o->minimum(100);
o->maximum(1000);
o->step(1);
o->value(440);
o->align(FL_ALIGN_TOP);
}
{Fl_Value_Slider* o = slider_duration = new Fl_Value_Slider(25, 115, 220, 18, _("Duration in ms"));
o->type(Fl_Value_Slider::HORIZONTAL);
o->maximum(1000);
o->step(1);
o->value(200);
o->align(FL_ALIGN_TOP);
}
{Fl_Button* o = new Fl_Button(180, 165, 60, 25, _("Test"));
o->callback((Fl_Callback*)cb_Test);
}
o->end();
}
{Fl_Group* o = group_keyboard = new Fl_Group(0, 20, 255, 265, _("Keyboard"));
o->align(FL_ALIGN_TOP | FL_ALIGN_LEFT);
o->hide();
{Fl_Check_Button* o = check_autorepeat = new Fl_Check_Button(24, 25, 221, 20, _(" Repeat key activated"));
o->selection_color((Fl_Color)2);
o->value(1);
}
{Fl_Value_Slider* o = slider_click = new Fl_Value_Slider(25, 65, 220, 18, _("Click volume %"));
o->type(Fl_Value_Slider::HORIZONTAL);
o->maximum(100);
o->step(1);
o->value(50);
o->align(FL_ALIGN_TOP);
}
o->end();
}
{Fl_Group* o = group_screen = new Fl_Group(0, 20, 255, 265, _("Screen"));
o->hide();
{Fl_Button* o = but_activate = new Fl_Button(165, 187, 80, 25, _("&Test"));
o->callback((Fl_Callback*)cb_but_activate);
}
new Fl_Box(10, 1, 234, 55);
{Fl_Value_Slider* o = slider_delay = new Fl_Value_Slider(25, 77, 220, 18, _("Activation delay (min)"));
o->type(Fl_Value_Slider::HORIZONTAL);
o->minimum(5);
o->maximum(120);
o->step(1);
o->value(15);
o->align(FL_ALIGN_TOP);
}
{Fl_Check_Button* o = check_blanking = new Fl_Check_Button(23, 25, 222, 20, _(" Screen blanker activated"));
o->selection_color((Fl_Color)2);
o->value(1);
}
new Fl_Box(10, 100, 234, 37);
{Fl_Value_Slider* o = slider_pattern = new Fl_Value_Slider(25, 152, 220, 18, _("Pattern change delay (min)"));
o->type(Fl_Value_Slider::HORIZONTAL);
o->minimum(1);
o->maximum(5);
o->step(0);
o->value(2);
o->align(FL_ALIGN_TOP);
o->deactivate();
}
{Fl_Group* o = new Fl_Group(30, 105, 210, 25);
{Fl_Round_Button* o = radio_blank = new Fl_Round_Button(0, 5, 105, 20, _("Blank"));
o->type(Fl_Round_Button::RADIO);
//.........这里部分代码省略.........
示例12:
Fl_Window * make_window()
{
Fl_Window * w;
{
Fl_Window * o = main_window = new Fl_Window(741, 622, "ASF/AMC Motion Capture Player");
w = o;
{
Fl_Group * o = new Fl_Group(10, 485, 615, 140);
{
Fl_Button * o = loadSkeleton_button = new Fl_Button(10, 495, 120, 40, "Load Skeleton");//***
o->callback((Fl_Callback *)load_callback);
}
{
Fl_Button * o = loadMotion_button = new Fl_Button(140, 495, 120, 40, "Load Motion"); //***
o->callback((Fl_Callback *)load_callback);
}
// "Reload motion" always reload the last skeleton loaded
{
Fl_Button * o = reloadMotion_button = new Fl_Button(270, 495, 120, 40, "Reload Motion");//***
o->callback((Fl_Callback *)reload_callback);
}
{
Fl_Button * o = resetScene_button = new Fl_Button(400, 495, 120, 40, "Reset Scene");
o->callback((Fl_Callback *)resetScene_callback);
}
{
Fl_Light_Button* o = record_button = new Fl_Light_Button(380, 575, 40, 25, "R");
o->callback((Fl_Callback *)record_callback, (void*)(0));
}
{
Fl_Button * o = screenShot_button = new Fl_Button(280, 575, 90, 25, "ScreenShot");
o->callback((Fl_Callback *)saveScreenToFile_callback);
}
{
Fl_Button * o = pause_button = new Fl_Button(430, 575, 35, 25, "@||");
o->labeltype(FL_SYMBOL_LABEL);
o->labelsize(12);
o->callback((Fl_Callback *)play_callback);
}
{
Fl_Button* o = rewind_button = new Fl_Button(465, 575, 35, 25, "@|<");
o->labeltype(FL_SYMBOL_LABEL);
o->labelsize(12);
o->callback((Fl_Callback *)play_callback);
}
{
Fl_Button* o = play_button = new Fl_Button(500, 575, 35, 25, "@>");
o->labeltype(FL_SYMBOL_LABEL);
o->labelsize(12);
o->callback((Fl_Callback *)play_callback, (void*)(0));
}
{
Fl_Button* o = minusOne_button = new Fl_Button(535, 575, 35, 25, "-1");
o->labeltype(FL_SYMBOL_LABEL);
o->labelsize(12);
o->callback((Fl_Callback *)play_callback, (void*)(0));
}
{
Fl_Button* o = plusOne_button = new Fl_Button(570, 575, 35, 25, "+1");
o->labeltype(FL_SYMBOL_LABEL);
o->labelsize(12);
o->callback((Fl_Callback *)play_callback, (void*)(0));
}
{
Fl_Button* o = repeat_button = new Fl_Button(605, 575, 35, 25, "@<->");
o->labeltype(FL_SYMBOL_LABEL);
o->labelsize(12);
o->callback((Fl_Callback *)play_callback, (void*)(0));
}
o->end();
} // FL_group
{
Player_Gl_Window * o = glwindow = new Player_Gl_Window(5, 5, 640, 480, "label");
o->box(FL_DOWN_FRAME);
o->labeltype(FL_NO_LABEL);
}
{
Fl_Value_Slider* o = frame_slider = new Fl_Value_Slider(10, 545, 630, 20); // slider
o->type(5);
o->labelsize(18);
o->minimum(1);
o->maximum(60000);
o->step(1);
o->callback((Fl_Callback*)fslider_callback, (void*)(0));
o->align(197);
}
{
Fl_Value_Input* o = speedUp = new Fl_Value_Input(65, 575, 40, 25, "Speed");
o->minimum(0);
o->value(1);
o->callback((Fl_Callback*)playSpeed_callback);
//.........这里部分代码省略.........
示例13: main
int main (int argc, char **argv) {
Fl_Window* w;
fl_init_locale_support("eiconsconf", PREFIX"/share/locale");
readIconsConfiguration();
{Fl_Window* o = iconsConfWindow = new Fl_Window(265, 314, _("Icons settings"));
w = o;
o->shortcut(0xff1b);
{Fl_Button* o = new Fl_Button(25, 280, 75, 25, _("&OK"));
o->callback((Fl_Callback*)cb_OK);
}
{Fl_Button* o = new Fl_Button(185, 280, 75, 25, _("&Cancel"));
o->callback((Fl_Callback*)cb_Cancel);
}
{Fl_Button* o = new Fl_Button(105, 280, 75, 25, _("&Apply"));
o->callback((Fl_Callback*)cb_Apply);
}
{Fl_Tabs* o = new Fl_Tabs(3, 5, 257, 265);
o->color((Fl_Color)0xfffffffe);
{Fl_Group* o = new Fl_Group(1, 23, 255, 241, _("Look&&feel"));
o->align(FL_ALIGN_TOP|FL_ALIGN_LEFT);
{Fl_Button* o = colorButton = new Fl_Button(165, 17, 60, 18, _("Background color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_colorButton);
o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
o->color((Fl_Color) label_background);
if(label_trans) o->deactivate();
}
{Fl_Button* o = colorButton1 = new Fl_Button(165, 47, 60, 18, _("Label color: "));
o->box(FL_DOWN_BOX);
o->callback((Fl_Callback*)cb_colorButton1);
o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
o->color((Fl_Color) label_foreground);
}
{Fl_Value_Slider* o = maxWidthSlider = new Fl_Value_Slider(115, 95, 125, 20, _("Maximum width: "));
o->type(Fl_Value_Slider::HORIZONTAL);
o->minimum(48);
o->maximum(200);
o->step(1);
o->value(50);
o->slider_size(10);
o->callback((Fl_Callback*)cb_maxWidthSlider);
o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
o->value(label_maxwidth);
}
{Fl_Value_Slider* o = fontsizeSlider = new Fl_Value_Slider(115, 125, 125, 20, _("Font height: "));
o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE);
o->minimum(8);
o->maximum(48);
o->step(1);
o->value(10);
o->slider_size(10);
o->callback((Fl_Callback*)cb_fontsizeSlider);
o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
o->value(label_fontsize);
}
{Fl_Value_Slider* o = gridspaceSlider = new Fl_Value_Slider(115, 155, 125, 20, _("Grid spacing: "));
o->type(Fl_Value_Slider::HORIZONTAL|Fl_Slider::TICK_ABOVE);
o->minimum(1);
o->maximum(50);
o->step(1);
o->value(10);
o->slider_size(10);
o->callback((Fl_Callback*)cb_gridspaceSlider);
o->align(FL_ALIGN_LEFT|FL_ALIGN_WRAP);
o->value(label_gridspacing);
}
{Fl_Check_Button* o = autoArrButton = new Fl_Check_Button(25, 215, 222, 20, _("Auto arrange icons"));
o->callback((Fl_Callback*)cb_autoArrButton);
o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP);
o->value(auto_arr);
}
{Fl_Check_Button* o = engageButton = new Fl_Check_Button(25, 190, 222, 20, _("Engage with just one click"));
o->callback((Fl_Callback*)cb_engageButton);
o->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE|FL_ALIGN_CLIP);
o->value(label_engage_1click);
}
{Fl_Check_Button* o = bg_color_check = new Fl_Check_Button(227, 17, 20, 18);
o->callback((Fl_Callback*)cb_bg_color_check);
o->tooltip(_("Clear this, to get transparent background."));
if(!label_trans) o->set_value();
}
o->end();
}
o->end();
}
o->end();
o->resizable(o);
}
w->show(argc, argv);
return Fl::run();
}
示例14: main
int main(int argc, char **argv)
{
signal(SIGCHLD, SIG_IGN);
signal(SIGSEGV, terminationHandler);
fl_init_locale_support("eworkpanel", PREFIX"/share/locale");
fl_init_images_lib();
int X=0,Y=0,W=Fl::w(),H=Fl::h();
int substract;
// Get current workarea
Fl_WM::get_workarea(X,Y,W,H);
//printf("Free area: %d %d %d %d\n", X,Y,W,H);
// We expect that other docks are moving away from panel :)
mPanelWindow = new Fl_Update_Window(X, Y+H-30, W, 30, "Workpanel");
mPanelWindow->layout_spacing(0);
// Panel is type DOCK
mPanelWindow->window_type(Fl_WM::DOCK);
mPanelWindow->setAutoHide(0);
// Read config
bool doShowDesktop;
pGlobalConfig.get("Panel", "ShowDesktop", doShowDesktop, false);
bool doWorkspaces;
pGlobalConfig.get("Panel", "Workspaces", doWorkspaces, true);
bool doRunBrowser;
pGlobalConfig.get("Panel", "RunBrowser", doRunBrowser, true);
bool doSoundMixer;
pGlobalConfig.get("Panel", "SoundMixer", doSoundMixer, true);
bool doCpuMonitor;
pGlobalConfig.get("Panel", "CPUMonitor", doCpuMonitor, true);
// Group that holds everything..
Fl_Group *g = new Fl_Group(0,0,0,0);
g->box(FL_DIV_UP_BOX);
g->layout_spacing(2);
g->layout_align(FL_ALIGN_CLIENT);
g->begin();
mSystemMenu = new MainMenu();
Fl_VertDivider *v = new Fl_VertDivider(0, 0, 5, 18, "");
v->layout_align(FL_ALIGN_LEFT);
substract = 5;
if ((doShowDesktop) || (doWorkspaces)) {
//this is ugly:
int size;
if ((doShowDesktop) && (doWorkspaces)) { size=48; } else { size=24; }
Fl_Group *g2 = new Fl_Group(0,0,size,22);
g2->box(FL_FLAT_BOX);
g2->layout_spacing(0);
g2->layout_align(FL_ALIGN_LEFT);
// Show desktop button
if (doShowDesktop) {
PanelButton *mShowDesktop;
mShowDesktop = new PanelButton(0, 0, 24, 22, FL_NO_BOX, FL_DOWN_BOX, "ShowDesktop");
mShowDesktop->layout_align(FL_ALIGN_LEFT);
mShowDesktop->label_type(FL_NO_LABEL);
mShowDesktop->align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER);
mShowDesktop->image(showdesktop_pix);
mShowDesktop->tooltip(_("Show desktop"));
mShowDesktop->callback( (Fl_Callback*)cb_showdesktop);
mShowDesktop->show();
substract += 26;
}
// Workspaces panel
if (doWorkspaces) {
mWorkspace = new PanelMenu(0, 0, 24, 22, FL_NO_BOX, FL_DOWN_BOX, "WSMenu");
mWorkspace->layout_align(FL_ALIGN_LEFT);
mWorkspace->label_type(FL_NO_LABEL);
mWorkspace->align(FL_ALIGN_INSIDE|FL_ALIGN_CENTER);
mWorkspace->image(desktop_pix);
mWorkspace->tooltip(_("Workspaces"));
mWorkspace->end();
substract += 26;
}
g2->end();
g2->show();
g2->resizable();
v = new Fl_VertDivider(0, 0, 5, 18, "");
v->layout_align(FL_ALIGN_LEFT);
substract += 5;
}
// Run browser
if (doRunBrowser) {
runBrowser = new Fl_Input_Browser("",100,FL_ALIGN_LEFT,30);
//runBrowser->image(run_pix);
//runBrowser->box(FL_THIN_DOWN_BOX);
// Added _ALWAYS so callback is in case:
//.........这里部分代码省略.........