Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Event Not Firing
Message
From
17/07/2007 13:36:42
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01240814
Message ID:
01241203
Views:
35
>>>>We have a combo box control. The style is 2 (Dropdown List)
>>>>
>>>>The code in the GotFocus event is inherited from the parent class. It is
KEYBOARD "{F4}" PLAIN CLEAR
>>>>
>>>>When the user double-clicks one of the items I would like to perform some action (open a document via ShellExecute). However, the dbl-click event code never seems to fire. I've put WAIT WINDOW's etc. there and they don't get displayed.
>>>>
>>>>I tried putting a NODEFAULT in the GotFocus method, but then nothing happens when I click either in the list or on the drop-down arrow.
>>>>
>>>>All suggestions greatly appreciated.........Rich
>>>
>>>Double Click event is fired only when you double click in Text portion of the combo, not in the list one. So follow Naomi's suggestion, put your code in IAC event.
>>
>>That would have worked just fine for me, except that the Double Click event is not firing. In my response to Naomi I said I would put a < View Item > button on the screen but in the interest of learning more about this control.........
>>
>>Is there any way I can get back the default behavior of the base combobox control? I'm pretty sure it's that KEYBOARD command that is preventing the actions I want. But NODEFAULT prevents any interaction (no list when the drop-down arrow is pressed, no click event code, no dbl-click event code). I could create a new control, but I've been asked to work with the ones we have.
>>
>>Thanks.....Rich
>
>
>As far as I understand you want to do something when user selec some item from List and then double click on text portion of the combo, right? If so can you post your code for that combo? I mean the code in Click, GotFocus, KeyPress events etc.

Sorry for delay in responding.......I do appreciate your help. Here is the entire heirarchy of controls.
frmApproval (frmBase of common_libs.vcx)
    |contains
    |__ cntAvlOutcome (cntOutcome of common_libs.vcx)
           |contains
           |__cmbAttachment (combobox_custom of common_controls.vcx)
                                     |a subclass of
                                     |__combobox_custom2 of common_controls.vcx

CMBATTACHMENT.INIT (inherited combobox_custom2)
DODEFAULT()
this.afterinit() 

CMBATTACHMENT.AFTERINIT(inherited combobox_custom2)
*!* Check the departments who has access to this control
IF NOT EMPTY(this.cEmp_Depts) AND (NOT (APP_GLOBAL.Emp_Dept $ this.cEmp_Depts)) THEN 
	this.readonly = .f.
ENDIF

*!* Check the emp Levels who has access to this control
IF NOT EMPTY(this.cEMP_Levels) AND (NOT (STR(APP_GLOBAL.Emp_Level, 1) $ this.cEMP_Levels)) THEN 
	this.readonly = .f.
ENDIF 

CMBATTACHMENT.GOTFOCUS (inherited combobox_custom)
KEYBOARD "{F4}" PLAIN CLEAR

CMBATTACHMENT.INTERACTIVECHANGEEVENT (inherited cntOutcome)
this.parent.setAttachmentIcon (sets an icon on another control)

CMBATTACHMENT.DBLCLICK(inherited cntCoutome)
WAIT WINDOW "dbl-click"
*ShellExecute(open document in combo box)
Again, the problem is that the DBLCLICK method never fires. I think it is because the GOTFOCUS method forces the dropdown to appear and prevents dblclick from firing. How can I modify all this so that the KEYBOARD command doesn't execute, but the normal combobox GotFocus event takes place? I hope I haven't made the explanation too confusing.

Thanks again........Rich
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform