Ejemplo n.º 1
0
static eint spinbn_keydown(eHandle hobj, GalEventKey *ent)
{
	GuiSpinBtn *spin = GUI_SPINBTN_DATA(hobj);

	switch (ent->code) {
		case GAL_KC_Up:
			spinbn_right_value(spin);
			spinbn_set_value(spin, spin->value + spin->step_inc);
			return -1;

		case GAL_KC_Down:
			spinbn_right_value(spin);
			spinbn_set_value(spin, spin->value - spin->step_inc);
			return -1;

		default: break;
	}
	return hbox_keydown(hobj, ent);
}
Ejemplo n.º 2
0
static void spinbn_right_value(GuiSpinBtn *spin)
{
	GuiEntry *entry = GUI_ENTRY_DATA(spin->entry);
	echar buf[entry->nchar + 1];

	e_memcpy(buf, entry->chars, entry->nchar);
	buf[entry->nchar] = 0;

	spinbn_set_value(spin, e_atof(buf));
}
Ejemplo n.º 3
0
static void spinbn_right_value(GuiSpinBtn *spin)
{
	GuiEntry *entry = GUI_ENTRY_DATA(spin->entry);
#ifdef linux
	echar buf[entry->nchar + 1];
#else
	echar buf[1024];
#endif

	e_memcpy(buf, entry->chars, entry->nchar);
	buf[entry->nchar] = 0;

	spinbn_set_value(spin, (efloat)e_atof(buf));
}