% The "GUI.CreateMenu" program.
import GUI
%Pic.ScreenLoad ("C:/game/Map1.jpg", 0, 0, picCopy)
View.Set ("graphics 640, 480")
View.Set ("nocursor")
var first, second : int % The menus.
var item : array 1 .. 4 of int % The menu items.
var name : array 1 .. 4 of string (20) :=
init ("Quit", "Map", "Player", "Player select")
%(, "B", "---", "C", "D",
%"Disable B Menu Item", "Enable B Menu Item", "---",
%"Disable Second Menu", "Enable Second Menu")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure MenuSelected
for i : 1 .. 4
if item (i) = GUI.GetEventWidgetID then
Text.Locate (maxrow, 1)
put name (i) + " selected option " ..
end if
end for
end MenuSelected
procedure Map
for i : 1 .. 4
if item (i) = GUI.GetEventWidgetID then
Text.Locate (maxrow, 1)
put name (i) + " selected option " ..
end if
end for
end Map
procedure Playsel
for i : 1 .. 4
if item (i) = GUI.GetEventWidgetID then
cls
Text.Locate (maxrow, 1)
put name (i) + " Test " ..
end if
end for
end Playsel
procedure Player
for i : 1 .. 4
if item (i) = GUI.GetEventWidgetID then
Text.Locate (maxrow, 1)
put name (i) + "s selected option " ..
delay (200)
Playsel
end if
end for
end Player
% Create the menus
first := GUI.CreateMenu ("Game")
item (1) := GUI.CreateMenuItem (name (1), GUI.Quit)
item (2) := GUI.CreateMenuItem (name (2), Map)
item (3) := GUI.CreateMenuItem (name (3), Player)
%item (4) := GUI.CreateMenuItem (name (4), Playsel)
loop
exit when GUI.ProcessEvent
end loop
|