WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Dialog Editor version 6.2
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

ReportView Single Click

 Keywords: Dialog ReportView Single Click Highlight Selection Event Callback Procedure 

Question:

I just noticed if is use default style REPORTVIEW control, then set up a callback procedure that monitors MSG_RVDBLCLICKROW events, that I get back different results depending on where I click.

Using REPORTVIEW default styles:

MyDialog002=`011,009,390,182,REPORTVIEW,"ReportView_1",rvVariable1,DEFAULT,DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
if I double click on the first column the callbacks MyDialog_ChangeInfo variable contains the text of the first column. However if I double click on the second column then the MyDialog_ChangeInfo variable is empty.

The single click behavior is a bit different. if I single click on the first column the callbacks MyDialog_ChangeInfo variable contains the text of the first column. If I single click on the second column then the event is not triggered.

Is this behavior expected?

#DefineFunction MyDialogCallbackProc(MyDialog_Handle,MyDialog_Message,MyDialog_Name,MyDialog_EventInfo,MyDialog_ChangeInfo)
    InitDialogConstants()                                   ; Initialize Dialog Constants
   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_TIMER,1000)
         DialogProcOptions(MyDialog_Handle,MSG_BUTTONPUSHED,@TRUE)
         DialogProcOptions(MyDialog_Handle,MSG_RVITEMSELROW,@TRUE)
         DialogProcOptions(MyDialog_Handle,MSG_RVDBLCLICKROW,@TRUE)
         DialogProcOptions(MyDialog_Handle,MSG_RVCHECKEDITEM,@TRUE)
         DialogProcOptions(MyDialog_Handle,MSG_RVITEMTEXT,@TRUE)
         DialogProcOptions(MyDialog_Handle,MSG_RVHEADER,@TRUE)

         Return(RET_DO_DEFAULT)

    ...

     Case MSG_RVITEMSELROW
     Case MSG_RVDBLCLICKROW
         ; ID "ReportView_1"  rvVariable1
          MyDialog_MessageTxt = "MSG_RVITEMSELROW"
          If MyDialog_Message == MSG_RVDBLCLICKROW Then  MyDialog_MessageTxt = "MSG_RVDBLCLICKROW"
         Pause(MyDialog_MessageTxt,MyDialog_ChangeInfo)
         Return(RET_DO_NOT_EXIT)

    ...

   EndSwitch                                                ; MyDialog_Message
   Return(RET_DO_DEFAULT)
#EndFunction

Answer:

First, dialogs do NOT support a single click event. Dialogs do support a selection event but this is not the same thing as a single click event because you can click and not generate selection and you can select without having to click ( Using the keyboard or using a mouse double click are two examples.) This is how MSFT made the control work and it makes perfect sense when you think about it.

Second, the double click event is triggered whenever you click on any item in the control. The double click notification sent back to the dialog only supplies item information when the double click also causes item selection. Again this is how MSFT made the control work.


Article ID:   W17733
Filename:   ReportView Single Click.txt
File Created: 2012:11:19:08:24:08
Last Updated: 2012:11:19:08:24:08