Add unlock icon for public stuff.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2116 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2002-04-27 18:34:11 +00:00
parent c9013cf892
commit a0021b31ef
4 changed files with 44 additions and 8 deletions

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Type.cxx,v 1.6.2.6.2.5 2002/04/27 18:08:45 easysw Exp $"
// "$Id: Fl_Type.cxx,v 1.6.2.6.2.6 2002/04/27 18:34:11 easysw Exp $"
//
// Widget type code for the Fast Light Tool Kit (FLTK).
//
@ -47,8 +47,10 @@
#include <FL/Fl_Pixmap.H>
#include "lock.xpm"
#include "unlock.xpm"
static Fl_Pixmap lock_pixmap(lock_xpm);
static Fl_Pixmap unlock_pixmap(unlock_xpm);
////////////////////////////////////////////////////////////////
@ -137,9 +139,8 @@ void Widget_Browser::item_draw(void *v, int x, int y, int, int) const {
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_public() == 0) unlock_pixmap.draw(x - 16, y);
else if (l->is_public() > 0) lock_pixmap.draw(x - 16, y);
if (l->is_parent()) {
if (!l->next || l->next->level <= l->level) {
if (l->open_!=(l==pushedtitle)) {
@ -515,6 +516,10 @@ 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;}
int Fl_Code_Type::is_public()const { return -1; }
int Fl_CodeBlock_Type::is_public()const { return -1; }
////////////////////////////////////////////////////////////////
Fl_Type *in_this_only; // set if menu popped-up in window
@ -677,5 +682,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.5 2002/04/27 18:08:45 easysw Exp $".
// End of "$Id: Fl_Type.cxx,v 1.6.2.6.2.6 2002/04/27 18:34:11 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Type.h,v 1.5.2.11.2.4 2002/04/26 11:51:52 easysw Exp $"
// "$Id: Fl_Type.h,v 1.5.2.11.2.5 2002/04/27 18:34:11 easysw Exp $"
//
// Widget type header file for the Fast Light Tool Kit (FLTK).
//
@ -158,6 +158,7 @@ public:
void open();
virtual const char *type_name() {return "code";}
int is_code_block() const {return 0;}
virtual int is_public() const;
};
class Fl_CodeBlock_Type : public Fl_Type {
@ -170,6 +171,7 @@ public:
virtual const char *type_name() {return "codeblock";}
int is_code_block() const {return 1;}
int is_parent() const {return 1;}
virtual int is_public() const;
void write_properties();
void read_property(const char *);
};
@ -565,5 +567,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.4 2002/04/26 11:51:52 easysw Exp $".
// End of "$Id: Fl_Type.h,v 1.5.2.11.2.5 2002/04/27 18:34:11 easysw Exp $".
//

View File

@ -57,7 +57,7 @@ Fl_Type.o: Fluid_Image.h ../FL/Fl_Shared_Image.H ../FL/Fl_Image.H ../FL/x.H
Fl_Type.o: ../FL/Fl_Window.H ../FL/Fl_Tabs.H ../FL/Fl_Pack.H ../FL/Fl_Group.H
Fl_Type.o: ../FL/Fl_Wizard.H ../FL/Fl_Menu_.H ../FL/Fl_Menu_Button.H
Fl_Type.o: ../FL/Fl_Menu_.H ../FL/Fl_Choice.H ../FL/Fl_Menu_Bar.H
Fl_Type.o: ../FL/Fl_Pixmap.H lock.xpm
Fl_Type.o: ../FL/Fl_Pixmap.H lock.xpm unlock.xpm
Fl_Window_Type.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_Window_Type.o: ../FL/Fl_Overlay_Window.H ../FL/Fl_Double_Window.H
Fl_Window_Type.o: ../FL/Fl_Window.H ../FL/Fl_Group.H ../FL/fl_message.H

29
fluid/unlock.xpm Normal file
View File

@ -0,0 +1,29 @@
/* XPM */
static char *unlock_xpm[] = {
/* width height ncolors chars_per_pixel */
"16 16 6 1",
/* colors */
"` c #000000",
"a c #00FF00",
"b c #40FF40",
"c c none",
"d c #80FF80",
"e c #008000",
/* pixels */
"cccccccccccccccc",
"cccccccccccccccc",
"cccccccccccccccc",
"ccccccccc````ccc",
"cccccccc`daaa`cc",
"ccccccc`da``bd`c",
"ccccccc`a`cc`d`c",
"ccccccc`a`cc`d`c",
"c``````````c```c",
"c`dddaaaae`ccccc",
"c`daa`aaae`ccccc",
"c`da`edaae`ccccc",
"c`da`edaae`ccccc",
"c`da`ddaee`ccccc",
"c``````````ccccc",
"cccccccccccccccc"
};