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

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Treeview and check-boxes

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-26-2007, 02:05 PM
Senior Member
 
Join Date: Apr 2007
Location: Copenhagen
Posts: 173
Default Treeview and check-boxes

Dear All,

I am struggling with the tree view, in many ways it is very nice but not very easy to understand (for me)... I have constructed a tree using this sub (see also the jpg file - it's a grocery list if you are wondering).

Sub UpdateTree
tv.checkboxes=true
for i=0 to MaxCat-1
node1.Value=tv.AddNewNode(tblCat.Cell("Cat",i))
tblData.Filter("Cat LIKE '"&tblCat.Cell("Cat",i)&"'")
For k=0 to tblData.RowCount-1
node2.Value = node1.addnewnode(tblData.Cell("Artikel",k))
if StrLength(tblData.Cell("ToBuy",k))>0 then node2.Checked=True
Next
next
End sub

Once the tree is constructed I will check some of the boxes. After "leaving" the tree and continuing the program I want to find out which boxes have been checked (more precisely the node text for each box which has been checked), but I can't find out how to do this. (At the time of checking the boxes tv.action is not raised and so cannot be used.)

Any ideas on how to do this?

all the best / Björn
Attached Images
File Type: jpg Tree.jpg (9.9 KB, 49 views)

Last edited by BjornF : 06-26-2007 at 02:56 PM.
Reply With Quote
  #2 (permalink)  
Old 06-26-2007, 03:41 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 1,057
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Hi BjornF,

you can browse through the tree with this little piece of code

Code:
Sub CheckTree
    
For i = 0 To tv.Count - 1
        node1.Value = tv.GetNode(i)
        
If node1.Checked = True Then
            
' do something for root
        ' name = node1.Text
    End If                
    
For j = 0 To node1.Count - 1
              node2.Value = node1.GetNode(j)
        
If node2.Checked = True Then
        
' do something for Child
        ' name = node2.text
        End If    
    
Next
    
Next
End sub

specci48
Reply With Quote
  #3 (permalink)  
Old 06-26-2007, 03:45 PM
Senior Member
 
Join Date: Apr 2007
Location: Copenhagen
Posts: 173
Default

Excellent !

thanks Specci48, I'll go off and play with this

Björn
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Check for duplicates moster67 Questions (Windows Mobile) 2 09-07-2008 06:58 AM
drive, file list boxes scott93727 Basic4ppc Wishlist 0 06-22-2008 01:35 AM
Area Selection by combo boxes mozaharul Questions (Windows Mobile) 4 04-30-2008 04:36 AM
Contacts and List Boxes Oran Questions (Windows Mobile) 9 01-22-2008 07:08 PM
Check for Sub existance Scubaticus Questions (Windows Mobile) 4 11-04-2007 09:54 PM


All times are GMT. The time now is 04:36 AM.


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