Schultz’s PowerBuilder Notes

List of Functions Available in Datawindow Expressions


Expressions are most commonly used to create datawindow column property expressions. But the are also used to create filter and find strings.
Continue reading

May 15, 2008 Posted by | Expressions | , , , , , , , , , , , , , , | Leave a comment

Window Types


Main window

A standalone window that can be independent of all other windows. You use the main window as the anchor for your application. The first window your application opens is a main window (unless you are building an MDI application, in which case the first window is an MDI frame).

Popup window

A window that displays only in response to an event within a window but can exist outside the window and, in some cases, after the window that opened it is closed.

The popup window may or may not have a parent window. When it has a parent window, it is dependent. The popup is hidden when the parent is minimized and visible when the parent is maximized (it is never overlapped by the parent). When the popup window does not have a parent, it is independent and can be overlapped by the window that opened it. When you minimize a popup window, the icon for the popup displays outside the window (regardless of whether it has a parent).

Child window

A window that is dependent on a main (parent) window and can exist only within the parent window. The initial position of the child is relative to the parent and not to the workspace. You can move the child within the parent, but not outside the parent.
When you move part of the child beyond the parent, PowerBuilder clips the window so that only the portion within the parent is visible. When you move the parent window, the child moves with the parent and maintains the same position relative to the parent.
When you minimize a child window, the icon displays within the parent.

Response Window

The window that displays to request information from the user and to which the user must respond. A response window is always opened from within another window (its parent). Typically, a response window is opened after a specific event occurs in the parent window.

A response window is application modal: when it displays, it is the active window (it has focus) and no other window in the application is accessible until the user responds to it. The user can go to other Windows applications; but when the user returns to the application, the response window is still active.
A response window acts like a modal popup window.

May 6, 2008 Posted by | Window Controls | , , , , , , , , | Leave a comment

Class() and TypeOf()


Class()

The class is the name of an object. You assign the name when you save the object in its painter.

ls_class = Lower(adw.ClassName())

In the above script, the class name will be n_ds or u_dw, or n_ds_add_rows. Here is another sample script:

choose case adw_wrkr_tm.ClassName()

case “dw_mach_op”

ls_type = “Direct Time”

case “dw_handwork_press”

ls_type = “Press Handwork”

case “dw_handwork_finishing”

ls_type = “Finishing Handwork”

case “dw_indirect_labor”

ls_type = “Indirect Time”

end choose

TypeOf()

TypeOf reports an object’s built-in object type. The types are values of the Object enumerated data type, such as Window! or CheckBox!. ClassName reports the class of the object in the ancestor-descendant hierarchy.

choose case TypeOf(adw)

case datastore!

lv_rc = TRUE

case else

lb_rc = FALSE

enc choose

If adw is a descendant of datastore!, like n_ds, it is still of TypeOf datastore!

April 21, 2008 Posted by | Powerscript | , , , , , | 1 Comment