Commit Graph

35 Commits

Author SHA1 Message Date
Albrecht Schlosser 183797e4a3 Minor fix of tree demo program (show tree widgets).
Clicking "Rebuild Tree" after "Close All" did not show the widgets
(Fl_Input test, ccc button, D1, D2). This is now fixed.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12037 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-10-17 12:51:58 +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
Albrecht Schlosser 00dd296ff2 Bump version numbers for next minor release: FLTK 1.4.0.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11088 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-30 00:56:42 +00:00
Albrecht Schlosser c9d8e0feaa Update fluid .fl files and generated code - remove trailing white space.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10783 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-07-09 02:09:33 +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 0f45a7adf5 [Version 1.3.4] Update version numbers - hopefully complete.
Note to devs: if I missed something, please mark follow-up commits with
[Version 1.3.4] so we can find the necessary commits for version updates.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10612 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-03-10 01:41:55 +00:00
Albrecht Schlosser aef482198e Bump version numbers to 1.3.3.
All fluid .fl files have been rewritten with fluid 1.3.3 and may differ
somehow, but there are no significant changes.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10353 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-10-05 00:03:27 +00:00
Lauri Kasanen d1d203ca57 Add support for dragging to reorder in Fl_Tree, STR #2828 (I)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10275 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-09-05 12:04:28 +00:00
Greg Ercolano 9b5f1d78e1 Fixes Micha's two NetBSD warning msgs (posted on fltk.general 12/16/13):
tree.cxx: 1443: warning: passing 'double' for argument 1 to 'void Fl_Tree::scrollbar_size(int)'
    tree.cxx: 1440: warning: passing 'double' for argument 1 to 'static void Fl::scrollbar_size(int)'



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10036 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2013-12-18 02:14:02 +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
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 df5c8cc76f Fixed some keynav problems:
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-29 13:34:39 +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 db73861e7c allow 'open all' button to include root.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9401 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-24 04:47:49 +00:00
Greg Ercolano d07ef80207 Various Fl_Tree enhancements:
o Added keyboard navigation table
    o Added Shift-Click to extend selection, Ctrl-Space to toggle selection, Enter key toggle
    o Added protected extend_selection(from_item,to_item)
    o Cleanup of Fl_Tree::handle()
    o Limit ^A to multi-select mode only
    o Disable focus box in SELECT_NONE mode
    o test/tree: changed default mode to 'multiselect' (most often needs testing)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9385 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-23 16:31:51 +00:00
Greg Ercolano 67ea785bfd Forgot tree.fl (should have been in r9377)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9379 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-22 13:55:17 +00:00
Greg Ercolano 055a7d47ed STR# 2827 cont'd:
> Prevent 'changed' flag from being set during reselect
> test/tree.fl: added chooser so user can test with item reselect enabled|disabled
  (Chooser deactivated if the ABI option is not enabled)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9358 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-19 08:50:04 +00:00
Fabien Costantini 1d3f79bc23 Made homogen the scope of the new fl_tree enum with previous Fl_Tree_Reason enum.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9350 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-16 03:29:56 +00:00
Fabien Costantini b31264e473 STR 2827 implementation. Implemented Reselect code and related API all within ABI controlled preprocessor blocks because of new attribute defintion would break ABI anyway. Because the code is already ABI controlled, I took the opportunity to keep keep the REASON enum sorted. Added test code in Tree.fl adequately.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9347 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-04-15 20:11:36 +00:00
Greg Ercolano 4e40f1b339 Mods to allow test/tree to add 20,000 items at a time to the tree to test for slowness.
Also added a test for the swap() method.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9232 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2012-01-19 12:52:53 +00:00
Greg Ercolano 5ecca683a3 Tree demo: removed unused cruft, fixed custom icons.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8448 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-19 22:39:00 +00:00
Greg Ercolano 97847cfe26 Enlarged pulldown menu choosers slightly.
(They were too small vertically, cutting off font descenders under linux.)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8421 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-13 17:31:54 +00:00
Greg Ercolano 5759f3151f Avoid non-ansi scoping issue with variables defined inside for() loops.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8346 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-02-01 00:08:45 +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
Manolo Gouy 712554e3b0 Fixed STR #2512: crash in test/tree demo.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8222 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-01-09 08:34:13 +00:00
Albrecht Schlosser 97b4b0c704 Fixed Compiling with mingw-w64 (STR #2308).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7978 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-12-08 14:00:35 +00:00
Greg Ercolano d3e0d030f0 Changes to solve STR#2426;
1) Hitting ENTER to select an item should make sure the item is
	   displayed if off-screen (Mayank Malik, pointing out similar behavior in Fl_Browser_)

        2) show_item() without a positional argument will invoke show_item_top()
	   if the item is off-screen.

	3) Added new method displayed() (to match Fl_Browser_'s)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7893 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-11-25 18:52:37 +00:00
Matthias Melcher 4cfee0c9c2 Removed preset theme from tree test, so that launching the test with the demo app can show the various available themes.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7839 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-11-15 08:44:28 +00:00
Greg Ercolano 5a461b0ff4 Some widgets reordered for consistent keyboard navigation in tree test program.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7784 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-10-31 16:54:00 +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
Albrecht Schlosser faf8908684 Fixed typos and rewrote tree.fl -> tree.cxx/.h
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7673 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-07-10 10:51:54 +00:00
Matthias Melcher 32716d6b1e Updated the Fluid IDE support for the current source file structure. Changed the Fl_Tree rendering code around a bit to make the tree more like MSWindows on Windows and more like Apple on Apple machines. I hope you guys like it. I also moved the function to load Fl_Preferences into an Fl_Tree into the Fl_Tree class where it belongs.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7672 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-07-10 09:44:45 +00:00
Greg Ercolano 41f7ed5477 Reordered widgets for proper keyboard navigation.
(in progress: adding keyboard nav to Fl_Tree)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7639 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-06-14 02:02:33 +00:00
Greg Ercolano a42b56fbe8 Added tree.fl -- the source file for tree.cxx / tree.h
In the future, tree.cxx and tree.h should be removed from svn
once tree.fl is merged into to the build system, so that it
generates the .cxx/.h files as part of an fltk build.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7638 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-06-14 01:58:56 +00:00