Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Property Grid
  New Posts New Posts RSS Feed - SOLVED:how to read or write from property grid
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SOLVED:how to read or write from property grid

 Post Reply Post Reply
Author
Message
Marino View Drop Down
Groupie
Groupie
Avatar

Joined: 09 June 2008
Location: Bosnia Hercegovina
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marino Quote  Post ReplyReply Direct Link To This Post Topic: SOLVED:how to read or write from property grid
    Posted: 25 August 2008 at 6:15am
Hi,

I use clarion to work with codejock so if somebody can give some advise ... how to read from or write into propery grid ... this is a code which I use for setting and initialising property grid ...


LOC:OCXproperty     = CSTRING(20)
Loc:Property1       = CSTRING(20)
Loc:Property1item   = CSTRING(20)
Loc:Prop1           = CSTRING(20)

  code
?property{prop:create} = 'Codejock.PropertyGrid.12.0.1'
Loc:OCXproperty = CREATE(?property,CREATE:OLE)

Loc:Property1 = ?property{'InsertCategory(0,"category 1")'}
Loc:Property1item = ?property{Loc:Property1 & '.AddChildItem(0,"option 1-1","something 1")'}
Loc:prop1 = ?property{Loc:Property1item & '.insertChildItem(1,0,"suboption 1", "sub-something 1")'}
Loc:Property1item = ?property{Loc:Property1 & '.AddChildItem(0,"option 2-1","something 2")'}
Loc:Property1item = ?property{Loc:Property1 & '.AddChildItem(0,"option 3-1","something 3")'}
Loc:Property1item = ?property{Loc:Property1 & '.AddChildItem(0,"option 4-1","something 4")'}
Loc:Property1 = ?property{'InsertCategory(1,"category 2")'}
Loc:Property1item = ?property{Loc:Property1 & '.AddChildItem(0,"option 1-2",9)'}
Loc:Property1item = ?property{Loc:Property1 & '.AddChildItem(0,"option 2-2",9)'}
Loc:Property1item = ?property{Loc:Property1 & '.AddChildItem(0,"option 3-2",9)'}

now, how to read and write values  ... I tried with .AddChildItemBinded too, but don't know how to put the name of the object like a parameter ... Tried with .Value, but didn't work, maybe my mistake...



Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2008 at 10:16am
Hi,
 
I'm not familiar with Clarion but you know that already
 
But I will try:
 
This will be in VB code.
 
Add item to category:
 
Set Item = selectionCategory.AddChildItem(PropertyItemString, "option 1-1", False)
      Item.Id = ID_PROPGRID_INCLUDEITEMS
 
Where:
selectionCategory                      = CategoryItem where item is added
Item                                           = PropertyGridItem
ID_PROPGRID_INCLUDEITEMS   = ID of added item
 
To find item use method FindItem:
 
Set Item = wndPropertyGrid.FindItem("option 1-1")
or by ID Set Item = wndPropertyGrid.FindItem(ID_PROPGRID_INCLUDEITEMS)
 
 
Where:
wndPropertyGrid = PropertyGrid control
Item                     = PropertyGridItem
FindItem             = method to find item in collection with ID or Caption
 
To read value:
 
msgbox Item.Value
(or messagebox or whatever Clarion uses to display a message)
 
to write value
Item.Value = "option 1a-1a"
 
I don't know if Clarion will accept this but you can also use it like this:
 
read:
msgbox wndPropertyGrid.FindItem("option 1-1").Value
msgbox wndPropertyGrid.FindItem(ID_PROPGRID_INCLUDEITEMS).Value
 
write:
wndPropertyGrid.FindItem("option 1-1").Value = "option 1a-1a"
wndPropertyGrid.FindItem(ID_PROPGRID_INCLUDEITEMS).Value = "option 1a-1a"
 
 
 
Hope this helps you a little  Just ask me if things aren't clear.
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
Marino View Drop Down
Groupie
Groupie
Avatar

Joined: 09 June 2008
Location: Bosnia Hercegovina
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote Marino Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2008 at 9:18am
Hi Aaron,

well, I did it :-) ... thanks to you ... I renamed my variables to make easier for read and use the following code:

Loc:OCXproperty = STRING(20)
Loc:category        =STRING(20)
Loc:item               =STRING(20)
var1                     =STRING('templates for codejock controls')
var2                     =STRING(50)
var3                     =STRING(50)

code
?wndPropertyGrid{prop:create} = 'Codejock.PropertyGrid.12.0.1'
Loc:OCXproperty = CREATE(?wndPropertyGrid,CREATE:OLE)

Loc:category =  ?wndPropertyGrid{'AddCategory("some documents")'}
Loc:item =      ?wndPropertyGrid{Loc:category & '.AddChildItem(0,"books","programming in clarion")'}
                ?wndPropertyGrid{Loc:item & '.id'} = 1

Loc:item =      ?wndPropertyGrid{Loc:category & '.AddChildItem(0,"magazines","clarionmag.com")'}
                ?wndPropertyGrid{Loc:item & '.id'} = 2

Loc:item =      ?wndPropertyGrid{Loc:category & '.AddChildItem(0,"flyers","noyantis.com")'}
                ?wndPropertyGrid{Loc:item & '.id'} = 3
                ?wndPropertyGrid{Loc:item & '.value'} = var1
var2 =            ?wndPropertyGrid{'finditem(3).value'}
var3 =            ?wndPropertyGrid{'finditem("magazines").value'}

Thanks to Andy Wilton and his great job of writing the templates for using this great controls with clarion, the community of clarion users of codejock controls is everyday bigger and bigger, but while we wait for the rest of templates, I'm sure that many of us will try to play with this ...

Once again, thank you Aaron on your help,

Regards,

Marino
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2008 at 9:48am
Hi,
 
If your isssue has been solved, please change your topic description into SOLVED: how to read or write from property grid and have a look at post:
 
This would be much easier for all members just to see what kind of language you use. If you would do the same we would all be happy
 
And if you have any sample code (you mentioned somekind of template) to share with other Clarion users, you could upload one in the sample subforum.
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.