Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ToQMGrid()
#1
i have created a CSV object, i created a DlgGrid object.  I am trying to pass a csv table to Grid, but get an error, "parameter is incorrect".  why? what am i doing wrong? (side question: how do i get formatted code??)


str dd=
 BEGIN DIALOG
 0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
 3 QM_Grid 0x56031041 0x200 12 0 96 48 "0[]A[]B"
 1 Button 0x54030001 0x4 116 116 48 14 "OK"
 2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
 END DIALOG
 DIALOG EDITOR: "" 0x2040A00 "*" "" "" ""

str controls = "3"
str qmg3

int hDlg
DlgGrid g.Init(hDlg 3)

ICsv x._create ;;create csv object
x.FromString("A,B[]C,D")
x.ToQmGrid(g 1)

if(!ShowDialog(dd 0 &controls)) ret
#2
your missing the dialog procedure

that code needs to be called from inside dialog procedure
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 QM_Grid 0x56031041 0x200 12 0 96 48 "0[]A[]B"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040A00 "*" "" "" ""

str controls = "3"
str qmg3

if(!ShowDialog(dd &sub.DlgProc 0)) ret

#sub DlgProc
function# hDlg message wParam lParam

DlgGrid g.Init(hDlg 3)
sel message
,case WM_INITDIALOG
,ICsv x._create ;;create csv object
,x.FromString("A,B[]C,D")
,x.ToQmGrid(g 1)
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

tip: to post qm code on forum
In QM, to copy all or selected text, use menu Edit -> Other Formats -> Copy for QM Forum. It copies correct and colored code to the clipboard. Then simply paste in the forum. Don't use the Code button.
see https://www.quickmacros.com/forum/showth...56#pid2956  for more info

also  for help with qmgrids look in the system folder 
\System\Dialogs\Dialog Control Classes\DlgGrid\samples\sample_Grid


Forum Jump:


Users browsing this thread: 1 Guest(s)