summaryrefslogtreecommitdiff
path: root/src/Fl_Tree_Item.cxx
AgeCommit message (Collapse)Author
46 hourswipmaxim nikonov
3 dayswi[maxim nikonov
2025-10-09Doc fix for issue #1310Greg Ercolano
2025-03-28Changed two connector methods to virtualGreg Ercolano
For reference, see fltk.general thread started Mar 26 2025, entitled: "Make some Fl_Tree_Item methods virtual?"
2024-07-21Fix slowness due to not clipping (#1014)Greg Ercolano
2024-07-17Fix Fl_Tree related -Wall warningsGreg Ercolano
2024-07-17Added is_visible_r() for consistency w/is_visible()Greg Ercolano
2024-07-09Fix warning (#1008)Greg Ercolano
2024-07-08Fix horiz connection lines (#1008)Greg Ercolano
2024-06-30Fl_Tree +/- buttons are no longer drawn using bitmaps, different default ↵Cyprinus Carpio
line color (#995) Fl_Tree changed to support system color themes (PR #995) merging CyprinusCarpio's mods carried over from from issue #972. * Fl_Tree: use named (colormap) colors to support system color themes (see issue #972). changed connectorcolor() default from gray ramp color to FL_INACTIVE_COLOR (Fl_Color(8)), and similar named colormap colors for icon drawing. * Fl_Tree ⊞ / ⊟ icons (and on macs, ▶ / ▼icons) are now drawn w/fl_draw() functions instead of with xpm bitmaps for colormap control --------- Co-authored-by: Greg Ercolano <erco@seriss.com>
2024-04-26Box types can now defined and draw their own focus frame, STR 2145, #659Matthias Melcher
2023-01-12Fix buffer overflow in Fl_Tree_Item::show_self()Albrecht Schlosser
2022-03-09Small doc improvements for Fl_Tree_Item.Greg Ercolano
2022-01-16Rename FL/fl_string.h to FL/fl_string_functions.hAlbrecht Schlosser
This is part 1 of the final fix for a previous name clash on case insensitive file systems (fl_string.h vs. Fl_String.H).
2021-11-27Solves Fl_Tree focus box artifacts on linux - fixes issue #299.Greg Ercolano
Nabbed the current code from Fl_Widget::draw_focus() which solves.
2020-08-01Implement + deploy fl_strdup()Greg Ercolano
2020-07-06Remove $Id$ tags, update URL's, and moreAlbrecht Schlosser
- remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers.
2019-08-27Added new method Fl_Tree_Item::event_on_item()Greg Ercolano
2019-08-27Added NULL checks in Fl_Tree_Item::move()Greg Ercolano
2019-08-25More fixes for STR #3527; handle usericons, etcGreg Ercolano
2019-02-02STR #2714: remove new shadow lint for MacOSMatthias Melcher
2019-01-25Fix Fl_Tree::insert() with pos out ouf range (#18)Albrecht Schlosser
The given position to insert a new item was not checked against the valid range so the program could crash if a position less than zero or greater than children() was given. The position is now clamped to the valid range, i.e. the item is either prepended or appended. Fixes issue #18.
2018-04-10General description: mention how to move items aroundGreg Ercolano
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12824 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-07-21Bringing over fix [r11840] from 1.3 current to the porting branch.Greg Ercolano
Solves STR#3294; added methods to let user set the userdeicon, and removed the performance degrading automatic deicon creation. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11841 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-13Remove FL_ABI_VERSION clauses from the Fl_Tree class source codeManolo Gouy
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11602 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-14Carrying over r11173 fix to the new 1.3 porting branch.Greg Ercolano
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11362 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-13Details on PORTME items. Move fl_parse_color() to screen drivers.Matthias Melcher
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11163 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-11Mark places that need to be refactored with // PORTME:Matthias Melcher
Searching for __APPLE, WIN32 or X11 did give me many false results. I instead marked most ifdef's that I would like to get rid of with the text // PORTME:, so they can be easily found by a global search. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11155 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-06-23Fixes STR 3234Greg Ercolano
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10773 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-28Fl_Tree: improved draw() behavior when deactivated;Greg Ercolano
icons draw deactivated now. test/tree: Added 'deactivate tree' button to test deactivating entire widget. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10723 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-13Small doc fixes as recommended by Albrecht, Greg Ercolano
who is currently proofreading the Fl_Tree docs/code. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10700 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-04-13Fix return value test, as pointed out by Albrecht.Greg Ercolano
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10699 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-19Fix problem with *horiz* dot pattern alignment,Greg Ercolano
optimized draw loop, fixed indent. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10497 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-12-19Optimize drawing loop, fix indent.Greg Ercolano
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10496 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-05Fixes to how new move() operations handle the conceptGreg Ercolano
of 'above' and 'below' when referring to items instead of index positions. Small offsets needed due to how the arrays are scrolled after a move operation. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10272 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-04Solves STR #3127.Greg Ercolano
Added to assist cand for his patch to solve RFE STR #2828 option (I). o Add move() methods to Fl_Tree_Item. o Add deparent()/reparent() methods o Supporting methods added to Fl_Tree_Item_Array, and enhancement to update_prev_next() to allow -1 option to create an orphan item Added to Fl_Tree_Item: * Fl_Tree_Item* deparent(int pos) * int reparent(Fl_Tree_Item *newchild, int pos) * int move(int to, int from) * int move(Fl_Tree_Item *item, int op, int pos) * int move_above(Fl_Tree_Item *item) * int move_below(Fl_Tree_Item *item) * int move_into(Fl_Tree_Item *item, int pos) Added to Fl_Tree_Item_Array: * int move(int to, int from) * int deparent(int pos) * int reparent(Fl_Tree_Item *item, Fl_Tree_Item* newparent, int pos) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10271 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-01-24More Fl_Tree doc improvements.Greg Ercolano
Only docs changed here, no code changed.. one method's definition moved to match similar method organization. Some redundant docs (for const vs. non-const) changed by referring the non-const method to the const one, to reduce size. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10081 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-01-20o Added draw_item_content() to Fl_Tree_Item,Greg Ercolano
a volatile method that can be overridden by subclasses to take drawing control of tree item's content. This replaces the old "item_draw_callback()" technique added a few months ago as an ABI feature; turned out the new technique is a better way to go. o The examples/tree-custom-draw-items.cxx demo adjusted accordingly. o Added missing docs for some methods that had none, including label_[xywh](). o Added related methods needed to implement this, including: Fl_Tree_Item_Array::replace() Fl_Tree_Item::replace() Fl_Tree::root(item) Fl_Tree::add() variations Fl_Tree_Item::drawbgcolor()/drawfgcolor() o Carefully worked the FLTK_ABI_VERSION macros so as to be ABI compatible with 1.3.0. o Verified 1.3.0 ABI compatibility with ABI Compliance Checker 1.99.8.5: http://ispras.linuxbase.org/index.php/ABI_compliance_checker git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10071 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-01-16ABI fixes.Greg Ercolano
These are problems "ABI Compliance Checker" found with the recent Fl_Tree mods. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10062 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-01-14Fix small memleak in Fl_Tree::show_self() [used only for debugging anyway]Greg Ercolano
and convert from malloc/free -> new/delete git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10055 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-12-28* Fixes STR#3024 issue with Fl_Tree::find_item()Greg Ercolano
* Removes redundant const vs. non-const code using technique from Scott Meyers' book "Effective C++", 3rd Ed. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10038 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-12-15Adds horizontal scrollbar to Fl_Tree as an ABI 1.3.3 feature.Greg Ercolano
*************************************************************** NOTE: You MUST uncomment the FLTK_ABI_VERSION in Enumerations.H to use these changes. *************************************************************** Also: separated tree size calculation from draw() code, so that one can cause the tree to recalculate immediately after making modifications to the tree by calling Fl_Tree::calc_tree(). Numerous improvements to docs for the tree as well, enough to create a rather large diff. Large internal changes were needed to do this properly. The following was added to the CHANGES file: - Fl_Tree: various related changes: o Added horizontal scrollbar o Separated draw() and tree size calculation o Added new public methods: > resize() -- uses optimized dim calc, avoids tree recalc > next_item() -- added parameters: direction, visibility > extend_selection() -- added parameters, improved algorithm > calc_dimensions() -- calc tix/y/w/h, tox/y/w/h and scrollbars > calc_tree() -- calc tree_w/tree_h > recalc_tree() -- schedules calc_tree() > first_visible_item(), last_visible_item(), next_visible_item() > first_selected_item(), last_selected_item(), next_selected_item() o Added protected variables: > _tix/y/w/h -- tree widget 'inner' dimension > _tox/y/w/h -- tree widget 'outer' dimension > _tree_w,_tree_h -- entire tree hierarchy width/height o Deprecated: > item_clicked() -- use callback_item() instead > first_visible() -- use first_visible_item() instead > last_visible() -- use last_visible_item() instead - Fl_Tree_Item: various related changes: o Added Fl_Tree ptr: needed for auto-recalc when item modified directly o Added new methods tree(), recalc_tree() o Added new ctor that accepts Fl_Tree* o draw() parameters changed to include tree size calculations o Deprecated: > ctor using Fl_Tree_Prefs parameter (Fl_Tree* version better, and must be used for 1.3.3 ABI features to work correctly) > next_displayed() -- use next_visible() instead > prev_displayed() -- use prev_visible() instead - test/tree: added tests for newly added features git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10034 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-11-10o Added Fl_Tree::item_draw_callback(), letting one define a custom draw ↵Greg Ercolano
function for Fl_Tree_Item's. o Added examples/tree-custom-draw-items.cxx to demonstrate its use. o Fixed small doc error for recent Fl_Tree::get_selected_items() git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10018 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-11-06Fl_Tree:Greg Ercolano
o Added new method Fl_Tree::get_selected_items() o Modified Fl_Tree_Item_Array to usable in a general way (i.e. beyond Fl_Tree's internal use) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10016 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-09-16STR# #2973: applied patch str_2973_r9958_sun-fix-errors-5.patch verbatim.Greg Ercolano
src/Fl_Tree_Item.cxx -- solve: "Fl_Tree_Item.cxx", line 614: Error: Initializing int& requires an lvalue. FL/Fl_Preferences.H -- solve: "FL/Fl_Preferences.H", line 196: Error: Fl_Preferences::RootNode is not accessible from 0 FL/Fl_Tree_Item.H -- solve: "Fl_Tree_Item.cxx", line 614: Error: Initializing int& requires an lvalue. test/unittests.cxx -- solve: "unittests.cxx", line 95: Error: The type "UnitTest*[]" is incomplete. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9978 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-11-06Replaced 10302 with 10301 for FLTK_ABI_VERSIONMatthias Melcher
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9706 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-05-29Fixed some keynav problems:Greg Ercolano
No focus, hitting down would skip first item Enter key to toggle was falling through to other widgets Removing an item that has focus clears item focus (to prevent wild ptr) Added new methods: Fl_Tree::get_item_focus() Fl_Tree::first_visible() Fl_Tree::last_visible() Fl_Tree::is_vscroll_visible() Simplified + fixed Fl_Tree_Item::next_displayed() Fixed Fl_Tree_Item::visible_r(), was skipping item if it was a closed branch. tree demo: fixed button ordering for "Test Suggestions" button git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9555 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-05-09o Added new 0xffffffff 'transparent' color behavior for the item's bg color;Greg Ercolano
with this as the default color, Fl_Tree::color() can control the tree's background. Tests added to the test/tree application. o test/tree.fl modified: o Added a 'Test Suggestions' button to document various tests o Added tests for new 'transparent' color behavior o Added test for STR#2832 to check if items can be drawn to the /right/ of child widgets o Added new methods to Fl_Tree_Prefs: item_labelfont() -- obsoletes labelfont() item_labelsize() -- obsoletes labelsize() item_labelfgcolor() -- obsoletes labelfgcolor() item_labelbgcolor() -- obsoletes labelbgcolor() o Added 'Fonts and Colors' section to Fl_Tree docs o Fl_Tree_Item ABI feature added: using bitflags instead of chars to keep the class small, as it gets instanced a lot. (fast + LIGHT) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9478 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-05-02Fixes small redraw problem with Fl_Tree child widgets on linux, perhaps others.Greg Ercolano
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9431 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-30Grr, looks like Fl_Group::update_child() Greg Ercolano
doesn't include drawing the label, so include drawing that explicitly. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9414 ea41ed52-d2ee-0310-a9c1-e6b18d33e121