EtsT_Obj_Dbox_Click_Handler

Abstract

Callback: Used to indicate how an application responds when a user clicks on an attribute name: perform the default action for that attribute, open a dialog box, or open a pull-down menu.

Syntax

<object_dbox_click_handler_name> (attr_name, orig_object, copy_object, menu_tlptr)
Argument Type Description
attr_name const char * Name of the attribute that the user clicked
orig_object EtsT_Obj_Handle Handle for the original attribute object
copy_object EtsT_Obj_Handle Handle for a copy of the original attribute object
menu_tlptr Prg_List * Text list that contains the current symbolic values defined by the attribute, plus the “Other…” string if the attribute allows other values

Return Type

EtsT_Obj_Dbox_Click_Options

A structure containing the following Boolean values:

EtsC_Obj_Dbox_Click_Default— indicates that the handler performed the default action for that attribute.

EtsC_Obj_Dbox_Click_Show_Dbox— indicates that the handler displayed an ETS dialog box to handle user input, and may have modified the attribute.

EtsC_Obj_Dbox_Click_Show_Menu— indicates that the handler displayed a pull-down menu based on the list referenced by *menu_tlptr, and may have modified the attribute.

ets_api_obj_dbox.h

Details

A object dbox click handler determines an application’s response when a user clicks on an attribute name in the Edit Attributes dialog box. An attribute dialog can take one of three forms: it can perform the default action for that attribute, it can open a pull-down menu, or it can open a custom ETS dialog box. The return value must accurately reflect the action taken.

The application automatically passes the attr_name, orig_object, copy_object, and menu_tlptr arguments when it calls an object dbox click handler.

If an object dbox click handler opens an ETS dialog box, you should include any input-processing routines (for example, checking for invalid input) with the dialog box code inside the click handler.

If an object dbox click handler opens a pull-down menu, the application calls a new value handler (EtsT_Obj_Dbox_New_Value_Handler) when the user changes the attribute value. For this reason, any input-processing routines for a menu should go in a new value handler, not the object dbox click handler.

A pull-down menu reflects the text list referenced by menu_tlptr. You must ensure that your handler initializes this pointer to reference an appropriate list. You do not need to deallocate the list contents within this handler.

To have the application perform the default dialog for an attribute, simply have the object dbox click handler return with EtsC_Obj_Dbox_Click_Default set to PRGC_TRUE.

Callbacks of this type are registered as the Click Handler in an attribute’s Enter ETS Handlers dialog box (see “Active Attributes“ on page 51).

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com