diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-11-01 23:34:47 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-11-01 23:34:53 +0100 |
| commit | fb6c38b1a44d185ed4d4c450d5ccae7992c4c774 (patch) | |
| tree | f7cd0008cb94d39be42cb8ccdeb2221efb986d9a /fluid/Fl_Group_Type.cxx | |
| parent | 904d25dafed1766e1fc6f25db873103218074eb9 (diff) | |
FLUID: Arrow keys move widgets inside Fl_Flex
Diffstat (limited to 'fluid/Fl_Group_Type.cxx')
| -rw-r--r-- | fluid/Fl_Group_Type.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fluid/Fl_Group_Type.cxx b/fluid/Fl_Group_Type.cxx index 4b49b481c..f1c68c888 100644 --- a/fluid/Fl_Group_Type.cxx +++ b/fluid/Fl_Group_Type.cxx @@ -515,6 +515,25 @@ void Fl_Flex_Type::insert_child_at(Fl_Widget *child, int x, int y) { } } +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); + if (ix == flex->children()) return; + if (flex->horizontal()) { + if (key==FL_Right) { + flex->insert(*child->o, ix+2); + } else if (key==FL_Left) { + if (ix > 0) flex->insert(*child->o, ix-1); + } + } else { + if (key==FL_Down) { + flex->insert(*child->o, ix+2); + } else if (key==FL_Up) { + if (ix > 0) flex->insert(*child->o, ix-1); + } + } +} + int Fl_Flex_Type::size(Fl_Type *t, char fixed_only) { if (!t->is_widget()) return 0; if (!t->parent) return 0; |
