-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ludo.prw
62 lines (40 loc) · 1.62 KB
/
Ludo.prw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#INCLUDE "PROTHEUS.CH"
//---------------------------------------------------------------------
/*/{Protheus.doc} Ludo
Função principal do jogo Ludo
@author Felipe Nathan Welter
@author Vitor Emanuel Batista
@since 08/09/2010
/*/
//-------------------------------------------------------------------
User Function Ludo()
Local oDlg
Local oTLudo
Local cTitle := "LUDO [FELIPE NATHAN WELTER / VITOR EMANUEL BATISTA]"
//Variaveis de Largura/Altura da Janela
Local nAltura := 520
Local nLargura := 755
Define Dialog oDlg Title cTitle From 0,0 To nAltura,nLargura COLOR CLR_BLACK, CLR_WHITE Pixel
oDlg:lEscClose := .F.
oTLudo := TLudo():New(0,0,(nLargura-15)/2,(nAltura-30)/2,oDlg)
//Cria Menu superior
CreateMenuBar(oDlg,oTLudo)
ACTIVATE DIALOG oDlg CENTERED ON INIT oTLudo:Activate()
Return
Static Function CreateMenuBar(oDlg,oTLudo)
oTMenuBar := TMenuBar():New(oDlg)
oTMenuBar:SetCss("QMenuBar{background-color:#eeeddd;}")
oTMenuBar:Align := CONTROL_ALIGN_TOP
oTMenuBar:nClrPane := RGB(238,237,221)
oTMenuBar:bRClicked := {||}
oArquivo := TMenu():New(0,0,0,0,.T.,,oDlg)
oAjuda := TMenu():New(0,0,0,0,.T.,,oDlg)
oTMenuBar:AddItem( '&Arquivo' , oArquivo, .T.)
oTMenuBar:AddItem( 'Aj&uda' , oAjuda, .T.)
oArquivo:Add(TMenuItem():New(oDlg,"Novo Jogo",,,,{|| oTLudo:NewGame()},,'',,,,,,,.T.))
oArquivo:Add(TMenuItem():New(oDlg,"Sair",,,,{|| If(MsgYesNo("Deseja realmente sair do jogo?"),oDlg:End(),)},,'FINAL',,,,,,,.T.))
oAjuda:Add(TMenuItem():New(oDlg,'&Sobre... F1',,,,{|| HelProg()},,'RPMPERG',,,,,,,.T.))
Return
//TODO Desenvolver Sobre...
Static Function HelProg()
Return