예제 #1
0
파일: slider.c 프로젝트: LiberatorUSA/GUCEF
AG_Slider *
AG_SliderNewUint16(void *parent, enum ag_slider_type type, Uint flags, Uint16 *val, Uint16 *min, Uint16 *max)
{
	AG_Slider *sl = AG_SliderNew(parent, type, flags);
	if (val != NULL) { AG_BindUint16(sl, "value", val); }
	if (min != NULL) { AG_BindUint16(sl, "min", min); }
	if (max != NULL) { AG_BindUint16(sl, "max", max); }
	return (sl);
}
예제 #2
0
파일: button.c 프로젝트: varialus/agar
AG_Button *
AG_ButtonNewUint16(void *parent, Uint flags, const char *caption, Uint16 *v)
{
	AG_Button *bu = AG_ButtonNewS(parent, flags, caption);
	AG_BindUint16(bu, "state", v);
	return (bu);
}
예제 #3
0
static void OnConfigMenuScreen(struct gui_disp *cfg, AG_NotebookTab *parent)
{
	AG_Radio *radio;
	AG_Checkbox *check;
	AG_Numerical *fps;
	AG_Box *box;
	AG_Box *box2;
        AG_Combo *combo;
        AG_TlistItem *TlistItem[RENDERING_END];
	int i;
	int limit;
	
	box = AG_BoxNewHoriz(AGWIDGET(parent), AG_BOX_VFILL);
	{
		radio = AG_RadioNewFn(AGWIDGET(box), 0, ScreenSizeName, OnChangeScreenReso, "%p", cfg);
		limit = sizeof(ScreenSizeHeight) / sizeof(WORD);
		for(i = 0; i <= limit; i++){
		  if((ScreenSizeWidth[i] == cfg->uWidth) && (ScreenSizeHeight[i] == cfg->uHeight)) break;
		}
		if(i >= limit) i = 2;
		AG_SetInt(radio, "value", i);
		box = AG_BoxNewVert(AGWIDGET(parent), AG_BOX_HFILL);
		fps = AG_NumericalNewS(AGWIDGET(box), AG_NUMERICAL_HFILL, NULL ,gettext("Display rate"));
		AG_BindUint16(fps, "value", &(cfg->nDrawFPS));
		{
		  AG_SetInt(fps, "min", 2);
		  AG_SetInt(fps, "max", 75);
		  AG_SetInt(fps, "inc", 1);
		}

		fps = AG_NumericalNewS(AGWIDGET(box), AG_NUMERICAL_HFILL, NULL ,gettext("Emulation rate"));
		AG_BindUint16(fps, "value", &(cfg->nEmuFPS));
		{
		  AG_SetInt(fps, "min", 2);
		  AG_SetInt(fps, "max", 75);
		  AG_SetInt(fps, "inc", 1);
		}

	   
		box2 = AG_BoxNewHoriz(AGWIDGET(box), AG_BOX_HFILL);
		combo = AG_ComboNewS(AGWIDGET(box2), AG_COMBO_SCROLLTOSEL | AG_COMBO_HFILL, gettext("Rendering Method"));
	        AG_ComboSizeHint(combo, "XXXXXXXXXXXXXX", RENDERING_END); 
	        TlistItem[0] = AG_TlistAddPtrHead(combo->list, NULL, gettext("Full Draw"),   (void *)&RenderMethodsList[0]);
	        TlistItem[1] = AG_TlistAddPtr(combo->list,     NULL, gettext("Diff Block"),  (void *)&RenderMethodsList[1]);
	        TlistItem[2] = AG_TlistAddPtr(combo->list,     NULL, gettext("Diff Raster"), (void *)&RenderMethodsList[2]);
	        for(i = RENDERING_FULL; i < RENDERING_END; i++) {
		   if(i == cfg->nRenderMethod) {
			AG_ComboSelect(combo, TlistItem[i]);
		   }
		}
		AG_SetEvent(combo, "combo-selected", RenderMethodSelected, "%p", cfg);
	   
		box2 = AG_BoxNewHoriz(AGWIDGET(box), AG_BOX_HFILL);
		check = AG_CheckboxNewInt(AGWIDGET(box2), AG_CHECKBOX_HFILL, gettext("Full Scan (15KHz)"), &(cfg->bFullScan));
		box2 = AG_BoxNewHoriz(AGWIDGET(box), AG_BOX_HFILL);
		check = AG_CheckboxNewInt(AGWIDGET(box2), AG_CHECKBOX_HFILL, gettext("SMOOSING"), &(cfg->bSmoosing));
		box2 = AG_BoxNewHoriz(AGWIDGET(box), AG_BOX_HFILL);
		check = AG_CheckboxNewInt(AGWIDGET(box2), AG_CHECKBOX_HFILL, gettext("Use OpenCL(Need REBOOT)"), &(cfg->bUseOpenCL));
		box2 = AG_BoxNewHoriz(AGWIDGET(box), AG_BOX_HFILL);
		check = AG_CheckboxNewInt(AGWIDGET(box2), AG_CHECKBOX_HFILL, gettext("Use SIMD instructions(Need REBOOT)"), &(cfg->bUseSIMD));
	}
}
예제 #4
0
void
agar_gui_widget_bind_uint16 (AG_Widget *w, const char *binding,
  Uint16 *val)
{
  AG_BindUint16 (w, binding, val);
}