summaryrefslogtreecommitdiff
path: root/src/Fl_Flex.cxx
AgeCommit message (Collapse)Author
2023-10-24Fix Fl_Flex::resize() and layout() (#811)Albrecht Schlosser
Remove "too optimistic optimization" in resize(). Resize must always call layout() to recalculate widget positions.
2023-09-04Introduce Fl_Flex::need_layout() to optimize layout calculationAlbrecht Schlosser
This is intended to reduce layout calculation and resizing of child widgets until necessary before the Fl_Flex widget and all its children are drawn in Fl_Flex::draw(). With this commit users no longer need to call layout() to layout the Fl_Flex widget and its children properly unless they change widget sizes or show/hide children.
2022-12-15Rename some Fl_Flex methods for FLTK compliance (#594)Albrecht Schlosser
Change some method names to comply with FLTK style as discussed in fltk.coredev, thread "Fl_Flex method name question". * Rename Fl_Flex::margins(...) to Fl_Flex::margin(...) (use singular form for all margin related methods) * Remove Fl_Flex::setSize() and isSetSize() "backwards compatibility" methods * Rename Fl_Flex::set_size(...) to fixed(...) Note: the latter affects existing (pre-release) fluid (.fl) files: you may want to edit and replace "set_size_tuples" with "fixed_size_tuples"
2022-11-01Added Fl_Group::on_insert/on_remove/on_move (#527)Matthias Melcher
2022-11-01Fluid support for Fl_Flex (#523) and some Fl_Flex improvementsMatthias Melcher
* Adding Fluid support for Fl_Flex, margins, and gap. * Fluid Fl_Flex mostly working. Fixed in Fl_Flex::set_size(). * Fluid Flex live mode works, interactive dragging works * Fluid Flex: adding check box for fixed children * Fluid Flex: visual flexibility indicator in guides. * Fluid Flex: bug in generated code. * Fix formatting * Fixing Tooltip, fixing resize issue PR #518. * Removing unused variables. Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2022-08-07Fl_Flex: support different margin sizes, improve docsAlbrecht Schlosser
Support different margin sizes on all four edges. Default margin and gap size is now 0 (compatible with Fl_Pack). Doxygen: move the description from the constructor to the class declaration which constitutes a "description". Make some methods virtual and/or 'const'. Clarify demo programs, make them even more "FLTK style".
2022-08-01Fix Fl_Flex unsetting of set_size()Albrecht Schlosser
Don't add the widget to the array if size == 0 (unset) but it has not been in the array (or it's called twice).
2022-08-01Add Fl_Flex widget from Karsten Pedersen (issue #255)Albrecht Schlosser
This work is based on the repository and latest commit: https://github.com/osen/FL_Flex.git commit 36e4ed75a00daac825b87e81295818b4650991f5 Author: Karsten Pedersen <...> Date: Fri Apr 23 12:06:16 2021 +0000 Added Fltk (LGPL) license. This widget is similar to Fl_Pack and supports either one row or one column of widgets but has some more features. Test and demo programs are included: test/flex_login.cxx: simple "login window" demo program test/flex_demo.cxx: slightly more complex demo program The original demo programs can still be compiled and built with the new widget provided you '#include <FL/Fl_Flex.H>'. Backwards compatible methods are included (except debug()). The original widget has been modified to match FLTK standards and enhanced in several ways, including: - support box frames - add HORIZONTAL and VERTICAL enum values (as in Fl_Pack) - add horizontal() method (as in Fl_Pack) - use type() rather than internal 'direction' variable - add standard widget constructor (x, y, w, h, label) - add margin and gap accessors rather than hard coding constants - improve test and demo programs - add documentation - replace <vector> with array as required by FLTK CMP - rename camelCase method names, keeping old names for compatibility: - change 'setSize(Fl_Widget*, int)' to 'set_size(Fl_Widget*, int)' - change 'bool isSetSize(Fl_Widget*)' to 'int set_size(Fl_Widget*)' - remove debug() method - add a way to "unset" fixed size: set_size(Fl_Widget *, 0) - add layout() method to force recalculation of children - unify resizeRow() and resizeCol() methods to avoid code duplication - improve widget size calculation.