From da9edc35a5c095613a85a35ea0622e4ca244fc6b Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Fri, 26 Apr 2002 11:51:54 +0000 Subject: [PATCH] Add lock icon next to static/private elements in FLUID. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2111 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 2 ++ fluid/Fl_Function_Type.cxx | 10 ++++++++-- fluid/Fl_Type.cxx | 17 +++++++++++++---- fluid/Fl_Type.h | 9 +++++++-- fluid/Fl_Widget_Type.cxx | 5 +++-- fluid/lock.xpm | 29 +++++++++++++++++++++++++++++ 6 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 fluid/lock.xpm diff --git a/CHANGES b/CHANGES index 69f77a6b9..fb29d18ac 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ CHANGES IN FLTK 1.1.0rc1 + - Now show a "lock" icon next to static/private elements + in FLUID. - Implemented Fl_Menu_Item image labels using older 1.0.x labeltype method. - Updated the PNG library check to support both png.h diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index c481bd76e..64d6dfb08 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.1 2002/01/01 15:11:28 easysw Exp $" +// "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.2 2002/04/26 11:51:52 easysw Exp $" // // C function type code for the Fast Light Tool Kit (FLTK). // @@ -113,6 +113,8 @@ const char *c_check(const char *c, int type) { //////////////////////////////////////////////////////////////// +int Fl_Function_Type::is_public() const {return public_;} + Fl_Type *Fl_Function_Type::make() { Fl_Type *p = Fl_Type::current; while (p && !p->is_decl_block()) p = p->parent; @@ -404,6 +406,8 @@ void Fl_CodeBlock_Type::write_code2() { //////////////////////////////////////////////////////////////// +int Fl_Decl_Type::is_public() const {return public_;} + Fl_Type *Fl_Decl_Type::make() { Fl_Type *p = Fl_Type::current; while (p && !p->is_decl_block()) p = p->parent; @@ -583,6 +587,8 @@ const char* Fl_Type::class_name(const int need_nest) const { return 0; } +int Fl_Class_Type::is_public() const {return public_;} + Fl_Type *Fl_Class_Type::make() { Fl_Type *p = Fl_Type::current; while (p && !p->is_decl_block()) p = p->parent; @@ -672,5 +678,5 @@ void Fl_Class_Type::write_code2() { } // -// End of "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.1 2002/01/01 15:11:28 easysw Exp $". +// End of "$Id: Fl_Function_Type.cxx,v 1.15.2.16.2.2 2002/04/26 11:51:52 easysw Exp $". // diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx index 4d5bde93f..8df2f0a3f 100644 --- a/fluid/Fl_Type.cxx +++ b/fluid/Fl_Type.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Type.cxx,v 1.6.2.6.2.3 2002/01/01 15:11:29 easysw Exp $" +// "$Id: Fl_Type.cxx,v 1.6.2.6.2.4 2002/04/26 11:51:52 easysw Exp $" // // Widget type code for the Fast Light Tool Kit (FLTK). // @@ -45,6 +45,11 @@ #include "Fl_Type.h" +#include +#include "lock.xpm" + +static Fl_Pixmap lock_pixmap(lock_xpm); + //////////////////////////////////////////////////////////////// class Widget_Browser : public Fl_Browser_ { @@ -129,9 +134,12 @@ extern const char* subclassname(Fl_Type*); void Widget_Browser::item_draw(void *v, int x, int y, int, int) const { Fl_Type *l = (Fl_Type *)v; - x += 3 + l->level * 10; + x += 3 + 16 + l->level * 10; if (l->new_selected) fl_color(fl_contrast(FL_BLACK,FL_SELECTION_COLOR)); else fl_color(FL_BLACK); + if (!l->is_public()) { + lock_pixmap.draw(x - 16, y); + } if (l->is_parent()) { if (!l->next || l->next->level <= l->level) { if (l->open_!=(l==pushedtitle)) { @@ -189,7 +197,7 @@ int Widget_Browser::item_width(void *v) const { if (!l->visible) return 0; - int w = 3 + l->level*10; + int w = 3 + 16 + l->level*10; if (l->is_parent()) w += 10; if (l->is_widget() || l->is_class()) { @@ -505,6 +513,7 @@ int Fl_Type::is_window() const {return 0;} int Fl_Type::is_code_block() const {return 0;} int Fl_Type::is_decl_block() const {return 0;} int Fl_Type::is_class() const {return 0;} +int Fl_Type::is_public() const {return 1;} //////////////////////////////////////////////////////////////// @@ -668,5 +677,5 @@ void Fl_Type::read_property(const char *c) { int Fl_Type::read_fdesign(const char*, const char*) {return 0;} // -// End of "$Id: Fl_Type.cxx,v 1.6.2.6.2.3 2002/01/01 15:11:29 easysw Exp $". +// End of "$Id: Fl_Type.cxx,v 1.6.2.6.2.4 2002/04/26 11:51:52 easysw Exp $". // diff --git a/fluid/Fl_Type.h b/fluid/Fl_Type.h index cb324e297..150eb79a6 100644 --- a/fluid/Fl_Type.h +++ b/fluid/Fl_Type.h @@ -1,5 +1,5 @@ // -// "$Id: Fl_Type.h,v 1.5.2.11.2.3 2002/01/01 15:11:29 easysw Exp $" +// "$Id: Fl_Type.h,v 1.5.2.11.2.4 2002/04/26 11:51:52 easysw Exp $" // // Widget type header file for the Fast Light Tool Kit (FLTK). // @@ -125,6 +125,7 @@ public: virtual int is_code_block() const; virtual int is_decl_block() const; virtual int is_class() const; + virtual int is_public() const; const char* class_name(const int need_nest) const; }; @@ -144,6 +145,7 @@ public: } int is_parent() const {return 1;} int is_code_block() const {return 1;} + virtual int is_public() const; void write_properties(); void read_property(const char *); }; @@ -182,6 +184,7 @@ public: virtual const char *type_name() {return "decl";} void write_properties(); void read_property(const char *); + virtual int is_public() const; }; class Fl_DeclBlock_Type : public Fl_Type { @@ -214,6 +217,7 @@ public: int is_parent() const {return 1;} int is_decl_block() const {return 1;} int is_class() const {return 1;} + virtual int is_public() const; void write_properties(); void read_property(const char *); }; @@ -275,6 +279,7 @@ public: virtual Fl_Menu_Item *subtypes(); virtual int is_widget() const; + virtual int is_public() const; virtual void write_properties(); virtual void read_property(const char *); @@ -560,5 +565,5 @@ int storestring(const char *n, const char * & p, int nostrip=0); extern int include_H_from_C; // -// End of "$Id: Fl_Type.h,v 1.5.2.11.2.3 2002/01/01 15:11:29 easysw Exp $". +// End of "$Id: Fl_Type.h,v 1.5.2.11.2.4 2002/04/26 11:51:52 easysw Exp $". // diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index 5e7d56ae0..6e294e392 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.12 2002/03/24 17:26:00 easysw Exp $" +// "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.13 2002/04/26 11:51:53 easysw Exp $" // // Widget type code for the Fast Light Tool Kit (FLTK). // @@ -53,6 +53,7 @@ extern const char* i18n_file; extern const char* i18n_set; int Fl_Widget_Type::is_widget() const {return 1;} +int Fl_Widget_Type::is_public() const {return public_;} const char* subclassname(Fl_Type* l) { if (l->is_widget()) { @@ -1974,5 +1975,5 @@ int Fl_Widget_Type::read_fdesign(const char* name, const char* value) { } // -// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.12 2002/03/24 17:26:00 easysw Exp $". +// End of "$Id: Fl_Widget_Type.cxx,v 1.15.2.16.2.13 2002/04/26 11:51:53 easysw Exp $". // diff --git a/fluid/lock.xpm b/fluid/lock.xpm new file mode 100644 index 000000000..465495351 --- /dev/null +++ b/fluid/lock.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static char *lock_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"` c #000000", +"a c #00FFFF", +"b c #80FFFF", +"c c none", +"d c #FFFFFF", +"e c #0000FF", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccc````cccccccc", +"ccc`daaa`ccccccc", +"cc`da``bd`cccccc", +"cc`a`cc`d`cccccc", +"cc`a`cc`d`cccccc", +"c``````````ccccc", +"c`dddaaaae`ccccc", +"c`daa`aaae`ccccc", +"c`da`edaae`ccccc", +"c`da`edaae`ccccc", +"c`da`ddaee`ccccc", +"c``````````ccccc", +"cccccccccccccccc" +};