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


C++ Fl_Tabs::begin方法代码示例

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


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

示例1: OnAddCommunity

//callback for add Community
void OnAddCommunity(Fl_Widget* pWidget,void * pParam)
{
    const char * scName=fl_input("New Community Name", "");
    if(scName==NULL)
        return ;
    
    char * sName = new char[strlen(scName)*2];
    strcpy(sName,scName);
    
    Fl_Tabs* pTab = (Fl_Tabs*)(pParam);
    Fl_Group* pG = (Fl_Group*)pTab->value();
    
    pTab->begin();
    MakeCommunityPane(10,30,pG->w()-20,pG->h()-10,sName);
    pTab->end();
    
}
开发者ID:HSOFEUP,项目名称:MOOS-IvP-releases,代码行数:18,代码来源:uMS.cpp

示例2: main

int main(int argc, char **argv) {
#ifdef HAVE_XKBRULES
	/* must be opened first */
	fl_open_display();

	/* only apply what was written in config */
	if(argc > 1 && strcmp(argv[1], "--apply") == 0) {
		String layout;

		read_config(&layout);
		apply_changes_on_x(layout.c_str(), NULL);
		return 0;
	} else {
		read_config(NULL);
	}

	EDE_APPLICATION("ede-keyboard-conf");

	String cl;
	dialog_canceled = false;

	/* get layout X holds */
	fetch_current_layout(cl);

	/* construct GUI */
	win = new AppWindow(340, 320, _("Keyboard configuration tool"));
	win->begin();
		Fl_Tabs *tabs = new Fl_Tabs(10, 10, 320, 265);
		tabs->begin();
			Fl_Group *layout_group = new Fl_Group(15, 30, 310, 240, _("Layout"));
			layout_group->begin();
				layout_browser = new Fl_Hold_Browser(20, 40, 300, 190);

				/* so things can be nicely aligned per column */
				int cwidths [] = {100, 0};
				layout_browser->column_widths(cwidths);
				layout_browser->column_char('\t');

				layout_group->resizable(layout_browser);

				show_flag = new Fl_Check_Button(20, 240, 300, 25, _("Show country flag"));
				show_flag->tooltip(_("Display country flag in panel keyboard applet"));
				show_flag->down_box(FL_DOWN_BOX);
				show_flag->value(show_flag_value);
				show_flag->callback(show_flag_cb);
			layout_group->end();
			Fl_Group::current()->resizable(layout_group);

			Fl_Group *details_group = new Fl_Group(15, 30, 310, 240, _("Details"));
			details_group->hide();
			details_group->begin();
				repeat_press = new Fl_Check_Button(20, 45, 300, 25, _("Repeat pressed key"));
				repeat_press->tooltip(_("Allow pressed key to be repeated"));
				repeat_press->down_box(FL_DOWN_BOX);
				repeat_press->value(repeat_press_value);
				repeat_press->callback(repeat_press_cb);
			details_group->end();
		tabs->end();

		/* resizable box */
		Fl_Box *rbox = new Fl_Box(30, 163, 65, 52);
		Fl_Group::current()->resizable(rbox);

		Fl_Button *ok_button = new Fl_Button(145, 285, 90, 25, _("&OK"));
		ok_button->callback(ok_cb);

		Fl_Button *cancel_button = new Fl_Button(240, 285, 90, 25, _("&Cancel"));
		cancel_button->callback(cancel_cb);
	win->end();

	/* read all XKB layouts */
	XkbRF_RulesPtr xkb_rules = fetch_all_layouts(cl);

	window_center_on_screen(win);
	win->show(argc, argv);
	Fl::run();

	/* do not save configuration if was canceled */
	if(!dialog_canceled && xkb_rules && layout_browser->value()) {
		int  i = layout_browser->value();
		/* get the layout that matches browser row */
		char *n  = xkb_rules->layouts.desc[i - 1].name;

		save_config(n);
		apply_changes_on_x(n, &cl);
	}

	if(xkb_rules) 
		XkbRF_Free(xkb_rules, True);

#else
	alert(_("ede-keyboard-conf was compiled without XKB extension. Please recompile it again"));
#endif /* HAVE_XKBRULES */

	return 0;
}
开发者ID:edeproject,项目名称:ede,代码行数:96,代码来源:ede-keyboard-conf.cpp

示例3: icon_dialog_icon_edit

void icon_dialog_icon_edit(Desktop *self, DesktopIcon *d) {
	const char  *lbl = d ? _("Edit desktop icon") : _("Create desktop icon");
	DesktopFile *df  = NULL;
	char        *buf = NULL;
	old_desktop_path = "";
	curr_icon        = d;
	
	if(d) {
		df = new DesktopFile();
		if(!df->load(d->get_path())) {
			delete df;
			df = NULL;

			int ret = ask(_("Unable to load .desktop file for this icon. Would you like to create a new icon instead?"));
			if(!ret) return;

			/* force NULL on icon, so we can run dialog in 'create' mode */
			d = NULL;
		}
		
		buf = new char[BUFSIZE];
		old_desktop_path = d->get_path();
	}
	
	win = new Fl_Window(450, 220, lbl);
	Fl_Tabs *tabs = new Fl_Tabs(10, 10, 430, 165);
	tabs->begin();
		Fl_Group *g1 = new Fl_Group(15, 30, 415, 140, _("Basic"));
		g1->begin();
			img = new Fl_Button(20, 45, 80, 75);
			img->callback(img_browse_cb);
			img->tooltip(_("Click to select icon"));
			
			if(d) {
				E_ASSERT(df != NULL);
				if(df->icon(buf, BUFSIZE)) {
					IconLoader::set(img, buf, ICON_SIZE_HUGE);
					img_path = buf;
				} 
			}

			/* handles even the case when we are creating the new icon */
			if(!img->image()) {
				IconLoader::set(img, DEFAULT_ICON, ICON_SIZE_HUGE);
				img_path = DEFAULT_ICON;
			}
			
			name = new Fl_Input(210, 45, 215, 25, _("Name:"));
			if(d && df->name(buf, BUFSIZE)) name->value(buf);
			
			comment = new Fl_Input(210, 75, 215, 25, _("Comment:"));
			if(d && df->comment(buf, BUFSIZE)) comment->value(buf);
			
			execute = new Fl_Input(210, 105, 185, 25, _("Execute:"));
			if(d && df->exec(buf, BUFSIZE)) execute->value(buf);
			
			browse = new Fl_Button(400, 105, 25, 25, "...");
			browse->callback(file_browse_cb);
			
			icon_type = new Fl_Choice(210, 135, 215, 25, _("Type:"));
			icon_type->down_box(FL_BORDER_BOX);
			icon_type->menu(menu_items);
		g1->end();		   
		
		Fl_Group *g2 = new Fl_Group(15, 30, 420, 140, _("Details"));
		g2->hide();
		g2->begin();
			run_in_terminal = new Fl_Check_Button(195, 80, 235, 25, _("Run in terminal"));
			run_in_terminal->down_box(FL_DOWN_BOX);
			if(df) run_in_terminal->value(df->terminal());

			workdir = new Fl_Input(195, 45, 205, 25, _("Working directory:"));
			if(df && df->path(buf, BUFSIZE)) workdir->value(buf);

			Fl_Button *browsedir = new Fl_Button(405, 45, 25, 25, "...");
			browsedir->callback(dir_browse_cb);

			start_notify = new Fl_Check_Button(195, 110, 235, 25, _("Use startup notification"));
			start_notify->down_box(FL_DOWN_BOX);
			if(df) start_notify->value(df->startup_notify());
		g2->end();
	tabs->end();	

	ok = new Fl_Button(255, 185, 90, 25, _("&OK"));
	ok->callback(ok_cb, self);
	cancel = new Fl_Button(350, 185, 90, 25, _("&Cancel"));
	cancel->callback(cancel_cb);

	win->end();
	win->set_modal();
	
	delete df;
	delete buf;

	Fl::focus(name);
	win->show();
}
开发者ID:GustavoMOG,项目名称:ede,代码行数:97,代码来源:IconDialog.cpp

示例4: show_icon_properties_dialog

void show_icon_properties_dialog(DesktopIcon* dicon) {
	// fetch usefull data
	DesktopIconData data;
	study_and_fill(dicon, &data);

	// now construct dialog and fill it
	edelib::Window* win = new edelib::Window(315, 395, _("Icon properties"));
	win->begin();
		Fl_Tabs* tabs = new Fl_Tabs(10, 10, 295, 340);
		tabs->begin();
			Fl_Group* g1 = new Fl_Group(15, 35, 285, 310, _("General"));
			g1->begin();
				Fl_Button* icon_button = new Fl_Button(20, 50, 75, 75);
				icon_button->image(data.image);
				icon_button->callback((Fl_Callback*)icon_change_cb, &data);
				icon_button->tooltip(_("Click to change icon"));

				Fl_Input* prog_name = new Fl_Input(100, 75, 195, 25);
				prog_name->value(data.label);

				Fl_Output* prog_mime = new Fl_Output(100, 150, 195, 25, _("Type:"));
				prog_mime->box(FL_FLAT_BOX);
				prog_mime->color(FL_BACKGROUND_COLOR);
				prog_mime->value(data.type.c_str());

				Fl_Output* prog_location = new Fl_Output(100, 180, 195, 25, _("Location:"));
				prog_location->box(FL_FLAT_BOX);
				prog_location->color(FL_BACKGROUND_COLOR);
				prog_location->value(data.location);

				Fl_Output* prog_size  = new Fl_Output(100, 210, 195, 25, _("Size:"));
				prog_size->box(FL_FLAT_BOX);
				prog_size->color(FL_BACKGROUND_COLOR);
				prog_size->value(data.size.c_str());

				Fl_Output* prog_date_mod = new Fl_Output(100, 240, 195, 25, _("Modified:"));
				prog_date_mod->box(FL_FLAT_BOX);
				prog_date_mod->color(FL_BACKGROUND_COLOR);
				prog_date_mod->value(data.time_mod.c_str());

				Fl_Output* prog_date_acessed = new Fl_Output(100, 270, 195, 25, "Accessed:");
				prog_date_acessed->box(FL_FLAT_BOX);
				prog_date_acessed->color(FL_BACKGROUND_COLOR);
				prog_date_acessed->value(data.time_access.c_str());
			g1->end();

			Fl_Group* g2 = new Fl_Group(15, 35, 285, 310, _("URL"));
			g2->hide();
			g2->begin();
				Fl_Input* prog_url = new Fl_Input(20, 65, 245, 25, _("URL:"));
				prog_url->align(FL_ALIGN_TOP_LEFT);

				Fl_Button* prog_browse = new Fl_Button(270, 65, 25, 25);
				prog_browse->tooltip(_("Browse location"));

				// set icon for browse button
				if(!edelib::IconLoader::set(prog_browse, "document-open", edelib::ICON_SIZE_TINY))
					prog_browse->label("...");

			g2->end();
		tabs->end();

		Fl_Button* ok_button = new Fl_Button(120, 360, 90, 25, _("&OK"));
		ok_button->callback(ok_cb, win);
		Fl_Button* cancel_button = new Fl_Button(215, 360, 90, 25, _("&Cancel"));
		cancel_button->callback(close_cb, win);
    win->end();
	win->show();

	while(win->shown())
		Fl::wait();
}
开发者ID:edeproject,项目名称:svn,代码行数:72,代码来源:IconProperties.cpp


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