diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2010-04-10 22:16:55 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2010-04-10 22:16:55 +0000 |
| commit | 2fe7eabb6249c4c9ff0f6e697679a7f9f85ce0eb (patch) | |
| tree | fbfb2957763ed47a673526a142aa33b318720065 /fluid/widget_panel.cxx | |
| parent | 927fd351655320ed90ceecedaf9ea58656594650 (diff) | |
Completed the alignment pulldown menus for all new alignment styles. Hope you guys like it.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7478 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/widget_panel.cxx')
| -rw-r--r-- | fluid/widget_panel.cxx | 68 |
1 files changed, 50 insertions, 18 deletions
diff --git a/fluid/widget_panel.cxx b/fluid/widget_panel.cxx index b98439825..a169b33e6 100644 --- a/fluid/widget_panel.cxx +++ b/fluid/widget_panel.cxx @@ -33,12 +33,32 @@ static void cb_(Fl_Tabs* o, void* v) { propagate_load((Fl_Group *)o,v); } -Fl_Menu_Item menu_Text[] = { - {"image over text", 0, 0, (void*)(FL_ALIGN_IMAGE_OVER_TEXT), 8, FL_NORMAL_LABEL, 0, 11, 0}, - {"text over image", 0, 0, (void*)(FL_ALIGN_TEXT_OVER_IMAGE), 8, FL_NORMAL_LABEL, 0, 11, 0}, - {"text next to image", 0, 0, (void*)(FL_ALIGN_TEXT_NEXT_TO_IMAGE), 8, FL_NORMAL_LABEL, 0, 11, 0}, - {"image next to text", 0, 0, (void*)(FL_ALIGN_IMAGE_NEXT_TO_TEXT), 8, FL_NORMAL_LABEL, 0, 11, 0}, - {"image is backdrop", 0, 0, (void*)(FL_ALIGN_IMAGE_BACKDROP), 8, FL_NORMAL_LABEL, 0, 11, 0}, +Fl_Menu_Item menu_[] = { + {" Image Alignment ", 0, 0, (void*)(0xFFFFFFFF), 1, FL_NORMAL_LABEL, 2, 11, 0}, + {"image over text", 0, 0, (void*)(FL_ALIGN_IMAGE_OVER_TEXT), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"text over image", 0, 0, (void*)(FL_ALIGN_TEXT_OVER_IMAGE), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"text next to image", 0, 0, (void*)(FL_ALIGN_TEXT_NEXT_TO_IMAGE), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"image next to text", 0, 0, (void*)(FL_ALIGN_IMAGE_NEXT_TO_TEXT), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"image is backdrop", 0, 0, (void*)(FL_ALIGN_IMAGE_BACKDROP), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {0,0,0,0,0,0,0,0,0} +}; + +Fl_Menu_Item menu_1[] = { + {" Inside && Outside ", 0, 0, (void*)(0xFFFFFFFF), 1, FL_NORMAL_LABEL, 2, 11, 0}, + {"top left", 0, 0, (void*)(FL_ALIGN_TOP_LEFT), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"top", 0, 0, (void*)(FL_ALIGN_TOP), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"top right", 0, 0, (void*)(FL_ALIGN_TOP_RIGHT), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"left", 0, 0, (void*)(FL_ALIGN_LEFT), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"center", 0, 0, (void*)(FL_ALIGN_CENTER), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"right", 0, 0, (void*)(FL_ALIGN_RIGHT), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"bottom left", 0, 0, (void*)(FL_ALIGN_BOTTOM_LEFT), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"bottom", 0, 0, (void*)(FL_ALIGN_BOTTOM), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"bottom right", 0, 0, (void*)(FL_ALIGN_BOTTOM_RIGHT), 128, FL_NORMAL_LABEL, 0, 11, 0}, + {" Outside Alignment ", 0, 0, (void*)(0xFFFFFFFF), 1, FL_NORMAL_LABEL, 2, 11, 0}, + {"left top", 0, 0, (void*)(FL_ALIGN_LEFT_TOP), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"right top", 0, 0, (void*)(FL_ALIGN_RIGHT_TOP), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"left bottom", 0, 0, (void*)(FL_ALIGN_LEFT_BOTTOM), 0, FL_NORMAL_LABEL, 0, 11, 0}, + {"right bottom", 0, 0, (void*)(FL_ALIGN_RIGHT_BOTTOM), 0, FL_NORMAL_LABEL, 0, 11, 0}, {0,0,0,0,0,0,0,0,0} }; @@ -50,14 +70,14 @@ Fl_Value_Input *widget_w_input=(Fl_Value_Input *)0; Fl_Value_Input *widget_h_input=(Fl_Value_Input *)0; -Fl_Menu_Item menu_[] = { +Fl_Menu_Item menu_2[] = { {"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[] = { +Fl_Menu_Item menu_3[] = { {"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} @@ -155,7 +175,7 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->callback((Fl_Callback*)propagate_load); o->align(Fl_Align(FL_ALIGN_LEFT)); - { Fl_Button* o = new Fl_Button(95, 115, 40, 20, "Clip"); + { Fl_Button* o = new Fl_Button(95, 115, 30, 20, "Clip"); o->tooltip("Clip the label to the inside of the widget."); o->type(1); o->selection_color(FL_INACTIVE_COLOR); @@ -163,19 +183,13 @@ Fl_Double_Window* make_widget_panel() { o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_CLIP)); o->align(Fl_Align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE)); } // Fl_Button* o - { Fl_Button* o = new Fl_Button(140, 115, 40, 20, "Wrap"); + { Fl_Button* o = new Fl_Button(130, 115, 30, 20, "Wrap"); o->tooltip("Wrap the label text."); o->type(1); o->selection_color(FL_INACTIVE_COLOR); o->labelsize(11); o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_WRAP)); } // Fl_Button* o - { Fl_Menu_Button* o = new Fl_Menu_Button(185, 115, 80, 20, "Text/Image"); - o->labelsize(11); - o->callback((Fl_Callback*)align_text_image_cb); - o->align(Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE)); - o->menu(menu_Text); - } // Fl_Menu_Button* o { Fl_Button* o = new Fl_Button(270, 115, 20, 20, "@-1<-"); o->tooltip("Left-align the label."); o->type(1); @@ -183,6 +197,7 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->labelcolor(FL_INACTIVE_COLOR); o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_LEFT)); + o->hide(); } // Fl_Button* o { Fl_Button* o = new Fl_Button(295, 115, 20, 20, "@-1->"); o->tooltip("Right-align the label."); @@ -191,6 +206,7 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->labelcolor(FL_INACTIVE_COLOR); o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_RIGHT)); + o->hide(); } // Fl_Button* o { Fl_Button* o = new Fl_Button(320, 115, 20, 20, "@-18"); o->tooltip("Top-align the label."); @@ -199,6 +215,7 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->labelcolor(FL_INACTIVE_COLOR); o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_TOP)); + o->hide(); } // Fl_Button* o { Fl_Button* o = new Fl_Button(345, 115, 20, 20, "@-12"); o->tooltip("Bottom-align the label."); @@ -207,7 +224,22 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->labelcolor(FL_INACTIVE_COLOR); o->callback((Fl_Callback*)align_cb, (void*)(FL_ALIGN_BOTTOM)); + o->hide(); } // Fl_Button* o + { Fl_Choice* o = new Fl_Choice(165, 115, 110, 20); + o->down_box(FL_BORDER_BOX); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)align_text_image_cb); + o->menu(menu_); + } // Fl_Choice* o + { Fl_Choice* o = new Fl_Choice(280, 115, 85, 20); + o->down_box(FL_BORDER_BOX); + o->labelsize(11); + o->textsize(11); + o->callback((Fl_Callback*)align_position_cb); + o->menu(menu_1); + } // Fl_Choice* o { Fl_Button* o = new Fl_Button(370, 115, 20, 20, "@-3square"); o->tooltip("Show the label inside the widget."); o->type(1); @@ -644,7 +676,7 @@ ive to the origin at construction time"); o->textsize(11); o->callback((Fl_Callback*)name_public_member_cb); o->when(FL_WHEN_CHANGED); - o->menu(menu_); + o->menu(menu_2); } // Fl_Choice* o { Fl_Choice* o = new Fl_Choice(330, 65, 75, 20); o->tooltip("Change widget accessibility."); @@ -653,7 +685,7 @@ ive to the origin at construction time"); o->textsize(11); o->callback((Fl_Callback*)name_public_cb); o->when(FL_WHEN_CHANGED); - o->menu(menu_1); + o->menu(menu_3); } // Fl_Choice* o o->end(); } // Fl_Group* o |
