?
Solved

treeview

Posted on 2003-03-22
7
Medium Priority
?
291 Views
Last Modified: 2013-12-26
How can I create a tree view?
0
Comment
Question by:wesam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Author Comment

by:wesam
ID: 8186182
Urgent
0
 
LVL 2

Expert Comment

by:SylvainPouliot
ID: 8191071
What's your problem?
There's already a treeview object in powerbuilder...
0
 
LVL 2

Accepted Solution

by:
NMi earned 92 total points
ID: 8193564
1. First of all, you must have some suitable object that will contain your treeview - a window, a tabpage, or something.
2. Assuming you're using PB as RAD tool, you place the TreeView object in the container - hope you can do that ;)
3. Enter this object's properties - assign an appropriate name (first tab), assign some icons to its tree levels (second tab), and that should do for the first time.
4. Make some command button to test your treeview. In the 'clicked' event of that button, you should write:

tv_YOURNAME.InsertItemFirst(0, "My first Level", 1)

Description
Inserts an item as the first child of its parent.

Syntax

treeviewname.InsertItemFirst ( handleparent, label, pictureindex )
Argument     Description
treeviewname     The TreeView control in which you want to specify an item as the first child of its parent
handleparent     The handle of the item that will be the inserted item's parent. To insert the item at the first level, specify 0
label     The label of the item you want to specify as the first child of its parent
pictureindex     The picture index for the item you want to specify as the first child of its parent
Return value
Long. Returns the handle of the item inserted if it succeeds and -1 if an error occurs.


Next, run your application and click the button - your first item should appear at the very first treeview level, accompanied with an icon of your choice.

The TreeView controls are an excellent example of user-friendly interface that your users would love to use. Have fun ! :)
0
 
LVL 4

Assisted Solution

by:Bhatti
Bhatti earned 88 total points
ID: 8206624
Hello Wesam,

Please try the following:

This is an example and you can then put your data to commplete you task.

long ll_lev1, ll_lev2 ,ll_lev3 ,ll_lev4

int index

tv_list.PictureHeight = 32

tv_list.PictureWidth = 32

ll_lev1 = tv_list.InsertItemFirst(0,"Composers",1)

ll_lev2 = tv_list.InsertItemLast(ll_lev1, "Beethoven",2)

ll_lev3 = tv_list.InsertItemLast(ll_lev2, "Symphonies", 3)

FOR index = 1 to 9

   ll_lev4 = tv_list.InsertItemSort(ll_lev3, "Symphony # " + String(index) , 4)

NEXT
tv_list.ExpandItem(ll_lev3)

tv_list.ExpandItem(ll_lev4)


This just example fom the PB help.

put your control in the window and then in the cinstuction event write thems script and name to treeview as tv_list.


run the programm and doubleclicked the composers and then you will + sign and clicked the + sign and you will further.

type in help treeview and then functions:

Imporant functions:

Insertitemfirst()
Insertitem()
and others will help you to create a beautiful treeview.


If you become questions please let me know.

Best regards


Bhatti
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question