Added a symbol named 'recycle' that can be used to refresh directory listings, etc.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4390 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2005-06-01 13:41:01 +00:00
parent 510545879b
commit daa8f53397
2 changed files with 37 additions and 2 deletions

View File

@ -36,6 +36,7 @@
#include <FL/Fl.H>
#include <FL/fl_draw.H>
#include <FL/math.h>
#include "flstring.h"
typedef struct {
@ -575,6 +576,38 @@ static void draw_fileprint(Fl_Color c) {
EC;
}
static void draw_recycle(Fl_Color c) {
double i, r, di=5.0, dr1=0.005, dr2=0.015;
int j;
for (j=0; j<4; j++) {
fl_rotate(180.0);
if (j&2) {
fl_color(c);
set_outline_color(c);
BC;
} else {
fl_color(c);
BCP;
}
vv(-0.1, 0.0);
vv(-1.0, 0.0);
vv(-1.0, 0.9);
for (i=135.0, r=1.0; i>=0.0; i-=di, r-=dr1) {
double a = i/180.0 * M_PI;
vv(cos(a)*r, sin(a)*r);
}
for (i=0.0; i<=135.0; i+=di, r-=dr2) {
double a = i/180.0 * M_PI;
vv(cos(a)*r, sin(a)*r);
}
if (j&2) {
EC;
} else {
ECP;
}
}
}
static void fl_init_symbols(void) {
static char beenhere;
if (beenhere) return;
@ -616,6 +649,7 @@ static void fl_init_symbols(void) {
fl_add_symbol("filesave", draw_filesave, 1);
fl_add_symbol("filesaveas", draw_filesaveas, 1);
fl_add_symbol("fileprint", draw_fileprint, 1);
fl_add_symbol("recycle", draw_recycle, 1);
// fl_add_symbol("file", draw_file, 1);
}

View File

@ -38,8 +38,8 @@
int N = 0;
#define W 70
#define H 70
#define ROWS 8
#define COLS 4
#define ROWS 6
#define COLS 6
Fl_Window *window;
Fl_Value_Slider *orientation;
@ -126,6 +126,7 @@ bt("@fileopen");
bt("@filesave");
bt("@filesaveas");
bt("@fileprint");
bt("@recycle");
orientation = new Fl_Value_Slider(
(int)(window->w()*.05+.5), window->h()-40,