diff options
| author | Matthias Melcher <github@matthiasm.com> | 2022-02-13 22:01:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-13 22:01:16 +0100 |
| commit | 8c3778e13feebced373497a3e4060ae065cf65b7 (patch) | |
| tree | 96ba807115e42e5f3cd35156343ccf5f700e5559 /fluid/Fl_Type.cxx | |
| parent | f196ffbb528f9ec5030697bc03fb956f79c9563e (diff) | |
Better Fluid Widget dimension controls (#394)
* Size and position widgets can evaluate basic math.
* Allowing x, y, w, and h as variables for formulas.
Also supporting 'i' as a counting index when selecting multiple
widgets, so setting Y: to i*25+10 arranges all selected widgets
vertically.
* Additional variables cx, etc. for children box
cx, cy, cw, ch
Diffstat (limited to 'fluid/Fl_Type.cxx')
| -rw-r--r-- | fluid/Fl_Type.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx index 50a59869b..b991e737d 100644 --- a/fluid/Fl_Type.cxx +++ b/fluid/Fl_Type.cxx @@ -299,6 +299,30 @@ Fl_Type::~Fl_Type() { if (comment_) free((void*)comment_); } +// Return the previous sibling in the tree structure or NULL. +Fl_Type *Fl_Type::prev_sibling() { + Fl_Type *n; + for (n = prev; n && n->level > level; n = n->prev) ; + return n; +} + +// Return the next sibling in the tree structure or NULL. +Fl_Type *Fl_Type::next_sibling() { + Fl_Type *n; + for (n = next; n && n->level > level; n = n->next) ; + if (n->level==level) + return n; + return 0; +} + +// Return the first child or NULL +Fl_Type *Fl_Type::first_child() { + Fl_Type *n = next; + if (n->level > level) + return n; + return NULL; +} + // Generate a descriptive text for this item, to put in browser & window titles const char* Fl_Type::title() { const char* c = name(); |
