Hi Rossine. Yes, it's possible with HMG4 not HMG3 compliant.
To give you an answer, you must think about parent. With HMG4 (HMG3 it's +- the same, but...) every object is built with a related parent (there are some internally excpetions, anyway...) This can be a scheme:
Code: Select all
Form
+--ToolBar1
| +---ToolButton1
| +---ToolButton2
+--ToolBar2
| +---ToolButton1
| +---ToolButton2
ToolButton1 is repeated two times, because one has parent with ToolBar1 and te second one with ToolBar2
But you can not have, at the same level, the same name
Code: Select all
Form
+--ToolBar1
| +---ToolButton1
| +---ToolButton1 NO, wrong
+--ToolBar1 NO wrong
| +---ToolButton1
| +---ToolButton2
And remember:
- - A)using streactly OOP you can omit the name of the object (this means you never will have the same name)
- B) using a mixed OOP you can omit the name of the object, but you can't retrieve it
- C) using XBase command style you can have problem with duplicate (error) names in some conditions.
Examples:
A)
Code: Select all
CLASS myclass....
DATA oButton
.....
METHOD New() CLASS myClass
WITH OBJECT oButton := BUTTON():New()
......
B)
Not defined class, but using.... Here you can't re-use "ButtonName"
Code: Select all
STATIC FUNCTION ....
......
WITH OBJECT BUTTON():New( "ButtonName",....)
................
MainForm:ButtonName
C)
It's mandatory ButtonName and you can't re-use it within its parent (ie FormName).
I hope my explanation it's clear and helpfull.
p.s. To show trees, you can call somewhere HMGAPP():ShowObjectsTree(). It creates HTML file within executable folder with all defined objects .
Cheers