Friday, May 9, 2008
Tip of the Day: Creating Dynamic TreeView Object in Forms
Section: New Commands (CREATEOBJECT, DELETEOBJECT)
Supported Versions:
. R:BASE 7.6 for Windows (Build: 7.6.3.30509 or higher)
. R:BASE C/S:I 7.6 for Windows (Build: 7.6.3.30509 or higher)
. R:BASE Turbo V-8 for Windows (Build: 8.0.17.30509 or higher)
Did you know that you can create a dynamic TreeView object in
forms using the CREATEOBJECT command?
Syntax:
CREATEOBJECT <FormObjectName> 'ComponentID' 'Parent' T L W H
Here's an example to create a dynamic TreeView object with
Node Items and Sub-Items.
-- Start here
-- Create TreeView Object
CREATEOBJECT TreeView 'TreeView' 'RBASE_FORM' 5 10 186 441
PROPERTY TreeView INIT 'TRUE'
-- Add Nodes (Items and Sub-Items)
-- Create First Item
CREATEOBJECT TREENODE Node1 TreeView 0 0 0 0
PROPERTY Node1 TEXT 'Node 1'
PROPERTY Node1 INIT 'TRUE'
-- Add Sub-Item to First Item
CREATEOBJECT TREENODE Node11 TreeView|Node1 0 0 0 0
PROPERTY Node11 TEXT 'Node 1 - 1'
PROPERTY Node11 INIT 'TRUE'
-- Create Second Item
CREATEOBJECT TREENODE Node2 TreeView 0 0 0 0
PROPERTY Node2 TEXT 'Node 2'
PROPERTY Node2 INIT 'TRUE'
-- Add Sub-Item to Second Item
CREATEOBJECT TREENODE Node21 TreeView|Node2 0 0 0 0
PROPERTY Node21 TEXT 'Node 2 - 1'
PROPERTY Node21 INIT 'TRUE'
RETURN
-- End here
DELETEOBJECT TreeView command will delete the dynamically
created TreeView object.
Imagine the possibilities!
Very Best R:egards,
Razzak.
P.S.
A sample application is also included in 2008 SAT App Pack
to demonstrate the use of CREATEOBJECT command for Creating
Dynamic Form Objects.
http://www.rupdates.com/SAT2008/samples/CDFO.jpg
--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]
(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
================================================