Class: DEOPopupMenu
Properties | Events | Methods | Index of Classes
Creates pulldown objects that disables messages not sent to DEOs
Hierarchy
cObject > cUIObject > DfBaseObject > DfBaseWindow > DfBaseUIWindow > DfBaseControl > DfBaseList > DfBaseActionBar > DfBasePullDown > PopupMenu > DEOPopupMenu
Show full hierarchy and direct subclasses
Library: Windows Application Class Library
Package: Dfdeomnu.pkg
Description
This class is obsolete. Menus are now created using class cCJMenuBar.
As of revision 12.1, DataFlex includes full support for Codejock Software's COM Xtreme CommandBars package for creating menus, toolbars and statusbars. See Using Menus, Toolbars and Statusbars for more information.
DEOPopupMenu is used to create pulldown objects that disables messages not sent to DEOs. A special function Is_Function is provided that allows the menu to query the invoking focus object and ask if the object is a DEO object, and, if the object is a DEO control object (as opposed to a container). This information can be used to set the shadow state of menu items appropriately. This should be used inside of onInitMenu. This ensures that DEO messages (save, clear, delete, etc.) are not sent to non-DEOs.
Sample
Use DFDEOMnu
DFCreate_Menu "&Navigate" NAVIGATE_Menu is a DEOPopupMenu
On_Item "&Next area\aF6" send Switch_Next_Area
Set Status_Help To 'Move to the Next area'
On_Item "P&revious area\aShift+F6" send Switch_Prior_Area
Set Status_Help To 'Move to the Previous area'
On_Item "Ne&xt view\aAlt+F6" send Switch_Next_View
Set Status_Help To 'Move to the Next view'
On_Item "Pre&vious View\aCtrl+F6" send Switch_Prior_View
Set Status_Help To 'Move to the Previous view'
On_Item "" send none
On_Item "&Prompt\aF4" send Prompt
Set Status_Help To 'Show available selections'
On_Item "&Zoom\aAlt+F9" send Zoom
Set Status_Help To 'Show appropriate Zoom'
// When ever the menu [pulldown] is initialized, check/set
// the state of its items.
//
Procedure OnInitMenu
integer Obj# IsDeo Itm prmpt zm isDeoControl
Get Focus to Obj#
Get is_Function Get_DEO_Object Obj# TRUE to IsDeo
If IsDeo Begin
Get is_Function Get_DEO_Control_Object Obj# False to IsDeoControl
If IsDeoControl Begin
Get Prompt_Object of Obj# to Prmpt
Get Zoom_Object of Obj# to zm
End
Set Shadow_state 0 to False
Set Shadow_state 1 to False
Set Shadow_state 2 to False
Set Shadow_state 3 to False
Set Shadow_state 5 to (Prmpt=0)
Set Shadow_state 6 to (Zm=0)
End
Else Begin
for itm from 0 to 6
Set shadow_State itm to TRUE
Loop
End
End_Procedure //Initialize_Menu
End_Menu
Set Status_Help to "Move to different areas of the application."
Syntax
Use windows
:
Object object_name is a DEOPopupMenu
Set Select_Mode to No_Select|Multi_Select
Item_List
On_Item MenuText Send message [to dest_object]
Set Status_Help to StatusHelpText
On_Item "" send none // separator
:
End_Item_List
Procedure OnInitMenu
integer isDEO isDEOControl Obj#
Get Focus to Obj#
// determine if a DEO
Get is_Function Get_DEO_Object Obj# TRUE to IsDeo
If IsDeo Begin
// determine if a DEO control
Get is_Function Get_DEO_Control_Object Obj# False to IsDeoControl
:
End
:
: (set shadow_state of item as needed
:
End_Procedure
End_Object
Of Special Notice
It is expected that object using this class will create an onInitMenu procedure which will check if the focus object is a DEO (Get is_Function Get_DEO_Object Obj# TRUE to IsDeo) or if the focus object is a DEO control (Get is_Function Get_DEO_Control_Object Obj# False to IsDeoControl). It will use this information to set each item's shadow_state as required.
The focus object is considered to be a DEO if it or any of its parent objects understands the function DEO_Object and returns a non-zero value. By default, all "db" objects do this.
The focus object is considered to be a DEO control if it objects understands the function DEO_Control_Object and returns a non-zero value. By default, all "db" control objects do this (dbform, dbComboForm, dbGrid, etc.)
You should not directly send the DEO_object or DEO_Control_Object message. If the focus object is not a DEO it will return an error message (the message will not be understood). Instead these properties are acquired indirectly by using the Is_Function function.
The packages Navi_pm.pkg and File_pm.pkg provide good examples of this class's usage.
This class's properties are unchanged from those of its superclass.