Adding pop-up menus to 4D Agenda
There are two places in the 4D Agenda area where you can add a pop-up menu:
1 When the user control-clicks on an event tab
2 When the user control-clicks in an empty area within the 4D Agenda area
Both pop-up menus are created via the AG AGENDA EVENT HANDLER callback method.
The pop-up for the user control-clicks on an event tab is defined after the AG_MouseClickInEvent and the user control-clicks in an empty area within the 4D Agenda area is defined after the AG_MouseClickInAgenda event.
Example:
Method: AG_EventHandler
`$1 - The event that occurred in the 4D Agenda area
`$2 - The ID of the event tab, if available, otherwise 0
`$3 The date location of the event
`$4 The time location of the event
C_INTEGER ( $1 )
C_LONGINT ( $2 )
C_DATE ( $3 )
C_TIME ( $4 )
Case of
: ($1=AG_MouseClickInAgenda )
AG_DoPopUpInAgenda
: ($1=AG_MouseClickInEvent )
AG_DoPopUpInEvent
: ($1=AG_MouseDoubleClickInAgenda )
` Create a new event
: ($1=AG_MouseDoubleClickInEvent )
` Display a dialog box with the event info
: ($1=AG_MouseDragInAgenda )
: ($1=AG_MouseDragInEvent )
End case
Method for AG_DoPopUpInAgenda:
Method: AG_DoPopUpInAgenda
GET MOUSE ($vlMouseX;$vlMouseY;$vlButton)
If (Macintosh control down |($vlButton=2))
$vtItems:="4D Agenda options...<I;(-;!-Add event
;"
$vlUserChoice:= Pop up menu ($vtItems)
Case of
: ($vlUserChoice=1)
` Do agenda options
: ($vlUserChoice=2)
` Add an event
End case
End if
|