Referring to objects in your application – PB Docs 2017

Referring to objects in your application

You can refer to any object in the application in scripts for
menu items. You must fully qualify the reference, using the object
name, as follows.

Referring to windows

When referring to a window, you simply name the window. When
referring to a property in a window, you must always qualify the
property with the window’s name:

For example, this statement moves the window w_cust from within
a menu item script:

This statement minimizes w_cust:

You can use the reserved word ParentWindow to refer to the
window that the menu is associated with at runtime. For example, the
following statement closes the window the menu is associated
with:

You can also use ParentWindow to refer to properties of the
window a menu is associated with, but not to refer to properties of
controls or user objects in the window.

For example, the following statement is valid, because it refers
to properties of the window itself:

But the following statement is invalid, because it refers to a
control in the window:

Referring to controls and user objects in
windows

When referring to a control or user object, you must always
qualify the control or user object with the name of the window:

For example, this statement enables a CommandButton in window
w_cust from a menu item script:

Referring to menu items

When referring to a menu item, use this syntax:

Reference within the same menu

When referring to a menu item within the same menu, you do not
have to qualify the reference with the menu name.

When referring to a menu item in a drop-down or cascading menu,
you must specify each menu item on the path to the menu item you are
referencing, separating the names with periods.

For example, to place a check mark next to the menu item m_bold,
which is on a drop-down menu under m_text in the menu saved in the
library as m_menu, use this statement:

If the previous script is for a menu item in the same menu
(m_menu), you do not need to qualify the menu item with the name of
the menu:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x