Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Code Samples & Tips > Additional Libraries
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Additional Libraries Users contributed libraries.
This sub-forum is only available to licensed users.

TreeViewPlus

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-17-2010, 12:37 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default TreeViewPlus

When developing the Family-tree application I had to fight with the absence of identifiers on top of the node text, and ended up finally with two trees in parallel, one for the names and the other, invisible, for the ID numbers.

The inability to color the nodes was another limitation.

I saw others look for solutions to other problems, like finding the path from the root node.

I am glad to contribute TreeViewPlus, (based on ControlsEx), providing the abovementioned additions and more.

The attachement includes the library, cs file for integration with the compiled application, help file and an example program. The help file text for the non-changed methods and properties is taken from the original help file of ControlEx.

The additional methods are:
- BackColor and ForeColor for nodes.
- ClearBackColor and ClearForeColor – clear all the nodes colors.
- Tag (as string) – additional identifier to the node.
- SelectedTag – returns the Tag of the selected node.
- AddNewNode2 – define a new node with both Text and Tag.
- FindByTag – searches the tree by the Tag and changes the BackColor of the compatible node, to a color defined by FoundTagColor.
- FindByText1 – searches the tree and returns a string with all the tags of the compatible nodes.
- FindByText2 – searches the tree and paints all the compatible nodes.
- SelectByTag – searches by the Tag and selects the found node.
- TextPath – returns the path from the root node to the activating node, by the Text of the nodes.
- TagPath – returns the path from the root node to the activating node, by the Tags of the nodes.
- FontSize - to set or get the fontsize.
- SetFontStyle - to set the style (bold,underline,italic or strikethrough)


Looking forward for comments and ideas for more improvements.

Edit: updated to ver 1.1 - "FindBy..." and "SearchByTag" methods now include check for empty input strings. FindByText2 and FindByTag now return the number of found nodes.
Attached Images
File Type: jpg treeplus.jpg (64.9 KB, 117 views)
Attached Files
File Type: zip TreeViewPlus_1.1.zip (39.4 KB, 96 views)
__________________
David Erez
Ramat Hasharon, Israel

Last edited by derez : 07-06-2010 at 06:06 PM.
Reply With Quote
  #2 (permalink)  
Old 02-17-2010, 08:57 PM
Byak@'s Avatar
Basic4ppc Veteran
 
Join Date: Jul 2008
Posts: 416
Send a message via ICQ to Byak@
Awards Showcase
Beta Tester 
Total Awards: 1
Default

nice lib,Thanks
__________________
I'll Kill you, I'll Crash you, I'll never be yours!
--------------------------------------------------
Qtek s110; o2 XDA Flame; Nokia E63 red;
ASUS Eee PC 901 (Windows XP sp3) + TouchScreen;
Reply With Quote
  #3 (permalink)  
Old 07-06-2010, 06:37 AM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Thanks to Racingdog and Agraham who found and commented, I corrected and updated the library to ver 1.1 -

"FindBy..." and "SearchByTag" methods now include check for empty input strings. FindByText2 and FindByTag now return the number of found nodes.
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
  #4 (permalink)  
Old 07-06-2010, 09:31 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 5,953
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Sorry derez, the check wasn't for an empty input string - it was for the return value when the string was not found.

return str.Substring(0, str.Length - 1);

will throw an exception if str contains an empty string.
__________________
Sorry, but I don't answer questions by PM or email.
Please post your queries in the forum.
Reply With Quote
  #5 (permalink)  
Old 07-06-2010, 06:07 PM
derez's Avatar
Basic4ppc Expert
 
Join Date: May 2007
Posts: 918
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

got it, corrected.
__________________
David Erez
Ramat Hasharon, Israel
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On


All times are GMT. The time now is 10:03 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0