Object qualificationPFC uses access levels (public, private, protected) to control your access to functions designed for 内部自动调用 use.
When you call these functions from outside the object, use dot notation to qualify the function name. Qualify the function name with the reference variable used to create the object (in some cases you qualify the function name with the actual object name).
调用PFC对象函数
确认对象是已否被创建
PowerBuilder在当窗口打开的时候会建立窗口、菜单和可视的用户对象。你
要使用函数of_Setservicename来建立大部分的不可视的用户对象。例如,下面u_dw的对象函数创建了排序Service(n_cst_dwsrv_sort user object),并且在u_dw’s中的实例变量inv_sort中保留它的引用。通常这些代码都在Datawindow的构造事件中:
3. Register IDs with the MRU service by calling the n_cst_mru of_Register function. An ID is the identifier that the window will use to retrieve information out of the MRU service. This is an example of code you can add to the pfc_PreOpen event of the MDI frame window:
IF IsValid(gnv_app.inv_mru) THEN gnv_app.inv_mru.of_Register("myapp") END IF
4. Extend the pfc_MRUProcess event in each window that uses exclusive processing, adding code to open the sheet passing the necessary arguments (be sure to add similar code to the frame window if you want to specify exclusive items on the frame menu):
Window lw_frame, lw_window n_cst_menu lnv_menu n_cst_mruattrib lnv_mruattrib // Check parameters. IF IsNull(ai_row) THEN Return -1 END IF IF NOT IsValid(gnv_app.inv_mru) THEN Return -1 END IF // Retrieve row from DataStore. gnv_app.inv_mru.of_GetItem & (ai_row, lnv_mruattrib) // Get the MDI frame, if necessary. lnv_menu.of_GetMDIFrame(this.menuid, lw_frame) OpenSheet(lw_window, & lnv_mruattrib.is_classname, lw_frame) Return 1
Performing other actions in the pfc_MRUProcess eventTo see other types of processing you can perform in the pfc_MRUProcess event, see the comments in the pfc_w_master pfc_MRUProcess event.5Extend the pfc_PreMRUSave event in each window that uses the MRU service. In this event, populate the n_cst_mruattrib object with the id, classname, key, item, and MicroHelp to be saved:
anv_mruattrib.is_id = "myapp" anv_mruattrib.is_classname = this.ClassName() anv_mruattrib.is_menuitemname = this.Title anv_mruattrib.is_menuitemkey = this.ClassName() anv_mruattrib.is_menuitemmhelp = & "Opens " + this.Title Return 1 6Extend the pfc_MRURestore event in each window that uses the MRU service. In this event, set the ID of the information you want to display on the menu:
If IsValid(gnv_app.inv_mru) Then Return gnv_app.inv_mru.of_Restore("myapp", This) End If
PFC uses predefined messages in certain situations. If you enable the error message service and receive message display errors, make sure the error message source has been established correctly. Additional user-defined messages must conform to the format of the messages table (also used by the d_definedmessages DataWindow object).
Update style(更新风格):控制Linkage service更新DataWindows的方式(top-down, bottom-up, top-down then bottom-up, bottom-up then top-down, or a developer-specified custom update)
PFC的报表服务增强了DataWindow的显示、打印功能。该服务中的许多函数既可以修改DataWindow中的对象也可以获得DataWindow中的修改语法,并为你的修改语句所用。If you code more than two consecutive report service functions, consider returning the Modify syntax, concatenating the strings and issuing the Modify function from within your own code 。
DataWindow必须使用PBUs或者pixels
使用该Service,DataWindow必须使用PBUs或者pixels作为度量单位。它不允许使用英尺、公分(It does not work with DataWindows that use thousandths of an inch or thousandths of a centimeter as the DataWindow Unit)。它对应的对象是n_cst_dwsrv_report 。