Mestre Quintas, como é q compila esse seu exemplo ? Posta o .HBP pra gente...
https://github.com/JoseQuintas/JoseQuintas/blob/master/source/jpa_menu.prg

Moderador: Moderadores
lugab escreveu:Mestre Quintas, como é q compila esse seu exemplo ? Posta o .HBP pra gente...
/***
* mDemo.prg
*
* Clipper 5.3 Demo program with GUI Get, Menu class and LightLib
*
* Copyright (c) 1990-1995, Computer Associates International Inc.
* All rights reserved.
*
* Build : Rmake mDemo.Rmk
* Run : mDemo <- Text mode
* mDemo /G <- Graphic mode
***/
#include "button.ch" // Menu definitions
#include "inkey.ch" // Key definitions
#include "setcurs.ch" // Cursor definitions
#include "llibg.ch" // Graphic definitions
#include "blob.ch" // Flex file
function Main( nMode )
Local oMenu
Local aMode := {}
Memvar oPopUp2
Private oPopUp2
// Decide running under which mode
If ValType(nMode) == "C" .and. Upper(nMode) == "/G"
SET( _SET_VIDEOMODE, LLG_VIDEO_VGA_640_480_16 )
Request DBFMEMO
RDDSetDefault("DBFMEMO")
MemoSetSuper("DBFNTX")
Endif
// Make the mouse cursor visible if mouse driver is loaded
If mPresent()
mSetCursor( .T. )
mDblClk( 500 )
mSetPos( 10,10 )
SET( _SET_EVENTMASK, INKEY_ALL )
Endif
// Create the menu and display
Scroll()
Set(_SET_SCOREBOARD,.F.)
SetCursor( SC_NONE )
oMenu := ApplyMenu()
aMode := gMode()
If aMode[ LLG_MODE_IN_USE ] == LLG_VIDEO_TXT
@ 10,34 Say "CA-Clipper" Color "BG+/N"
@ 12,20 Say "The Power Of GUI At The Speed Of DOS" Color "GR+/N"
Else
gBMPDisp( gBMPLoad( "CA-CLIP.BMP" ), 155, 160 )
Endif
// Wait for a menu event and do not exit until File/Exit is chosen
oMenu:Display()
While ( MenuModal(oMenu,1,MaxRow()-1,1,MaxCol()-1,"r/w") != -1 )
End
SetCursor( SC_NORMAL )
Return (0)
// This function will create the menu and return the newly created
// MenuObject as its return value.
Static Function ApplyMenu()
Local oTopBar, oPopUp1, oSubPopUp2, oItem
Local aMode := {}
Memvar oPopUp2
// Create first popup menu named MAIN
oPopUp1 := PopUp()
oPopUp1:ColorSpec := "b/w,gr+/rb,r/w,g/rb,n+/w,w+/b"
// Add some menu items to the newly created popup
oPopUp1:AddItem( MenuItem("&Config Alt+F2",{|| MenuConfig(oPopUp2)},;
K_ALT_F2,"Menu Items Configuration") )
oItem := MenuItem("&Graphic Ctrl+G",{|| LLibDemo() }, ;
K_CTRL_G,"Light Lib Graphic demo")
oPopUp1:AddItem( oItem )
// Check the current video mode status
aMode := gMode()
If aMode[ LLG_MODE_IN_USE ] == LLG_VIDEO_TXT
oItem:Enabled := .F.
Endif
// Add a Separator and Exit
oPopUp1:AddItem( MenuItem( MENU_SEPARATOR ) )
oPopUp1:AddItem( MenuItem("E&xit Alt+F4" ,{|| .T.}, K_ALT_F4,;
"End of application", -1) )
// Create a Sub-Pop up menu
oSubPopUp2 := PopUp()
oSubPopUp2 :ColorSpec:= "b/w,gr+/rb,r/w,g/rb,n+/w,w+/b"
// Add some items
oSubPopUp2:AddItem( MenuItem("&Go To... F5",{|o| Marker(o,oSubPopUp2)},;
K_F5,"Go to a specific line number") )
oSubPopUp2:AddItem( MenuItem("G&o To Top ",{|o| Marker(o,oSubPopUp2)},;
K_HOME,"Go to top of file") )
oSubPopUp2:AddItem( MenuItem("Go To &Bottom",{|o| Marker(o,oSubPopUp2)},;
K_END,"Go to bottom of file") )
// Create a second popup menu named EDIT and attach it to oTopBar
oPopUp2 := PopUp()
oPopUp2:ColorSpec := "b/w,gr+/rb,r/w,g/rb,n+/w,w+/b"
// Add some menu items to this EDIT popup menu
oPopUp2:AddItem( MenuItem( "&Undo Ctrl+Z" ,{||.T.}, K_CTRL_Z,;
"Reverse changes made to this file") )
oPopUp2:AddItem( MenuItem( "Cu&t Ctrl+X" ,{||.T.}, K_CTRL_X,;
"Cut to clipboard") )
oPopUp2:AddItem( MenuItem( "&Copy Ctrl+C" ,{||.T.}, K_CTRL_C,;
"Copy to clipboard") )
oPopUp2:AddItem( MenuItem( "&Paste Ctrl+V" ,{||.T.}, K_CTRL_V,;
"Paste from clipboard") )
oPopUp2:AddItem( MenuItem( MENU_SEPARATOR ) )
oPopup2:AddItem( MenuItem( "&Go",oSubPopUp2 ) )
// Add yet another separator
oPopUp2:AddItem( MenuItem( MENU_SEPARATOR ) )
// Add one final menu item to the EDIT popup menu
oPopUp2:AddItem( MenuItem( "&Find..." ,{|| .T.}, K_ALT_F3,;
"Search for text") )
// TopBar() creates the menu at the very top of the screen
oTopBar := TopBar( 0, 0, 78)
oTopBar:ColorSpec := "b/w,gr+/rb,r/w,g/rb,n+/w,w+/b"
oTopBar:AddItem( MenuItem ( "&Main",oPopUp1) )
oTopBar:AddItem( MenuItem ( "&Edit",oPopUp2) )
// Return our TopBar object back to ApplyMenu()
Return ( oTopBar)
Static Function Marker( oItem, oSubMenu )
Local oMenuItem, i
For i := 1 To oSubMenu:ItemCount()
oMenuItem := oSubMenu:GetItem(i)
oMenuItem:Checked := .F.
Next
oItem:Checked := !oItem:Checked
Return .T.
NiltonGM escreveu:Aproveitando que o assunto é menu, e só tem feras por aqui
Usuários vendo este fórum: Bing [Bot] e 8 visitantes