Wed Nov 24 20:11:57 GMT 1999

(gilbertt)

E-UrlWatch.

Now displays the url it launches, and scrolls long urls back and forth, so
you can see 'em.


SVN revision: 1391
This commit is contained in:
Tom Gilbert 1999-11-24 17:13:47 +00:00
parent a5df9b1bdb
commit b00a41b4e9
3 changed files with 62 additions and 13 deletions

View File

@ -827,3 +827,13 @@ ignore that :)
More cool stuff to come :)
-------------------------------------------------------------------------------
Wed Nov 24 20:11:57 GMT 1999
(gilbertt)
E-UrlWatch.
Now displays the url it launches, and scrolls long urls back and forth, so
you can see 'em.

View File

@ -27,6 +27,8 @@
#include "cloak.h"
#include "E-UrlWatch.h"
static void display_string (char *string);
static void
choose_random_cloak (void *data)
{
@ -438,18 +440,58 @@ save_url (char *url)
static void
reset_string (void *data)
{
Epplet_change_label (lbl_url, "E-UrlWatch");
display_string("E-UrlWatch");
return;
data = NULL;
}
static void
scroll_string(void *data)
scroll_string (void *data)
{
Epplet_change_label (lbl_url, dtext.str);
char buf[20];
static int back = 0;
static int pause = 0;
return;
data=NULL;
if(dtext.len > 19)
{
if (dtext.pos > (dtext.len - 19))
{
dtext.pos = dtext.len - 19;
back = 1;
pause = 1;
}
else if (dtext.pos == 0)
{
back = 0;
pause = 1;
}
Esnprintf (buf, sizeof (buf), "%s", dtext.str + dtext.pos);
if (!back)
dtext.pos += 1;
else
dtext.pos -= 1;
Epplet_change_label (lbl_url, buf);
}
else
{
Epplet_change_label (lbl_url, dtext.str);
}
if (pause)
{
Epplet_timer (scroll_string, NULL, 1.0, "SCROLL_TIMER");
pause = 0;
}
else
Epplet_timer (scroll_string, NULL, 0.3, "SCROLL_TIMER");
Esync ();
return;
data = NULL;
}
static void
@ -460,9 +502,8 @@ display_string (char *string)
dtext.str = _Strdup (string);
dtext.len = strlen (string);
dtext.pos = 0;
Epplet_change_label (lbl_url, string);
Epplet_timer (scroll_string, NULL, 0.1, "SCROLL_TIMER");
Epplet_timer (reset_string, NULL, 10, "RESET_TIMER");
Epplet_timer (reset_string, NULL, 20, "RESET_TIMER");
}
static void
@ -536,9 +577,7 @@ cb_color (void *data)
static void
create_epplet_layout (void)
{
Epplet_gadget_show (lbl_url =
Epplet_create_label (2, 34, "Welcome to E-UrlWatch :-)",
0));
Epplet_gadget_show (lbl_url = Epplet_create_label (2, 34, " ", 0));
Epplet_gadget_show (btn_close =
Epplet_create_button (NULL, NULL, 2,
@ -638,9 +677,9 @@ create_epplet_layout (void)
set_flame_col (0);
if (opt.do_cloak)
Epplet_timer (cloak_epplet, NULL, opt.cloak_delay, "CLOAK_TIMER");
Epplet_timer (reset_string, NULL, 10, "RESET_TIMER");
Epplet_register_mouse_enter_handler (cb_in, (void *) win);
Epplet_register_mouse_leave_handler (cb_out, NULL);
display_string ("Welcome to E-UrlWatch ;-)");
}
static void

View File

@ -22,8 +22,8 @@ int rand_delays[] = {
struct
{
char *str;
int len;
int pos;
unsigned int len;
unsigned int pos;
}dtext;
struct