home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ANews 3
/
AnewsCD3.iso
/
DP
/
Programmation
/
PureBasic_Demo
/
Examples
/
Sources
/
Menu.pb
< prev
next >
Wrap
Text File
|
1999-10-10
|
2KB
|
82 lines
;
; *********************************
;
; Menus example file for Pure Basic
;
; © 1999 - Fantaisie Software -
;
; *********************************
;
;
InitScreen (0) ; We need 1 screen
InitWindow (0) ; 1 window
InitTagList (10) ; a taglist upto 11 tags
InitMenu (0,30) ; 1 menu with maximum 30 items
FindScreen (0,"") ; Find the default screen
ShowScreen() ; Bring it to front of the display
;
; Here are all our menus strings...
;
Title1.s = "Project"
Item1.s = "Open..." : Short1.s = ""
Item2.s = "Brush" : Short2.s = "B"
Item3.s = "Picture" : Short3.s = "P"
Item4.s = "Sound" : Short4.s = "L"
Item14.s = "Save As..." : Short14.s = "S"
Item5.s = "Compression" : Short5.s = "C"
Item6.s = "FORM/IFF" : Short6.s = "I"
Item7.s = "Datatype" : Short7.s = "D"
Item8.s = "Binary" : Short8.s = "B"
Item13.s = "Quit" : Short13.s = "Q"
Title2.s = "Option"
Item9.s = "Configure..." : Short9.s = ""
;
; Build the menus (note the indentation which is important)
;
MenuTitle(Title1)
MenuItem( 1, Item1, 0)
MenuSubItem( 2, Item2, Short2)
MenuSubCheckItem( 3, Item3, Short3, 1)
MenuSubBar()
MenuSubItem( 4, Item4, Short4)
MenuItem( 14, Item14, Short14)
MenuCheckItem( 5, Item5, Short5, 1)
CreateMenu(0, ScreenID()) ; Create our menu
WinTitle.s = "Menu example"
ResetTagList (#WA_Title, WinTitle)
AddTag (#WA_SmartRefresh,1)
AddTag (#WA_CustomScreen, ScreenID())
AddTag (#WA_NewLookMenus, 1)
If OpenWindow(0, 100, 40, 480, 200, #WFLG_CLOSEGADGET | #WFLG_DRAGBAR | #WFLG_DEPTHGADGET | #WFLG_ACTIVATE, TagListID())
AttachMenu(0,WindowID()) ; Attach our menu to the opened window
Repeat
VWait()
IDCMP.l = WindowEvent()
Until IDCMP = #IDCMP_CLOSEWINDOW
EndIf
End