Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clicking a QmGrid checkbox
#1
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
#2
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.
#3
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
#4
I tried to make a LvSetItemText based on LvGetItemText

Function LvGetItemText
Code:
Copy      Help
;/
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
Code:
Copy      Help
;/
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
Code:
Copy      Help
,,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
#5
Macro
Code:
Copy      Help
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
#6
Works great!!!
Thanks so much!!!!!

Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)