Commit Graph

31 Commits

Author SHA1 Message Date
Greg Ercolano f950b93e9c Added is_visible_r() for consistency w/is_visible() 2024-07-17 10:20:39 -07:00
Albrecht Schlosser f09e17c3c5 Remove $Id$ tags, update URL's, and more
- 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.
2020-07-06 20:28:20 +02:00
Greg Ercolano 62e39e5559 Added new method Fl_Tree_Item::event_on_item() 2019-08-27 16:53:57 -07:00
Greg Ercolano 4870cde0a6 More fixes for STR #3527; handle usericons, etc 2019-08-25 01:13:35 -07:00
Albrecht Schlosser bacced2c92 Add non-const version of Fl_Tree_Item::tree().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12036 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-10-17 12:51:05 +00:00
Greg Ercolano e92fa6914b Bringing over fix [r11840] from 1.3 current to the porting branch.
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-07-21 00:51:14 +00:00
Manolo Gouy a56124c20b Remove #if FLTK_ABI_VERSION >= xxx directives.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11679 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-23 04:30:39 +00:00
Greg Ercolano 81654d15eb Fl_Tree: improved draw() behavior when deactivated;
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-28 19:39:53 +00:00
Albrecht Schlosser 14524992a6 Documentation: fix another image display issue.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10447 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-11-10 22:29:49 +00:00
Greg Ercolano 107fc50e48 Solves STR #3127.
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-09-04 18:56:52 +00:00
Greg Ercolano 1b1f02a365 Fix STR #3086, missing virtual dtor when ABI >= 10303.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10157 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-05-22 15:38:27 +00:00
Greg Ercolano abdc834705 o Added draw_item_content() to Fl_Tree_Item,
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-20 21:23:24 +00:00
Greg Ercolano b849a1d2d9 ABI fixes.
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-16 00:58:58 +00:00
Greg Ercolano d36882e67e Adds horizontal scrollbar to Fl_Tree as an ABI 1.3.3 feature.
***************************************************************
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-12-15 18:59:02 +00:00
Greg Ercolano 88cea3c82d o Added Fl_Tree::item_draw_callback(), letting one define a custom draw 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-10 04:33:44 +00:00
Greg Ercolano 67ed1a8da9 STR# #2973: applied patch str_2973_r9958_sun-fix-errors-5.patch verbatim.
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
2013-09-16 20:25:14 +00:00
Matthias Melcher 78039ecb55 Replaced 10302 with 10301 for FLTK_ABI_VERSION
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9706 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-11-06 20:46:14 +00:00
Greg Ercolano 31f320e2c6 o Added new 0xffffffff 'transparent' color behavior for the item's bg color;
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-09 21:26:32 +00:00
Greg Ercolano 474feee1db o Added FL_TREE_ITEM_HEIGHT_FROM_WIDGET option to item_draw_mode()
to allow widgets to control the size of items in the tree
  (instead of vice versa).

o Added item_draw_mode(int) to allow for easier bitflag maintenance,
  since enums don't seem to be typesafe yet.

o Tree demo modified to demonstrate this feature.
  An important feature for adding large widgets to tree items.
  Will probably add an example, 'tree-of-tables' to demo this usage.

o Small doc fixes.

o Had to rename FL_TREE_ITEM_DRAW_WIDGET_ONLY to FL_TREE_ITEM_DRAW_DEFAULT.
  Its meaning for the bit fields changed when new bit fields were added.
  (The prev name just didn't make sense in the new context. Since it was
  just a few svn commits old and an unreleased ABI feature, it shouldn't
  affect anyone not in R&D)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9404 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-27 02:03:48 +00:00
Greg Ercolano 2ae607e8ba o doc fixes
o new calc_item_height() -> const
o Added a needed ABI ifdef



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9380 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-22 14:21:08 +00:00
Greg Ercolano f58cd169c0 Various mods for Fl_Tree
o Fix STR#2828 (E): {Vertical|Widget} Gap
    o Moved Fabien's reselected methods to Fl_Tree_Prefs,
      return method made const, doxygen, removed underbars from methods
      (to follow general API)
    o Widgets can now appear to the right of labels.
      This can be controlled with item_draw_mode(FL_TREE_ITEM_DRAW_LABEL_AND_WIDGET)
    o Cleaned up Fl_Tree_Item::draw(), Fl_Tree::draw()
    o New methods:
            marginbottom()       -- [ABI feature] extra space below last tree element when scrolling
            widgetmarginleft()   -- [ABI feature] space to left of widget
            usericonmarginleft() -- space to left of usericon
            labelmarginleft()    -- space to left of label
            item_draw_mode()     -- control how items, widget() are drawn
    o Updated Fl_Tree docs, tree-elements.png
    o test/tree: added sliders to test the above new features,
      added "open all" and "close all" buttons
    o Probably other stuff..


TODO: Fix "scroll-beyond-bottom" (STR#2796)
TODO: Fix other items in STR#2828



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9377 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-22 13:40:02 +00:00
Greg Ercolano 9a4ef219de Fl_Tree optimizations for selecting large trees (100k items).
Added _next_sibling and _prev_sibling to Fl_Tree_Item class to make 
next_sibling() and prev_sibling() more efficient during item selection.
Used new FLTK_ABI_VERSION macro (as designed by Greg and Albrecht on fltk.dev) to protect the ABI breaking features.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9231 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-01-19 12:44:26 +00:00
Greg Ercolano 4f4a8fc3c7 Modifications to all LGPL headers for STR #2685.
(to clarify static exception LGPL by changing license references)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8864 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-07-19 04:49:30 +00:00
Greg Ercolano 2c5006563f Fl_Tree API breaking changes (we haven't released 1.3.0 yet..):
Fl_Tree::labelsize() -> item_labelsize()            -- TO AVOID COLLISION WITH Fl_Widget::labelsize()!
    Fl_Tree::labelfont() -> item_labelfont()            -- TO AVOID COLLISION WITH Fl_Widget::labelfont()!

Fl_Tree_Prefs (internal) changes:
    Fl_Tree_Prefs::fgcolor() -> labelfgcolor()          -- for consistency with above
    Fl_Tree_Prefs::bgcolor() -> labelbgcolor()          -- for consistency with above
    Fl_Tree_Prefs::selectcolor() removed                -- uses Fl_Widget::selection_color() instead
    Fl_Tree_Prefs::inactivecolor() removed              -- was unused; inactive color procedurally calculated

Other Fl_Tree mods:
    o Fixed bug with select_all(item) and deselect_all(item)
      (they were not limiting themselves to children of specified item)
    o Fixed bug with item not drawing in its /own/ bgcolor when item selected
    o Fl_Tree uses the Fl_Widget::selection_color()
    o All methods that deal with 'font types' changed int -> Fl_Font
    o All methods that deal with 'font sizes' changed int -> Fl_Fontsize
    o Added needed methods to Fl_Tree for accessing colors:

        item_labelfgcolor()     -- access default fg color used for new items
        item_labelbgcolor()     -- access default bg color used for new items
        tree_connectorcolor()   -- access the connector line color

    o Small doxygen comment adjustments and general clarifications
    o test/tree demo modified to include testing of new label color methods, cleanup



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8340 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-30 20:22:06 +00:00
Matthias Melcher e454f97acc Fixed Copyright to 2010.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7903 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-11-28 21:06:39 +00:00
yuri 71bf7c6400 add missing FL_EXPORT macro
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7694 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-09-02 19:38:08 +00:00
Greg Ercolano c7ef0f1d17 Fl_Tree related mods
* open() / close() now can invoke the callback().
      New method callback_reason() lets one determine the cause.
      (Used FLU's tree for reference on this)

    * new Fl_Tree methods:
      > item_pathname()
      > show_item(), show_top(), show_middle(), show_bottom().
      > next_selected_item() -- loop through the selected items.
      > callback_item() -- the item that caused the callback
      > callback_reason() -- reason the callback was invoked
             FL_TREE_REASON_SELECTED    -- item was selected
             FL_TREE_REASON_DESELECTED  -- item was de-selected
             FL_TREE_REASON_OPENED      -- item was opened
             FL_TREE_REASON_CLOSED      -- item was closed
      > position()
      > display()

    * new Fl_Tree_Item methods:
      > find_child_item() -- searches children for a path
      > find_item()       -- searches self and children for a path
      > next(item)        -- loop forward through tree
      > prev(item)        -- loop backward through tree
      > first_selected_item()
      > next_selected_item()
      > x(), y(), w(), h()

    * deprecated:
      > item_clicked().  Use callback_item() instead

    * the 'docallback' optional integer argument for all methods
      is now back to 0 or 1 only. (Other values became unnecessary
      when above new callback() behavior was defined)

    * test/tree has new "Test Callback Flags" button to test the
      'docallback' flags for eg. open/close/select/deselect
      to make sure no bugs creep in.

    * INTERNAL: added free_path() to free special path array created by parse_path().

    * Various docs strengthened:
	* How to use first()/next() and last()/prev() to walk tree
    	> made sure more method's options use \param[in]
	> Added more \see references

    * Moved several implementations from .H -> .cxx
    * Added autoscroll to keyboard nav and mouse drags
    * test/unittests: added Fl_Tree to scrollsize test

        TODO:
	    o Horiz scroll bar (see Johannes Schock's email re. additions he sent)
	    o Need to allow keyboard nav to move focus to child FLTK widgets
	    o Fix fast-selections so that no gaps are left behind.
	      (Select all items from the last selected item to the current)
	    o Investigate non-default values of when() causing odd behavior.
	      (See the tree demo's when() pulldown..)

    * tree demo modified to include top/mid/bot buttons that test the above.

    * Keyboard navigation added:
		Up/Down       -- move focus
		Left/Right    -- closes/opens tree item in focus
		Spacebar      -- toggle selection state of item in focus
		Enter         -- selects the item in focus, deselecting all others
		Tab/Shift-Tab -- change widget focus

    * All Fl_Tree select() and deselect() methods now return a value
      that indicates if the item's state was changed.

    * Fixed focus box drawing (focus box resides more precisely within item's box)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7691 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-08-26 13:32:30 +00:00
Greg Ercolano 79cd1d2ccb Small fixed to SebHoll's user_data() mods (init + copy ctor),
added select_all() to Fl_Tree and Fl_Tree_Item.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6957 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-12-08 08:39:31 +00:00
Greg Ercolano a657069cc5 Checked in SebHoll's API mods, fixed indents.
o Added user_data() to Fl_Tree_Item
	o Added insert() and add() methods that allow specification of Fl_Tree_Prefs
	o Changed Fl_Pixmap args to Fl_Image for more flexibility
	o Fixes for positioning of items in the presence of user icons
	o find_children() changed from protected -> public



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6956 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-12-08 08:06:44 +00:00
Albrecht Schlosser 4fa7fde790 Added missing svn properties and $Id$ tags.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6942 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-11-18 12:22:51 +00:00
Matthias Melcher 07a18370ad Added Fl_Tree source code, demo files, and documentation. Thanks, Greg!
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6934 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-11-14 15:49:12 +00:00