Package RASCAL.WimpMenu

DescriptionMenu related types and methods.
Authorbbracke
Date2005/11/21 20:14:33
Revision1.1
 

Clauses

Quick access : ClausesGenericsDefinitionsSubprograms


 
Context clauses
RASCAL.OS
RASCAL.Memory
System.Unsigned_Types
System
 
Use clauses
RASCAL.OS
RASCAL.Memory
System.Unsigned_Types
System
 

Definitions

Quick access : ClausesGenericsDefinitionsSubprograms


Types
Name Declaration
Menu_Typeprivate
Abstract data type for menu creation/manipulation
first item is 0!
Message_MenusDeleted_Pointeraccess Message_MenusDeleted
Message_MenuWarning_Pointeraccess Message_MenuWarning
Reason_MenuSelection_Pointeraccess Reason_MenuSelection
Icon_Data_StringChar_Array (1..12)
   
Message_MenusDeleted record
This message is sent when your Menu was closed without a selection having been made.
Component Type Default
Menu_BlockInteger
HeaderMessage_Event_Header
   
AMEL_Message_MenusDeleted abstract tagged record
inheritance from Message_EventListener (Message_Event_MenusDeleted)
Component Type Default
EventMessage_MenusDeleted_Pointer
   
Message_MenuWarning record
You receive this message when pointer moves over the subMenu arrow in a Menu entry with the 'generate message' bit set.

You can use the 'subMenu pointer' and/or the selection list, to decide which window or Menu to open with Wimp_CreateSubMenu.
The subMenu you actually open doesn't have to be the same as the one passed to you.
However, if you wish the subMenu to be re-opened when the Wimp recreates the Menu you should store the new handle.
Component Type Default
SubMenu_20Integer
SubMenu_19Integer
SubMenu_18Integer
SubMenu_17Integer
SubMenu_16Integer
SubMenu_15Integer
SubMenu_14Integer
SubMenu_13Integer
SubMenu_12Integer
SubMenu_11Integer
SubMenu_10Integer
SubMenu_09Integer
SubMenu_08Integer
SubMenu_07Integer
SubMenu_06Integer
SubMenu_05Integer
SubMenu_04Integer
SubMenu_03Integer
SubMenu_02Integer
SubMenu_01Integer
Main_MenuInteger
YInteger
XInteger
SubmenuInteger
HeaderMessage_Event_Header
   
AMEL_Message_MenuWarning abstract tagged record
inheritance from Message_EventListener (Message_Event_MenuWarning)
Component Type Default
EventMessage_MenuWarning_Pointer
   
Reason_MenuSelection record
The datastructure contains the path of selection starting with the element selected in the main Menu.

If the user clicks with adjust (call Wimp_GetPointerInfo to find out), the Menu should remain on screen.
To do this, you have to reopen the Menu after having responded to selection.
This is done by calling Wimp_CreateMenu again.
Component Type Default
SubMenu_20Integer
SubMenu_19Integer
SubMenu_18Integer
SubMenu_17Integer
SubMenu_16Integer
SubMenu_15Integer
SubMenu_14Integer
SubMenu_13Integer
SubMenu_12Integer
SubMenu_11Integer
SubMenu_10Integer
SubMenu_09Integer
SubMenu_08Integer
SubMenu_07Integer
SubMenu_06Integer
SubMenu_05Integer
SubMenu_04Integer
SubMenu_03Integer
SubMenu_02Integer
SubMenu_01Integer
Main_MenuInteger
   
AWEL_Reason_MenuSelection abstract tagged record
inheritance from Wimp_EventListener (Reason_Event_MenuSelection, -1, -1)
Component Type Default
EventReason_MenuSelection_Pointer
  
Exceptions
too_many_menu_items
  
Pragmas
Convention(C, Message_MenusDeleted)
Convention(C, Message_MenuWarning)
Convention(C, Reason_MenuSelection)
 

Subprograms

Quick access : ClausesGenericsDefinitionsSubprograms


  
Init function
ReturnMenu_Type
Initialises a Menu object (of Type Menu_Type)
"items" is the maximum number of allowed Menu entries
Parameter name Type Mode Default
ItemsNaturalin
  
Create procedure
Opens a Menu using the Menu structure at address "MenuPtr"
direct wrap to Wimp_CreateMenu
Parameter name Type Mode Default
MenuPtrIntegerin
XIntegerin
YIntegerin
  
Create_SubMenu procedure
Opens a submenu using the menu structure at address "MenuPtr"
direct wrap to Wimp_CreateSubMenu
Parameter name Type Mode Default
MenuPtrIntegerin
XIntegerin
YIntegerin
  
Open procedure
Opens a Menu at the given position
Parameter name Type Mode Default
MenuMenu_Typein
XIntegerin
YIntegerin
  
Reopen procedure
Reopens the last opened Menu at the last position
(necessary if the user clicked with adjust button)
  
Open_SubMenu procedure
Opens menu as a submenu at the given position.
Parameter name Type Mode Default
MenuMenu_Typein
XIntegerin
YIntegerin
  
Close procedure
Closes the active Menu
  
Current function
ReturnMenu_Type
Returns the currently displayed Menu
  
Set_Title procedure
Sets the Menu title
Parameter name Type Mode Default
MenuMenu_Typein
TitleStringin
  
Get_Title function
ReturnString
Gets the Menu title
Parameter name Type Mode Default
MenuMenu_Typein
  
Get_Item function
ReturnString
Gets the Menu title
Parameter name Type Mode Default
MenuAddressin
ItemNaturalin
  
Add_Last_Item procedure
Adds a Menu item to the given Menu
Menu entries are always added at the end of the Menu - the position
can be read via "item" by the caller
with specifying "reserve_space", the caller can allocate a defined number
of bytes for the text of the Menu item - if it is left at 0, memory
is automatically allocated to cope with the length of the given string
Parameter name Type Mode Default
MenuMenu_Typein out
ItemNaturalout
NameStringin
Reserve_spaceNaturalin0
TickBooleaninfalse
DottedBooleaninfalse
WritableBooleaninfalse
MessageBooleaninfalse
SubMenuBooleaninfalse
  
Add_Last_Item procedure
Adds a Menu item to the given Menu
Menu entries are always added at the end of the Menu - the position
can be read via "item" by the caller.
This is the low level version of Add_last_Item,
the caller has to supply the contents of the menu entry and allocate memory if necessary.
Parameter name Type Mode Default
MenuMenu_Typein out
ItemNaturalout
Item_FlagsSystem.Unsigned_Types.Unsignedin
Icon_FlagsSystem.Unsigned_Types.Unsignedin
Icon_DataIcon_Data_Stringin
  
Get_Item function
ReturnString
Gets the text of a given Menu item
Parameter name Type Mode Default
MenuMenu_Typein
ItemNaturalin
  
Change_Item procedure
Changes the text of a given Menu item
Be careful! No checks for sufficiently allocated memory is done!
Parameter name Type Mode Default
MenuMenu_Typein
ItemNaturalin
NameStringin
  
Change_ItemCount procedure
Change item count.
Parameter name Type Mode Default
MenuMenu_Typein out
New_CountNaturalin
  
Shade_Item procedure
Shades the specified Menu item to make it unselectable
Parameter name Type Mode Default
MenuMenu_Typein
ItemNaturalin
ShadeBooleanintrue
  
Tick_Item procedure
Puts a tick in front of the specified Menu item
Parameter name Type Mode Default
MenuMenu_Typein
ItemNaturalin
TickBooleanintrue
  
Attach_Window procedure
Attaches a subwindow to the specified Menu item
Parameter name Type Mode Default
MenuMenu_Typein
ItemNaturalin
WHWimp_Handle_Typein
  
Attach_SubMenu procedure
Attaches a subwindow to the specified Menu item
Parameter name Type Mode Default
MenuMenu_Typein
ItemNaturalin
SubMenuMenu_Typein
  
Set_Colours procedure
Sets the Menu colours
Parameter name Type Mode Default
MenuMenu_Typein
Title_FGIntegerin7
Title_BGIntegerin2
Work_Area_FGIntegerin7
Work_Area_BGIntegerin0
  
Get_Colours procedure
Gets the Menu colours
Parameter name Type Mode Default
MenuMenu_Typein
Title_FGIntegerout
Title_BGIntegerout
Work_Area_FGIntegerout
Work_Area_BGIntegerout
  
Set_Parameters procedure
Sets the Menu parameters
Parameter name Type Mode Default
MenuMenu_Typein
WidthIntegerin0
HeightIntegerin44
GapIntegerin0
  
Get_Parameters procedure
Gets the Menu parameters
Parameter name Type Mode Default
MenuMenu_Typein
WidthIntegerout
HeightIntegerout
GapIntegerout
  
Get_Pointer function
ReturnMem_Adr_Type
Returns a pointer to memory block containing the menu.
Parameter name Type Mode Default
MenuMenu_Typein