Add filenew, fileopen, filesave, filesaveas, and fileprint symbols.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4302 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2005-04-30 03:02:04 +00:00
parent 671ef36117
commit 28d2c320c9
3 changed files with 218 additions and 1 deletions

View File

@ -2,6 +2,9 @@ CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #648, STR #692, STR #730, STR
#744, STR #745)
- Added "filenew", "fileopen", "filesave", "filesaveas",
and "fileprint" symbols with standard toolbar
symbology.
- Updated Fl_Tabs to check the contrast of the label
color against the tab background, and to highlight the
top 5 lines of the tab pane with the selection color so

View File

@ -374,6 +374,207 @@ static void draw_menu(Fl_Color col)
rectangle(-0.65, -0.6, 0.65, -1.0, col);
}
// Standard UI icons...
static void draw_filenew(Fl_Color c) {
fl_color(c);
BCP;
vv(-0.7, -1.0);
vv(0.1, -1.0);
vv(0.1, -0.4);
vv(0.7, -0.4);
vv(0.7, 1.0);
vv(-0.7, 1.0);
ECP;
fl_color(fl_lighter(c));
BP;
vv(0.1, -1.0);
vv(0.1, -0.4);
vv(0.7, -0.4);
EP;
fl_color(fl_darker(c));
BC;
vv(-0.7, -1.0);
vv(0.1, -1.0);
vv(0.1, -0.4);
vv(0.7, -0.4);
vv(0.7, 1.0);
vv(-0.7, 1.0);
EC;
BL;
vv(0.1, -1.0);
vv(0.7, -0.4);
EL;
}
static void draw_fileopen(Fl_Color c) {
fl_color(c);
BP;
vv(-1.0, -0.7);
vv(-0.9, -0.8);
vv(-0.4, -0.8);
vv(-0.3, -0.7);
vv(0.6, -0.7);
vv(0.6, 0.7);
vv(-1.0, 0.7);
EP;
fl_color(fl_darker(c));
BC;
vv(-1.0, -0.7);
vv(-0.9, -0.8);
vv(-0.4, -0.8);
vv(-0.3, -0.7);
vv(0.6, -0.7);
vv(0.6, 0.7);
vv(-1.0, 0.7);
EC;
fl_color(fl_lighter(c));
BP;
vv(-1.0, 0.7);
vv(-0.6, -0.3);
vv(1.0, -0.3);
vv(0.6, 0.7);
EP;
fl_color(fl_darker(c));
BC;
vv(-1.0, 0.7);
vv(-0.6, -0.3);
vv(1.0, -0.3);
vv(0.6, 0.7);
EC;
}
static void draw_filesave(Fl_Color c) {
fl_color(c);
BP;
vv(-0.9, -1.0);
vv(0.9, -1.0);
vv(1.0, -0.9);
vv(1.0, 0.9);
vv(0.9, 1.0);
vv(-0.9, 1.0);
vv(-1.0, 0.9);
vv(-1.0, -0.9);
EP;
fl_color(fl_lighter(c));
BP;
vv(-0.7, -1.0);
vv(0.7, -1.0);
vv(0.7, -0.4);
vv(-0.7, -0.4);
EP;
BP;
vv(-0.7, 0.0);
vv(0.7, 0.0);
vv(0.7, 1.0);
vv(-0.7, 1.0);
EP;
fl_color(c);
BP;
vv(-0.5, -0.9);
vv(-0.3, -0.9);
vv(-0.3, -0.5);
vv(-0.5, -0.5);
EP;
fl_color(fl_darker(c));
BC;
vv(-0.9, -1.0);
vv(0.9, -1.0);
vv(1.0, -0.9);
vv(1.0, 0.9);
vv(0.9, 1.0);
vv(-0.9, 1.0);
vv(-1.0, 0.9);
vv(-1.0, -0.9);
EC;
}
static void draw_filesaveas(Fl_Color c) {
draw_filesave(c);
fl_color(fl_color_average(c, FL_WHITE, 0.25f));
BP;
vv(0.6, -0.8);
vv(1.0, -0.4);
vv(0.0, 0.6);
vv(-0.4, 0.6);
vv(-0.4, 0.2);
EP;
fl_color(fl_darker(c));
BC;
vv(0.6, -0.8);
vv(1.0, -0.4);
vv(0.0, 0.6);
vv(-0.4, 0.6);
vv(-0.4, 0.2);
EC;
BP;
vv(-0.1, 0.6);
vv(-0.4, 0.6);
vv(-0.4, 0.3);
EP;
}
static void draw_fileprint(Fl_Color c) {
fl_color(c);
BP;
vv(-0.8, 0.0);
vv(0.8, 0.0);
vv(1.0, 0.2);
vv(1.0, 1.0);
vv(-1.0, 1.0);
vv(-1.0, 0.2);
EP;
fl_color(fl_color_average(c, FL_WHITE, 0.25f));
BP;
vv(-0.6, 0.0);
vv(-0.6, -1.0);
vv(0.6, -1.0);
vv(0.6, 0.0);
EP;
fl_color(fl_lighter(c));
BP;
vv(-0.6, 0.6);
vv(0.6, 0.6);
vv(0.6, 1.0);
vv(-0.6, 1.0);
EP;
fl_color(fl_darker(c));
BC;
vv(-0.8, 0.0);
vv(-0.6, 0.0);
vv(-0.6, -1.0);
vv(0.6, -1.0);
vv(0.6, 0.0);
vv(0.8, 0.0);
vv(1.0, 0.2);
vv(1.0, 1.0);
vv(-1.0, 1.0);
vv(-1.0, 0.2);
EC;
BC;
vv(-0.6, 0.6);
vv(0.6, 0.6);
vv(0.6, 1.0);
vv(-0.6, 1.0);
EC;
}
static void fl_init_symbols(void) {
static char beenhere;
if (beenhere) return;
@ -409,6 +610,14 @@ static void fl_init_symbols(void) {
fl_add_symbol("||", draw_doublebar, 1);
fl_add_symbol("search", draw_search, 1);
fl_add_symbol("FLTK", draw_fltk, 1);
fl_add_symbol("filenew", draw_filenew, 1);
fl_add_symbol("fileopen", draw_fileopen, 1);
fl_add_symbol("filesave", draw_filesave, 1);
fl_add_symbol("filesaveas", draw_filesaveas, 1);
fl_add_symbol("fileprint", draw_fileprint, 1);
// fl_add_symbol("file", draw_file, 1);
}
//

View File

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