Posts: 1,006
Threads: 330
Joined: Mar 2007
Hi Gintaras,
I have a column in my qmgrid that has "checkbox" as its type - it acts as a place for the user to indicate "yes I reviewed the information on this row"
However, I want for them to be able to check it off by clicking another button in the dialog e.g. "Reviewed"
how do I click off the item in QMscript - I am already able to get the selected row number and the column number (first column ... 0)
Thanks!!!,
Stuart
Posts: 11,926
Threads: 138
Joined: Dec 2002
QM grid checkbox state is stored as cell text: "yes" - checked, empty - unchecked. Change cell text (LVM_SETITEMTEXTW). The cell then must be not in edit mode.
Posts: 1,006
Threads: 330
Joined: Mar 2007
Thanks for your response, Gintaras.
I am embarrassed that I can't figure this out even from MSDN
I know the row number (int RowNumber) and the column number of type Checkbox = first column i.e. zero-order = 0
I have this in a case statement in the dialog but it doesn't seem to be doing anything
SendMessage(hlv LVM_SETITEMTEXTW RowNumber 0)
Thanks for any help!!!
Stuart
Posts: 1,006
Threads: 330
Joined: Mar 2007
I tried to make a LvSetItemText based on LvGetItemText
Function
LvGetItemText
;/
function! hlv item subitem str&s
;Gets listview control item text.
;Returns 1 if not empty, 0 if empty.
;hlv - handle.
;item - 0-based row index.
;subitem - 0-based column index.
;s - receives text.
LVITEMW li
BSTR b.alloc(260)
li.pszText=b
li.cchTextMax=260
li.iSubItem=subitem
SendMessage(hlv LVM_GETITEMTEXTW item &li)
s.ansi(b)
ret s.len!=0
I edited it like this....
Function
LvSetItemText
;/
function! hlv item subitem str&s
;Gets listview control item text.
;Returns 1 if not empty, 0 if empty.
;hlv - handle.
;item - 0-based row index.
;subitem - 0-based column index.
;s - supplies text.
LVITEMW li
BSTR b.alloc(260)
li.pszText=s
li.iSubItem=subitem
SendMessage(hlv LVM_SETITEMTEXTW item &li)
ret
with the calling statement
Function
AttendingCommentsDlg_Trainee
,,str CheckBoxYes="Yes"
,,int CheckBoxSubItem=0
,,LvSetItemText hlv RowNumber CheckBoxSubItem CheckBoxYes
but it still doesn't work.
Any help would be much appreciated. I think I am getting close!!
Stuart
Posts: 11,926
Threads: 138
Joined: Dec 2002
Macro
int w1=id(1580 win("Options" "#32770")) ;;QM Options dialog, Editor tab, first grid
;lets make String bold
LVITEMW li
li.iSubItem=3
li.pszText=@"Yes"
SendMessage w1 LVM_SETITEMTEXTW 2 &li
1
;not bold
li.pszText=0
SendMessage w1 LVM_SETITEMTEXTW 2 &li
Posts: 1,006
Threads: 330
Joined: Mar 2007
Works great!!!
Thanks so much!!!!!
Stuart