summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-09-04 13:13:29 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-09-04 13:13:29 +0000
commit9a528400f083b3761e0d54565ea1002604f5472a (patch)
tree789a2d8e0283ad5715026bba5dcd4ce805a067f5 /src
parentbc3de1ec15062a9016150c124d6a4d6c14d87720 (diff)
Doco updates.
Add directory-only support to Fl_FileBrowser. Update button and menu drawing code for check and radio buttons. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1582 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_FileBrowser.cxx10
-rw-r--r--src/Fl_Light_Button.cxx10
-rw-r--r--src/Fl_Menu.cxx53
-rw-r--r--src/Fl_Return_Button.cxx10
4 files changed, 45 insertions, 38 deletions
diff --git a/src/Fl_FileBrowser.cxx b/src/Fl_FileBrowser.cxx
index 7ebbcfcb8..63587bcf4 100644
--- a/src/Fl_FileBrowser.cxx
+++ b/src/Fl_FileBrowser.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_FileBrowser.cxx,v 1.13.2.4 2001/08/06 15:19:20 easysw Exp $"
+// "$Id: Fl_FileBrowser.cxx,v 1.13.2.5 2001/09/04 13:13:29 easysw Exp $"
//
// Fl_FileBrowser routines.
//
@@ -382,6 +382,7 @@ Fl_FileBrowser::Fl_FileBrowser(int x, // I - Upper-lefthand X coordinate
pattern_ = "*";
directory_ = "";
iconsize_ = 3 * textsize() / 2;
+ filetype_ = FILES;
}
@@ -389,7 +390,7 @@ Fl_FileBrowser::Fl_FileBrowser(int x, // I - Upper-lefthand X coordinate
// 'Fl_FileBrowser::load()' - Load a directory into the browser.
//
-int // O - Number of files loaded
+int // O - Number of files loaded
Fl_FileBrowser::load(const char *directory)// I - Directory to load
{
int i; // Looping var
@@ -531,7 +532,8 @@ Fl_FileBrowser::load(const char *directory)// I - Directory to load
num_dirs ++;
insert(num_dirs, name, Fl_FileIcon::find(filename));
}
- else if (filename_match(files[i]->d_name, pattern_))
+ else if (filetype_ == FILES &&
+ filename_match(files[i]->d_name, pattern_))
add(files[i]->d_name, Fl_FileIcon::find(filename));
}
@@ -564,5 +566,5 @@ Fl_FileBrowser::filter(const char *pattern) // I - Pattern string
//
-// End of "$Id: Fl_FileBrowser.cxx,v 1.13.2.4 2001/08/06 15:19:20 easysw Exp $".
+// End of "$Id: Fl_FileBrowser.cxx,v 1.13.2.5 2001/09/04 13:13:29 easysw Exp $".
//
diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx
index 3a554ac62..7993ff909 100644
--- a/src/Fl_Light_Button.cxx
+++ b/src/Fl_Light_Button.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.2 2001/08/04 20:17:10 easysw Exp $"
+// "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.3 2001/09/04 13:13:29 easysw Exp $"
//
// Lighted button widget for the Fast Light Tool Kit (FLTK).
//
@@ -50,9 +50,9 @@ void Fl_Light_Button::draw() {
if (value()) {
fl_color(col);
fl_line_style(FL_SOLID, 2);
- fl_line(x() + W - d - 6, y() + d + 4,
- x() + W / 2 - 2, y() + W - d - 6,
- x() + d + 4, y() + W / 2 - 1);
+ fl_line(x() + W - d - 7, y() + d + 5,
+ x() + W / 2 - 1, y() + W - d - 7,
+ x() + d + 5, y() + W / 2);
fl_line_style(FL_SOLID);
}
break;
@@ -105,5 +105,5 @@ Fl_Light_Button::Fl_Light_Button(int x, int y, int w, int h, const char* l)
}
//
-// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.2 2001/08/04 20:17:10 easysw Exp $".
+// End of "$Id: Fl_Light_Button.cxx,v 1.4.2.3.2.3 2001/09/04 13:13:29 easysw Exp $".
//
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 2e958dab9..000e7d706 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.2 2001/08/06 03:17:43 easysw Exp $"
+// "$Id: Fl_Menu.cxx,v 1.18.2.12.2.3 2001/09/04 13:13:29 easysw Exp $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
@@ -108,11 +108,13 @@ extern char fl_draw_shortcut;
// width of label, including effect of & characters:
int Fl_Menu_Item::measure(int* hp, const Fl_Menu_* m) const {
Fl_Label l;
- l.value = text;
- l.type = labeltype_;
- l.font = labelsize_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA);
- l.size = labelsize_ ? labelsize_ : m ? m->textsize() : FL_NORMAL_SIZE;
- l.color = FL_BLACK; // this makes no difference?
+ l.value = text;
+ l.image = 0;
+ l.deimage = 0;
+ l.type = labeltype_;
+ l.font = labelsize_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA);
+ l.size = labelsize_ ? labelsize_ : m ? m->textsize() : FL_NORMAL_SIZE;
+ l.color = FL_BLACK; // this makes no difference?
fl_draw_shortcut = 1;
int w = 0; int h = 0; l.measure(w, hp ? *hp : h);
fl_draw_shortcut = 0;
@@ -156,26 +158,33 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m,
}
if (flags & (FL_MENU_TOGGLE|FL_MENU_RADIO)) {
- int y1 = y+(h-14)/2;
- fl_color(FL_DARK3);
+ int size = 12;
+ int y1 = y + (h - size) / 2;
+ int x1 = x + 2;
+
if (flags & FL_MENU_RADIO) {
- fl_line(x+2, y1+7, x+8, y1+1, x+14, y1+7);
- if (selected) {
- fl_color(color);
- fl_polygon(x+3, y1+7, x+8, y1+2, x+13, y1+7, x+8, y1+12);
- }
- fl_color(FL_LIGHT3); fl_line(x+14, y1+7, x+8, y1+13, x+2, y1+7);
+ fl_color(FL_DARK3);
+ fl_arc(x1, y1, size, size, 45.0, 225.0);
+ fl_color(FL_LIGHT3);
+ fl_arc(x1, y1, size, size, 225.0, 405.0);
+
if (value()) {
- fl_color(FL_BLACK);
- fl_polygon(x+4, y1+7, x+8, y1+3, x+12, y1+7, x+8, y1+11);
+ fl_color(FL_BLACK);
+ fl_pie(x1 + 3, y1 + 3, size - 7, size - 7, 0.0, 360.0);
}
} else {
- fl_yxline(x+3, y1+11, y1+2, x+12);
- if (selected) {fl_color(color); fl_rectf(x+4, y1+3, 9, 9);}
- fl_color(FL_LIGHT3); fl_xyline(x+4, y1+12, x+13, y1+3);
- if (value()) {fl_color(FL_BLACK); fl_rectf(x+5, y1+4, 7, 7);}
+ fl_draw_box(FL_THIN_DOWN_FRAME, x1, y1, size, size, color);
+ if (value()) {
+ fl_color(FL_BLACK);
+ fl_line_style(FL_SOLID, 2);
+ fl_line(x1 + size - 3, y1 + 2,
+ x1 + size / 2 - 1, y1 + size - 4,
+ x1 + 3, y1 + size / 2);
+ fl_line_style(FL_SOLID);
+ }
}
- x += 14; w -= 14;
+ x += size + 3;
+ w -= size + 3;
}
if (!fl_draw_shortcut) fl_draw_shortcut = 1;
@@ -743,5 +752,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}
//
-// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.2 2001/08/06 03:17:43 easysw Exp $".
+// End of "$Id: Fl_Menu.cxx,v 1.18.2.12.2.3 2001/09/04 13:13:29 easysw Exp $".
//
diff --git a/src/Fl_Return_Button.cxx b/src/Fl_Return_Button.cxx
index 55723fcb0..7394a23e3 100644
--- a/src/Fl_Return_Button.cxx
+++ b/src/Fl_Return_Button.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Return_Button.cxx,v 1.5.2.3.2.1 2001/08/04 16:43:31 easysw Exp $"
+// "$Id: Fl_Return_Button.cxx,v 1.5.2.3.2.2 2001/09/04 13:13:29 easysw Exp $"
//
// Return button widget for the Fast Light Tool Kit (FLTK).
//
@@ -53,11 +53,7 @@ void Fl_Return_Button::draw() {
if (w()/3 < W) W = w()/3;
fl_return_arrow(x()+w()-W-4, y(), W, h());
draw_label(x(), y(), w()-W+4, h());
- if (Fl::focus() == this) {
- fl_line_style(FL_DASH);
- fl_rect(x() + 4, y() + 4, w() - 8, h() - 8);
- fl_line_style(FL_SOLID);
- }
+ if (Fl::focus() == this) draw_focus();
}
int Fl_Return_Button::handle(int event) {
@@ -70,5 +66,5 @@ int Fl_Return_Button::handle(int event) {
}
//
-// End of "$Id: Fl_Return_Button.cxx,v 1.5.2.3.2.1 2001/08/04 16:43:31 easysw Exp $".
+// End of "$Id: Fl_Return_Button.cxx,v 1.5.2.3.2.2 2001/09/04 13:13:29 easysw Exp $".
//