Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
#Include "Win32API.inc"
#Include "mlg.inc"
Enum Equates Singular
IDC_Button = 500
IDC_Grid
End Enum
Global hDlg, hGrid as Dword
Function PBMain() As Long
Dialog New Pixels, 0, "MLG Example",300,300,600,350, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, %IDC_Button,"Push", 50,10,100,20
MLG_Init
Control Add "MyLittleGrid", hDlg, %IDC_Grid, "r10/c4/b3", 10,40,550,250, %MLG_STYLE
Control Handle hDlg, %IDC_Grid to hGrid
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local Mlgn as MyGridData PTR, w,h,row,col As Long
Select Case Cb.Msg
Case %WM_InitDialog
Case %WM_Paint
Control Redraw hDlg, %IDC_Grid
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_Button
Select Case Cb.CtlMsg
Case %BN_Clicked : ? "Bingo"
End Select
End Select
Case %WM_NOTIFY
Select Case CB.NmID
Case %IDC_Grid
Select Case CB.Nmcode
Case %Mlgn_Return
Mlgn = CB.lParam
row = @Mlgn.Param1 'current Row
col = @Mlgn.Param2 'current Col
Dialog Set Text hDlg, "MLG Example" + Str$(Row) + Str$(Col)
End Select
End Select
Case %WM_Size
Dialog Get Client hDlg to w,h
Control Set Size hDlg, %IDC_Grid, w-20,h-40
End Select
End Function
http://www.garybeene.com/sw/gbsnippets.htm