Ejemplo n.º 1
0
tAxWin3_Widget *make_textbutton(tAxWin3_Widget *Parent, const char *Label, tAxWin3_Widget_FireCb handler)
{
	tAxWin3_Widget	*ret, *txt;
	ret = AxWin3_Widget_AddWidget(Parent, ELETYPE_BUTTON, ELEFLAG_ALIGN_CENTER, "_btn");
	AxWin3_Widget_SetFireHandler(ret, handler);
	AxWin3_Widget_AddWidget(ret, ELETYPE_NONE, 0, "_spacer1");
	txt = AxWin3_Widget_AddWidget(ret, ELETYPE_TEXT, ELEFLAG_NOSTRETCH|ELEFLAG_NOEXPAND, "_txt");
	AxWin3_Widget_SetText(txt, Label);
	AxWin3_Widget_AddWidget(ret, ELETYPE_NONE, 0, "_spacer2");
	return ret;
}
Ejemplo n.º 2
0
Archivo: main.c Proyecto: berkus/acess2
void add_toolbar_button(tAxWin3_Widget *Toolbar, const char *Ident, tAxWin3_Widget_FireCb Callback)
{
	tAxWin3_Widget *btn = AxWin3_Widget_AddWidget(Toolbar, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH, Ident);
	const char *img = getimg(Ident);
	if( img )
	{
		tAxWin3_Widget *txt = AxWin3_Widget_AddWidget(btn, ELETYPE_IMAGE, 0, Ident);
		AxWin3_Widget_SetText(txt, img);
		// TODO: tooltip?
	}
	else
	{
		tAxWin3_Widget *txt = AxWin3_Widget_AddWidget(btn, ELETYPE_TEXT, 0, Ident);
		AxWin3_Widget_SetText(txt, getstr(Ident));
	}
	AxWin3_Widget_SetFireHandler(btn, Callback);
}
Ejemplo n.º 3
0
void create_run_dialog(void)
{
	tAxWin3_Widget	*root, *box;
	
	gRunDialog = AxWin3_Widget_CreateWindow(NULL, RUN_WIDTH, RUN_HEIGHT, ELEFLAG_VERTICAL);
	AxWin3_SetWindowTitle(gRunDialog, "Run Program...");
	AxWin3_MoveWindow(gRunDialog, giScreenWidth/2-RUN_WIDTH/2, giScreenHeight/2-RUN_HEIGHT/2);

	root = AxWin3_Widget_GetRoot(gRunDialog);

	gRunInput = AxWin3_Widget_AddWidget(root, ELETYPE_TEXTINPUT, ELEFLAG_NOSTRETCH, "Input");
	AxWin3_Widget_SetFireHandler(gRunInput, run_dorun);
	
	box = AxWin3_Widget_AddWidget(root, ELETYPE_BOX, ELEFLAG_ALIGN_CENTER, "Button Area");
	make_textbutton(box, "Ok", run_dorun);
	make_textbutton(box, "Cancel", run_close);
}
Ejemplo n.º 4
0
void create_sidebar(void)
{
	tAxWin3_Widget	*btn, *txt, *ele;

	// Create sidebar
	gSidebar = AxWin3_Widget_CreateWindow(NULL, SIDEBAR_WIDTH, giScreenHeight, ELEFLAG_VERTICAL);
	AxWin3_MoveWindow(gSidebar, 0, 0);
	gSidebarRoot = AxWin3_Widget_GetRoot(gSidebar);	

	// - Main menu
	btn = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH, "SystemButton");
	AxWin3_Widget_SetSize(btn, SIDEBAR_WIDTH);
	AxWin3_Widget_SetFireHandler(btn, systembutton_fire);
	txt = AxWin3_Widget_AddWidget(btn, ELETYPE_IMAGE, 0, "SystemLogo");
	AxWin3_Widget_SetText(txt, "file:///Acess/Apps/AxWin/3.0/AcessLogoSmall.sif");
	
	// - Plain <hr/> style spacer
	ele = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Top");
	AxWin3_Widget_SetSize(ele, 4);

	// TODO: Program list
	gWindowList = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_BOX, ELEFLAG_VERTICAL, "ProgramList");

	// - Plain <hr/> style spacer
	ele = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Top");
	AxWin3_Widget_SetSize(ele, 4);

	// > Version/Time
	ele = AxWin3_Widget_AddWidget(gSidebarRoot,
		ELETYPE_BOX,
		ELEFLAG_VERTICAL|ELEFLAG_ALIGN_CENTER|ELEFLAG_NOSTRETCH,
		"Version/Time"
		);
	gTimeDisplay = AxWin3_Widget_AddWidget(ele, ELETYPE_TEXT, ELEFLAG_NOSTRETCH, "Time");
	AxWin3_Widget_SetSize(gTimeDisplay, 20);
	//AxWin3_Widget_SetText(gTimeDisplay, "--:--");
	update_time();

	// Turn off decorations
	AxWin3_DecorateWindow(gSidebar, 0);

	// Show!
	AxWin3_ShowWindow(gSidebar, 1);	
	
}