FLUID: Adds more interactive editing to Fl_Grid
* this commit introduces a few FIXMEs and TODOs that probably can't be solved until we do some major refactoring. They work for now, but adding more layout controlling widgets will be hard.
This commit is contained in:
parent
040607b595
commit
9ca4aed1fa
@ -68,13 +68,22 @@ void Fl_Grid_Proxy::draw() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Draw additional markings in the overlay plane when a grid is selected.
|
||||
*/
|
||||
void Fl_Grid_Proxy::draw_overlay() {
|
||||
fl_line_style(FL_DOT);
|
||||
grid_color = fl_color();
|
||||
draw_grid();
|
||||
fl_color(grid_color);
|
||||
}
|
||||
|
||||
Fl_Grid_Type::Fl_Grid_Type() {
|
||||
}
|
||||
|
||||
Fl_Widget *Fl_Grid_Type::widget(int X,int Y,int W,int H) {
|
||||
Fl_Grid *g = new Fl_Grid_Proxy(X,Y,W,H);
|
||||
g->layout(3, 3);
|
||||
g->show_grid(1, FL_RED);
|
||||
Fl_Group::current(0);
|
||||
return g;
|
||||
}
|
||||
@ -251,6 +260,9 @@ void Fl_Grid_Type::write_parent_properties(Fd_Project_Writer &f, Fl_Type *child,
|
||||
return;
|
||||
}
|
||||
|
||||
// NOTE: we have to do this in a loop just as ::read_property() in case a new
|
||||
// property is added. In the current setup, all the remaining properties
|
||||
// will be skipped
|
||||
void Fl_Grid_Type::read_parent_properties(Fd_Project_Reader &f, Fl_Type *child, const char *property) {
|
||||
if (!child->is_true_widget()) {
|
||||
super::read_parent_properties(f, child, property);
|
||||
@ -494,6 +506,29 @@ void Fl_Grid_Type::insert_child(Fl_Widget *child) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Move cells around using the keyboard.
|
||||
\note this fails if we have two children selected side by side and press 'right',
|
||||
which will move the left child first, removing the right child from the
|
||||
cell system. When trying to move the second child, it has no longer an
|
||||
assigned row or column.
|
||||
\param[in] child pointer to the child type
|
||||
\param[in] key code of the last keypress when handling a FL_KEYBOARD event.
|
||||
*/
|
||||
void Fl_Grid_Type::keyboard_move_child(Fl_Widget_Type *child, int key) {
|
||||
Fl_Grid *grid = ((Fl_Grid*)o);
|
||||
Fl_Grid::Cell *cell = grid->cell(child->o);
|
||||
if (!cell) return;
|
||||
if (key == FL_Right) {
|
||||
move_cell(grid, child->o, cell->row(), cell->col()+1);
|
||||
} else if (key == FL_Left) {
|
||||
move_cell(grid, child->o, cell->row(), cell->col()-1);
|
||||
} else if (key == FL_Up) {
|
||||
move_cell(grid, child->o, cell->row()-1, cell->col());
|
||||
} else if (key == FL_Down) {
|
||||
move_cell(grid, child->o, cell->row()+1, cell->col());
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: when changing the cell location, and another cell would be overridden,
|
||||
// don't actually move the cell (hard to implement!) and activate
|
||||
// a red button "replace". If clicked, user gets the option to delete
|
||||
@ -651,32 +686,67 @@ void grid_set_min_hgt_cb(Fluid_Coord_Input* i, void* v) {
|
||||
grid_child_cb(i, v, 13);
|
||||
}
|
||||
|
||||
void grid_align_cb(Fl_Choice* i, void* v) {
|
||||
void grid_align_horizontal_cb(Fl_Choice* i, void* v) {
|
||||
if ( !current_widget
|
||||
|| !current_widget->parent
|
||||
|| !current_widget->parent->is_a(ID_Grid))
|
||||
{
|
||||
return;
|
||||
}
|
||||
int mask = (FL_GRID_LEFT | FL_GRID_RIGHT | FL_GRID_HORIZONTAL);
|
||||
Fl_Grid *g = ((Fl_Grid*)((Fl_Widget_Type*)current_widget->parent)->o);
|
||||
if (v == LOAD) {
|
||||
int a = FL_GRID_FILL;
|
||||
int a = FL_GRID_FILL & mask;
|
||||
Fl_Grid::Cell *cell = g->cell(current_widget->o);
|
||||
if (cell) {
|
||||
a = cell->align();
|
||||
a = cell->align() & mask;
|
||||
}
|
||||
const Fl_Menu_Item *mi = i->find_item_with_argument(a);
|
||||
if (mi) i->value(mi);
|
||||
} else {
|
||||
int v = FL_GRID_FILL, old_v = FL_GRID_FILL;
|
||||
int v = FL_GRID_FILL & mask, old_v = FL_GRID_FILL & mask;
|
||||
const Fl_Menu_Item *mi = i->mvalue();
|
||||
if (mi) v = (int)mi->argument();
|
||||
Fl_Grid::Cell *cell = g->cell(current_widget->o);
|
||||
if (cell) {
|
||||
old_v = cell->align();
|
||||
old_v = cell->align() & mask;
|
||||
}
|
||||
if (old_v != v) {
|
||||
cell->align((Fl_Grid_Align)v);
|
||||
cell->align((Fl_Grid_Align)(v | (cell->align() & ~mask)));
|
||||
g->need_layout(true);
|
||||
g->redraw();
|
||||
set_modflag(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void grid_align_vertical_cb(Fl_Choice* i, void* v) {
|
||||
if ( !current_widget
|
||||
|| !current_widget->parent
|
||||
|| !current_widget->parent->is_a(ID_Grid))
|
||||
{
|
||||
return;
|
||||
}
|
||||
int mask = (FL_GRID_TOP | FL_GRID_BOTTOM | FL_GRID_VERTICAL);
|
||||
Fl_Grid *g = ((Fl_Grid*)((Fl_Widget_Type*)current_widget->parent)->o);
|
||||
if (v == LOAD) {
|
||||
int a = FL_GRID_FILL & mask;
|
||||
Fl_Grid::Cell *cell = g->cell(current_widget->o);
|
||||
if (cell) {
|
||||
a = cell->align() & mask;
|
||||
}
|
||||
const Fl_Menu_Item *mi = i->find_item_with_argument(a);
|
||||
if (mi) i->value(mi);
|
||||
} else {
|
||||
int v = FL_GRID_FILL & mask, old_v = FL_GRID_FILL & mask;
|
||||
const Fl_Menu_Item *mi = i->mvalue();
|
||||
if (mi) v = (int)mi->argument();
|
||||
Fl_Grid::Cell *cell = g->cell(current_widget->o);
|
||||
if (cell) {
|
||||
old_v = cell->align() & mask;
|
||||
}
|
||||
if (old_v != v) {
|
||||
cell->align((Fl_Grid_Align)(v | (cell->align() & ~mask)));
|
||||
g->need_layout(true);
|
||||
g->redraw();
|
||||
set_modflag(1);
|
||||
@ -686,7 +756,7 @@ void grid_align_cb(Fl_Choice* i, void* v) {
|
||||
|
||||
void Fl_Grid_Type::layout_widget() {
|
||||
allow_layout++;
|
||||
((Fl_Grid*)o)->need_layout(1);
|
||||
((Fl_Grid*)o)->layout();
|
||||
allow_layout--;
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ public:
|
||||
Fl_Grid_Proxy(int X,int Y,int W,int H) : Fl_Grid(X,Y,W,H) {}
|
||||
void resize(int,int,int,int) FL_OVERRIDE;
|
||||
void draw() FL_OVERRIDE;
|
||||
void draw_overlay();
|
||||
};
|
||||
|
||||
class Fl_Grid_Type : public Fl_Group_Type
|
||||
@ -56,6 +57,7 @@ public:
|
||||
void child_resized(Fl_Widget_Type *child);
|
||||
void insert_child_at(Fl_Widget *child, int x, int y);
|
||||
void insert_child(Fl_Widget *child);
|
||||
void keyboard_move_child(Fl_Widget_Type*, int key);
|
||||
|
||||
static class Fl_Grid *selected();
|
||||
};
|
||||
|
@ -66,6 +66,8 @@ void Fl_Group_Proxy::draw() {
|
||||
fl_rect(x(), y(), w(), h(), Fl::box_color(fl_color_average(FL_FOREGROUND_COLOR, color(), .1f)));
|
||||
Fl_Group::draw();
|
||||
} else if (box() == FL_FLAT_BOX && parent() && parent()->color() == color()) {
|
||||
// FIXME: the rect will be drawn over the children. Instead, change the
|
||||
// draw function for the FL_FLAT_BOX boxtype only while the group is drawn.
|
||||
Fl_Group::draw();
|
||||
fl_rect(x(), y(), w(), h(), Fl::box_color(fl_color_average(FL_FOREGROUND_COLOR, color(), .1f)));
|
||||
} else {
|
||||
@ -515,6 +517,10 @@ void Fl_Flex_Type::insert_child_at(Fl_Widget *child, int x, int y) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Move children around using the keyboard.
|
||||
\param[in] child pointer to the child type
|
||||
\param[in] key code of the last keypress when handling a FL_KEYBOARD event.
|
||||
*/
|
||||
void Fl_Flex_Type::keyboard_move_child(Fl_Widget_Type *child, int key) {
|
||||
Fl_Flex *flex = ((Fl_Flex*)o);
|
||||
int ix = flex->find(child->o);
|
||||
|
@ -621,6 +621,13 @@ void Fl_Window_Type::draw_overlay() {
|
||||
Fl_Widget_Type* myo = (Fl_Widget_Type*)q;
|
||||
int x,y,r,t;
|
||||
newposition(myo,x,y,r,t);
|
||||
if (show_guides) {
|
||||
// If we are in a drag operation, and the parent is a grid, show the grid overlay
|
||||
if (drag && q->parent && q->parent->is_a(ID_Grid)) {
|
||||
Fl_Grid_Proxy *grid = ((Fl_Grid_Proxy*)((Fl_Grid_Type*)q->parent)->o);
|
||||
grid->draw_overlay();
|
||||
}
|
||||
}
|
||||
if (!show_guides || !drag || numselected != 1) {
|
||||
if (Fl_Flex_Type::parent_is_flex(q) && Fl_Flex_Type::is_fixed(q)) {
|
||||
Fl_Flex *flex = ((Fl_Flex*)((Fl_Flex_Type*)q->parent)->o);
|
||||
@ -630,6 +637,9 @@ void Fl_Window_Type::draw_overlay() {
|
||||
} else {
|
||||
draw_height(wgt->x()+15, wgt->y(), wgt->y()+wgt->h(), FL_ALIGN_CENTER);
|
||||
}
|
||||
} else if (q->is_a(ID_Grid)) {
|
||||
Fl_Grid_Proxy *grid = ((Fl_Grid_Proxy*)((Fl_Grid_Type*)q)->o);
|
||||
grid->draw_overlay();
|
||||
}
|
||||
fl_rect(x,y,r-x,t-y);
|
||||
}
|
||||
@ -882,11 +892,19 @@ void Fl_Window_Type::moveallchildren(int key)
|
||||
allow_layout--;
|
||||
} else if (myo->parent && myo->parent->is_a(ID_Grid)) {
|
||||
Fl_Grid_Type* gt = (Fl_Grid_Type*)myo->parent;
|
||||
if (drag & FD_DRAG) {
|
||||
gt->insert_child_at(myo->o, Fl::event_x(), Fl::event_y());
|
||||
Fl_Grid* g = (Fl_Grid*)gt->o;
|
||||
if (key) {
|
||||
gt->keyboard_move_child(myo, key);
|
||||
} else {
|
||||
gt->child_resized(myo);
|
||||
if (drag & FD_DRAG) {
|
||||
gt->insert_child_at(myo->o, Fl::event_x(), Fl::event_y());
|
||||
} else {
|
||||
gt->child_resized(myo);
|
||||
}
|
||||
}
|
||||
allow_layout++;
|
||||
g->layout();
|
||||
allow_layout--;
|
||||
} else if (myo->parent && myo->parent->is_a(ID_Group)) {
|
||||
Fl_Group_Type* gt = (Fl_Group_Type*)myo->parent;
|
||||
((Fl_Group*)gt->o)->init_sizes();
|
||||
|
@ -110,7 +110,7 @@ decl {void scheme_cb(Fl_Scheme_Choice *, void *);} {public local
|
||||
decl {int w_settings_shell_list_selected;} {public local
|
||||
}
|
||||
|
||||
Function {make_script_panel()} {open
|
||||
Function {make_script_panel()} {open selected
|
||||
} {
|
||||
Fl_Window script_panel {
|
||||
label {Shell Script Editor}
|
||||
@ -142,8 +142,7 @@ script_panel->hide(); // otherwise hide..} open
|
||||
}
|
||||
code {// Enable line numbers
|
||||
script_input->linenumber_width(60);
|
||||
script_input->linenumber_size(script_input->Fl_Text_Display::textsize());} {selected
|
||||
}
|
||||
script_input->linenumber_size(script_input->Fl_Text_Display::textsize());} {}
|
||||
}
|
||||
|
||||
Function {make_settings_window()} {open
|
||||
|
@ -24,3 +24,76 @@
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Creating a user manual for your interactive user interface editor, "FLUID," involves several key steps to ensure it's informative and user-friendly. Here's a structured approach to help you get started:
|
||||
|
||||
1. **Title and Cover Page:**
|
||||
- Title: Give your manual a clear and concise title, such as "FLUID User Manual."
|
||||
- Cover Page: Include the title, a brief description, your company or project logo, and any relevant contact information.
|
||||
|
||||
2. **Table of Contents:**
|
||||
- Create a table of contents that lists all the major sections and subsections of your user manual. Ensure it's hyperlinked for easy navigation in digital formats.
|
||||
|
||||
3. **Introduction:**
|
||||
- Provide an introduction that explains the purpose of the user manual and any prerequisites or system requirements.
|
||||
|
||||
4. **Getting Started:**
|
||||
- Walk users through the initial setup and installation process.
|
||||
- Explain how to launch the FLUID editor.
|
||||
|
||||
5. **User Interface Overview:**
|
||||
- Describe the main components of the FLUID user interface, including menus, toolbars, panels, and any unique features.
|
||||
|
||||
6. **Basic Operations:**
|
||||
- Provide step-by-step instructions for common tasks, such as creating a new project, opening existing projects, and saving work.
|
||||
|
||||
7. **Widgets and Elements:**
|
||||
- Explain how to add, modify, and delete widgets and UI elements.
|
||||
- Detail the available widget libraries and their usage.
|
||||
|
||||
8. **Layout and Design:**
|
||||
- Discuss how to arrange and design UI elements in the editor.
|
||||
- Cover alignment, grouping, and layout management.
|
||||
|
||||
9. **Code Integration:**
|
||||
- Explain how to integrate code into FLUID, including code nodes and event handling.
|
||||
|
||||
10. **Advanced Features:**
|
||||
- Describe any advanced or less commonly used features of FLUID, such as custom scripting, animations, or specialized widgets.
|
||||
|
||||
11. **Troubleshooting:**
|
||||
- Provide solutions to common issues and error messages users may encounter.
|
||||
|
||||
12. **Tips and Best Practices:**
|
||||
- Offer tips and best practices to help users make the most of FLUID.
|
||||
|
||||
13. **Keyboard Shortcuts:**
|
||||
- List keyboard shortcuts for common actions to expedite user workflows.
|
||||
|
||||
14. **FAQs:**
|
||||
- Include a section with frequently asked questions and their answers.
|
||||
|
||||
15. **Glossary:**
|
||||
- Define any technical terms or jargon used in FLUID.
|
||||
|
||||
16. **Appendices:**
|
||||
- If necessary, add appendices with supplementary information, like reference tables or additional resources.
|
||||
|
||||
17. **Index:**
|
||||
- Include an index to help users quickly find specific topics or terms within the manual.
|
||||
|
||||
18. **Legal and Copyright Information:**
|
||||
- Include legal disclaimers, copyright information, and any terms of use or licensing agreements.
|
||||
|
||||
19. **Feedback and Contact Information:**
|
||||
- Encourage users to provide feedback and include contact information for support or inquiries.
|
||||
|
||||
20. **Revision History:**
|
||||
- If you plan to update the manual over time, maintain a section for revision history to track changes and updates.
|
||||
|
||||
21. **Conclusion:**
|
||||
- Wrap up the manual with a thank-you message, encouraging users to explore FLUID further.
|
||||
|
||||
Ensure that your user manual is well-organized, easy to read, and uses clear language. Consider including screenshots, diagrams, and examples to illustrate key points. Test the manual with actual users to gather feedback and make improvements as needed.
|
||||
*/
|
||||
|
@ -1205,7 +1205,7 @@ Fl_Type *add_new_widget_from_user(Fl_Type *inPrototype, Strategy strategy) {
|
||||
&& (layout->top_tabs_margin > 0)) {
|
||||
// If the widget is a group and the parent is tabs and the top tabs
|
||||
// margin is set (and the user is not requesting a specific position)
|
||||
// then prefit the group correctly to the Tabs container.
|
||||
// then prefit the group correctly to the Tabs container.
|
||||
Fl_Widget *po = ((Fl_Tabs_Type*)wt->parent)->o;
|
||||
wt->o->resize(po->x(), po->y() + layout->top_tabs_margin,
|
||||
po->w(), po->h() - layout->top_tabs_margin);
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "factory.h"
|
||||
#include "Fl_Function_Type.h"
|
||||
#include "Fl_Widget_Type.h"
|
||||
#include "Fl_Grid_Type.h"
|
||||
#include "Fl_Window_Type.h"
|
||||
#include "alignment_panel.h"
|
||||
#include "widget_browser.h"
|
||||
@ -391,6 +392,17 @@ Fl_Type *Fd_Project_Reader::read_children(Fl_Type *p, int merge, Strategy strate
|
||||
}
|
||||
read_children(t, 0, strategy, skip_options);
|
||||
t->postprocess_read();
|
||||
// FIXME: this has no business in the file reader!
|
||||
// TODO: this is called whenever something is pasted from the top level into a grid
|
||||
// It makes sense to make this more universal for other widget types too.
|
||||
if (merge && t && t->parent && t->parent->is_a(ID_Grid)) {
|
||||
if (Fl_Window_Type::popupx != 0x7FFFFFFF) {
|
||||
((Fl_Grid_Type*)t->parent)->insert_child_at(((Fl_Widget_Type*)t)->o, Fl_Window_Type::popupx, Fl_Window_Type::popupy);
|
||||
} else {
|
||||
((Fl_Grid_Type*)t->parent)->insert_child(((Fl_Widget_Type*)t)->o);
|
||||
}
|
||||
}
|
||||
|
||||
t->layout_widget();
|
||||
}
|
||||
|
||||
@ -425,6 +437,7 @@ int Fd_Project_Reader::read_project(const char *filename, int merge, Strategy st
|
||||
else
|
||||
g_project.reset();
|
||||
read_children(Fl_Type::current, merge, strategy);
|
||||
// clear this
|
||||
Fl_Type::current = 0;
|
||||
// Force menu items to be rebuilt...
|
||||
for (o = Fl_Type::first; o; o = o->next) {
|
||||
|
@ -123,19 +123,19 @@ Fluid_Coord_Input *widget_grid_row_input=(Fluid_Coord_Input *)0;
|
||||
|
||||
Fluid_Coord_Input *widget_grid_col_input=(Fluid_Coord_Input *)0;
|
||||
|
||||
Fl_Menu_Item menu_5[] = {
|
||||
{"GRID_CENTER", 0, 0, (void*)(FL_GRID_CENTER), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_FILL", 0, 0, (void*)(FL_GRID_FILL), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_HORIZONTAL", 0, 0, (void*)(FL_GRID_HORIZONTAL), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_VERTICAL", 0, 0, (void*)(FL_GRID_VERTICAL), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
Fl_Menu_Item menu_Horizontal[] = {
|
||||
{"GRID_LEFT", 0, 0, (void*)(FL_GRID_LEFT), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_TOP_LEFT", 0, 0, (void*)(FL_GRID_TOP_LEFT), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_TOP", 0, 0, (void*)(FL_GRID_TOP), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_TOP_RIGHT", 0, 0, (void*)(FL_GRID_TOP_RIGHT), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_CENTER", 0, 0, (void*)(FL_GRID_CENTER), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_RIGHT", 0, 0, (void*)(FL_GRID_RIGHT), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_BOTTOM_LEFT", 0, 0, (void*)(FL_GRID_BOTTOM_LEFT), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_FILL", 0, 0, (void*)(FL_GRID_HORIZONTAL), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{0,0,0,0,0,0,0,0,0}
|
||||
};
|
||||
|
||||
Fl_Menu_Item menu_Vertical[] = {
|
||||
{"GRID_TOP", 0, 0, (void*)(FL_GRID_TOP), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_CENTER", 0, 0, (void*)(FL_GRID_CENTER), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_BOTTOM", 0, 0, (void*)(FL_GRID_BOTTOM), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_BOTTOM_RIGHT", 0, 0, (void*)(FL_GRID_BOTTOM_RIGHT), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{"GRID_FILL", 0, 0, (void*)(FL_GRID_VERTICAL), 0, (uchar)FL_NORMAL_LABEL, 0, 11, 0},
|
||||
{0,0,0,0,0,0,0,0,0}
|
||||
};
|
||||
|
||||
@ -541,6 +541,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);
|
||||
@ -1414,7 +1415,6 @@ access the Widget pointer and \'v\' to access the user value.");
|
||||
{ widget_tab_grid_child = new Fl_Group(10, 30, 400, 330, "Grid Child");
|
||||
widget_tab_grid_child->labelsize(11);
|
||||
widget_tab_grid_child->callback((Fl_Callback*)propagate_load);
|
||||
widget_tab_grid_child->hide();
|
||||
{ Fl_Group* o = new Fl_Group(95, 60, 315, 20, "Location:");
|
||||
o->labelfont(1);
|
||||
o->labelsize(11);
|
||||
@ -1482,18 +1482,26 @@ access the Widget pointer and \'v\' to access the user value.");
|
||||
} // Fl_Box* o
|
||||
o->end();
|
||||
} // Fl_Group* o
|
||||
{ Fl_Group* o = new Fl_Group(95, 90, 315, 20, "Align:");
|
||||
{ Fl_Group* o = new Fl_Group(95, 90, 315, 30, "Align:");
|
||||
o->labelfont(1);
|
||||
o->labelsize(11);
|
||||
o->callback((Fl_Callback*)propagate_load);
|
||||
o->align(Fl_Align(FL_ALIGN_LEFT));
|
||||
{ Fl_Choice* o = new Fl_Choice(95, 90, 160, 20);
|
||||
{ Fl_Choice* o = new Fl_Choice(95, 100, 115, 20, "Horizontal");
|
||||
o->down_box(FL_BORDER_BOX);
|
||||
o->labelsize(11);
|
||||
o->textsize(11);
|
||||
o->callback((Fl_Callback*)grid_align_cb);
|
||||
o->callback((Fl_Callback*)grid_align_horizontal_cb);
|
||||
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
|
||||
o->menu(menu_5);
|
||||
o->menu(menu_Horizontal);
|
||||
} // Fl_Choice* o
|
||||
{ Fl_Choice* o = new Fl_Choice(215, 100, 115, 20, "Vertical");
|
||||
o->down_box(FL_BORDER_BOX);
|
||||
o->labelsize(11);
|
||||
o->textsize(11);
|
||||
o->callback((Fl_Callback*)grid_align_vertical_cb);
|
||||
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
|
||||
o->menu(menu_Vertical);
|
||||
} // Fl_Choice* o
|
||||
{ Fl_Box* o = new Fl_Box(395, 90, 1, 20);
|
||||
o->hide();
|
||||
@ -1501,12 +1509,12 @@ access the Widget pointer and \'v\' to access the user value.");
|
||||
} // Fl_Box* o
|
||||
o->end();
|
||||
} // Fl_Group* o
|
||||
{ Fl_Group* o = new Fl_Group(95, 125, 315, 20, "Min. Size:");
|
||||
{ Fl_Group* o = new Fl_Group(95, 125, 315, 30, "Min. Size:");
|
||||
o->labelfont(1);
|
||||
o->labelsize(11);
|
||||
o->callback((Fl_Callback*)propagate_load);
|
||||
o->align(Fl_Align(FL_ALIGN_LEFT));
|
||||
{ Fluid_Coord_Input* o = new Fluid_Coord_Input(95, 125, 55, 20, "Width:");
|
||||
{ Fluid_Coord_Input* o = new Fluid_Coord_Input(95, 135, 55, 20, "Width:");
|
||||
o->box(FL_DOWN_BOX);
|
||||
o->color(FL_BACKGROUND2_COLOR);
|
||||
o->selection_color(FL_SELECTION_COLOR);
|
||||
@ -1519,7 +1527,7 @@ access the Widget pointer and \'v\' to access the user value.");
|
||||
o->align(Fl_Align(FL_ALIGN_TOP_LEFT));
|
||||
o->when(FL_WHEN_RELEASE);
|
||||
} // Fluid_Coord_Input* o
|
||||
{ Fluid_Coord_Input* o = new Fluid_Coord_Input(155, 125, 55, 20, "Height:");
|
||||
{ Fluid_Coord_Input* o = new Fluid_Coord_Input(155, 135, 55, 20, "Height:");
|
||||
o->box(FL_DOWN_BOX);
|
||||
o->color(FL_BACKGROUND2_COLOR);
|
||||
o->selection_color(FL_SELECTION_COLOR);
|
||||
@ -1538,12 +1546,12 @@ access the Widget pointer and \'v\' to access the user value.");
|
||||
} // Fl_Box* o
|
||||
o->end();
|
||||
} // Fl_Group* o
|
||||
{ Fl_Group* o = new Fl_Group(95, 160, 315, 20, "Span:");
|
||||
{ Fl_Group* o = new Fl_Group(95, 160, 315, 30, "Span:");
|
||||
o->labelfont(1);
|
||||
o->labelsize(11);
|
||||
o->callback((Fl_Callback*)propagate_load);
|
||||
o->align(Fl_Align(FL_ALIGN_LEFT));
|
||||
{ widget_grid_rowspan_input = new Fluid_Coord_Input(95, 160, 40, 20, "Row Span:");
|
||||
{ widget_grid_rowspan_input = new Fluid_Coord_Input(95, 170, 40, 20, "Row Span:");
|
||||
widget_grid_rowspan_input->box(FL_DOWN_BOX);
|
||||
widget_grid_rowspan_input->color(FL_BACKGROUND2_COLOR);
|
||||
widget_grid_rowspan_input->selection_color(FL_SELECTION_COLOR);
|
||||
@ -1556,14 +1564,14 @@ access the Widget pointer and \'v\' to access the user value.");
|
||||
widget_grid_rowspan_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
|
||||
widget_grid_rowspan_input->when(FL_WHEN_RELEASE);
|
||||
} // Fluid_Coord_Input* widget_grid_rowspan_input
|
||||
{ Fl_Group* o = new Fl_Group(135, 160, 30, 20);
|
||||
{ Fl_Button* o = new Fl_Button(135, 160, 15, 20, "-");
|
||||
{ Fl_Group* o = new Fl_Group(135, 170, 30, 20);
|
||||
{ Fl_Button* o = new Fl_Button(135, 170, 15, 20, "-");
|
||||
o->compact(1);
|
||||
o->labelsize(11);
|
||||
o->callback((Fl_Callback*)grid_dec_rowspan_cb);
|
||||
o->clear_visible_focus();
|
||||
} // Fl_Button* o
|
||||
{ Fl_Button* o = new Fl_Button(150, 160, 15, 20, "+");
|
||||
{ Fl_Button* o = new Fl_Button(150, 170, 15, 20, "+");
|
||||
o->compact(1);
|
||||
o->labelsize(11);
|
||||
o->callback((Fl_Callback*)grid_inc_rowspan_cb);
|
||||
@ -1571,7 +1579,7 @@ access the Widget pointer and \'v\' to access the user value.");
|
||||
} // Fl_Button* o
|
||||
o->end();
|
||||
} // Fl_Group* o
|
||||
{ widget_grid_colspan_input = new Fluid_Coord_Input(175, 160, 40, 20, "Col. Span:");
|
||||
{ widget_grid_colspan_input = new Fluid_Coord_Input(175, 170, 40, 20, "Col. Span:");
|
||||
widget_grid_colspan_input->box(FL_DOWN_BOX);
|
||||
widget_grid_colspan_input->color(FL_BACKGROUND2_COLOR);
|
||||
widget_grid_colspan_input->selection_color(FL_SELECTION_COLOR);
|
||||
@ -1584,14 +1592,14 @@ access the Widget pointer and \'v\' to access the user value.");
|
||||
widget_grid_colspan_input->align(Fl_Align(FL_ALIGN_TOP_LEFT));
|
||||
widget_grid_colspan_input->when(FL_WHEN_RELEASE);
|
||||
} // Fluid_Coord_Input* widget_grid_colspan_input
|
||||
{ Fl_Group* o = new Fl_Group(215, 160, 30, 20);
|
||||
{ Fl_Button* o = new Fl_Button(215, 160, 15, 20, "-");
|
||||
{ Fl_Group* o = new Fl_Group(215, 170, 30, 20);
|
||||
{ Fl_Button* o = new Fl_Button(215, 170, 15, 20, "-");
|
||||
o->compact(1);
|
||||
o->labelsize(11);
|
||||
o->callback((Fl_Callback*)grid_dec_colspan_cb);
|
||||
o->clear_visible_focus();
|
||||
} // Fl_Button* o
|
||||
{ Fl_Button* o = new Fl_Button(230, 160, 15, 20, "+");
|
||||
{ Fl_Button* o = new Fl_Button(230, 170, 15, 20, "+");
|
||||
o->compact(1);
|
||||
o->labelsize(11);
|
||||
o->callback((Fl_Callback*)grid_inc_colspan_cb);
|
||||
|
@ -59,7 +59,7 @@ Function {make_widget_panel()} {
|
||||
Fl_Group {} {
|
||||
label GUI
|
||||
callback propagate_load
|
||||
xywh {10 30 400 330} labelsize 11 when 0 resizable
|
||||
xywh {10 30 400 330} labelsize 11 when 0 hide resizable
|
||||
} {
|
||||
Fl_Group {} {
|
||||
label {Label:}
|
||||
@ -835,7 +835,7 @@ wCallback->do_callback(wCallback, v);} open
|
||||
Fl_Group widget_tab_grid_child {
|
||||
label {Grid Child}
|
||||
callback propagate_load open
|
||||
xywh {10 30 400 330} labelsize 11 hide
|
||||
xywh {10 30 400 330} labelsize 11
|
||||
} {
|
||||
Fl_Group {} {
|
||||
label {Location:}
|
||||
@ -893,50 +893,21 @@ wCallback->do_callback(wCallback, v);} open
|
||||
Fl_Group {} {
|
||||
label {Align:}
|
||||
callback propagate_load open
|
||||
xywh {95 90 315 20} labelfont 1 labelsize 11 align 4
|
||||
xywh {95 90 315 30} labelfont 1 labelsize 11 align 4
|
||||
} {
|
||||
Fl_Choice {} {
|
||||
callback grid_align_cb
|
||||
xywh {95 90 160 20} down_box BORDER_BOX labelsize 11 align 5 textsize 11
|
||||
label Horizontal
|
||||
callback grid_align_horizontal_cb open
|
||||
xywh {95 100 115 20} down_box BORDER_BOX labelsize 11 align 5 textsize 11
|
||||
} {
|
||||
MenuItem {} {
|
||||
label GRID_CENTER
|
||||
user_data FL_GRID_CENTER user_data_type long
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
label GRID_FILL
|
||||
user_data FL_GRID_FILL user_data_type long
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
label GRID_HORIZONTAL
|
||||
user_data FL_GRID_HORIZONTAL user_data_type long
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
label GRID_VERTICAL
|
||||
user_data FL_GRID_VERTICAL user_data_type long
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
label GRID_LEFT
|
||||
user_data FL_GRID_LEFT user_data_type long
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
label GRID_TOP_LEFT
|
||||
user_data FL_GRID_TOP_LEFT user_data_type long
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
label GRID_TOP
|
||||
user_data FL_GRID_TOP user_data_type long
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
label GRID_TOP_RIGHT
|
||||
user_data FL_GRID_TOP_RIGHT user_data_type long
|
||||
label GRID_CENTER
|
||||
user_data FL_GRID_CENTER user_data_type long
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
@ -945,8 +916,24 @@ wCallback->do_callback(wCallback, v);} open
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
label GRID_BOTTOM_LEFT
|
||||
user_data FL_GRID_BOTTOM_LEFT user_data_type long
|
||||
label GRID_FILL
|
||||
user_data FL_GRID_HORIZONTAL user_data_type long
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
}
|
||||
Fl_Choice {} {
|
||||
label Vertical
|
||||
callback grid_align_vertical_cb open
|
||||
xywh {215 100 115 20} down_box BORDER_BOX labelsize 11 align 5 textsize 11
|
||||
} {
|
||||
MenuItem {} {
|
||||
label GRID_TOP
|
||||
user_data FL_GRID_TOP user_data_type long
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
label GRID_CENTER
|
||||
user_data FL_GRID_CENTER user_data_type long
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
@ -955,8 +942,8 @@ wCallback->do_callback(wCallback, v);} open
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
MenuItem {} {
|
||||
label GRID_BOTTOM_RIGHT
|
||||
user_data FL_GRID_BOTTOM_RIGHT user_data_type long
|
||||
label GRID_FILL
|
||||
user_data FL_GRID_VERTICAL user_data_type long selected
|
||||
xywh {10 10 31 20} labelsize 11
|
||||
}
|
||||
}
|
||||
@ -967,18 +954,18 @@ wCallback->do_callback(wCallback, v);} open
|
||||
Fl_Group {} {
|
||||
label {Min. Size:}
|
||||
callback propagate_load open
|
||||
xywh {95 125 315 20} labelfont 1 labelsize 11 align 4
|
||||
xywh {95 125 315 30} labelfont 1 labelsize 11 align 4
|
||||
} {
|
||||
Fl_Input {} {
|
||||
label {Width:}
|
||||
callback grid_set_min_wdt_cb
|
||||
xywh {95 125 55 20} labelsize 11 align 5 textsize 11
|
||||
xywh {95 135 55 20} labelsize 11 align 5 textsize 11
|
||||
class Fluid_Coord_Input
|
||||
}
|
||||
Fl_Input {} {
|
||||
label {Height:}
|
||||
callback grid_set_min_hgt_cb
|
||||
xywh {155 125 55 20} labelsize 11 align 5 textsize 11
|
||||
xywh {155 135 55 20} labelsize 11 align 5 textsize 11
|
||||
class Fluid_Coord_Input
|
||||
}
|
||||
Fl_Box {} {
|
||||
@ -988,49 +975,49 @@ wCallback->do_callback(wCallback, v);} open
|
||||
Fl_Group {} {
|
||||
label {Span:}
|
||||
callback propagate_load open
|
||||
xywh {95 160 315 20} labelfont 1 labelsize 11 align 4
|
||||
xywh {95 160 315 30} labelfont 1 labelsize 11 align 4
|
||||
} {
|
||||
Fl_Input widget_grid_rowspan_input {
|
||||
label {Row Span:}
|
||||
callback grid_set_rowspan_cb
|
||||
xywh {95 160 40 20} labelsize 11 align 5 textsize 11
|
||||
xywh {95 170 40 20} labelsize 11 align 5 textsize 11
|
||||
class Fluid_Coord_Input
|
||||
}
|
||||
Fl_Group {} {open
|
||||
xywh {135 160 30 20}
|
||||
xywh {135 170 30 20}
|
||||
} {
|
||||
Fl_Button {} {
|
||||
label {-}
|
||||
callback grid_dec_rowspan_cb
|
||||
xywh {135 160 15 20} labelsize 11
|
||||
xywh {135 170 15 20} labelsize 11
|
||||
code0 {o->clear_visible_focus();} compact 1
|
||||
}
|
||||
Fl_Button {} {
|
||||
label {+}
|
||||
callback grid_inc_rowspan_cb
|
||||
xywh {150 160 15 20} labelsize 11
|
||||
xywh {150 170 15 20} labelsize 11
|
||||
code0 {o->clear_visible_focus();} compact 1
|
||||
}
|
||||
}
|
||||
Fl_Input widget_grid_colspan_input {
|
||||
label {Col. Span:}
|
||||
callback grid_set_colspan_cb
|
||||
xywh {175 160 40 20} labelsize 11 align 5 textsize 11
|
||||
xywh {175 170 40 20} labelsize 11 align 5 textsize 11
|
||||
class Fluid_Coord_Input
|
||||
}
|
||||
Fl_Group {} {open
|
||||
xywh {215 160 30 20}
|
||||
xywh {215 170 30 20}
|
||||
} {
|
||||
Fl_Button {} {
|
||||
label {-}
|
||||
callback grid_dec_colspan_cb
|
||||
xywh {215 160 15 20} labelsize 11
|
||||
xywh {215 170 15 20} labelsize 11
|
||||
code0 {o->clear_visible_focus();} compact 1
|
||||
}
|
||||
Fl_Button {} {
|
||||
label {+}
|
||||
callback grid_inc_colspan_cb
|
||||
xywh {230 160 15 20} labelsize 11
|
||||
xywh {230 170 15 20} labelsize 11
|
||||
code0 {o->clear_visible_focus();} compact 1
|
||||
}
|
||||
}
|
||||
|
@ -143,7 +143,8 @@ extern void grid_set_col_cb(Fluid_Coord_Input*, void*);
|
||||
extern Fluid_Coord_Input *widget_grid_col_input;
|
||||
extern void grid_dec_col_cb(Fl_Button*, void*);
|
||||
extern void grid_inc_col_cb(Fl_Button*, void*);
|
||||
extern void grid_align_cb(Fl_Choice*, void*);
|
||||
extern void grid_align_horizontal_cb(Fl_Choice*, void*);
|
||||
extern void grid_align_vertical_cb(Fl_Choice*, void*);
|
||||
extern void grid_set_min_wdt_cb(Fluid_Coord_Input*, void*);
|
||||
extern void grid_set_min_hgt_cb(Fluid_Coord_Input*, void*);
|
||||
extern void grid_set_rowspan_cb(Fluid_Coord_Input*, void*);
|
||||
@ -175,5 +176,6 @@ extern Fl_Menu_Item menu_Children[];
|
||||
extern Fl_Menu_Item menu_2[];
|
||||
extern Fl_Menu_Item menu_3[];
|
||||
extern Fl_Menu_Item menu_4[];
|
||||
extern Fl_Menu_Item menu_5[];
|
||||
extern Fl_Menu_Item menu_Horizontal[];
|
||||
extern Fl_Menu_Item menu_Vertical[];
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user