summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2008-01-04 21:45:49 +0000
committerMatthias Melcher <fltk@matthiasm.com>2008-01-04 21:45:49 +0000
commita1f96ffea02ffd023897fd23328d20f66c11212e (patch)
treeff9ce9d29692bdd5e1c33bae645b494330391ab7 /fluid
parent329f5de33080274b8b2cf3bbb92c61e04b039fa5 (diff)
STR #1776: FLUID now tries to find a previously declared callback to avoid declaring one as 'extern'. I also replaced many 'public' Light_Buttons with pulldown menus which offer either 'local'/'global', or 'private'/'public'/'protected', depending if the item is outside or inside a class. I took great care to make this change transparent to previous .fl files. Downward compatibility is only problematic if the new 'protected' keyword is used.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@6012 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid')
-rw-r--r--fluid/Fl_Function_Type.cxx117
-rw-r--r--fluid/Fl_Type.cxx42
-rw-r--r--fluid/Fl_Type.h2
-rw-r--r--fluid/Fl_Widget_Type.cxx41
-rw-r--r--fluid/Fl_Window_Type.cxx6
-rw-r--r--fluid/function_panel.cxx145
-rw-r--r--fluid/function_panel.fl203
-rw-r--r--fluid/function_panel.h17
-rw-r--r--fluid/widget_panel.cxx42
-rw-r--r--fluid/widget_panel.fl76
-rw-r--r--fluid/widget_panel.h5
11 files changed, 507 insertions, 189 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx
index d993b248f..cbe3edd1a 100644
--- a/fluid/Fl_Function_Type.cxx
+++ b/fluid/Fl_Function_Type.cxx
@@ -41,6 +41,8 @@ extern const char* i18n_file;
extern const char* i18n_set;
extern char i18n_program[];
+extern void redraw_browser();
+
////////////////////////////////////////////////////////////////
// quick check of any C code for legality, returns an error message
@@ -134,7 +136,10 @@ Fl_Type *Fl_Function_Type::make() {
void Fl_Function_Type::write_properties() {
Fl_Type::write_properties();
- if (!public_) write_string("private");
+ switch (public_) {
+ case 0: write_string("private"); break;
+ case 2: write_string("protected"); break;
+ }
if (cdecl_) write_string("C");
if (return_type) {
write_string("return_type");
@@ -145,6 +150,8 @@ void Fl_Function_Type::write_properties() {
void Fl_Function_Type::read_property(const char *c) {
if (!strcmp(c,"private")) {
public_ = 0;
+ } else if (!strcmp(c,"protected")) {
+ public_ = 2;
} else if (!strcmp(c,"C")) {
cdecl_ = 1;
} else if (!strcmp(c,"return_type")) {
@@ -161,7 +168,15 @@ void Fl_Function_Type::open() {
if (!function_panel) make_function_panel();
f_return_type_input->static_value(return_type);
f_name_input->static_value(name());
- f_public_button->value(public_);
+ if (is_in_class()) {
+ f_public_member_choice->value(public_);
+ f_public_member_choice->show();
+ f_public_choice->hide();
+ } else {
+ f_public_choice->value(public_>0);
+ f_public_choice->show();
+ f_public_member_choice->hide();
+ }
f_c_button->value(cdecl_);
function_panel->show();
const char* message = 0;
@@ -186,9 +201,18 @@ void Fl_Function_Type::open() {
message = c_check(c); if (message) continue;
name(f_name_input->value());
storestring(c, return_type);
- if (public_ != f_public_button->value()) {
- mod = 1;
- public_ = f_public_button->value();
+ if (is_in_class()) {
+ if (public_ != f_public_member_choice->value()) {
+ mod = 1;
+ public_ = f_public_member_choice->value();
+ redraw_browser();
+ }
+ } else {
+ if (public_ != f_public_choice->value()) {
+ mod = 1;
+ public_ = f_public_choice->value();
+ redraw_browser();
+ }
}
if (cdecl_ != f_c_button->value()) {
mod = 1;
@@ -356,9 +380,9 @@ void Fl_Function_Type::write_code2() {
}
int Fl_Function_Type::has_signature(const char *rtype, const char *sig) const {
- if (!return_type) return 0;
+ if (rtype && !return_type) return 0;
if (!name()) return 0;
- if ( strcmp(return_type, rtype)==0
+ if ( (rtype==0L || strcmp(return_type, rtype)==0)
&& fl_filename_match(name(), sig)) {
return 1;
}
@@ -515,13 +539,18 @@ Fl_Type *Fl_Decl_Type::make() {
void Fl_Decl_Type::write_properties() {
Fl_Type::write_properties();
- if (public_) write_string("public");
+ switch (public_) {
+ case 1: write_string("public"); break;
+ case 2: write_string("protected"); break;
+ }
if (!static_) write_string("global");
}
void Fl_Decl_Type::read_property(const char *c) {
if (!strcmp(c,"public")) {
public_ = 1;
+ } else if (!strcmp(c,"protected")) {
+ public_ = 2;
} else if (!strcmp(c,"global")) {
static_ = 0;
} else {
@@ -532,13 +561,15 @@ void Fl_Decl_Type::read_property(const char *c) {
void Fl_Decl_Type::open() {
if (!decl_panel) make_decl_panel();
decl_input->static_value(name());
- decl_public_button->value(public_);
- decl_static_button->value(static_);
- if (public_)
- decl_static_button->label("extern");
- else
- decl_static_button->label("static");
- char pp = public_;
+ if (is_in_class()) {
+ decl_class_choice->value(public_);
+ decl_class_choice->show();
+ decl_choice->hide();
+ } else {
+ decl_choice->value((public_&1)|((static_&1)<<1));
+ decl_choice->show();
+ decl_class_choice->hide();
+ }
decl_panel->show();
const char* message = 0;
for (;;) { // repeat as long as there are errors
@@ -548,27 +579,26 @@ void Fl_Decl_Type::open() {
if (w == decl_panel_cancel) goto BREAK2;
else if (w == decl_panel_ok) break;
else if (!w) Fl::wait();
- if (pp != decl_public_button->value()) {
- pp = decl_public_button->value();
- if (pp)
- decl_static_button->label("extern");
- else
- decl_static_button->label("static");
- decl_static_button->redraw();
- }
}
const char*c = decl_input->value();
while (isspace(*c)) c++;
message = c_check(c&&c[0]=='#' ? c+1 : c);
if (message) continue;
name(c);
- if (public_!=decl_public_button->value()) {
- set_modflag(1);
- public_ = decl_public_button->value();
- }
- if (static_!=decl_static_button->value()) {
- set_modflag(1);
- static_ = decl_static_button->value();
+ if (is_in_class()) {
+ if (public_!=decl_class_choice->value()) {
+ set_modflag(1);
+ public_ = decl_class_choice->value();
+ }
+ } else {
+ if (public_!=(decl_choice->value()&1)) {
+ set_modflag(1);
+ public_ = (decl_choice->value()&1);
+ }
+ if (static_!=((decl_choice->value()>>1)&1)) {
+ set_modflag(1);
+ static_ = ((decl_choice->value()>>1)&1);
+ }
}
break;
}
@@ -652,7 +682,10 @@ Fl_Type *Fl_DeclBlock_Type::make() {
void Fl_DeclBlock_Type::write_properties() {
Fl_Type::write_properties();
- if (public_) write_string("public");
+ switch (public_) {
+ case 1: write_string("public"); break;
+ case 2: write_string("protected"); break;
+ }
write_string("after");
write_word(after);
}
@@ -660,6 +693,8 @@ void Fl_DeclBlock_Type::write_properties() {
void Fl_DeclBlock_Type::read_property(const char *c) {
if(!strcmp(c,"public")) {
public_ = 1;
+ } else if(!strcmp(c,"protected")) {
+ public_ = 2;
} else if (!strcmp(c,"after")) {
storestring(read_word(),after);
} else {
@@ -670,7 +705,7 @@ void Fl_DeclBlock_Type::read_property(const char *c) {
void Fl_DeclBlock_Type::open() {
if (!declblock_panel) make_declblock_panel();
decl_before_input->static_value(name());
- declblock_public_button->value(public_);
+ declblock_public_choice->value((public_>0));
decl_after_input->static_value(after);
declblock_panel->show();
const char* message = 0;
@@ -692,9 +727,10 @@ void Fl_DeclBlock_Type::open() {
message = c_check(c&&c[0]=='#' ? c+1 : c);
if (message) continue;
storestring(c,after);
- if (public_ != declblock_public_button->value()) {
+ if (public_ != declblock_public_choice->value()) {
set_modflag(1);
- public_ = declblock_public_button->value();
+ public_ = declblock_public_choice->value();
+ redraw_browser();
}
break;
}
@@ -1017,12 +1053,17 @@ void Fl_Class_Type::write_properties() {
write_string(":");
write_word(subclass_of);
}
- if (!public_) write_string("private");
+ switch (public_) {
+ case 0: write_string("private"); break;
+ case 2: write_string("protected"); break;
+ }
}
void Fl_Class_Type::read_property(const char *c) {
if (!strcmp(c,"private")) {
public_ = 0;
+ } else if (!strcmp(c,"protected")) {
+ public_ = 2;
} else if (!strcmp(c,":")) {
storestring(read_word(), subclass_of);
} else {
@@ -1099,7 +1140,11 @@ void write_public(int state) {
if (current_widget_class && current_widget_class->write_public_state == state) return;
if (current_class) current_class->write_public_state = state;
if (current_widget_class) current_widget_class->write_public_state = state;
- write_h(state ? "public:\n" : "private:\n");
+ switch (state) {
+ case 0: write_h("private:\n"); break;
+ case 1: write_h("public:\n"); break;
+ case 2: write_h("protected:\n"); break;
+ }
}
void Fl_Class_Type::write_code1() {
diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx
index 6754de395..d2ae60ca7 100644
--- a/fluid/Fl_Type.cxx
+++ b/fluid/Fl_Type.cxx
@@ -49,9 +49,11 @@
#include <FL/Fl_Pixmap.H>
#include "pixmaps/lock.xpm"
+#include "pixmaps/protected.xpm"
//#include "pixmaps/unlock.xpm"
static Fl_Pixmap lock_pixmap(lock_xpm);
+static Fl_Pixmap protected_pixmap(protected_xpm);
//static Fl_Pixmap unlock_pixmap(unlock_xpm);
#include "pixmaps/flWindow.xpm"
@@ -252,8 +254,10 @@ void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const {
else fl_color(FL_FOREGROUND_COLOR);
Fl_Pixmap *pm = pixmap[l->pixmapID()];
if (pm) pm->draw(X-18, Y);
- if (l->is_public() == 0) lock_pixmap.draw(X - 17, Y);
- else if (l->is_public() > 0) ; //unlock_pixmap.draw(X - 17, Y);
+ switch (l->is_public()) {
+ case 0: lock_pixmap.draw(X - 17, Y); break;
+ case 2: protected_pixmap.draw(X - 17, Y); break;
+ }
if (l->is_parent()) {
if (!l->next || l->next->level <= l->level) {
if (l->open_!=(l==pushedtitle)) {
@@ -844,6 +848,40 @@ void Fl_Type::read_property(const char *c) {
int Fl_Type::read_fdesign(const char*, const char*) {return 0;}
/**
+ * Return 1 if the list contains a function with the given signature at the top level
+ */
+int has_toplevel_function(const char *rtype, const char *sig) {
+ Fl_Type *child;
+ for (child = Fl_Type::first; child; child = child->next) {
+ if (!child->is_in_class() && strcmp(child->type_name(), "Function")==0) {
+ const Fl_Function_Type *fn = (const Fl_Function_Type*)child;
+ if (fn->has_signature(rtype, sig))
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/**
+ * Make sure that the given item is visible in the browser by opening
+ * all parent groups and moving the item into the visible space.
+ */
+void reveal_in_browser(Fl_Type *t) {
+ Fl_Type *p = t->parent;
+ if (p) {
+ for (;;) {
+ if (!p->open_)
+ p->open_ = 1;
+ if (!p->parent) break;
+ p = p->parent;
+ }
+ fixvisible(p);
+ }
+ widget_browser->display(t);
+ redraw_browser();
+}
+
+/**
* Build widgets and dataset needed in live mode.
* \return a widget pointer that the live mode initiator can 'show()'
* \see leave_live_mode()
diff --git a/fluid/Fl_Type.h b/fluid/Fl_Type.h
index 0eed936a2..a35fc6201 100644
--- a/fluid/Fl_Type.h
+++ b/fluid/Fl_Type.h
@@ -721,6 +721,8 @@ Fl_Widget *make_widget_browser(int X,int Y,int W,int H);
extern int modflag;
void delete_all(int selected_only=0);
void selection_changed(Fl_Type* new_current);
+void reveal_in_browser(Fl_Type*);
+int has_toplevel_function(const char *rtype, const char *sig);
// file operations:
# ifdef __GNUC__
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx
index 68512cb54..cae00ab0c 100644
--- a/fluid/Fl_Widget_Type.cxx
+++ b/fluid/Fl_Widget_Type.cxx
@@ -318,9 +318,35 @@ void name_cb(Fl_Input* o, void *v) {
}
}
-void name_public_cb(Fl_Light_Button* i, void* v) {
+void name_public_member_cb(Fl_Choice* i, void* v) {
if (v == LOAD) {
i->value(current_widget->public_);
+ if (current_widget->is_in_class()) i->show(); else i->hide();
+ } else {
+ int mod = 0;
+ for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
+ if (o->selected && o->is_widget()) {
+ Fl_Widget_Type *w = ((Fl_Widget_Type*)o);
+ if (w->is_in_class()) {
+ w->public_ = i->value();
+ } else {
+ // if this is not in a class, it can be only private or public
+ w->public_ = (i->value()>0);
+ }
+ mod = 1;
+ }
+ }
+ if (mod) {
+ set_modflag(1);
+ redraw_browser();
+ }
+ }
+}
+
+void name_public_cb(Fl_Choice* i, void* v) {
+ if (v == LOAD) {
+ i->value(current_widget->public_>0);
+ if (current_widget->is_in_class()) i->hide(); else i->show();
} else {
int mod = 0;
for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
@@ -1883,10 +1909,13 @@ void Fl_Widget_Type::write_static() {
if (callback() && is_name(callback())) {
int write_extern_declaration = 1;
const Fl_Class_Type *cc = is_in_class();
+ char buf[1024]; snprintf(buf, 1023, "%s(*)", callback());
if (cc) {
- char buf[1024]; snprintf(buf, 1023, "%s(*)", callback());
if (cc->has_function("static void", buf))
write_extern_declaration = 0;
+ } else {
+ if (has_toplevel_function(0L, buf))
+ write_extern_declaration = 0;
}
if (write_extern_declaration)
write_declare("extern void %s(%s*, %s);", callback(), t,
@@ -2276,7 +2305,11 @@ void Fl_Widget_Type::write_code2() {
void Fl_Widget_Type::write_properties() {
Fl_Type::write_properties();
write_indent(level+1);
- if (!public_) write_string("private");
+ switch (public_) {
+ case 0: write_string("private"); break;
+ case 1: break;
+ case 2: write_string("protected"); break;
+ }
if (tooltip() && *tooltip()) {
write_string("tooltip");
write_word(tooltip());
@@ -2382,6 +2415,8 @@ void Fl_Widget_Type::read_property(const char *c) {
int x,y,w,h; Fl_Font f; int s; Fl_Color cc;
if (!strcmp(c,"private")) {
public_ = 0;
+ } else if (!strcmp(c,"protected")) {
+ public_ = 2;
} else if (!strcmp(c,"xywh")) {
if (sscanf(read_word(),"%d %d %d %d",&x,&y,&w,&h) == 4) {
x += pasteoffset;
diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx
index a52d47d0c..36a7338c9 100644
--- a/fluid/Fl_Window_Type.cxx
+++ b/fluid/Fl_Window_Type.cxx
@@ -1145,7 +1145,11 @@ int Fl_Window_Type::handle(int event) {
Fl_Widget_Type* myo = (Fl_Widget_Type*)i;
for (Fl_Widget *o1 = myo->o; o1; o1 = o1->parent())
if (!o1->visible()) goto CONTINUE2;
- if (Fl::event_inside(myo->o)) selection = myo;
+ if (Fl::event_inside(myo->o)) {
+ selection = myo;
+ if (Fl::event_clicks()==1)
+ reveal_in_browser(myo);
+ }
CONTINUE2:;
}}
// see if user grabs edges of selected region:
diff --git a/fluid/function_panel.cxx b/fluid/function_panel.cxx
index 36cb1e716..6829d723f 100644
--- a/fluid/function_panel.cxx
+++ b/fluid/function_panel.cxx
@@ -37,7 +37,22 @@ extern void select_only(Fl_Type*);
Fl_Double_Window *function_panel=(Fl_Double_Window *)0;
-Fl_Light_Button *f_public_button=(Fl_Light_Button *)0;
+Fl_Choice *f_public_member_choice=(Fl_Choice *)0;
+
+Fl_Menu_Item menu_f_public_member_choice[] = {
+ {"private", 0, 0, (void*)(0), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"public", 0, 0, (void*)(1), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"protected", 0, 0, (void*)(2), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {0,0,0,0,0,0,0,0,0}
+};
+
+Fl_Choice *f_public_choice=(Fl_Choice *)0;
+
+Fl_Menu_Item menu_f_public_choice[] = {
+ {"local", 0, 0, (void*)(0), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"global", 0, 0, (void*)(1), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {0,0,0,0,0,0,0,0,0}
+};
Fl_Light_Button *f_c_button=(Fl_Light_Button *)0;
@@ -52,16 +67,27 @@ Fl_Button *f_panel_cancel=(Fl_Button *)0;
Fl_Double_Window* make_function_panel() {
{ Fl_Double_Window* o = function_panel = new Fl_Double_Window(290, 150, "Function/Method Properties");
{ Fl_Group* o = new Fl_Group(10, 10, 270, 20);
- { f_public_button = new Fl_Light_Button(10, 10, 60, 20, "public");
- f_public_button->tooltip("Make the function or method publicly accessible.");
- f_public_button->labelsize(11);
- f_public_button->when(FL_WHEN_NEVER);
- } // Fl_Light_Button* f_public_button
- { f_c_button = new Fl_Light_Button(80, 10, 80, 20, "C declaration");
+ { f_public_member_choice = new Fl_Choice(10, 10, 75, 20);
+ f_public_member_choice->tooltip("Change member access attribute.");
+ f_public_member_choice->down_box(FL_BORDER_BOX);
+ f_public_member_choice->labelsize(11);
+ f_public_member_choice->textsize(11);
+ f_public_member_choice->when(FL_WHEN_CHANGED);
+ f_public_member_choice->menu(menu_f_public_member_choice);
+ } // Fl_Choice* f_public_member_choice
+ { f_public_choice = new Fl_Choice(10, 10, 75, 20);
+ f_public_choice->tooltip("Change widget accessibility.");
+ f_public_choice->down_box(FL_BORDER_BOX);
+ f_public_choice->labelsize(11);
+ f_public_choice->textsize(11);
+ f_public_choice->when(FL_WHEN_CHANGED);
+ f_public_choice->menu(menu_f_public_choice);
+ } // Fl_Choice* f_public_choice
+ { f_c_button = new Fl_Light_Button(95, 10, 80, 20, "C declaration");
f_c_button->tooltip("Declare with a C interface instead of C++.");
f_c_button->labelsize(11);
} // Fl_Light_Button* f_c_button
- { Fl_Box* o = new Fl_Box(170, 10, 110, 20);
+ { Fl_Box* o = new Fl_Box(235, 10, 45, 20);
Fl_Group::current()->resizable(o);
} // Fl_Box* o
o->end();
@@ -210,6 +236,16 @@ Fl_Double_Window* make_codeblock_panel() {
Fl_Double_Window *declblock_panel=(Fl_Double_Window *)0;
+Fl_Choice *declblock_public_choice=(Fl_Choice *)0;
+
+Fl_Menu_Item menu_declblock_public_choice[] = {
+ {"in source code only", 0, 0, (void*)(0), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"in header and source", 0, 0, (void*)(1), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {0,0,0,0,0,0,0,0,0}
+};
+
+Fl_Light_Button *declblock_public_button_x=(Fl_Light_Button *)0;
+
Fl_Input *decl_before_input=(Fl_Input *)0;
Fl_Input *decl_after_input=(Fl_Input *)0;
@@ -218,11 +254,29 @@ Fl_Return_Button *declblock_panel_ok=(Fl_Return_Button *)0;
Fl_Button *declblock_panel_cancel=(Fl_Button *)0;
-Fl_Light_Button *declblock_public_button=(Fl_Light_Button *)0;
-
Fl_Double_Window* make_declblock_panel() {
{ Fl_Double_Window* o = declblock_panel = new Fl_Double_Window(300, 135, "Declaration Block Properties");
declblock_panel->labelsize(11);
+ { Fl_Group* o = new Fl_Group(10, 10, 280, 20);
+ { declblock_public_choice = new Fl_Choice(10, 10, 140, 20);
+ declblock_public_choice->tooltip("Change widget accessibility.");
+ declblock_public_choice->down_box(FL_BORDER_BOX);
+ declblock_public_choice->labelsize(11);
+ declblock_public_choice->textsize(11);
+ declblock_public_choice->when(FL_WHEN_NEVER);
+ declblock_public_choice->menu(menu_declblock_public_choice);
+ } // Fl_Choice* declblock_public_choice
+ { declblock_public_button_x = new Fl_Light_Button(10, 10, 60, 20, "public");
+ declblock_public_button_x->tooltip("Make the declaration publicly accessible.");
+ declblock_public_button_x->labelsize(11);
+ declblock_public_button_x->when(FL_WHEN_NEVER);
+ declblock_public_button_x->hide();
+ } // Fl_Light_Button* declblock_public_button_x
+ { Fl_Box* o = new Fl_Box(155, 10, 135, 20);
+ Fl_Group::current()->resizable(o);
+ } // Fl_Box* o
+ o->end();
+ } // Fl_Group* o
{ decl_before_input = new Fl_Input(10, 40, 280, 20);
decl_before_input->tooltip("#ifdef or similar conditional declaration block.");
decl_before_input->labelsize(11);
@@ -254,17 +308,6 @@ Fl_Double_Window* make_declblock_panel() {
} // Fl_Box* o
o->end();
} // Fl_Group* o
- { Fl_Group* o = new Fl_Group(10, 10, 280, 20);
- { declblock_public_button = new Fl_Light_Button(10, 10, 60, 20, "public");
- declblock_public_button->tooltip("Make the declaration publicly accessible.");
- declblock_public_button->labelsize(11);
- declblock_public_button->when(FL_WHEN_NEVER);
- } // Fl_Light_Button* declblock_public_button
- { Fl_Box* o = new Fl_Box(80, 10, 210, 20);
- Fl_Group::current()->resizable(o);
- } // Fl_Box* o
- o->end();
- } // Fl_Group* o
o->size_range(o->w(), o->h(), Fl::w(), o->h());
declblock_panel->set_modal();
declblock_panel->end();
@@ -274,9 +317,24 @@ Fl_Double_Window* make_declblock_panel() {
Fl_Double_Window *decl_panel=(Fl_Double_Window *)0;
-Fl_Light_Button *decl_public_button=(Fl_Light_Button *)0;
+Fl_Choice *decl_choice=(Fl_Choice *)0;
+
+Fl_Menu_Item menu_decl_choice[] = {
+ {"in source file only", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"in header file only", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"\"static\" in source file", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"in source and \"extern\" in header", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {0,0,0,0,0,0,0,0,0}
+};
+
+Fl_Choice *decl_class_choice=(Fl_Choice *)0;
-Fl_Light_Button *decl_static_button=(Fl_Light_Button *)0;
+Fl_Menu_Item menu_decl_class_choice[] = {
+ {"private", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"public", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"protected", 0, 0, 0, 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {0,0,0,0,0,0,0,0,0}
+};
Fl_Input *decl_input=(Fl_Input *)0;
@@ -288,20 +346,21 @@ Fl_Double_Window* make_decl_panel() {
{ Fl_Double_Window* o = decl_panel = new Fl_Double_Window(290, 150, "Declaration Properties");
decl_panel->align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE);
{ Fl_Group* o = new Fl_Group(10, 10, 270, 20);
- { decl_public_button = new Fl_Light_Button(10, 10, 60, 20, "public");
- decl_public_button->tooltip("Make the declaration publicly accessible.");
- decl_public_button->labelsize(11);
- decl_public_button->when(FL_WHEN_NEVER);
- } // Fl_Light_Button* decl_public_button
- { decl_static_button = new Fl_Light_Button(80, 10, 60, 20, "static");
- decl_static_button->tooltip("Prepend \'static\' to private declarations in the source code, or \'extern\' \
-to public declarations in the header file.");
- decl_static_button->labelsize(11);
- decl_static_button->when(FL_WHEN_NEVER);
- } // Fl_Light_Button* decl_static_button
- { Fl_Box* o = new Fl_Box(150, 10, 130, 20);
+ { Fl_Box* o = new Fl_Box(200, 10, 80, 20);
Fl_Group::current()->resizable(o);
} // Fl_Box* o
+ { decl_choice = new Fl_Choice(10, 10, 185, 20);
+ decl_choice->down_box(FL_BORDER_BOX);
+ decl_choice->labelsize(11);
+ decl_choice->textsize(11);
+ decl_choice->menu(menu_decl_choice);
+ } // Fl_Choice* decl_choice
+ { decl_class_choice = new Fl_Choice(10, 10, 75, 20);
+ decl_class_choice->down_box(FL_BORDER_BOX);
+ decl_class_choice->labelsize(11);
+ decl_class_choice->textsize(11);
+ decl_class_choice->menu(menu_decl_class_choice);
+ } // Fl_Choice* decl_class_choice
o->end();
} // Fl_Group* o
{ decl_input = new Fl_Input(10, 40, 270, 20, "Can be any declaration, like \"int x;\", an external symbol like \"extern int\
@@ -348,20 +407,22 @@ Fl_Return_Button *c_panel_ok=(Fl_Return_Button *)0;
Fl_Button *c_panel_cancel=(Fl_Button *)0;
Fl_Double_Window* make_class_panel() {
- { Fl_Double_Window* o = class_panel = new Fl_Double_Window(300, 140, "Class Properties");
+ { Fl_Double_Window* o = class_panel = new Fl_Double_Window(300, 115, "Class Properties");
class_panel->labelsize(11);
{ Fl_Group* o = new Fl_Group(10, 10, 280, 20);
+ o->hide();
{ c_public_button = new Fl_Light_Button(10, 10, 60, 20, "public");
c_public_button->tooltip("Make the class publicly accessible.");
c_public_button->labelsize(11);
c_public_button->when(FL_WHEN_NEVER);
+ c_public_button->hide();
} // Fl_Light_Button* c_public_button
{ Fl_Box* o = new Fl_Box(80, 10, 210, 20);
Fl_Group::current()->resizable(o);
} // Fl_Box* o
o->end();
} // Fl_Group* o
- { c_name_input = new Fl_Input(10, 45, 280, 20, "Name:");
+ { c_name_input = new Fl_Input(10, 20, 280, 20, "Name:");
c_name_input->tooltip("Name of class.");
c_name_input->labelfont(1);
c_name_input->labelsize(11);
@@ -371,7 +432,7 @@ Fl_Double_Window* make_class_panel() {
c_name_input->when(FL_WHEN_NEVER);
Fl_Group::current()->resizable(c_name_input);
} // Fl_Input* c_name_input
- { c_subclass_input = new Fl_Input(10, 80, 280, 20, "Subclass of (text between : and {)");
+ { c_subclass_input = new Fl_Input(10, 55, 280, 20, "Subclass of (text between : and {)");
c_subclass_input->tooltip("Name of subclass.");
c_subclass_input->labelfont(1);
c_subclass_input->labelsize(11);
@@ -380,16 +441,16 @@ Fl_Double_Window* make_class_panel() {
c_subclass_input->align(FL_ALIGN_TOP_LEFT);
c_subclass_input->when(FL_WHEN_NEVER);
} // Fl_Input* c_subclass_input
- { Fl_Group* o = new Fl_Group(10, 110, 280, 20);
- { c_panel_ok = new Fl_Return_Button(160, 110, 60, 20, "OK");
+ { Fl_Group* o = new Fl_Group(10, 85, 280, 20);
+ { c_panel_ok = new Fl_Return_Button(160, 85, 60, 20, "OK");
c_panel_ok->labelsize(11);
c_panel_ok->window()->hotspot(c_panel_ok);
} // Fl_Return_Button* c_panel_ok
- { c_panel_cancel = new Fl_Button(230, 110, 60, 20, "Cancel");
+ { c_panel_cancel = new Fl_Button(230, 85, 60, 20, "Cancel");
c_panel_cancel->shortcut(0xff1b);
c_panel_cancel->labelsize(11);
} // Fl_Button* c_panel_cancel
- { Fl_Box* o = new Fl_Box(10, 110, 140, 20);
+ { Fl_Box* o = new Fl_Box(10, 85, 140, 20);
Fl_Group::current()->resizable(o);
} // Fl_Box* o
o->end();
diff --git a/fluid/function_panel.fl b/fluid/function_panel.fl
index 79c809a6a..6f279d741 100644
--- a/fluid/function_panel.fl
+++ b/fluid/function_panel.fl
@@ -43,26 +43,54 @@ decl {extern class Fl_Type *Fl_Type_make(const char*);} {}
decl {extern void select_only(Fl_Type*);} {}
-Function {make_function_panel()} {open
-} {
+Function {make_function_panel()} {} {
Fl_Window function_panel {
- label {Function/Method Properties}
- xywh {419 200 290 150} type Double hide resizable
- code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal
+ label {Function/Method Properties} open
+ xywh {412 442 290 150} type Double resizable
+ code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal visible
} {
Fl_Group {} {open
xywh {10 10 270 20}
} {
- Fl_Light_Button f_public_button {
- label public
- tooltip {Make the function or method publicly accessible.} xywh {10 10 60 20} labelsize 11 when 0
+ Fl_Choice f_public_member_choice {
+ tooltip {Change member access attribute.} xywh {10 10 75 20} down_box BORDER_BOX labelsize 11 when 1 textsize 11
+ } {
+ MenuItem {} {
+ label private
+ user_data 0 user_data_type long
+ xywh {5 5 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label public
+ user_data 1 user_data_type long
+ xywh {5 5 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label protected
+ user_data 2 user_data_type long
+ xywh {5 5 100 20} labelsize 11
+ }
+ }
+ Fl_Choice f_public_choice {
+ tooltip {Change widget accessibility.} xywh {10 10 75 20} down_box BORDER_BOX labelsize 11 when 1 textsize 11
+ } {
+ MenuItem {} {
+ label local
+ user_data 0 user_data_type long
+ xywh {15 15 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label global
+ user_data 1 user_data_type long
+ xywh {15 15 100 20} labelsize 11
+ }
}
Fl_Light_Button f_c_button {
label {C declaration}
- tooltip {Declare with a C interface instead of C++.} xywh {80 10 80 20} labelsize 11
+ tooltip {Declare with a C interface instead of C++.} xywh {95 10 80 20} labelsize 11
}
Fl_Box {} {
- xywh {170 10 110 20} resizable
+ xywh {235 10 45 20} resizable
}
}
Fl_Input f_name_input {
@@ -73,7 +101,7 @@ Function {make_function_panel()} {open
label {Return Type: (blank to return outermost widget)}
tooltip {The return type of the function or method.} xywh {10 90 270 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11
}
- Fl_Group {} {open
+ Fl_Group {} {
xywh {10 120 270 20}
} {
Fl_Return_Button f_panel_ok {
@@ -91,12 +119,11 @@ Function {make_function_panel()} {open
}
}
-Function {make_code_panel()} {open
-} {
+Function {make_code_panel()} {} {
Fl_Window code_panel {
label {Code Properties}
- xywh {353 262 540 180} type Double labelsize 11 hide resizable
- code0 {o->size_range(200, 150);} modal
+ xywh {353 262 540 180} type Double labelsize 11 resizable
+ code0 {o->size_range(200, 150);} modal visible
} {
Fl_Text_Editor code_input {
xywh {10 10 520 130} box DOWN_BOX labelsize 11 textfont 4 textsize 11 resizable
@@ -122,12 +149,11 @@ Function {make_code_panel()} {open
}
}
-Function {make_codeblock_panel()} {open
-} {
+Function {make_codeblock_panel()} {} {
Fl_Window codeblock_panel {
- label {Code Block Properties} selected
- xywh {468 221 300 115} type Double labelsize 11 hide resizable
- code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal
+ label {Code Block Properties}
+ xywh {468 221 300 115} type Double labelsize 11 resizable
+ code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal visible
} {
Fl_Input code_before_input {
label {Conditional code block}
@@ -155,13 +181,37 @@ Function {make_codeblock_panel()} {open
}
}
-Function {make_declblock_panel()} {open
-} {
+Function {make_declblock_panel()} {} {
Fl_Window declblock_panel {
- label {Declaration Block Properties}
- xywh {428 215 300 135} type Double labelsize 11 hide resizable
- code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal
+ label {Declaration Block Properties} open
+ xywh {428 215 300 135} type Double labelsize 11 resizable
+ code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal visible
} {
+ Fl_Group {} {open
+ xywh {10 10 280 20}
+ } {
+ Fl_Choice declblock_public_choice {open
+ tooltip {Change widget accessibility.} xywh {10 10 140 20} down_box BORDER_BOX labelsize 11 when 0 textsize 11
+ } {
+ MenuItem {} {
+ label {in source code only}
+ user_data 0 user_data_type long
+ xywh {25 25 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label {in header and source}
+ user_data 1 user_data_type long
+ xywh {25 25 100 20} labelsize 11
+ }
+ }
+ Fl_Light_Button declblock_public_button_x {
+ label public
+ tooltip {Make the declaration publicly accessible.} xywh {10 10 60 20} labelsize 11 when 0 hide
+ }
+ Fl_Box {} {
+ xywh {155 10 135 20} resizable
+ }
+ }
Fl_Input decl_before_input {
tooltip {\#ifdef or similar conditional declaration block.} xywh {10 40 280 20} labelsize 11 align 5 when 0 textfont 4 textsize 11 resizable
}
@@ -169,7 +219,7 @@ Function {make_declblock_panel()} {open
label {"\\n...child code...\\n" is inserted here}
tooltip {\#endif or similar declaration code block.} xywh {10 75 280 20} labelsize 11 align 5 when 0 textfont 4 textsize 11
}
- Fl_Group {} {open
+ Fl_Group {} {
xywh {10 105 280 20}
} {
Fl_Return_Button declblock_panel_ok {
@@ -184,40 +234,57 @@ Function {make_declblock_panel()} {open
xywh {10 105 140 20} resizable
}
}
- Fl_Group {} {open
- xywh {10 10 280 20}
- } {
- Fl_Light_Button declblock_public_button {
- label public
- tooltip {Make the declaration publicly accessible.} xywh {10 10 60 20} labelsize 11 when 0
- }
- Fl_Box {} {
- xywh {80 10 210 20} resizable
- }
- }
}
}
-Function {make_decl_panel()} {open
+Function {make_decl_panel()} {selected
} {
Fl_Window decl_panel {
label {Declaration Properties} open
- xywh {412 206 290 150} type Double align 80 resizable
+ xywh {501 185 290 150} type Double align 80 resizable
code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} visible
} {
Fl_Group {} {open
xywh {10 10 270 20}
} {
- Fl_Light_Button decl_public_button {
- label public
- tooltip {Make the declaration publicly accessible.} xywh {10 10 60 20} labelsize 11 when 0
+ Fl_Box {} {
+ xywh {200 10 80 20} resizable
}
- Fl_Light_Button decl_static_button {
- label static
- tooltip {Prepend 'static' to private declarations in the source code, or 'extern' to public declarations in the header file.} xywh {80 10 60 20} labelsize 11 when 0
+ Fl_Choice decl_choice {
+ xywh {10 10 185 20} down_box BORDER_BOX labelsize 11 textsize 11
+ } {
+ MenuItem {} {
+ label {in source file only}
+ xywh {0 0 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label {in header file only}
+ xywh {0 0 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label {"static" in source file}
+ xywh {0 0 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label {in source and "extern" in header}
+ xywh {0 0 100 20} labelsize 11
+ }
}
- Fl_Box {} {
- xywh {150 10 130 20} resizable
+ Fl_Choice decl_class_choice {
+ xywh {10 10 75 20} down_box BORDER_BOX labelsize 11 textsize 11
+ } {
+ MenuItem {} {
+ label private
+ xywh {10 10 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label public
+ xywh {10 10 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label protected
+ xywh {10 10 100 20} labelsize 11
+ }
}
}
Fl_Input decl_input {
@@ -242,19 +309,18 @@ Function {make_decl_panel()} {open
}
}
-Function {make_class_panel()} {open
-} {
+Function {make_class_panel()} {} {
Fl_Window class_panel {
- label {Class Properties}
- xywh {449 218 300 140} type Double labelsize 11 hide resizable
- code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal
+ label {Class Properties} open
+ xywh {449 218 300 115} type Double labelsize 11 resizable
+ code0 {o->size_range(o->w(), o->h(), Fl::w(), o->h());} modal visible
} {
Fl_Group {} {open
- xywh {10 10 280 20}
+ xywh {10 10 280 20} hide
} {
Fl_Light_Button c_public_button {
label public
- tooltip {Make the class publicly accessible.} xywh {10 10 60 20} labelsize 11 when 0
+ tooltip {Make the class publicly accessible.} xywh {10 10 60 20} labelsize 11 when 0 hide
}
Fl_Box {} {
xywh {80 10 210 20} resizable
@@ -262,36 +328,35 @@ Function {make_class_panel()} {open
}
Fl_Input c_name_input {
label {Name:}
- tooltip {Name of class.} xywh {10 45 280 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 resizable
+ tooltip {Name of class.} xywh {10 20 280 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11 resizable
}
Fl_Input c_subclass_input {
label {Subclass of (text between : and \{)}
- tooltip {Name of subclass.} xywh {10 80 280 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11
+ tooltip {Name of subclass.} xywh {10 55 280 20} labelfont 1 labelsize 11 align 5 when 0 textfont 4 textsize 11
}
Fl_Group {} {open
- xywh {10 110 280 20}
+ xywh {10 85 280 20}
} {
Fl_Return_Button c_panel_ok {
label OK
- xywh {160 110 60 20} labelsize 11 hotspot
+ xywh {160 85 60 20} labelsize 11 hotspot
}
Fl_Button c_panel_cancel {
label Cancel
- xywh {230 110 60 20} shortcut 0xff1b labelsize 11
+ xywh {230 85 60 20} shortcut 0xff1b labelsize 11
}
Fl_Box {} {
- xywh {10 110 140 20} resizable
+ xywh {10 85 140 20} resizable
}
}
}
}
-Function {make_comment_panel()} {open
-} {
+Function {make_comment_panel()} {} {
Fl_Window comment_panel {
label {Comment Properties}
- xywh {422 190 550 280} type Double labelsize 11 hide resizable
- code0 {o->size_range(320, 180);} modal
+ xywh {422 190 550 280} type Double labelsize 11 resizable
+ code0 {o->size_range(320, 180);} modal visible
} {
Fl_Text_Editor comment_input {
xywh {110 10 430 230} box DOWN_BOX labelsize 11 textfont 4 textsize 11 resizable
@@ -339,7 +404,7 @@ Function {make_comment_panel()} {open
}
}
-Function {type_make_cb(Fl_Widget*,void*d)} {open return_type void
+Function {type_make_cb(Fl_Widget*,void*d)} {return_type void
} {
code {undo_checkpoint();
Fl_Type *t = Fl_Type_make((char*)d);
@@ -353,8 +418,7 @@ Function {type_make_cb(Fl_Widget*,void*d)} {open return_type void
}} {}
}
-Function {make_widgetbin()} {open
-} {
+Function {make_widgetbin()} {} {
Fl_Window widgetbin_panel {
label {Widget Bin}
xywh {411 171 550 85} type Single align 80 non_modal visible
@@ -688,12 +752,11 @@ Function {make_widgetbin()} {open
}
}
-Function {make_sourceview()} {open
-} {
+Function {make_sourceview()} {} {
Fl_Window sourceview_panel {
label {Code View}
callback toggle_sourceview_cb
- xywh {533 374 520 490} type Double align 80 resizable size_range {384 120 0 0} visible
+ xywh {430 273 520 490} type Double align 80 resizable size_range {384 120 0 0} visible
} {
Fl_Tabs sv_tab {
callback update_sourceview_position_cb
diff --git a/fluid/function_panel.h b/fluid/function_panel.h
index 08740183d..d2886d04b 100644
--- a/fluid/function_panel.h
+++ b/fluid/function_panel.h
@@ -33,8 +33,10 @@
#include <FL/Fl_Double_Window.H>
extern Fl_Double_Window *function_panel;
#include <FL/Fl_Group.H>
+#include <FL/Fl_Choice.H>
+extern Fl_Choice *f_public_member_choice;
+extern Fl_Choice *f_public_choice;
#include <FL/Fl_Light_Button.H>
-extern Fl_Light_Button *f_public_button;
extern Fl_Light_Button *f_c_button;
#include <FL/Fl_Box.H>
#include <FL/Fl_Input.H>
@@ -45,6 +47,8 @@ extern Fl_Return_Button *f_panel_ok;
#include <FL/Fl_Button.H>
extern Fl_Button *f_panel_cancel;
Fl_Double_Window* make_function_panel();
+extern Fl_Menu_Item menu_f_public_member_choice[];
+extern Fl_Menu_Item menu_f_public_choice[];
extern Fl_Double_Window *code_panel;
#include "CodeEditor.h"
extern CodeEditor *code_input;
@@ -58,19 +62,23 @@ extern Fl_Return_Button *codeblock_panel_ok;
extern Fl_Button *codeblock_panel_cancel;
Fl_Double_Window* make_codeblock_panel();
extern Fl_Double_Window *declblock_panel;
+extern Fl_Choice *declblock_public_choice;
+extern Fl_Light_Button *declblock_public_button_x;
extern Fl_Input *decl_before_input;
extern Fl_Input *decl_after_input;
extern Fl_Return_Button *declblock_panel_ok;
extern Fl_Button *declblock_panel_cancel;
-extern Fl_Light_Button *declblock_public_button;
Fl_Double_Window* make_declblock_panel();
+extern Fl_Menu_Item menu_declblock_public_choice[];
extern Fl_Double_Window *decl_panel;
-extern Fl_Light_Button *decl_public_button;
-extern Fl_Light_Button *decl_static_button;
+extern Fl_Choice *decl_choice;
+extern Fl_Choice *decl_class_choice;
extern Fl_Input *decl_input;
extern Fl_Return_Button *decl_panel_ok;
extern Fl_Button *decl_panel_cancel;
Fl_Double_Window* make_decl_panel();
+extern Fl_Menu_Item menu_decl_choice[];
+extern Fl_Menu_Item menu_decl_class_choice[];
extern Fl_Double_Window *class_panel;
extern Fl_Light_Button *c_public_button;
extern Fl_Input *c_name_input;
@@ -91,7 +99,6 @@ Fl_Double_Window* make_comment_panel();
void type_make_cb(Fl_Widget*,void*d);
#include <FL/Fl_Window.H>
extern Fl_Window *widgetbin_panel;
-extern void type_make_cb(Fl_Button*, void*);
Fl_Window* make_widgetbin();
extern void toggle_sourceview_cb(Fl_Double_Window*, void*);
extern Fl_Double_Window *sourceview_panel;
diff --git a/fluid/widget_panel.cxx b/fluid/widget_panel.cxx
index 29d1c2029..65f891614 100644
--- a/fluid/widget_panel.cxx
+++ b/fluid/widget_panel.cxx
@@ -41,6 +41,19 @@ Fl_Value_Input *widget_w_input=(Fl_Value_Input *)0;
Fl_Value_Input *widget_h_input=(Fl_Value_Input *)0;
+Fl_Menu_Item menu_[] = {
+ {"private", 0, 0, (void*)(0), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"public", 0, 0, (void*)(1), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"protected", 0, 0, (void*)(2), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {0,0,0,0,0,0,0,0,0}
+};
+
+Fl_Menu_Item menu_1[] = {
+ {"local", 0, 0, (void*)(0), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {"global", 0, 0, (void*)(1), 0, FL_NORMAL_LABEL, 0, 11, 0},
+ {0,0,0,0,0,0,0,0,0}
+};
+
Fl_Input *v_input[4]={(Fl_Input *)0};
Fl_Button *wLiveMode=(Fl_Button *)0;
@@ -62,6 +75,7 @@ Fl_Double_Window* make_widget_panel() {
o->labelsize(11);
o->callback((Fl_Callback*)propagate_load);
o->when(FL_WHEN_NEVER);
+ o->hide();
{ Fl_Group* o = new Fl_Group(95, 40, 309, 20, "Label:");
o->labelfont(1);
o->labelsize(11);
@@ -469,6 +483,7 @@ ive to the origin at construction time");
o->down_box(FL_BORDER_BOX);
o->labelfont(1);
o->labelsize(11);
+ o->textsize(11);
o->callback((Fl_Callback*)labelfont_cb);
Fl_Group::current()->resizable(o);
o->menu(fontmenu);
@@ -500,6 +515,7 @@ ive to the origin at construction time");
o->down_box(FL_BORDER_BOX);
o->labelfont(1);
o->labelsize(11);
+ o->textsize(11);
o->callback((Fl_Callback*)box_cb);
Fl_Group::current()->resizable(o);
o->menu(boxmenu);
@@ -522,6 +538,7 @@ ive to the origin at construction time");
o->down_box(FL_BORDER_BOX);
o->labelfont(1);
o->labelsize(11);
+ o->textsize(11);
o->callback((Fl_Callback*)down_box_cb);
Fl_Group::current()->resizable(o);
o->menu(boxmenu);
@@ -544,6 +561,7 @@ ive to the origin at construction time");
o->down_box(FL_BORDER_BOX);
o->labelfont(1);
o->labelsize(11);
+ o->textsize(11);
o->callback((Fl_Callback*)textfont_cb);
Fl_Group::current()->resizable(o);
o->menu(fontmenu);
@@ -574,7 +592,6 @@ ive to the origin at construction time");
o->labelsize(11);
o->callback((Fl_Callback*)propagate_load);
o->when(FL_WHEN_NEVER);
- o->hide();
{ Fl_Group* o = new Fl_Group(95, 40, 310, 20, "Class:");
o->labelfont(1);
o->labelsize(11);
@@ -594,6 +611,7 @@ ive to the origin at construction time");
o->box(FL_THIN_UP_BOX);
o->down_box(FL_BORDER_BOX);
o->labelsize(11);
+ o->textsize(11);
o->callback((Fl_Callback*)subtype_cb);
} // Fl_Choice* o
o->end();
@@ -603,7 +621,7 @@ ive to the origin at construction time");
o->labelsize(11);
o->callback((Fl_Callback*)propagate_load);
o->align(FL_ALIGN_LEFT);
- { Fl_Input* o = new Fl_Input(95, 65, 250, 20);
+ { Fl_Input* o = new Fl_Input(95, 65, 235, 20);
o->tooltip("The name of the widget.");
o->labelfont(1);
o->labelsize(11);
@@ -611,13 +629,24 @@ ive to the origin at construction time");
o->callback((Fl_Callback*)name_cb);
Fl_Group::current()->resizable(o);
} // Fl_Input* o
- { Fl_Light_Button* o = new Fl_Light_Button(345, 65, 60, 20, "public");
- o->tooltip("Make the widget publicly accessible.");
- o->selection_color((Fl_Color)1);
+ { Fl_Choice* o = new Fl_Choice(330, 65, 75, 20);
+ o->tooltip("Change member access attribute.");
+ o->down_box(FL_BORDER_BOX);
+ o->labelsize(11);
+ o->textsize(11);
+ o->callback((Fl_Callback*)name_public_member_cb);
+ o->when(FL_WHEN_CHANGED);
+ o->menu(menu_);
+ } // Fl_Choice* o
+ { Fl_Choice* o = new Fl_Choice(330, 65, 75, 20);
+ o->tooltip("Change widget accessibility.");
+ o->down_box(FL_BORDER_BOX);
o->labelsize(11);
+ o->textsize(11);
o->callback((Fl_Callback*)name_public_cb);
o->when(FL_WHEN_CHANGED);
- } // Fl_Light_Button* o
+ o->menu(menu_1);
+ } // Fl_Choice* o
o->end();
} // Fl_Group* o
{ v_input[0] = new Fl_Input(95, 90, 310, 20, "Extra Code:");
@@ -686,6 +715,7 @@ access the Widget pointer and \'v\' to access the user value.");
o->down_box(FL_BORDER_BOX);
o->labelfont(1);
o->labelsize(11);
+ o->textsize(11);
o->callback((Fl_Callback*)when_cb);
o->when(FL_WHEN_CHANGED);
o->menu(whenmenu);
diff --git a/fluid/widget_panel.fl b/fluid/widget_panel.fl
index f76bf2673..7fc44753f 100644
--- a/fluid/widget_panel.fl
+++ b/fluid/widget_panel.fl
@@ -33,8 +33,8 @@ comment {//
Function {make_widget_panel()} {open
} {
- Fl_Window {} {open selected
- xywh {711 172 420 360} type Double labelsize 11 align 80 resizable hotspot
+ Fl_Window {} {open
+ xywh {383 206 420 360} type Double labelsize 11 align 80 resizable hotspot
code0 {o->size_range(o->w(), o->h());} visible
} {
Fl_Tabs {} {
@@ -44,7 +44,7 @@ Function {make_widget_panel()} {open
Fl_Group {} {
label GUI
callback propagate_load
- xywh {10 30 400 290} labelsize 11 when 0 resizable
+ xywh {10 30 400 290} labelsize 11 when 0 hide resizable
} {
Fl_Group {} {
label {Label:}
@@ -151,7 +151,7 @@ Function {make_widget_panel()} {open
}
Fl_Group {} {
label {Position:}
- callback propagate_load open
+ callback propagate_load
xywh {95 150 300 20} labelfont 1 labelsize 11 align 4
} {
Fl_Value_Input widget_x_input {
@@ -332,12 +332,12 @@ Function {make_widget_panel()} {open
} {
Fl_Group {} {
label {Label Font:}
- callback propagate_load open
+ callback propagate_load
xywh {95 40 309 20} labelfont 1 labelsize 11 align 4
} {
Fl_Choice {} {
callback labelfont_cb open
- tooltip {The style of the label text.} xywh {95 40 170 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 resizable
+ tooltip {The style of the label text.} xywh {95 40 170 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable
code0 {extern Fl_Menu_Item fontmenu[];}
code1 {o->menu(fontmenu);}
} {}
@@ -353,12 +353,12 @@ Function {make_widget_panel()} {open
}
Fl_Group {} {
label {Box:}
- callback propagate_load open
+ callback propagate_load
xywh {95 65 309 20} labelfont 1 labelsize 11 align 4
} {
Fl_Choice {} {
callback box_cb open
- tooltip {The "up" box of the widget.} xywh {95 65 219 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 resizable
+ tooltip {The "up" box of the widget.} xywh {95 65 219 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable
code0 {extern Fl_Menu_Item boxmenu[];}
code1 {o->menu(boxmenu);}
} {}
@@ -370,12 +370,12 @@ Function {make_widget_panel()} {open
}
Fl_Group {} {
label {Down Box:}
- callback propagate_load open
+ callback propagate_load
xywh {95 90 309 20} labelfont 1 labelsize 11 align 4
} {
Fl_Choice {} {
callback down_box_cb open
- tooltip {The "down" box of the widget.} xywh {95 90 219 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 resizable
+ tooltip {The "down" box of the widget.} xywh {95 90 219 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable
code0 {extern Fl_Menu_Item boxmenu[];}
code1 {o->menu(boxmenu);}
} {}
@@ -387,12 +387,12 @@ Function {make_widget_panel()} {open
}
Fl_Group {} {
label {Text Font:}
- callback propagate_load open
+ callback propagate_load
xywh {95 115 309 20} labelfont 1 labelsize 11 align 4
} {
Fl_Choice {} {
callback textfont_cb open
- tooltip {The value text style.} xywh {95 115 170 20} box DOWN_BOX down_box BORDER_BOX labelfont 1 labelsize 11 resizable
+ tooltip {The value text style.} xywh {95 115 170 20} box DOWN_BOX down_box BORDER_BOX labelfont 1 labelsize 11 textsize 11 resizable
code0 {extern Fl_Menu_Item fontmenu[];}
code1 {o->menu(fontmenu);}
} {}
@@ -412,8 +412,8 @@ Function {make_widget_panel()} {open
}
Fl_Group {} {
label {C++}
- callback propagate_load
- xywh {10 30 400 290} labelsize 11 when 0 hide
+ callback propagate_load open
+ xywh {10 30 400 290} labelsize 11 when 0
} {
Fl_Group {} {
label {Class:}
@@ -427,22 +427,52 @@ Function {make_widget_panel()} {open
}
Fl_Choice {} {
callback subtype_cb open
- tooltip {The widget subtype.} xywh {265 40 140 20} box THIN_UP_BOX down_box BORDER_BOX labelsize 11
+ tooltip {The widget subtype.} xywh {265 40 140 20} box THIN_UP_BOX down_box BORDER_BOX labelsize 11 textsize 11
} {}
}
Fl_Group {} {
label {Name:}
- callback propagate_load
+ callback propagate_load open
xywh {95 65 310 20} labelfont 1 labelsize 11 align 4
} {
Fl_Input {} {
- callback name_cb
- tooltip {The name of the widget.} xywh {95 65 250 20} labelfont 1 labelsize 11 textsize 11 resizable
+ callback name_cb selected
+ tooltip {The name of the widget.} xywh {95 65 235 20} labelfont 1 labelsize 11 textsize 11 resizable
}
- Fl_Light_Button {} {
- label public
- callback name_public_cb
- tooltip {Make the widget publicly accessible.} xywh {345 65 60 20} selection_color 1 labelsize 11 when 1
+ Fl_Choice {} {
+ callback name_public_member_cb open
+ tooltip {Change member access attribute.} xywh {330 65 75 20} down_box BORDER_BOX labelsize 11 when 1 textsize 11
+ } {
+ MenuItem {} {
+ label private
+ user_data 0 user_data_type long
+ xywh {0 0 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label public
+ user_data 1 user_data_type long
+ xywh {0 0 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label protected
+ user_data 2 user_data_type long
+ xywh {0 0 100 20} labelsize 11
+ }
+ }
+ Fl_Choice {} {
+ callback name_public_cb open
+ tooltip {Change widget accessibility.} xywh {330 65 75 20} down_box BORDER_BOX labelsize 11 when 1 textsize 11
+ } {
+ MenuItem {} {
+ label local
+ user_data 0 user_data_type long
+ xywh {10 10 100 20} labelsize 11
+ }
+ MenuItem {} {
+ label global
+ user_data 1 user_data_type long
+ xywh {10 10 100 20} labelsize 11
+ }
}
}
Fl_Input {v_input[0]} {
@@ -485,7 +515,7 @@ Function {make_widget_panel()} {open
Fl_Choice {} {
label {When:}
callback when_cb open
- tooltip {When to call the callback function.} xywh {300 270 105 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 when 1
+ tooltip {When to call the callback function.} xywh {300 270 105 20} box THIN_UP_BOX down_box BORDER_BOX labelfont 1 labelsize 11 when 1 textsize 11
code0 {extern Fl_Menu_Item whenmenu[];}
code1 {o->menu(whenmenu);}
} {}
diff --git a/fluid/widget_panel.h b/fluid/widget_panel.h
index e4e0c5aaa..b0caa5613 100644
--- a/fluid/widget_panel.h
+++ b/fluid/widget_panel.h
@@ -94,7 +94,8 @@ extern void textcolor_cb(Fl_Button*, void*);
extern void subclass_cb(Fl_Input*, void*);
extern void subtype_cb(Fl_Choice*, void*);
extern void name_cb(Fl_Input*, void*);
-extern void name_public_cb(Fl_Light_Button*, void*);
+extern void name_public_member_cb(Fl_Choice*, void*);
+extern void name_public_cb(Fl_Choice*, void*);
extern void v_input_cb(Fl_Input*, void*);
extern Fl_Input *v_input[4];
#include "CodeEditor.h"
@@ -112,6 +113,8 @@ extern void cancel_cb(Fl_Button*, void*);
extern void live_mode_cb(Fl_Button*, void*);
extern Fl_Button *wLiveMode;
Fl_Double_Window* make_widget_panel();
+extern Fl_Menu_Item menu_[];
+extern Fl_Menu_Item menu_1[];
#endif
//