#DefineSubroutine MyDialogCallbackProc(MyDialog_Handle,MyDialog_Message,MyDialog_Name,MyDialog_EventInfo,MyDialog_ChangeInfo)
MSG_INIT=0 ; The one-time initialization
MSG_BUTTONPUSHED=2 ; Pushbutton or Picturebutton
DC_CHECKBOX=1 ; CHECKBOX REPORTVIEW
;Return code constants
RET_DO_CANCEL=0 ; Cancels dialog
RET_DO_DEFAULT= -1 ; Continue with default processing for control
RET_DO_NOT_EXIT= -2 ; Do not exit the dialog
ON_EQUAL = @TRUE ; Initialize variable ON_EQUAL
Switch MyDialog_Message ; Switch based on Dialog Message type
Case MSG_INIT ; Standard Initialization message
DialogProcOptions(MyDialog_Handle,MSG_BUTTONPUSHED,@TRUE)
Return(RET_DO_DEFAULT)
Case MSG_BUTTONPUSHED
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
If MyDialog_Name == "PushButton_Select"
itemname = DialogControlGet( MyDialog_Handle, "EditBox_1", 3 )
item = ArraySearch( arrArray, itemname)
if item == -1
Pause('Notice','That item was not found')
else
DialogControlSet( MyDialog_Handle, "ReportView_1", DC_CHECKBOX, arrArray[item,0] )
endif
Return(RET_DO_NOT_EXIT)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ElseIf MyDialog_Name == "PushButton_Cancel" ; Cancel
Return(RET_DO_CANCEL)
EndIf ; MyDialog_Name
Return(RET_DO_DEFAULT)
; case MSG_RVITEMSELROW ; ID "ReportView_1" arrSafeArray
; return(RET_DO_DEFAULT)
EndSwitch ; MyDialog_Message
Return(RET_DO_DEFAULT)
#EndSubRoutine ; End of Dialog Callback MyDialogCallbackProc
filename = 'C:\TEMP\Data\CSV\Authors.csv'
arrArray = ArrayFileGetCSV(filename, 1)
MyDialogFormat=`WWWDLGED,6.2`
MyDialogCaption=`ReportView Check an Item`
MyDialogX=138
MyDialogY=141
MyDialogWidth=566
MyDialogHeight=243
MyDialogNumControls=004
MyDialogProcedure=`MyDialogCallbackProc`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0
MyDialog001=`191,181,066,012,PUSHBUTTON,"PushButton_Select",DEFAULT,"Check Item Name",1,10,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`365,223,036,012,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`187,063,174,100,REPORTVIEW,"ReportView_1",arrArray,DEFAULT,DEFAULT,30,142606336,DEFAULT,DEFAULT,"192|192|192"`
MyDialog004=`259,181,100,012,EDITBOX,"EditBox_1",ebVariable1,"Au_ID",DEFAULT,40,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
ButtonPushed=Dialog("MyDialog")
Quote from: JTaylor on July 31, 2013, 01:00:58 PM
Thanks. Wish I'd asked sooner as I've spent several hours on this question. Never crossed my mind that you would have used the checkbox control call for reportview changes.
For my further edification...any suggestions on how to make it work via the LVM_SetItemState call in an Extender?
Thanks again.
Jim
Request | Applicable Controls | Set-info |
1 | CHECKBOX REPORTVIEW | CHECKBOX: (i) 1 means check the box, 0 means unchecked the box REPORTVIEW: (s) Checks or unchecks an item in a REPORTVIEW control. Use the function's set-info (fourth) parameter to indicate the first column text of the row to check or uncheck. The text can be a delimited list to indicate which row should be checked or unchecked when multiple rows have the same first column text. |
DC_CHECKBOX=1
; CHECKBOX REPORTVIEW