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
This commit is contained in:
Michael R Sweet 2002-04-26 11:51:54 +00:00
parent ee5fdc99ce
commit da9edc35a5
6 changed files with 62 additions and 10 deletions

View File

@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.0rc1 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 - Implemented Fl_Menu_Item image labels using older
1.0.x labeltype method. 1.0.x labeltype method.
- Updated the PNG library check to support both png.h - Updated the PNG library check to support both png.h

View File

@ -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). // 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 *Fl_Function_Type::make() {
Fl_Type *p = Fl_Type::current; Fl_Type *p = Fl_Type::current;
while (p && !p->is_decl_block()) p = p->parent; 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 *Fl_Decl_Type::make() {
Fl_Type *p = Fl_Type::current; Fl_Type *p = Fl_Type::current;
while (p && !p->is_decl_block()) p = p->parent; 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; return 0;
} }
int Fl_Class_Type::is_public() const {return public_;}
Fl_Type *Fl_Class_Type::make() { Fl_Type *Fl_Class_Type::make() {
Fl_Type *p = Fl_Type::current; Fl_Type *p = Fl_Type::current;
while (p && !p->is_decl_block()) p = p->parent; 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 $".
// //

View File

@ -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). // Widget type code for the Fast Light Tool Kit (FLTK).
// //
@ -45,6 +45,11 @@
#include "Fl_Type.h" #include "Fl_Type.h"
#include <FL/Fl_Pixmap.H>
#include "lock.xpm"
static Fl_Pixmap lock_pixmap(lock_xpm);
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
class Widget_Browser : public Fl_Browser_ { 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 { void Widget_Browser::item_draw(void *v, int x, int y, int, int) const {
Fl_Type *l = (Fl_Type *)v; 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)); if (l->new_selected) fl_color(fl_contrast(FL_BLACK,FL_SELECTION_COLOR));
else fl_color(FL_BLACK); else fl_color(FL_BLACK);
if (!l->is_public()) {
lock_pixmap.draw(x - 16, y);
}
if (l->is_parent()) { if (l->is_parent()) {
if (!l->next || l->next->level <= l->level) { if (!l->next || l->next->level <= l->level) {
if (l->open_!=(l==pushedtitle)) { if (l->open_!=(l==pushedtitle)) {
@ -189,7 +197,7 @@ int Widget_Browser::item_width(void *v) const {
if (!l->visible) return 0; 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_parent()) w += 10;
if (l->is_widget() || l->is_class()) { 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_code_block() const {return 0;}
int Fl_Type::is_decl_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_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;} 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 $".
// //

View File

@ -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). // 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_code_block() const;
virtual int is_decl_block() const; virtual int is_decl_block() const;
virtual int is_class() const; virtual int is_class() const;
virtual int is_public() const;
const char* class_name(const int need_nest) const; const char* class_name(const int need_nest) const;
}; };
@ -144,6 +145,7 @@ public:
} }
int is_parent() const {return 1;} int is_parent() const {return 1;}
int is_code_block() const {return 1;} int is_code_block() const {return 1;}
virtual int is_public() const;
void write_properties(); void write_properties();
void read_property(const char *); void read_property(const char *);
}; };
@ -182,6 +184,7 @@ public:
virtual const char *type_name() {return "decl";} virtual const char *type_name() {return "decl";}
void write_properties(); void write_properties();
void read_property(const char *); void read_property(const char *);
virtual int is_public() const;
}; };
class Fl_DeclBlock_Type : public Fl_Type { class Fl_DeclBlock_Type : public Fl_Type {
@ -214,6 +217,7 @@ public:
int is_parent() const {return 1;} int is_parent() const {return 1;}
int is_decl_block() const {return 1;} int is_decl_block() const {return 1;}
int is_class() const {return 1;} int is_class() const {return 1;}
virtual int is_public() const;
void write_properties(); void write_properties();
void read_property(const char *); void read_property(const char *);
}; };
@ -275,6 +279,7 @@ public:
virtual Fl_Menu_Item *subtypes(); virtual Fl_Menu_Item *subtypes();
virtual int is_widget() const; virtual int is_widget() const;
virtual int is_public() const;
virtual void write_properties(); virtual void write_properties();
virtual void read_property(const char *); 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; 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 $".
// //

View File

@ -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). // Widget type code for the Fast Light Tool Kit (FLTK).
// //
@ -53,6 +53,7 @@ extern const char* i18n_file;
extern const char* i18n_set; extern const char* i18n_set;
int Fl_Widget_Type::is_widget() const {return 1;} int Fl_Widget_Type::is_widget() const {return 1;}
int Fl_Widget_Type::is_public() const {return public_;}
const char* subclassname(Fl_Type* l) { const char* subclassname(Fl_Type* l) {
if (l->is_widget()) { 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 $".
// //

29
fluid/lock.xpm Normal file
View File

@ -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"
};