Sat Dec 04 12:38:14 GMT 1999

(gilbertt)

Okay. E-ScreenSave now has a working config window which actually changes
the things config! Its really basic, 'cos the epplet is really basic, but it
works. Press the configure button to see it :)

It has working Ok, Apply and Cancel buttons, try them and see. There is
always a dilemna over how stuff like this should work, but in my epplets at
least, cancel undoes everything you changed since opening the window, even
stuff you "apply"ed. See it for yourself, it was really easy to do ;)

Hey StriderZ, there's a textbox on there too :) I'll be talking to you later
about that =P


SVN revision: 1495
This commit is contained in:
Tom Gilbert 1999-12-04 08:16:16 +00:00
parent eeaff8aff5
commit 4c98b7a9dc
2 changed files with 66 additions and 32 deletions

View File

@ -1317,3 +1317,20 @@ more rich over the next few days, then it should stabilise.
Any feature suggestions, send 'em now :)
-------------------------------------------------------------------------------
Sat Dec 04 12:38:14 GMT 1999
(gilbertt)
Okay. E-ScreenSave now has a working config window which actually changes
the things config! Its really basic, 'cos the epplet is really basic, but it
works. Press the configure button to see it :)
It has working Ok, Apply and Cancel buttons, try them and see. There is
always a dilemna over how stuff like this should work, but in my epplets at
least, cancel undoes everything you changed since opening the window, even
stuff you "apply"ed. See it for yourself, it was really easy to do ;)
Hey StriderZ, there's a textbox on there too :) I'll be talking to you later
about that =P

View File

@ -29,6 +29,7 @@
#include "E-ScreenSave.h"
Window confwin = 0;
Epplet_gadget txt;
static void
choose_random_cloak (void *data)
@ -332,10 +333,21 @@ delete_cb (void *data, Window win)
data = NULL;
}
static void
apply_config (void)
{
if(opt.lock_cmd)
free(opt.lock_cmd);
opt.lock_cmd=_Strdup(Epplet_textbox_contents(txt));
return;
}
static void
ok_cb (void *data)
{
printf ("Ok pressed\n");
apply_config ();
save_config ();
Epplet_window_destroy (confwin);
confwin = 0;
@ -346,8 +358,7 @@ ok_cb (void *data)
static void
apply_cb (void *data)
{
printf ("Apply pressed\n");
apply_config ();
return;
data = NULL;
}
@ -355,23 +366,18 @@ apply_cb (void *data)
static void
cancel_cb (void *data)
{
printf ("Cancel pressed\n");
Epplet_window_destroy (confwin);
confwin = 0;
load_config ();
return;
data = NULL;
}
/* Amongst all the fluff, this is the bit that does the actual work. */
static void
cb_shoot (void *data)
cb_config (void *data)
{
static int temp = 20;
static int temp2 = 50;
static int temp3 = 80;
Epplet_gadget sld, sld2, sld3, lbl, lbl2;
Epplet_gadget lbl1, lbl2, btn_anim;
if (confwin)
return;
@ -381,33 +387,37 @@ cb_shoot (void *data)
&confwin, apply_cb, &confwin, cancel_cb,
&confwin);
Epplet_gadget_show (lbl =
Epplet_create_label (20, 10,
"This window was created using Epplet_create_window_config.",
Epplet_gadget_show (lbl1 =
Epplet_create_label (40, 20,
"Please choose a cloak animation",
2));
Epplet_gadget_show (btn_anim =
Epplet_create_popupbutton (NULL,
NULL, 20,
20, 12, 12, "ARROW_DOWN",
p));
Epplet_gadget_show (lbl2 =
Epplet_create_label (20, 25,
"I added this text and the sliders myself.",
2));
Epplet_create_label (20, 45,
"Screensaver lock command:", 2));
Epplet_gadget_show (txt =
Epplet_create_textbox (NULL, opt.lock_cmd, 20, 65, 250,
20, 2, NULL, NULL));
Epplet_gadget_show (sld =
Epplet_create_hslider (20, 50, 100, 0, 100, 1, 5, &temp,
NULL, NULL));
Epplet_gadget_show (sld2 =
Epplet_create_hslider (20, 100, 200, 0, 100, 1, 5,
&temp2, NULL, NULL));
Epplet_gadget_show (sld3 =
Epplet_create_hslider (20, 150, 300, 0, 100, 1, 5,
&temp3, NULL, NULL));
Epplet_window_show (confwin);
Epplet_window_pop_context ();
#if 0
return;
data = NULL;
}
/* Amongst all the fluff, this is the bit that does the actual work. */
static void
cb_shoot (void *data)
{
if (opt.lock_cmd)
system (opt.lock_cmd);
#endif
return;
data = NULL;
@ -538,10 +548,17 @@ create_epplet_layout (void)
cb_save_delay, (void *) (&(save_delays[12])));
Epplet_add_popup_entry (stimer_p, "10 mins", NULL,
cb_save_delay, (void *) (&(save_delays[13])));
#if 0
Epplet_gadget_show (btn_conf =
Epplet_create_popupbutton (NULL,
NULL, 34,
2, 12, 12, "CONFIGURE", p));
#endif
Epplet_gadget_show (btn_conf =
Epplet_create_button (NULL,
NULL, 34,
2, 12, 12, "CONFIGURE", 0, NULL,
cb_config, NULL));
Epplet_gadget_show (btn_col =
Epplet_create_popupbutton (NULL,
EROOT
@ -551,14 +568,14 @@ create_epplet_layout (void)
Epplet_create_popupbutton (NULL,
EROOT
"/epplet_data/E-ScreenShoot/E-ScreenShoot_minitime.png",
17, 17,
13, 13, NULL, ctimer_p));
17, 17, 13, 13, NULL,
ctimer_p));
Epplet_gadget_show (btn_stimer =
Epplet_create_popupbutton (NULL,
EROOT
"/epplet_data/E-ScreenShoot/E-ScreenShoot_minitime2.png",
33, 17,
13, 13, NULL, stimer_p));
33, 17, 13, 13, NULL,
stimer_p));
da = Epplet_create_drawingarea (2, 2, 44, 44);
win = Epplet_get_drawingarea_window (da);
buf = Epplet_make_rgb_buf (40, 40);