diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2005-03-09 21:26:53 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2005-03-09 21:26:53 +0000 |
| commit | fc1a4cf809de316d356672a834b7f2f797032d98 (patch) | |
| tree | 7702d3ae290313a22261baf06892ac148aaa1243 | |
| parent | 2bbee87dc306d6beeb8f0a0a4bd3b6092eb6eee5 (diff) | |
Added a new Type to fluid called 'Comment' to be used for standardized Copyright notices and other comments throughout the source code.
- simply add the 'Comment' type from the 'New' menu or the Widget Bin
- comments in the very first position will be added at the very beginning of the source file or header. Comments at the end are at the very end in source and headers as well.
- if the users enters simple text, FLUID will add '// ' in front of every line. If a line already starts with '//' or a block starts with '/*', the text will be copied verbatim.
- text can be loaded from files
- text can be stored in a database and quickly retrieved later via a pulldown menu. The pulldown menu is customizable.
Enjoy!
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4092 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | fluid/Fl_Function_Type.cxx | 201 | ||||
| -rw-r--r-- | fluid/Fl_Type.cxx | 8 | ||||
| -rw-r--r-- | fluid/Fl_Type.h | 16 | ||||
| -rw-r--r-- | fluid/about_panel.cxx | 101 | ||||
| -rw-r--r-- | fluid/about_panel.fl | 39 | ||||
| -rw-r--r-- | fluid/about_panel.h | 37 | ||||
| -rw-r--r-- | fluid/alignment_panel.cxx | 12 | ||||
| -rw-r--r-- | fluid/alignment_panel.fl | 14 | ||||
| -rw-r--r-- | fluid/alignment_panel.h | 1 | ||||
| -rw-r--r-- | fluid/code.cxx | 24 | ||||
| -rw-r--r-- | fluid/comments.h | 80 | ||||
| -rw-r--r-- | fluid/factory.cxx | 2 | ||||
| -rw-r--r-- | fluid/function_panel.cxx | 176 | ||||
| -rw-r--r-- | fluid/function_panel.fl | 165 | ||||
| -rw-r--r-- | fluid/function_panel.h | 12 | ||||
| -rw-r--r-- | fluid/pixmaps/flComment.xpm | 27 |
16 files changed, 743 insertions, 172 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index d4c38af2f..d43476d24 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -24,6 +24,8 @@ // #include <FL/Fl.H> +#include <FL/Fl_Preferences.H> +#include <FL/fl_file_chooser.H> #include "Fl_Type.h" #include <FL/fl_show_input.H> #include "../src/flstring.h" @@ -643,6 +645,205 @@ void Fl_DeclBlock_Type::write_code2() { //////////////////////////////////////////////////////////////// +Fl_Type *Fl_Comment_Type::make() { + Fl_Type *p = Fl_Type::current; + while (p && !p->is_code_block()) p = p->parent; + Fl_Comment_Type *o = new Fl_Comment_Type(); + o->in_c_ = 1; + o->in_h_ = 1; + o->style_ = 0; + o->name("my comment"); + o->add(p); + o->factory = this; + return o; +} + +void Fl_Comment_Type::write_properties() { + Fl_Type::write_properties(); + if (in_c_) write_string("in_source"); else write_string("not_in_source"); + if (in_h_) write_string("in_header"); else write_string("not_in_header"); +} + +void Fl_Comment_Type::read_property(const char *c) { + if (!strcmp(c,"in_source")) { + in_c_ = 1; + } else if (!strcmp(c,"not_in_source")) { + in_c_ = 0; + } else if (!strcmp(c,"in_header")) { + in_h_ = 1; + } else if (!strcmp(c,"not_in_header")) { + in_h_ = 0; + } else { + Fl_Type::read_property(c); + } +} + +#include "comments.h" + +static void load_comments_preset(Fl_Preferences &menu) { + static char *predefined_comment[] = { + "GNU Public License/GPL Header", "GNU Public License/GPL Footer", + "GNU Public License/LGPL Header", "GNU Public License/LGPL Footer", + "FLTK/Header", "FLTK/Footer" }; + int i; + menu.set("n", 6); + Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); + for (i=0; i<6; i++) { + menu.set(Fl_Preferences::Name(i), predefined_comment[i]); + db.set(predefined_comment[i], comment_text[i]); + } +} + +void Fl_Comment_Type::open() { + if (!comment_panel) make_comment_panel(); + const char *text = name(); + { + int i=0, n=0; + Fl_Preferences menu(Fl_Preferences::USER, "fltk.org", "fluid_comments_menu"); + comment_predefined->clear(); + comment_predefined->add("_Edit/Add current comment..."); + comment_predefined->add("_Edit/Remove last selection..."); + menu.get("n", n, -1); + if (n==-1) load_comments_preset(menu); + menu.get("n", n, 0); + for (i=0;i<n;i++) { + char *text; + menu.get(Fl_Preferences::Name(i), text, ""); + comment_predefined->add(text); + free(text); + } + } + comment_input->buffer()->text( text ? text : "" ); + comment_in_source->value(in_c_); + comment_in_header->value(in_h_); + comment_panel->show(); + const char* message = 0; + char itempath[256]; itempath[0] = 0; + int last_selected_item = 0; + for (;;) { // repeat as long as there are errors + if (message) fl_alert(message); + for (;;) { + Fl_Widget* w = Fl::readqueue(); + if (w == comment_panel_cancel) goto BREAK2; + else if (w == comment_panel_ok) break; + else if (w == comment_predefined) { + if (comment_predefined->value()==1) { + // add the current comment to the database + const char *xname = fl_input( + "Please enter a name to reference the current\ncomment in your database.\n\n" + "Use forward slashes '/' to create submenus.", + "My Comment"); + if (xname) { + char *name = strdup(xname); + for (char*s=name;*s;s++) if (*s==':') *s = ';'; + int n; + Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); + db.set(name, comment_input->buffer()->text()); + Fl_Preferences menu(Fl_Preferences::USER, "fltk.org", "fluid_comments_menu"); + menu.get("n", n, 0); + menu.set(Fl_Preferences::Name(n), name); + menu.set("n", ++n); + comment_predefined->add(name); + free(name); + } + } else if (comment_predefined->value()==2) { + // remove the last selected comment from the database + if (itempath[0]==0 || last_selected_item==0) { + fl_message("Please select an entry form this menu first."); + } else if (fl_ask("Are you sure that you want to delete the entry\n\"%s\"\nfrom the database?", itempath)) { + Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); + db.deleteEntry(itempath); + comment_predefined->remove(last_selected_item); + Fl_Preferences menu(Fl_Preferences::USER, "fltk.org", "fluid_comments_menu"); + for (int i=4, n=0; i<comment_predefined->size(); i++) { + const Fl_Menu_Item *mi = comment_predefined->menu()+i; + if (comment_predefined->item_pathname(itempath, 255, mi)==0) { + if (itempath[0]=='/') memmove(itempath, itempath+1, 255); + if (itempath[0]) menu.set(Fl_Preferences::Name(n++), itempath); + } + } + menu.set("n", n); + } + } else { + // load the selected comment from the database + if (comment_predefined->item_pathname(itempath, 255)==0) { + if (itempath[0]=='/') memmove(itempath, itempath+1, 255); + Fl_Preferences db(Fl_Preferences::USER, "fltk.org", "fluid_comments"); + char *text; + db.get(itempath, text, "(no text found in data base)"); + comment_input->buffer()->text(text); + free(text); + last_selected_item = comment_predefined->value(); + } + } + } + else if (w == comment_load) { + // load a comment from disk + const char *fname = fl_file_chooser("Pick a comment", 0L, 0L); + if (fname) { + if (comment_input->buffer()->loadfile(fname)) { + fl_alert("Error loading file\n%s", fname); + } + } + } + else if (!w) Fl::wait(); + } + char*c = comment_input->buffer()->text(); + name(c); + free(c); + in_c_ = comment_in_source->value(); + in_h_ = comment_in_header->value(); + break; + } + BREAK2: + comment_panel->hide(); +} + +Fl_Comment_Type Fl_Comment_type; + +void Fl_Comment_Type::write_code1() { + const char* c = name(); + if (!c) return; + if (!in_c_ && !in_h_) return; + // find out if there is already a valid comment: + const char *s = c; + while (isspace(*s)) s++; + // if this seems to be a C style comment, copy the block as is + // (it's up to the user to correctly close the comment) + if (s[0]=='/' && s[1]=='*') { + if (in_h_) write_h("%s\n", c); + if (in_c_) write_c("%s\n", c); + return; + } + // copy the comment line by line, add the double slash if needed + char *txt = strdup(c); + char *b = txt, *e = txt; + for (;;) { + // find the end of the line and set it to NUL + while (*e && *e!='\n') e++; + char eol = *e; + *e = 0; + // check if there is a C++ style comment at the beginning of the line + char *s = b; + while (isspace(*s)) s++; + if (s!=e && ( s[0]!='/' || s[1]!='/') ) { + // if no comment marker was found, we add one ourselves + if (in_h_) write_h("// "); + if (in_c_) write_c("// "); + } + // now copy the rest of the line + if (in_h_) write_h("%s\n", b); + if (in_c_) write_c("%s\n", b); + if (eol==0) break; + *e++ = eol; + b = e; + } +} + +void Fl_Comment_Type::write_code2() {} + +//////////////////////////////////////////////////////////////// + const char* Fl_Type::class_name(const int need_nest) const { Fl_Type* p = parent; while (p) { diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx index f6bda685e..1817374ba 100644 --- a/fluid/Fl_Type.cxx +++ b/fluid/Fl_Type.cxx @@ -60,6 +60,7 @@ static Fl_Pixmap lock_pixmap(lock_xpm); #include "pixmaps/flFunction.xpm" #include "pixmaps/flCode.xpm" #include "pixmaps/flCodeBlock.xpm" +#include "pixmaps/flComment.xpm" #include "pixmaps/flDeclaration.xpm" #include "pixmaps/flDeclarationBlock.xpm" #include "pixmaps/flClass.xpm" @@ -106,6 +107,7 @@ static Fl_Pixmap group_pixmap(flGroup_xpm); static Fl_Pixmap function_pixmap(flFunction_xpm); static Fl_Pixmap code_pixmap(flCode_xpm); static Fl_Pixmap codeblock_pixmap(flCodeBlock_xpm); +static Fl_Pixmap comment_pixmap(flComment_xpm); static Fl_Pixmap declaration_pixmap(flDeclaration_xpm); static Fl_Pixmap declarationblock_pixmap(flDeclarationBlock_xpm); static Fl_Pixmap class_pixmap(flClass_xpm); @@ -151,7 +153,7 @@ Fl_Pixmap *pixmap[] = { 0, &window_pixmap, &button_pixmap, &checkbutton_pixmap, &output_pixmap, &textdisplay_pixmap, &textedit_pixmap, &fileinput_pixmap, &browser_pixmap, /* 27..32 */ &checkbrowser_pixmap, &filebrowser_pixmap, &clock_pixmap, &help_pixmap, &progress_pixmap, /* 33..36 */ &slider_pixmap, &scrollbar_pixmap, &valueslider_pixmap, &adjuster_pixmap, &counter_pixmap, /* 37..41 */ - &dial_pixmap, &roller_pixmap, &valueinput_pixmap, &valueoutput_pixmap, /* 42..45*/ }; + &dial_pixmap, &roller_pixmap, &valueinput_pixmap, &valueoutput_pixmap, &comment_pixmap /* 42..46*/ }; //////////////////////////////////////////////////////////////// @@ -565,7 +567,8 @@ int storestring(const char *n, const char * & p, int nostrip) { } void Fl_Type::name(const char *n) { - if (storestring(n,name_)) { + int nostrip = is_comment(); + if (storestring(n,name_,nostrip)) { if (visible) widget_browser->redraw(); } } @@ -615,6 +618,7 @@ int Fl_Type::is_group() const {return 0;} 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_comment() const {return 0;} int Fl_Type::is_class() const {return 0;} int Fl_Type::is_public() const {return 1;} diff --git a/fluid/Fl_Type.h b/fluid/Fl_Type.h index 72574a5bc..6e2f63e4e 100644 --- a/fluid/Fl_Type.h +++ b/fluid/Fl_Type.h @@ -125,6 +125,7 @@ public: virtual int is_window() const; virtual int is_code_block() const; virtual int is_decl_block() const; + virtual int is_comment() const; virtual int is_class() const; virtual int is_public() const; @@ -213,6 +214,21 @@ public: int pixmapID() { return 11; } }; +class Fl_Comment_Type : public Fl_Type { + char in_c_, in_h_, style_; +public: + Fl_Type *make(); + void write_code1(); + void write_code2(); + void open(); + virtual const char *type_name() {return "comment";} + void write_properties(); + void read_property(const char *); + virtual int is_public() const { return 1; } + virtual int is_comment() const { return 1; } + int pixmapID() { return 46; } +}; + class Fl_Class_Type : public Fl_Type { const char* subclass_of; char public_; diff --git a/fluid/about_panel.cxx b/fluid/about_panel.cxx index 7e2d9ce64..3fa9368e4 100644 --- a/fluid/about_panel.cxx +++ b/fluid/about_panel.cxx @@ -1,9 +1,34 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0104 +// +// "$Id$" +// +// About Panel for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems to "fltk-bugs@fltk.org". +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0107 #include "about_panel.h" void show_help(const char *name); -Fl_Window *about_panel=(Fl_Window *)0; +Fl_Double_Window *about_panel=(Fl_Double_Window *)0; Fl_Group *display_group=(Fl_Group *)0; @@ -15,89 +40,89 @@ static void cb_OK(Fl_Return_Button* o, void*) { ((Fl_Window*)(o->parent()))->hide(); } -Fl_Window* make_about_panel() { - Fl_Window* w; - { Fl_Window* o = about_panel = new Fl_Window(309, 258, "about fluid"); +Fl_Double_Window* make_about_panel() { + Fl_Double_Window* w; + { Fl_Double_Window* o = about_panel = new Fl_Double_Window(309, 258, "about fluid"); w = o; o->box(FL_UP_BOX); - o->color(97); - o->selection_color(47); + o->color((Fl_Color)97); + o->selection_color(FL_DARK1); w->hotspot(o); { Fl_Group* o = display_group = new Fl_Group(10, 10, 290, 240); { Fl_Box* o = new Fl_Box(50, 30, 70, 150); o->box(FL_ROUND_UP_BOX); - o->color(14); - o->selection_color(47); - o->labelcolor(6); + o->color((Fl_Color)14); + o->selection_color(FL_DARK1); + o->labelcolor((Fl_Color)6); } { Fl_Box* o = new Fl_Box(50, 10, 90, 40); o->box(FL_FLAT_BOX); - o->color(97); - o->selection_color(47); + o->color((Fl_Color)97); + o->selection_color(FL_DARK1); } { Fl_Box* o = new Fl_Box(60, 50, 50, 70); o->box(FL_DOWN_BOX); - o->color(6); - o->selection_color(47); + o->color((Fl_Color)6); + o->selection_color(FL_DARK1); } { Fl_Box* o = new Fl_Box(40, 30, 90, 30); o->box(FL_ROUND_UP_BOX); - o->color(6); - o->selection_color(47); - o->labelcolor(6); + o->color((Fl_Color)6); + o->selection_color(FL_DARK1); + o->labelcolor((Fl_Color)6); o->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE); } { Fl_Box* o = new Fl_Box(10, 150, 150, 90, "fluid"); o->box(FL_ROUND_UP_BOX); - o->color(14); - o->selection_color(47); + o->color((Fl_Color)14); + o->selection_color(FL_DARK1); o->labeltype(FL_SHADOW_LABEL); o->labelfont(1); o->labelsize(40); - o->labelcolor(6); + o->labelcolor((Fl_Color)6); } { Fl_Box* o = new Fl_Box(50, 150, 67, 10); o->box(FL_FLAT_BOX); - o->color(14); - o->selection_color(47); + o->color((Fl_Color)14); + o->selection_color(FL_DARK1); } { Fl_Box* o = new Fl_Box(79, 160, 15, 15, "` "); o->box(FL_OVAL_BOX); - o->color(6); - o->selection_color(47); + o->color((Fl_Color)6); + o->selection_color(FL_DARK1); o->labelsize(20); - o->labelcolor(7); + o->labelcolor(FL_BACKGROUND2_COLOR); o->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE); } { Fl_Box* o = new Fl_Box(70, 145, 15, 15, "` "); o->box(FL_OVAL_BOX); - o->color(6); - o->selection_color(47); + o->color((Fl_Color)6); + o->selection_color(FL_DARK1); o->labelsize(20); - o->labelcolor(7); + o->labelcolor(FL_BACKGROUND2_COLOR); o->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE); } { Fl_Box* o = new Fl_Box(84, 125, 15, 15, "` "); o->box(FL_OVAL_BOX); - o->color(6); - o->selection_color(47); + o->color((Fl_Color)6); + o->selection_color(FL_DARK1); o->labelsize(20); - o->labelcolor(7); + o->labelcolor(FL_BACKGROUND2_COLOR); o->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE); } { Fl_Box* o = new Fl_Box(140, 27, 160, 123, "FLTK User\nInterface\nDesigner\nVersion 1.1.6"); o->box(FL_OVAL_BOX); - o->color(12); - o->selection_color(47); + o->color((Fl_Color)12); + o->selection_color(FL_DARK1); o->labeltype(FL_SHADOW_LABEL); o->labelfont(1); o->labelsize(18); - o->labelcolor(7); + o->labelcolor(FL_BACKGROUND2_COLOR); } - { Fl_Button* o = new Fl_Button(181, 176, 115, 30, "\251""1998-2005 by\nBill Spitzak and others"); + { Fl_Button* o = new Fl_Button(181, 176, 115, 30, "\251""1998-2004 by\nBill Spitzak and others"); o->box(FL_THIN_UP_BOX); o->labelsize(10); - o->labelcolor(136); + o->labelcolor(FL_DARK_BLUE); o->callback((Fl_Callback*)cb_1998); } o->end(); @@ -111,3 +136,7 @@ Fl_Window* make_about_panel() { } return w; } + +// +// End of "$Id$". +// diff --git a/fluid/about_panel.fl b/fluid/about_panel.fl index 8fd23966b..429dedbf8 100644 --- a/fluid/about_panel.fl +++ b/fluid/about_panel.fl @@ -1,7 +1,34 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0104 +version 1.0107 header_name {.h} code_name {.cxx} +comment {// +// "$Id$" +// +// About Panel for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems to "fltk-bugs@fltk.org". +// +} {in_source in_header +} + decl {void show_help(const char *name);} {public } @@ -9,7 +36,7 @@ Function {make_about_panel()} {open } { Fl_Window about_panel { label {about fluid} open - xywh {78 110 309 258} box UP_BOX color 97 selection_color 47 hotspot non_modal visible + xywh {337 120 309 258} type Double box UP_BOX color 97 selection_color 47 hotspot non_modal visible } { Fl_Group display_group {open xywh {10 10 290 240} @@ -55,7 +82,7 @@ Version 1.1.6} Fl_Button {} { label {©1998-2004 by Bill Spitzak and others} - callback {show_help("license.html");} selected + callback {show_help("license.html");} xywh {181 176 115 30} box THIN_UP_BOX labelsize 10 labelcolor 136 } } @@ -66,3 +93,9 @@ Bill Spitzak and others} } } } + +comment { +// +// End of "$Id$". +//} {selected in_source in_header +} diff --git a/fluid/about_panel.h b/fluid/about_panel.h index 2d5435388..88d99193d 100644 --- a/fluid/about_panel.h +++ b/fluid/about_panel.h @@ -1,15 +1,44 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0104 +// +// "$Id$" +// +// About Panel for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2005 by Bill Spitzak and others. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Library General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// USA. +// +// Please report all bugs and problems to "fltk-bugs@fltk.org". +// + +// generated by Fast Light User Interface Designer (fluid) version 1.0107 #ifndef about_panel_h #define about_panel_h #include <FL/Fl.H> extern void show_help(const char *name); -#include <FL/Fl_Window.H> -extern Fl_Window *about_panel; +#include <FL/Fl_Double_Window.H> +extern Fl_Double_Window *about_panel; #include <FL/Fl_Group.H> extern Fl_Group *display_group; #include <FL/Fl_Box.H> #include <FL/Fl_Button.H> #include <FL/Fl_Return_Button.H> -Fl_Window* make_about_panel(); +Fl_Double_Window* make_about_panel(); #endif + +// +// End of "$Id$". +// diff --git a/fluid/alignment_panel.cxx b/fluid/alignment_panel.cxx index b66ec73d4..fdca44967 100644 --- a/fluid/alignment_panel.cxx +++ b/fluid/alignment_panel.cxx @@ -33,7 +33,7 @@ Fl_Input *i18n_function_input=(Fl_Input *)0; Fl_Double_Window* make_project_window() { Fl_Double_Window* w; - { Fl_Double_Window* o = project_window = new Fl_Double_Window(365, 208, "Project Settings"); + { Fl_Double_Window* o = project_window = new Fl_Double_Window(365, 210, "Project Settings"); w = o; { Fl_Button* o = new Fl_Button(295, 175, 60, 25, "Close"); o->tooltip("Close this dialog."); @@ -76,7 +76,6 @@ Fl_Double_Window* make_project_window() { } { Fl_Group* o = new Fl_Group(10, 30, 345, 134, "Internationalization"); o->labelsize(11); - o->hide(); { Fl_Choice* o = i18n_type_chooser = new Fl_Choice(100, 42, 100, 20, "Use:"); o->tooltip("Type of internationalization to use."); o->box(FL_THIN_UP_BOX); @@ -121,15 +120,6 @@ Fl_Double_Window* make_project_window() { } o->end(); } - { Fl_Group* o = new Fl_Group(10, 30, 345, 134, "Copyright"); - o->labelsize(11); - { Fl_Text_Editor* o = new Fl_Text_Editor(15, 35, 335, 124); - o->labelsize(11); - o->textfont(4); - o->textsize(11); - } - o->end(); - } o->end(); } o->set_modal(); diff --git a/fluid/alignment_panel.fl b/fluid/alignment_panel.fl index ce208982e..c7a8cc574 100644 --- a/fluid/alignment_panel.fl +++ b/fluid/alignment_panel.fl @@ -12,7 +12,7 @@ Function {make_project_window()} {open } { Fl_Window project_window { label {Project Settings} open - xywh {4 21 365 210} type Double + xywh {312 395 365 210} type Double code0 {\#include <FL/Fl_Preferences.H>} code1 {\#include <FL/Fl_Tooltip.H>} modal visible } { @@ -21,7 +21,7 @@ Function {make_project_window()} {open callback {project_window->hide();} tooltip {Close this dialog.} xywh {295 175 60 25} } - Fl_Tabs {} {open + Fl_Tabs {} {open selected xywh {10 10 345 154} labelsize 11 } { Fl_Group {} { @@ -52,7 +52,7 @@ Function {make_project_window()} {open } Fl_Group {} { label Internationalization open - xywh {10 30 345 134} labelsize 11 hide + xywh {10 30 345 134} labelsize 11 } { Fl_Choice i18n_type_chooser { label {Use:} @@ -93,14 +93,6 @@ Function {make_project_window()} {open tooltip {The function to call to internationalize the labels and tooltips.} xywh {100 92 245 20} box THIN_DOWN_BOX labelsize 11 textfont 4 textsize 11 } } - Fl_Group {} { - label Copyright open - xywh {10 30 345 134} labelsize 11 - } { - Fl_Text_Editor {} {selected - xywh {20 40 325 114} labelsize 11 textfont 4 textsize 11 - } - } } } } diff --git a/fluid/alignment_panel.h b/fluid/alignment_panel.h index 9815beeaa..87d51339b 100644 --- a/fluid/alignment_panel.h +++ b/fluid/alignment_panel.h @@ -29,7 +29,6 @@ extern Fl_Input *i18n_include_input; extern Fl_Input *i18n_file_input; extern Fl_Input *i18n_set_input; extern Fl_Input *i18n_function_input; -#include <FL/Fl_Text_Editor.H> Fl_Double_Window* make_project_window(); extern Fl_Menu_Item menu_i18n_type_chooser[]; extern void i18n_cb(Fl_Choice *,void *); diff --git a/fluid/code.cxx b/fluid/code.cxx index b07c9675c..f8fd58e6e 100644 --- a/fluid/code.cxx +++ b/fluid/code.cxx @@ -246,7 +246,9 @@ int write_number; // recursively dump code, putting children between the two parts // of the parent code: static Fl_Type* write_code(Fl_Type* p) { - p->write_code1(); + // don't write the last comment until the very end + if (!(p==Fl_Type::last && p->is_comment())) + p->write_code1(); Fl_Type* q; for (q = p->next; q && q->level > p->level;) q = write_code(q); p->write_code2(); @@ -271,6 +273,15 @@ int write_code(const char *s, const char *t) { if (!f) {fclose(code_file); return 0;} header_file = f; } + // if the first entry in the Type tree is a comment, then it is probably + // a copyright notice. We print that before anything else in the file! + Fl_Type* first_type = Fl_Type::first; + if (first_type && first_type->is_comment()) { + // this is ok, because comments have no children or code2 blocks + first_type->write_code1(); + first_type = first_type->next; + } + const char *hdr = "\ // generated by Fast Light User Interface Designer (fluid) version %.4f\n\n"; fprintf(header_file, hdr, FL_VERSION); @@ -311,7 +322,7 @@ int write_code(const char *s, const char *t) { write_c("#include \"%s\"\n", t); } } - for (Fl_Type* p = Fl_Type::first; p;) { + for (Fl_Type* p = first_type; p;) { // write all static data for this & all children first p->write_static(); for (Fl_Type* q = p->next; q && q->level > p->level; q = q->next) @@ -323,9 +334,16 @@ int write_code(const char *s, const char *t) { delete included_root; included_root = 0; if (!s) return 1; + + fprintf(header_file, "#endif\n"); + + Fl_Type* last_type = Fl_Type::last; + if (last_type && last_type->is_comment()) { + last_type->write_code1(); + } + int x = fclose(code_file); code_file = 0; - fprintf(header_file, "#endif\n"); int y = fclose(header_file); header_file = 0; return x >= 0 && y >= 0; diff --git a/fluid/comments.h b/fluid/comments.h new file mode 100644 index 000000000..0a9887ad1 --- /dev/null +++ b/fluid/comments.h @@ -0,0 +1,80 @@ + +static char *comment_text[] = { + // GNU Public License/GPL Header + "//\n" + "// NameOfProgram, ShortDescription\n" + "// Copyright (C) YYYY NameOfAuthor\n" + "//\n" + "// This program is free software; you can redistribute it and/or\n" + "// modify it under the terms of the GNU General Public License\n" + "// as published by the Free Software Foundation; either version 2\n" + "// of the License, or (at your option) any later version.\n" + "//\n" + "// This program is distributed in the hope that it will be useful,\n" + "// but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "// GNU General Public License for more details.\n" + "//\n" + "// You should have received a copy of the GNU General Public License\n" + "// along with this program; if not, write to the Free Software\n" + "// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + "//\n", + // GNU Public License/GPL Footer + "\n//\n" + "// NameOfProgram, ShortDescription\n" + "// Copyright (C) YYYY NameOfAuthor\n" + "//", + // GNU Public License/LGPL Header + "//\n" + "// NameOfLibrary, ShortDescription\n" + "// Copyright (C) YYYY NameOfAuthor\n" + "//\n" + "// This library is free software; you can redistribute it and/or\n" + "// modify it under the terms of the GNU Lesser General Public\n" + "// License as published by the Free Software Foundation; either\n" + "// version 2.1 of the License, or (at your option) any later version.\n" + "//\n" + "// This library is distributed in the hope that it will be useful,\n" + "// but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "// GNU Lesser General Public License for more details.\n" + "//\n" + "// You should have received a copy of the GNU Lesser General Public\n" + "// License along with this program; if not, write to the Free Software\n" + "// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n" + "//\n", + // GNU Public License/LGPL Footer + "\n//\n" + "// NameOfLibrary, ShortDescription\n" + "// Copyright (C) YYYY NameOfAuthor\n" + "//", + // FLTK/Header + "//\n" + "// \"$Id$\"\n" + "//\n" + "// ... for the Fast Light Tool Kit (FLTK).\n" + "//\n" + "// Copyright 1998-2005 by Bill Spitzak and others.\n" + "//\n" + "// This library is free software; you can redistribute it and/or\n" + "// modify it under the terms of the GNU Library General Public\n" + "// License as published by the Free Software Foundation; either\n" + "// version 2 of the License, or (at your option) any later version.\n" + "//\n" + "// This library is distributed in the hope that it will be useful,\n" + "// but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" + "// Library General Public License for more details.\n" + "//\n" + "// You should have received a copy of the GNU Library General Public\n" + "// License along with this library; if not, write to the Free Software\n" + "// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307\n" + "// USA.\n" + "//\n" + "// Please report all bugs and problems to \"fltk-bugs@fltk.org\".\n" + "//\n", + // FLTK/Footer + "\n//\n" + "// End of \"$Id$\".\n" + "//", +}; diff --git a/fluid/factory.cxx b/fluid/factory.cxx index b2dac3573..2e8bc496d 100644 --- a/fluid/factory.cxx +++ b/fluid/factory.cxx @@ -801,6 +801,7 @@ extern class Fl_Code_Type Fl_Code_type; extern class Fl_CodeBlock_Type Fl_CodeBlock_type; extern class Fl_Decl_Type Fl_Decl_type; extern class Fl_DeclBlock_Type Fl_DeclBlock_type; +extern class Fl_Comment_Type Fl_Comment_type; extern class Fl_Class_Type Fl_Class_type; extern class Fl_Window_Type Fl_Window_type; extern class Fl_Group_Type Fl_Group_type; @@ -832,6 +833,7 @@ Fl_Menu_Item New_Menu[] = { {"declaration",0,cb,(void*)&Fl_Decl_type}, {"declaration block",0,cb,(void*)&Fl_DeclBlock_type}, {"class",0,cb,(void*)&Fl_Class_type}, + {"comment",0,cb,(void*)&Fl_Comment_type}, {0}, {"group",0,0,0,FL_SUBMENU}, {0,0,cb,(void*)&Fl_Window_type}, diff --git a/fluid/function_panel.cxx b/fluid/function_panel.cxx index f2fba6ec0..ba261b189 100644 --- a/fluid/function_panel.cxx +++ b/fluid/function_panel.cxx @@ -1,4 +1,4 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0105 +// generated by Fast Light User Interface Designer (fluid) version 1.0107 #include "function_panel.h" #include <FL/Fl_Pixmap.H> @@ -282,6 +282,78 @@ Fl_Window* make_class_panel() { return w; } +Fl_Window *comment_panel=(Fl_Window *)0; + +Fl_Text_Editor *comment_input=(Fl_Text_Editor *)0; + +Fl_Return_Button *comment_panel_ok=(Fl_Return_Button *)0; + +Fl_Button *comment_panel_cancel=(Fl_Button *)0; + +Fl_Light_Button *comment_in_source=(Fl_Light_Button *)0; + +Fl_Light_Button *comment_in_header=(Fl_Light_Button *)0; + +Fl_Menu_Button *comment_predefined=(Fl_Menu_Button *)0; + +Fl_Button *comment_load=(Fl_Button *)0; + +Fl_Window* make_comment_panel() { + Fl_Window* w; + { Fl_Window* o = comment_panel = new Fl_Window(545, 290, "comment"); + w = o; + { Fl_Group* o = new Fl_Group(100, 10, 435, 235); + o->box(FL_DOWN_FRAME); + { Fl_Text_Editor* o = comment_input = new Fl_Text_Editor(102, 12, 431, 231); + o->box(FL_NO_BOX); + Fl_Group::current()->resizable(o); + o->buffer(new Fl_Text_Buffer); + o->textfont(FL_COURIER); + o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE); + } + o->end(); + Fl_Group::current()->resizable(o); + } + { Fl_Group* o = new Fl_Group(368, 255, 167, 25); + { Fl_Return_Button* o = comment_panel_ok = new Fl_Return_Button(370, 255, 80, 25, "OK"); + w->hotspot(o); + } + { Fl_Button* o = comment_panel_cancel = new Fl_Button(455, 255, 80, 25, "Cancel"); + o->shortcut(0xff1b); + } + { Fl_Box* o = new Fl_Box(368, 255, 1, 1); + Fl_Group::current()->resizable(o); + } + o->end(); + } + { Fl_Group* o = new Fl_Group(10, 10, 80, 127); + { Fl_Light_Button* o = comment_in_source = new Fl_Light_Button(10, 10, 80, 25, "in source"); + o->tooltip("Put the comment into the source (.cxx) file."); + o->labelsize(10); + o->when(FL_WHEN_NEVER); + } + { Fl_Light_Button* o = comment_in_header = new Fl_Light_Button(10, 40, 80, 25, "in header"); + o->tooltip("Put the comment into the header (.h) file."); + o->labelsize(10); + o->when(FL_WHEN_NEVER); + } + { Fl_Menu_Button* o = comment_predefined = new Fl_Menu_Button(10, 75, 80, 25, "predefined"); + o->labelsize(10); + } + { Fl_Button* o = comment_load = new Fl_Button(10, 110, 80, 25, "load..."); + o->labelsize(10); + } + { Fl_Box* o = new Fl_Box(10, 135, 2, 2); + Fl_Group::current()->resizable(o); + } + o->end(); + } + o->set_modal(); + o->end(); + } + return w; +} + void type_make_cb(Fl_Widget*w,void*d) { Fl_Type *t = Fl_Type_make((char*)d); if (t) {select_only(t); modflag = 1; t->open();} @@ -291,9 +363,9 @@ Fl_Window *widgetbin_panel=(Fl_Window *)0; Fl_Window* make_widgetbin() { Fl_Window* w; - { Fl_Window* o = widgetbin_panel = new Fl_Window(440, 100, "Bin"); + { Fl_Window* o = widgetbin_panel = new Fl_Window(468, 100, "Bin"); w = o; - { Fl_Group* o = new Fl_Group(3, 3, 50, 74); + { Fl_Group* o = new Fl_Group(3, 3, 74, 74); o->box(FL_THIN_DOWN_BOX); { Fl_Button* o = new Fl_Button(4, 4, 24, 24); o->tooltip("Function"); @@ -331,47 +403,53 @@ Fl_Window* make_widgetbin() { o->callback((Fl_Callback*)type_make_cb, (void*)("declblock")); o->image(pixmap[11]); } + { Fl_Button* o = new Fl_Button(52, 4, 24, 24); + o->tooltip("Function"); + o->box(FL_THIN_UP_BOX); + o->callback((Fl_Callback*)type_make_cb, (void*)("comment")); + o->image(pixmap[46]); + } o->end(); } - { Fl_Group* o = new Fl_Group(55, 3, 74, 74); + { Fl_Group* o = new Fl_Group(79, 3, 74, 74); o->box(FL_THIN_DOWN_BOX); - { Fl_Button* o = new Fl_Button(56, 4, 24, 24); + { Fl_Button* o = new Fl_Button(80, 4, 24, 24); o->tooltip("Window"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Window")); o->image(pixmap[1]); } - { Fl_Button* o = new Fl_Button(80, 4, 24, 24); + { Fl_Button* o = new Fl_Button(104, 4, 24, 24); o->tooltip("Group"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Group")); o->image(pixmap[6]); } - { Fl_Button* o = new Fl_Button(104, 4, 24, 24); + { Fl_Button* o = new Fl_Button(128, 4, 24, 24); o->tooltip("Pack"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Pack")); o->image(pixmap[22]); } - { Fl_Button* o = new Fl_Button(56, 28, 24, 24); + { Fl_Button* o = new Fl_Button(80, 28, 24, 24); o->tooltip("Tabs"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Tabs")); o->image(pixmap[13]); } - { Fl_Button* o = new Fl_Button(80, 28, 24, 24); + { Fl_Button* o = new Fl_Button(104, 28, 24, 24); o->tooltip("Scroll"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Scroll")); o->image(pixmap[19]); } - { Fl_Button* o = new Fl_Button(56, 52, 24, 24); + { Fl_Button* o = new Fl_Button(80, 52, 24, 24); o->tooltip("Tile"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Tile")); o->image(pixmap[20]); } - { Fl_Button* o = new Fl_Button(80, 52, 24, 24); + { Fl_Button* o = new Fl_Button(104, 52, 24, 24); o->tooltip("Wizard"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Wizard")); @@ -379,39 +457,39 @@ Fl_Window* make_widgetbin() { } o->end(); } - { Fl_Group* o = new Fl_Group(131, 3, 50, 74); + { Fl_Group* o = new Fl_Group(155, 3, 50, 74); o->box(FL_THIN_DOWN_BOX); - { Fl_Button* o = new Fl_Button(132, 4, 24, 24); + { Fl_Button* o = new Fl_Button(156, 4, 24, 24); o->tooltip("Button"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Button")); o->image(pixmap[2]); } - { Fl_Button* o = new Fl_Button(156, 4, 24, 24); + { Fl_Button* o = new Fl_Button(180, 4, 24, 24); o->tooltip("Return Button"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Return_Button")); o->image(pixmap[23]); } - { Fl_Button* o = new Fl_Button(132, 28, 24, 24); + { Fl_Button* o = new Fl_Button(156, 28, 24, 24); o->tooltip("Light Button"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Light_Button")); o->image(pixmap[24]); } - { Fl_Button* o = new Fl_Button(156, 28, 24, 24); + { Fl_Button* o = new Fl_Button(180, 28, 24, 24); o->tooltip("Repeat Button"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Repeat_Button")); o->image(pixmap[25]); } - { Fl_Button* o = new Fl_Button(132, 52, 24, 24); + { Fl_Button* o = new Fl_Button(156, 52, 24, 24); o->tooltip("Check Button"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Check_Button")); o->image(pixmap[3]); } - { Fl_Button* o = new Fl_Button(156, 52, 24, 24); + { Fl_Button* o = new Fl_Button(180, 52, 24, 24); o->tooltip("Round Button"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Round_Button")); @@ -419,57 +497,57 @@ Fl_Window* make_widgetbin() { } o->end(); } - { Fl_Group* o = new Fl_Group(183, 3, 74, 74); + { Fl_Group* o = new Fl_Group(207, 3, 74, 74); o->box(FL_THIN_DOWN_BOX); - { Fl_Button* o = new Fl_Button(184, 4, 24, 24); + { Fl_Button* o = new Fl_Button(208, 4, 24, 24); o->tooltip("Slider"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Slider")); o->image(pixmap[37]); } - { Fl_Button* o = new Fl_Button(208, 4, 24, 24); + { Fl_Button* o = new Fl_Button(232, 4, 24, 24); o->tooltip("Scroll Bar"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Scrollbar")); o->image(pixmap[38]); } - { Fl_Button* o = new Fl_Button(232, 4, 24, 24); + { Fl_Button* o = new Fl_Button(256, 4, 24, 24); o->tooltip("Value Slider"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Value_Slider")); o->image(pixmap[39]); } - { Fl_Button* o = new Fl_Button(184, 28, 24, 24); + { Fl_Button* o = new Fl_Button(208, 28, 24, 24); o->tooltip("Adjuster"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Adjuster")); o->image(pixmap[40]); } - { Fl_Button* o = new Fl_Button(208, 28, 24, 24); + { Fl_Button* o = new Fl_Button(232, 28, 24, 24); o->tooltip("Counter"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Counter")); o->image(pixmap[41]); } - { Fl_Button* o = new Fl_Button(232, 28, 24, 24); + { Fl_Button* o = new Fl_Button(256, 28, 24, 24); o->tooltip("Dial"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Dial")); o->image(pixmap[42]); } - { Fl_Button* o = new Fl_Button(184, 52, 24, 24); + { Fl_Button* o = new Fl_Button(208, 52, 24, 24); o->tooltip("Roller"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Roller")); o->image(pixmap[43]); } - { Fl_Button* o = new Fl_Button(208, 52, 24, 24); + { Fl_Button* o = new Fl_Button(232, 52, 24, 24); o->tooltip("Value Input"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Value_Input")); o->image(pixmap[44]); } - { Fl_Button* o = new Fl_Button(232, 52, 24, 24); + { Fl_Button* o = new Fl_Button(256, 52, 24, 24); o->tooltip("Value Output"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Value_Output")); @@ -477,33 +555,33 @@ Fl_Window* make_widgetbin() { } o->end(); } - { Fl_Group* o = new Fl_Group(259, 3, 50, 74); + { Fl_Group* o = new Fl_Group(283, 3, 50, 74); o->box(FL_THIN_DOWN_BOX); - { Fl_Button* o = new Fl_Button(260, 4, 24, 24); + { Fl_Button* o = new Fl_Button(284, 4, 24, 24); o->tooltip("Input"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Input")); o->image(pixmap[14]); } - { Fl_Button* o = new Fl_Button(284, 4, 24, 24); + { Fl_Button* o = new Fl_Button(308, 4, 24, 24); o->tooltip("Output"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Output")); o->image(pixmap[27]); } - { Fl_Button* o = new Fl_Button(260, 28, 24, 24); + { Fl_Button* o = new Fl_Button(284, 28, 24, 24); o->tooltip("Text Edit"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Text_Editor")); o->image(pixmap[29]); } - { Fl_Button* o = new Fl_Button(284, 28, 24, 24); + { Fl_Button* o = new Fl_Button(308, 28, 24, 24); o->tooltip("Text Display"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Text_Display")); o->image(pixmap[28]); } - { Fl_Button* o = new Fl_Button(260, 52, 24, 24); + { Fl_Button* o = new Fl_Button(284, 52, 24, 24); o->tooltip("File Input"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_File_Input")); @@ -511,33 +589,33 @@ Fl_Window* make_widgetbin() { } o->end(); } - { Fl_Group* o = new Fl_Group(311, 3, 50, 74); + { Fl_Group* o = new Fl_Group(335, 3, 50, 74); o->box(FL_THIN_DOWN_BOX); - { Fl_Button* o = new Fl_Button(312, 4, 24, 24); + { Fl_Button* o = new Fl_Button(336, 4, 24, 24); o->tooltip("Menu Bar"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Menu_Bar")); o->image(pixmap[17]); } - { Fl_Button* o = new Fl_Button(336, 4, 24, 24); + { Fl_Button* o = new Fl_Button(360, 4, 24, 24); o->tooltip("Menu Item"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("menuitem")); o->image(pixmap[16]); } - { Fl_Button* o = new Fl_Button(312, 28, 24, 24); + { Fl_Button* o = new Fl_Button(336, 28, 24, 24); o->tooltip("Menu Button"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Menu_Button")); o->image(pixmap[26]); } - { Fl_Button* o = new Fl_Button(336, 28, 24, 24); + { Fl_Button* o = new Fl_Button(360, 28, 24, 24); o->tooltip("Sub Menu"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("submenu")); o->image(pixmap[18]); } - { Fl_Button* o = new Fl_Button(312, 52, 24, 24); + { Fl_Button* o = new Fl_Button(336, 52, 24, 24); o->tooltip("Choice"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Choice")); @@ -545,21 +623,21 @@ Fl_Window* make_widgetbin() { } o->end(); } - { Fl_Group* o = new Fl_Group(363, 3, 26, 74); + { Fl_Group* o = new Fl_Group(387, 3, 26, 74); o->box(FL_THIN_DOWN_BOX); - { Fl_Button* o = new Fl_Button(364, 4, 24, 24); + { Fl_Button* o = new Fl_Button(388, 4, 24, 24); o->tooltip("Browser"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Browser")); o->image(pixmap[31]); } - { Fl_Button* o = new Fl_Button(364, 28, 24, 24); + { Fl_Button* o = new Fl_Button(388, 28, 24, 24); o->tooltip("Check Browser"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Check_Browser")); o->image(pixmap[32]); } - { Fl_Button* o = new Fl_Button(364, 52, 24, 24); + { Fl_Button* o = new Fl_Button(388, 52, 24, 24); o->tooltip("File Browser"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_File_Browser")); @@ -567,27 +645,27 @@ Fl_Window* make_widgetbin() { } o->end(); } - { Fl_Group* o = new Fl_Group(391, 3, 50, 74); + { Fl_Group* o = new Fl_Group(415, 3, 50, 74); o->box(FL_THIN_DOWN_BOX); - { Fl_Button* o = new Fl_Button(392, 4, 24, 24); + { Fl_Button* o = new Fl_Button(416, 4, 24, 24); o->tooltip("Box"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Box")); o->image(pixmap[5]); } - { Fl_Button* o = new Fl_Button(416, 4, 24, 24); + { Fl_Button* o = new Fl_Button(440, 4, 24, 24); o->tooltip("Clock"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Clock")); o->image(pixmap[34]); } - { Fl_Button* o = new Fl_Button(392, 28, 24, 24); + { Fl_Button* o = new Fl_Button(416, 28, 24, 24); o->tooltip("Help Browser"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Help_View")); o->image(pixmap[35]); } - { Fl_Button* o = new Fl_Button(392, 52, 24, 24); + { Fl_Button* o = new Fl_Button(416, 52, 24, 24); o->tooltip("Progress"); o->box(FL_THIN_UP_BOX); o->callback((Fl_Callback*)type_make_cb, (void*)("Fl_Progress")); diff --git a/fluid/function_panel.fl b/fluid/function_panel.fl index 5b7f84ce0..b73b64c98 100644 --- a/fluid/function_panel.fl +++ b/fluid/function_panel.fl @@ -1,5 +1,5 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0105 +version 1.0107 header_name {.h} code_name {.cxx} decl {\#include <FL/Fl_Pixmap.H>} {} @@ -16,7 +16,7 @@ Function {make_function_panel()} {open } { Fl_Window function_panel { label {function/method} open - xywh {909 450 285 170} type Single hide resizable modal + xywh {1046 445 285 170} type Single hide resizable modal } { Fl_Light_Button f_public_button { label public @@ -75,7 +75,7 @@ Function {make_code_panel()} {open Function {make_codeblock_panel()} {open } { Fl_Window codeblock_panel { - label codeblock open selected + label codeblock open xywh {289 462 295 130} type Single hide resizable modal } { Fl_Input code_before_input { @@ -184,6 +184,63 @@ Function {make_class_panel()} {open } } +Function {make_comment_panel()} {open +} { + Fl_Window comment_panel { + label comment open + xywh {328 152 545 290} type Single hide resizable modal + } { + Fl_Group {} {open + xywh {100 10 435 235} box DOWN_FRAME resizable + } { + Fl_Text_Editor comment_input { + xywh {102 12 431 231} box NO_BOX resizable + code0 {o->buffer(new Fl_Text_Buffer);} + code1 {o->textfont(FL_COURIER);} + code2 {o->when(FL_WHEN_ENTER_KEY_CHANGED|FL_WHEN_RELEASE);} + } + } + Fl_Group {} {open + xywh {368 255 167 25} + } { + Fl_Return_Button comment_panel_ok { + label OK + xywh {370 255 80 25} hotspot + } + Fl_Button comment_panel_cancel { + label Cancel + xywh {455 255 80 25} shortcut 0xff1b + } + Fl_Box {} { + xywh {368 255 1 1} resizable + } + } + Fl_Group {} {open + xywh {10 10 80 127} + } { + Fl_Light_Button comment_in_source { + label {in source} + tooltip {Put the comment into the source (.cxx) file.} xywh {10 10 80 25} labelsize 10 when 0 + } + Fl_Light_Button comment_in_header { + label {in header} + tooltip {Put the comment into the header (.h) file.} xywh {10 40 80 25} labelsize 10 when 0 + } + Fl_Menu_Button comment_predefined { + label predefined open selected + xywh {10 75 80 25} labelsize 10 + } {} + Fl_Button comment_load { + label {load...} + xywh {10 110 80 25} labelsize 10 + } + Fl_Box {} { + xywh {10 135 2 2} resizable + } + } + } +} + Function {type_make_cb(Fl_Widget*w,void*d)} {open return_type void } { code {Fl_Type *t = Fl_Type_make((char*)d); @@ -194,11 +251,11 @@ Function {make_widgetbin()} {open } { Fl_Window widgetbin_panel { label Bin open - xywh {325 137 440 100} type Single hide + xywh {325 137 468 100} type Single hide code0 {o->size(o->w(),80);} non_modal } { Fl_Group {} { - xywh {3 3 50 74} box THIN_DOWN_BOX + xywh {3 3 74 74} box THIN_DOWN_BOX } { Fl_Button {} { user_data {"Function"} @@ -236,266 +293,272 @@ Function {make_widgetbin()} {open tooltip {Declaration Block} xywh {28 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[11]);} } + Fl_Button {} { + user_data {"comment"} + callback type_make_cb + tooltip Function xywh {52 4 24 24} box THIN_UP_BOX + code0 {o->image(pixmap[46]);} + } } Fl_Group {} { - xywh {55 3 74 74} box THIN_DOWN_BOX + xywh {79 3 74 74} box THIN_DOWN_BOX } { Fl_Button {} { user_data {"Fl_Window"} callback type_make_cb - tooltip Window xywh {56 4 24 24} box THIN_UP_BOX + tooltip Window xywh {80 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[1]);} } Fl_Button {} { user_data {"Fl_Group"} callback type_make_cb - tooltip Group xywh {80 4 24 24} box THIN_UP_BOX + tooltip Group xywh {104 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[6]);} } Fl_Button {} { user_data {"Fl_Pack"} callback type_make_cb - tooltip Pack xywh {104 4 24 24} box THIN_UP_BOX + tooltip Pack xywh {128 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[22]);} } Fl_Button {} { user_data {"Fl_Tabs"} callback type_make_cb - tooltip Tabs xywh {56 28 24 24} box THIN_UP_BOX + tooltip Tabs xywh {80 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[13]);} } Fl_Button {} { user_data {"Fl_Scroll"} callback type_make_cb - tooltip Scroll xywh {80 28 24 24} box THIN_UP_BOX + tooltip Scroll xywh {104 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[19]);} } Fl_Button {} { user_data {"Fl_Tile"} callback type_make_cb - tooltip Tile xywh {56 52 24 24} box THIN_UP_BOX + tooltip Tile xywh {80 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[20]);} } Fl_Button {} { user_data {"Fl_Wizard"} callback type_make_cb - tooltip Wizard xywh {80 52 24 24} box THIN_UP_BOX + tooltip Wizard xywh {104 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[21]);} } } Fl_Group {} { - xywh {131 3 50 74} box THIN_DOWN_BOX + xywh {155 3 50 74} box THIN_DOWN_BOX } { Fl_Button {} { user_data {"Fl_Button"} callback type_make_cb - tooltip Button xywh {132 4 24 24} box THIN_UP_BOX + tooltip Button xywh {156 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[2]);} } Fl_Button {} { user_data {"Fl_Return_Button"} callback type_make_cb - tooltip {Return Button} xywh {156 4 24 24} box THIN_UP_BOX + tooltip {Return Button} xywh {180 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[23]);} } Fl_Button {} { user_data {"Fl_Light_Button"} callback type_make_cb - tooltip {Light Button} xywh {132 28 24 24} box THIN_UP_BOX + tooltip {Light Button} xywh {156 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[24]);} } Fl_Button {} { user_data {"Fl_Repeat_Button"} callback type_make_cb - tooltip {Repeat Button} xywh {156 28 24 24} box THIN_UP_BOX + tooltip {Repeat Button} xywh {180 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[25]);} } Fl_Button {} { user_data {"Fl_Check_Button"} callback type_make_cb - tooltip {Check Button} xywh {132 52 24 24} box THIN_UP_BOX + tooltip {Check Button} xywh {156 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[3]);} } Fl_Button {} { user_data {"Fl_Round_Button"} callback type_make_cb - tooltip {Round Button} xywh {156 52 24 24} box THIN_UP_BOX + tooltip {Round Button} xywh {180 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[4]);} } } Fl_Group {} { - xywh {183 3 74 74} box THIN_DOWN_BOX + xywh {207 3 74 74} box THIN_DOWN_BOX } { Fl_Button {} { user_data {"Fl_Slider"} callback type_make_cb - tooltip Slider xywh {184 4 24 24} box THIN_UP_BOX + tooltip Slider xywh {208 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[37]);} } Fl_Button {} { user_data {"Fl_Scrollbar"} callback type_make_cb - tooltip {Scroll Bar} xywh {208 4 24 24} box THIN_UP_BOX + tooltip {Scroll Bar} xywh {232 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[38]);} } Fl_Button {} { user_data {"Fl_Value_Slider"} callback type_make_cb - tooltip {Value Slider} xywh {232 4 24 24} box THIN_UP_BOX + tooltip {Value Slider} xywh {256 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[39]);} } Fl_Button {} { user_data {"Fl_Adjuster"} callback type_make_cb - tooltip Adjuster xywh {184 28 24 24} box THIN_UP_BOX + tooltip Adjuster xywh {208 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[40]);} } Fl_Button {} { user_data {"Fl_Counter"} callback type_make_cb - tooltip Counter xywh {208 28 24 24} box THIN_UP_BOX + tooltip Counter xywh {232 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[41]);} } Fl_Button {} { user_data {"Fl_Dial"} callback type_make_cb - tooltip Dial xywh {232 28 24 24} box THIN_UP_BOX + tooltip Dial xywh {256 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[42]);} } Fl_Button {} { user_data {"Fl_Roller"} callback type_make_cb - tooltip Roller xywh {184 52 24 24} box THIN_UP_BOX + tooltip Roller xywh {208 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[43]);} } Fl_Button {} { user_data {"Fl_Value_Input"} callback type_make_cb - tooltip {Value Input} xywh {208 52 24 24} box THIN_UP_BOX + tooltip {Value Input} xywh {232 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[44]);} } Fl_Button {} { user_data {"Fl_Value_Output"} callback type_make_cb - tooltip {Value Output} xywh {232 52 24 24} box THIN_UP_BOX + tooltip {Value Output} xywh {256 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[45]);} } } Fl_Group {} { - xywh {259 3 50 74} box THIN_DOWN_BOX + xywh {283 3 50 74} box THIN_DOWN_BOX } { Fl_Button {} { user_data {"Fl_Input"} callback type_make_cb - tooltip Input xywh {260 4 24 24} box THIN_UP_BOX + tooltip Input xywh {284 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[14]);} } Fl_Button {} { user_data {"Fl_Output"} callback type_make_cb - tooltip Output xywh {284 4 24 24} box THIN_UP_BOX + tooltip Output xywh {308 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[27]);} } Fl_Button {} { user_data {"Fl_Text_Editor"} callback type_make_cb - tooltip {Text Edit} xywh {260 28 24 24} box THIN_UP_BOX + tooltip {Text Edit} xywh {284 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[29]);} } Fl_Button {} { user_data {"Fl_Text_Display"} callback type_make_cb - tooltip {Text Display} xywh {284 28 24 24} box THIN_UP_BOX + tooltip {Text Display} xywh {308 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[28]);} } Fl_Button {} { user_data {"Fl_File_Input"} callback type_make_cb - tooltip {File Input} xywh {260 52 24 24} box THIN_UP_BOX + tooltip {File Input} xywh {284 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[30]);} } } Fl_Group {} { - xywh {311 3 50 74} box THIN_DOWN_BOX + xywh {335 3 50 74} box THIN_DOWN_BOX } { Fl_Button {} { user_data {"Fl_Menu_Bar"} callback type_make_cb - tooltip {Menu Bar} xywh {312 4 24 24} box THIN_UP_BOX + tooltip {Menu Bar} xywh {336 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[17]);} } Fl_Button {} { user_data {"menuitem"} callback type_make_cb - tooltip {Menu Item} xywh {336 4 24 24} box THIN_UP_BOX + tooltip {Menu Item} xywh {360 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[16]);} } Fl_Button {} { user_data {"Fl_Menu_Button"} callback type_make_cb - tooltip {Menu Button} xywh {312 28 24 24} box THIN_UP_BOX + tooltip {Menu Button} xywh {336 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[26]);} } Fl_Button {} { user_data {"submenu"} callback type_make_cb - tooltip {Sub Menu} xywh {336 28 24 24} box THIN_UP_BOX + tooltip {Sub Menu} xywh {360 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[18]);} } Fl_Button {} { user_data {"Fl_Choice"} callback type_make_cb - tooltip Choice xywh {312 52 24 24} box THIN_UP_BOX + tooltip Choice xywh {336 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[15]);} } } Fl_Group {} { - xywh {363 3 26 74} box THIN_DOWN_BOX + xywh {387 3 26 74} box THIN_DOWN_BOX } { Fl_Button {} { user_data {"Fl_Browser"} callback type_make_cb - tooltip Browser xywh {364 4 24 24} box THIN_UP_BOX + tooltip Browser xywh {388 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[31]);} } Fl_Button {} { user_data {"Fl_Check_Browser"} callback type_make_cb - tooltip {Check Browser} xywh {364 28 24 24} box THIN_UP_BOX + tooltip {Check Browser} xywh {388 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[32]);} } Fl_Button {} { user_data {"Fl_File_Browser"} callback type_make_cb - tooltip {File Browser} xywh {364 52 24 24} box THIN_UP_BOX + tooltip {File Browser} xywh {388 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[33]);} } } Fl_Group {} { - xywh {391 3 50 74} box THIN_DOWN_BOX + xywh {415 3 50 74} box THIN_DOWN_BOX } { Fl_Button {} { user_data {"Fl_Box"} callback type_make_cb - tooltip Box xywh {392 4 24 24} box THIN_UP_BOX + tooltip Box xywh {416 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[5]);} } Fl_Button {} { user_data {"Fl_Clock"} callback type_make_cb - tooltip Clock xywh {416 4 24 24} box THIN_UP_BOX + tooltip Clock xywh {440 4 24 24} box THIN_UP_BOX code0 {o->image(pixmap[34]);} } Fl_Button {} { user_data {"Fl_Help_View"} callback type_make_cb - tooltip {Help Browser} xywh {392 28 24 24} box THIN_UP_BOX + tooltip {Help Browser} xywh {416 28 24 24} box THIN_UP_BOX code0 {o->image(pixmap[35]);} } Fl_Button {} { user_data {"Fl_Progress"} callback type_make_cb - tooltip Progress xywh {392 52 24 24} box THIN_UP_BOX + tooltip Progress xywh {416 52 24 24} box THIN_UP_BOX code0 {o->image(pixmap[36]);} } } diff --git a/fluid/function_panel.h b/fluid/function_panel.h index 2f57f16b6..0b7770f51 100644 --- a/fluid/function_panel.h +++ b/fluid/function_panel.h @@ -1,4 +1,4 @@ -// generated by Fast Light User Interface Designer (fluid) version 1.0105 +// generated by Fast Light User Interface Designer (fluid) version 1.0107 #ifndef function_panel_h #define function_panel_h @@ -50,6 +50,16 @@ extern Fl_Input *c_subclass_input; extern Fl_Return_Button *c_panel_ok; extern Fl_Button *c_panel_cancel; Fl_Window* make_class_panel(); +extern Fl_Window *comment_panel; +extern Fl_Text_Editor *comment_input; +extern Fl_Return_Button *comment_panel_ok; +extern Fl_Button *comment_panel_cancel; +extern Fl_Light_Button *comment_in_source; +extern Fl_Light_Button *comment_in_header; +#include <FL/Fl_Menu_Button.H> +extern Fl_Menu_Button *comment_predefined; +extern Fl_Button *comment_load; +Fl_Window* make_comment_panel(); void type_make_cb(Fl_Widget*w,void*d); extern Fl_Window *widgetbin_panel; extern void type_make_cb(Fl_Button*, void*); diff --git a/fluid/pixmaps/flComment.xpm b/fluid/pixmaps/flComment.xpm new file mode 100644 index 000000000..ece76c562 --- /dev/null +++ b/fluid/pixmaps/flComment.xpm @@ -0,0 +1,27 @@ +/* XPM */
+static const char *flComment_xpm[] = {
+/* width height ncolors chars_per_pixel */
+"16 16 4 1",
+/* colors */
+". c none",
+"a c #000000",
+"b c #c0e0c0",
+"c c #000000",
+/* pixels */
+"................",
+"................",
+".aaaaaaaaaaaaaa.",
+".abbbbbbbbbbbbc.",
+".abbbbbccbbccbc.",
+".abbbbccbbccbbc.",
+".abbbbccbbccbbc.",
+".abbbccbbccbbbc.",
+".abbbccbbccbbbc.",
+".abbccbbccbbbbc.",
+".abbccbbccbbbbc.",
+".abccbbccbbbbbc.",
+".abbbbbbbbbbbbc.",
+".accccccccccccc.",
+"................",
+"................",
+};
|
