Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog size at run time
#4
Thanks for your help.

The dialog function always uses the parameters: hDlg message wParam lParam

since ShowDialog: ShowDialog(dd &DynamicGrid

In order to pass coordinates x,y to my grid I used wParam lParam
but how to pass different CSV (data arrays)?

Example:

DynamicGrid 0 0 200 105 CSV1

And another question, please: ColumnsAdd is for column labels, is there any command for row labels? I used the trick of column=0

Regards.

Function DynamicGrid
Code:
Copy      Help
\Dialog_Editor

function# hDlg message wParam lParam
if(hDlg) goto messages

int Dlgw Dlgh Gridw Gridh OKx OKy Cancelx Cancely

Dlgw=wParam
Dlgh=lParam

Gridw=Dlgw+1
Gridh=Dlgh-21
OKx=Dlgw/2-55
OKy=Gridh+2
Cancelx=Dlgw/2-5
Cancely=Gridh+2

str dd=
F
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 {Dlgw} {Dlgh} "Stats in detail"
;3 QM_Grid 0x54030000 0x0 0 0 {Gridw} {Gridh} ""
;1 Button 0x54030001 0x4 {OKx} {OKy} 48 14 "OK"
;2 Button 0x54030000 0x4 {Cancelx} {Cancely} 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030202 "" "" ""

if(!ShowDialog(dd &DynamicGrid 0 0 0 0 0 0 0 0 "")) ret

ret
;messages
DlgGrid g.Init(hDlg 3)
sel message
,case WM_INITDIALOG
,g.GridStyleSet(GRID.QG_NOEDIT)
,g.ColumnsAdd("[]A[]B[]C[]D" 1)
,g.ColumnsWidthAdjust(5);; n columns=5
,
,_s=
,;A,1,2,3,88
,;B,4,5,6,89
,;C,7,8,9,99
,;D,10,11,12,6.77
,g.FromCsv(_s ",")
,
,case WM_DESTROY
,case WM_COMMAND goto messages2

ret
;messages2
sel wParam
,case IDOK
ret 1

Macro Use DynamicGrid
Code:
Copy      Help
DynamicGrid 0 0 200 105
DynamicGrid 0 0 351 135
DynamicGrid 0 0 651 235


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)