Browse Source

Use uppercase letters for shortcut labels (e.g. "Ctrl+N", not

"Ctrl+n") to be consistent with other toolkits.

Remove debug printf from undo_checkpoint().

Change "Show Widget Panel" to "Show Properties" since it displays any
Fl_Type dialog, not just the widget panel.

Add "properties" to all of the type dialogs (UI consistency)

Remove extra elipsis (...) from code items in the new menu.

Revert Grid shortcut to Ctrl+G, since Alt+G is used to run a shell
command again.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4146 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
pull/168/head
Michael R Sweet 21 years ago
parent
commit
4e965380bc
  1. 3
      CHANGES
  2. 9
      fluid/Fl_Widget_Type.cxx
  3. 14
      fluid/factory.cxx
  4. 8
      fluid/fluid.cxx
  5. 17
      fluid/function_panel.cxx
  6. 17
      fluid/function_panel.fl
  7. 4
      fluid/undo.cxx
  8. 4
      src/fl_shortcut.cxx

3
CHANGES

@ -2,6 +2,9 @@ CHANGES IN FLTK 1.1.7
- Documentation fixes (STR #648, STR #692, STR #730, STR - Documentation fixes (STR #648, STR #692, STR #730, STR
#744, STR #745) #744, STR #745)
- fl_shortcut_label() now shows letter shortcuts in
uppercase, e.g. "Ctrl+N" instead of "Ctrl+n" to be
consistent with other toolkits.
- FLUID now provides unlimited undo/redo support. - FLUID now provides unlimited undo/redo support.
- FLUID now provides an option to choose which scheme - FLUID now provides an option to choose which scheme
(default, none, plastic) to display. (default, none, plastic) to display.

9
fluid/Fl_Widget_Type.cxx

@ -292,16 +292,17 @@ static int haderror;
void name_cb(Fl_Input* o, void *v) { void name_cb(Fl_Input* o, void *v) {
if (v == LOAD) { if (v == LOAD) {
static char buf[1024];
if (numselected != 1) { if (numselected != 1) {
static char buf[16]; snprintf(buf, sizeof(buf), "Widget Properties (%d widgets)", numselected);
sprintf(buf,"(%d widgets)",numselected);
the_panel->label(buf);
o->hide(); o->hide();
} else { } else {
o->static_value(current_widget->name()); o->static_value(current_widget->name());
o->show(); o->show();
the_panel->label(current_widget->title()); snprintf(buf, sizeof(buf), "%s Properties", current_widget->title());
} }
the_panel->label(buf);
} else { } else {
if (numselected == 1) { if (numselected == 1) {
current_widget->name(o->value()); current_widget->name(o->value());

14
fluid/factory.cxx

@ -869,13 +869,13 @@ static void cb(Fl_Widget *, void *v) {
Fl_Menu_Item New_Menu[] = { Fl_Menu_Item New_Menu[] = {
{"Code",0,0,0,FL_SUBMENU}, {"Code",0,0,0,FL_SUBMENU},
{"Function/Method...",0,cb,(void*)&Fl_Function_type}, {"Function/Method",0,cb,(void*)&Fl_Function_type},
{"Code...",0,cb,(void*)&Fl_Code_type}, {"Code",0,cb,(void*)&Fl_Code_type},
{"Code Block...",0,cb,(void*)&Fl_CodeBlock_type}, {"Code Block",0,cb,(void*)&Fl_CodeBlock_type},
{"Declaration...",0,cb,(void*)&Fl_Decl_type}, {"Declaration",0,cb,(void*)&Fl_Decl_type},
{"Declaration Block...",0,cb,(void*)&Fl_DeclBlock_type}, {"Declaration Block",0,cb,(void*)&Fl_DeclBlock_type},
{"Class...",0,cb,(void*)&Fl_Class_type}, {"Class",0,cb,(void*)&Fl_Class_type},
{"Comment...",0,cb,(void*)&Fl_Comment_type}, {"Comment",0,cb,(void*)&Fl_Comment_type},
{0}, {0},
{"Group",0,0,0,FL_SUBMENU}, {"Group",0,0,0,FL_SUBMENU},
{0,0,cb,(void*)&Fl_Window_type}, {0,0,cb,(void*)&Fl_Window_type},

8
fluid/fluid.cxx

@ -631,12 +631,12 @@ Fl_Menu_Item Main_Menu[] = {
{"&Redo", FL_CTRL+FL_SHIFT+'z', redo_cb, 0, FL_MENU_DIVIDER}, {"&Redo", FL_CTRL+FL_SHIFT+'z', redo_cb, 0, FL_MENU_DIVIDER},
{"C&ut", FL_CTRL+'x', cut_cb}, {"C&ut", FL_CTRL+'x', cut_cb},
{"&Copy", FL_CTRL+'c', copy_cb}, {"&Copy", FL_CTRL+'c', copy_cb},
{"&Delete", FL_Delete, delete_cb},
{"Dup&licate", FL_CTRL+'d', duplicate_cb},
{"&Paste", FL_CTRL+'v', paste_cb}, {"&Paste", FL_CTRL+'v', paste_cb},
{"Dup&licate", FL_CTRL+'u', duplicate_cb},
{"&Delete", FL_Delete, delete_cb, 0, FL_MENU_DIVIDER},
{"Select &All", FL_CTRL+'a', select_all_cb}, {"Select &All", FL_CTRL+'a', select_all_cb},
{"Select &None", FL_CTRL+FL_SHIFT+'a', select_none_cb, 0, FL_MENU_DIVIDER}, {"Select &None", FL_CTRL+FL_SHIFT+'a', select_none_cb, 0, FL_MENU_DIVIDER},
{"&Show Widget Panel...", FL_F+1, openwidget_cb}, {"Pr&operties...", FL_F+1, openwidget_cb},
{"&Sort",0,sort_cb}, {"&Sort",0,sort_cb},
{"&Earlier", FL_F+2, earlier_cb}, {"&Earlier", FL_F+2, earlier_cb},
{"&Later", FL_F+3, later_cb}, {"&Later", FL_F+3, later_cb},
@ -675,7 +675,7 @@ Fl_Menu_Item Main_Menu[] = {
{"&Small",FL_ALT+'2',(Fl_Callback *)widget_size_cb,(void*)11,FL_MENU_RADIO,FL_NORMAL_LABEL,FL_HELVETICA,11}, {"&Small",FL_ALT+'2',(Fl_Callback *)widget_size_cb,(void*)11,FL_MENU_RADIO,FL_NORMAL_LABEL,FL_HELVETICA,11},
{"&Normal",FL_ALT+'3',(Fl_Callback *)widget_size_cb,(void*)14,FL_MENU_RADIO|FL_MENU_VALUE}, {"&Normal",FL_ALT+'3',(Fl_Callback *)widget_size_cb,(void*)14,FL_MENU_RADIO|FL_MENU_VALUE},
{0}, {0},
{"&Grid...",FL_ALT+'g',show_grid_cb}, {"&Grid...",FL_CTRL+'g',show_grid_cb},
{0}, {0},
{"&Shell",0,0,0,FL_SUBMENU}, {"&Shell",0,0,0,FL_SUBMENU},
{"Execute &Command...",FL_ALT+'x',(Fl_Callback *)show_shell_window}, {"Execute &Command...",FL_ALT+'x',(Fl_Callback *)show_shell_window},

17
fluid/function_panel.cxx

@ -51,7 +51,7 @@ Fl_Button *f_panel_cancel=(Fl_Button *)0;
Fl_Window* make_function_panel() { Fl_Window* make_function_panel() {
Fl_Window* w; Fl_Window* w;
{ Fl_Window* o = function_panel = new Fl_Window(285, 140, "Function/Method"); { Fl_Window* o = function_panel = new Fl_Window(285, 140, "Function/Method Properties");
w = o; w = o;
{ Fl_Light_Button* o = f_public_button = new Fl_Light_Button(10, 10, 54, 20, "public"); { Fl_Light_Button* o = f_public_button = new Fl_Light_Button(10, 10, 54, 20, "public");
o->tooltip("Make the function or method publicly accessible."); o->tooltip("Make the function or method publicly accessible.");
@ -107,7 +107,7 @@ Fl_Button *code_panel_cancel=(Fl_Button *)0;
Fl_Window* make_code_panel() { Fl_Window* make_code_panel() {
Fl_Window* w; Fl_Window* w;
{ Fl_Window* o = code_panel = new Fl_Window(545, 175, "Code"); { Fl_Window* o = code_panel = new Fl_Window(545, 175, "Code Properties");
w = o; w = o;
o->labelsize(11); o->labelsize(11);
{ Fl_Text_Editor* o = code_input = new Fl_Text_Editor(10, 12, 525, 123); { Fl_Text_Editor* o = code_input = new Fl_Text_Editor(10, 12, 525, 123);
@ -153,7 +153,7 @@ Fl_Button *codeblock_panel_cancel=(Fl_Button *)0;
Fl_Window* make_codeblock_panel() { Fl_Window* make_codeblock_panel() {
Fl_Window* w; Fl_Window* w;
{ Fl_Window* o = codeblock_panel = new Fl_Window(295, 100, "Code Block"); { Fl_Window* o = codeblock_panel = new Fl_Window(295, 100, "Code Block Properties");
w = o; w = o;
o->labelsize(11); o->labelsize(11);
{ Fl_Input* o = code_before_input = new Fl_Input(10, 10, 275, 20); { Fl_Input* o = code_before_input = new Fl_Input(10, 10, 275, 20);
@ -201,7 +201,7 @@ Fl_Light_Button *declblock_public_button=(Fl_Light_Button *)0;
Fl_Window* make_declblock_panel() { Fl_Window* make_declblock_panel() {
Fl_Window* w; Fl_Window* w;
{ Fl_Window* o = declblock_panel = new Fl_Window(295, 125, "Declaration Block"); { Fl_Window* o = declblock_panel = new Fl_Window(295, 125, "Declaration Block Properties");
w = o; w = o;
o->labelsize(11); o->labelsize(11);
{ Fl_Input* o = decl_before_input = new Fl_Input(10, 35, 275, 20); { Fl_Input* o = decl_before_input = new Fl_Input(10, 35, 275, 20);
@ -252,7 +252,7 @@ Fl_Button *decl_panel_cancel=(Fl_Button *)0;
Fl_Window* make_decl_panel() { Fl_Window* make_decl_panel() {
Fl_Window* w; Fl_Window* w;
{ Fl_Window* o = decl_panel = new Fl_Window(290, 145, "Declaration"); { Fl_Window* o = decl_panel = new Fl_Window(290, 145, "Declaration Properties");
w = o; w = o;
{ Fl_Light_Button* o = decl_public_button = new Fl_Light_Button(10, 10, 54, 20, "public"); { Fl_Light_Button* o = decl_public_button = new Fl_Light_Button(10, 10, 54, 20, "public");
o->tooltip("Make the declaration publicly accessible."); o->tooltip("Make the declaration publicly accessible.");
@ -297,7 +297,7 @@ Fl_Button *c_panel_cancel=(Fl_Button *)0;
Fl_Window* make_class_panel() { Fl_Window* make_class_panel() {
Fl_Window* w; Fl_Window* w;
{ Fl_Window* o = class_panel = new Fl_Window(285, 140, "Class"); { Fl_Window* o = class_panel = new Fl_Window(285, 140, "Class Properties");
w = o; w = o;
o->labelsize(11); o->labelsize(11);
{ Fl_Light_Button* o = c_public_button = new Fl_Light_Button(10, 10, 54, 20, "public"); { Fl_Light_Button* o = c_public_button = new Fl_Light_Button(10, 10, 54, 20, "public");
@ -356,7 +356,7 @@ Fl_Button *comment_load=(Fl_Button *)0;
Fl_Window* make_comment_panel() { Fl_Window* make_comment_panel() {
Fl_Window* w; Fl_Window* w;
{ Fl_Window* o = comment_panel = new Fl_Window(545, 285, "Comment"); { Fl_Window* o = comment_panel = new Fl_Window(545, 285, "Comment Properties");
w = o; w = o;
o->labelsize(11); o->labelsize(11);
{ Fl_Text_Editor* o = comment_input = new Fl_Text_Editor(95, 10, 438, 241); { Fl_Text_Editor* o = comment_input = new Fl_Text_Editor(95, 10, 438, 241);
@ -422,6 +422,9 @@ void type_make_cb(Fl_Widget*w,void*d) {
select_only(t); select_only(t);
set_modflag(1); set_modflag(1);
t->open(); t->open();
} else {
undo_current --;
undo_last --;
} }
} }

17
fluid/function_panel.fl

@ -46,7 +46,7 @@ decl {extern void select_only(Fl_Type*);} {}
Function {make_function_panel()} {open Function {make_function_panel()} {open
} { } {
Fl_Window function_panel { Fl_Window function_panel {
label {Function/Method} label {Function/Method Properties}
xywh {855 21 285 140} type Single hide resizable modal xywh {855 21 285 140} type Single hide resizable modal
} { } {
Fl_Light_Button f_public_button { Fl_Light_Button f_public_button {
@ -79,7 +79,7 @@ Function {make_function_panel()} {open
Function {make_code_panel()} {open Function {make_code_panel()} {open
} { } {
Fl_Window code_panel { Fl_Window code_panel {
label Code label {Code Properties}
xywh {527 128 545 175} type Single labelsize 11 hide resizable modal xywh {527 128 545 175} type Single labelsize 11 hide resizable modal
} { } {
Fl_Text_Editor code_input { Fl_Text_Editor code_input {
@ -109,7 +109,7 @@ Function {make_code_panel()} {open
Function {make_codeblock_panel()} {open Function {make_codeblock_panel()} {open
} { } {
Fl_Window codeblock_panel { Fl_Window codeblock_panel {
label {Code Block} label {Code Block Properties}
xywh {845 158 295 100} type Single labelsize 11 hide resizable modal xywh {845 158 295 100} type Single labelsize 11 hide resizable modal
} { } {
Fl_Input code_before_input { Fl_Input code_before_input {
@ -133,7 +133,7 @@ Function {make_codeblock_panel()} {open
Function {make_declblock_panel()} {open Function {make_declblock_panel()} {open
} { } {
Fl_Window declblock_panel { Fl_Window declblock_panel {
label {Declaration Block} label {Declaration Block Properties}
xywh {665 33 295 125} type Single labelsize 11 hide resizable modal xywh {665 33 295 125} type Single labelsize 11 hide resizable modal
} { } {
Fl_Input decl_before_input { Fl_Input decl_before_input {
@ -161,7 +161,7 @@ Function {make_declblock_panel()} {open
Function {make_decl_panel()} {open Function {make_decl_panel()} {open
} { } {
Fl_Window decl_panel { Fl_Window decl_panel {
label Declaration label {Declaration Properties}
xywh {789 289 290 145} type Single hide resizable xywh {789 289 290 145} type Single hide resizable
} { } {
Fl_Light_Button decl_public_button { Fl_Light_Button decl_public_button {
@ -186,7 +186,7 @@ Function {make_decl_panel()} {open
Function {make_class_panel()} {open Function {make_class_panel()} {open
} { } {
Fl_Window class_panel { Fl_Window class_panel {
label Class label {Class Properties}
xywh {744 223 285 140} type Single labelsize 11 hide resizable modal xywh {744 223 285 140} type Single labelsize 11 hide resizable modal
} { } {
Fl_Light_Button c_public_button { Fl_Light_Button c_public_button {
@ -215,7 +215,7 @@ Function {make_class_panel()} {open
Function {make_comment_panel()} {open Function {make_comment_panel()} {open
} { } {
Fl_Window comment_panel { Fl_Window comment_panel {
label Comment label {Comment Properties}
xywh {328 152 545 285} type Single labelsize 11 hide resizable modal xywh {328 152 545 285} type Single labelsize 11 hide resizable modal
} { } {
Fl_Text_Editor comment_input { Fl_Text_Editor comment_input {
@ -273,6 +273,9 @@ Function {type_make_cb(Fl_Widget*w,void*d)} {open return_type void
select_only(t); select_only(t);
set_modflag(1); set_modflag(1);
t->open(); t->open();
} else {
undo_current --;
undo_last --;
}} {} }} {}
} }

4
fluid/undo.cxx

@ -126,8 +126,8 @@ void undo_cb(Fl_Widget *, void *) {
void undo_checkpoint() { void undo_checkpoint() {
char filename[1024]; // Undo checkpoint filename char filename[1024]; // Undo checkpoint filename
printf("undo_checkpoint(): undo_current=%d, undo_paused=%d, modflag=%d\n", // printf("undo_checkpoint(): undo_current=%d, undo_paused=%d, modflag=%d\n",
undo_current, undo_paused, modflag); // undo_current, undo_paused, modflag);
// Don't checkpoint if undo_suspend() has been called... // Don't checkpoint if undo_suspend() has been called...
if (undo_paused) return; if (undo_paused) return;

4
src/fl_shortcut.cxx

@ -153,7 +153,7 @@ const char * fl_shortcut_label(int shortcut) {
*p++ = uchar(key & 127); *p++ = uchar(key & 127);
} else { } else {
// if none found, use the keystroke as a match: // if none found, use the keystroke as a match:
*p++ = uchar(key); *p++ = uchar(toupper(key & 255));
} }
} }
*p = 0; *p = 0;
@ -163,7 +163,7 @@ const char * fl_shortcut_label(int shortcut) {
if (key == FL_Enter || key == '\r') q="Enter"; // don't use Xlib's "Return": if (key == FL_Enter || key == '\r') q="Enter"; // don't use Xlib's "Return":
else if (key > 32 && key < 0x100) q = 0; else if (key > 32 && key < 0x100) q = 0;
else q = XKeysymToString(key); else q = XKeysymToString(key);
if (!q) {*p++ = uchar(key); *p = 0; return buf;} if (!q) {*p++ = uchar(toupper(key & 255)); *p = 0; return buf;}
if (p > buf) {strcpy(p,q); return buf;} else return q; if (p > buf) {strcpy(p,q); return buf;} else return q;
#endif #endif
} }

Loading…
Cancel
Save