home *** CD-ROM | disk | FTP | other *** search
- // ACTION.PKG
- // March 13, 1992
- // LS
- //
- // package for Action_Bar_Menu class
-
- #CHKSUB 1 1 // Verify the UI subsystem.
-
- use UI
-
- register_procedure Activate_Pull_Down
-
- class Action_Bar_Menu is an ACTION_BAR
- procedure Construct_Object integer Img
- forward send Construct_Object Img
-
- property integer Action_Bar_Keys_Msg Public 0 // used to assign alt-char keys
- property integer Ignore_Exit_State Public 0 // used to skip exit message
- property integer Verify_Exit_Msg Public 0
- property integer Auto_Pull_Down_State Public 0 // activate pull_down on left/right arrow
-
- set Attach_Parent_State to True
- set Inverse_State to True
- set Scope_State to True
- set Skip_State to True
- set Wrap_State to True
-
- on_key kAction_Bar send Return_To_Prior_Scope Private
- on_key kCancel send Request_Cancel Private
- on_key kDownarrow send Choose Private
- on_key kNext_Item send None Private
- on_key kPrevious_Item send None Private
- end_procedure
-
- function Action_Bar_Location returns integer
- function_return (Location( Current_Object ))
- end_function
-
- function Action_Bar_Width returns integer
- function_return (Low( Size( Current_Object ) ))
- end_function
-
- procedure Choose
- if (Message( Current_Object, Current )) EQ Msg_Activate_Pull_Down ;
- send Key kEnter
- end_procedure
-
- procedure Entering returns integer
- local integer Ret_Val
-
- forward get Msg_Entering to Ret_Val
- if Ret_Val procedure_return Ret_Val
-
- set Auto_Pull_Down_State to False
-
- set Select_Count to 0 // de-select Current_Item for normal highlight
- end_procedure
-
- #IFSUB 'AREA_FLAG'
- #ELSE
- #REPLACE AREA_FLAG 3 //scope AND popup
- #ENDIF
-
- procedure Exit_Area
- local integer Obj
-
- get Prior_Level to Obj
- if Obj send Deactivate to Obj AREA_FLAG
- end_procedure
-
- procedure Exit_Cascade // dummy for delegation from pull down
- end_procedure
-
- procedure Exiting_Scope integer New_Sco
- local integer Nxt_Lvl
-
- forward send Exiting_Scope New_Sco
-
- get Next_Level to Nxt_Lvl
- if Nxt_Lvl NE 0 send Deactivate to Nxt_Lvl
- set Current_Item to 0
- end_procedure
-
- procedure Mouse_Down integer W_Num integer C_Pos
- forward send Mouse_Down W_Num C_Pos
- send Mouse_Up W_Num C_Pos
- end_procedure
-
- procedure Request_Cancel
- local integer Msg Ret_Val
-
- send Return_To_Prior_Scope
- if (Current_Scope( Desktop )) EQ Current_Object begin
- get Verify_Exit_Msg to Msg
- if Msg NE 0 get Msg to Ret_Val
- if Ret_Val EQ 0 send Exit_Area
- end
- end_procedure
-
- procedure Return_To_Prior_Scope
- local integer Pri_Sco
-
- if (Focus( Desktop )) NE Current_Object send Activate
-
- get Prior_Scope to Pri_Sco
-
- if Pri_Sco EQ 0 move Desktop to Pri_Sco
- if (Active_State( Scope_Focus( Pri_Sco ) )) set Current_Scope to Pri_Sco
- else set Current_Item to 0
- end_procedure
-
- procedure Key integer Key_Val returns integer
- local integer Ret_Val
-
- forward get Msg_Key Key_Val to Ret_Val
- if Ret_Val NE 0 procedure_return Ret_Val
-
- if ((Key_Val = kRightArrow or Key_Val = kLeftArrow) and ;
- Auto_Pull_Down_State( Current_Object ) and ;
- Message( Current_Object, Current ) = Msg_Activate_Pull_Down) begin
- get Msg_Process_Key kEnter to Ret_Val
- procedure_return Ret_Val
- end
- end_procedure
- end_class
-
- procedure Assign_Action_Bar_Keys for Desktop integer Obj
- local integer Msg
-
- if (Obj <> 0 and Obj <> Current_Object and ;
- (Focus_Mode( Current_Object ) = Focusable or ;
- Popup_State( Current_Object ) <> 0)) begin
- on_key kAction_Bar send Activate to Obj Private
- get Action_Bar_Keys_Msg of Obj to Msg
- if Msg NE 0 send Msg Obj
- end
- end_procedure
-
- procedure Define_Access_Keys for Desktop integer Obj
- if (not(Popup_State( Current_Object )) and Obj <> 0 and ;
- Obj <> Current_Object) begin
- send Assign_Action_Bar_Keys Obj
- if (Child_Count( Current_Object ) > 0) ;
- broadcast send Define_Access_Keys Obj
- end
- end_procedure
-