Link to home
Start Free TrialLog in
Avatar of staarship
staarship

asked on

How to bypass the code in clicked event of DataWindow when i double click on the datawindow

How to bypass the code in clicked event of DataWindow when i double click on the datawindow. I have written some code in the double clicked event also..

When i double click, the code in the clicked event must not get executed..
Only the code in the double clicked event must get executed..
Avatar of diasroshan
diasroshan
Flag of Kuwait image

Hi,

DoubleClick will always trigger the clicked event first.

Do u need the code in ur Clicked event?
You can just write a 'Return' in the start of ur clicked event based on some instance variable and the code will move to double clicked.
If u have some ancestor code in clicked event, u can over ride it...

Cheers,
Rosh
Avatar of staarship
staarship

ASKER

Code in the clicked event is also required... i cannot set an instance variable also, this is because how will i know in clicked event that actually mouse left button is double-clicked and not just clicked..
You cant bypass the clicked event for exactly the reason that you yourself described: at the scope of the clicked event, you dont have enough information yet to know whether a double clicked even will fire off after the completion of the clicked event you are currently in.  If your users want the functionality of both actions, but the two actions are mutually exclusive, then one of the scrips is going to have to move, to say a button click instead of the double click.  Perhaps if we had a basic idea of what the two scripts did and why they have to be bypassed, we could suggest alternatives?
I have a grid datawindow on the first tabpage of a tab control. Tab control having 2 tabpages.

When i click on a row, In the clicked event, all the other rows below the clicked row open up i.e. initially the height of all the below rows was 0, i have set the height of all the rows to the detail band height.. just to give a drill down functionality similar to a tree view...

When i double click on the row, the control immediately moves to the next tab, showing some other details of the clicked row.

Problem is when i double-click, the drill down functionality of the clicked event is visible on screen first and then the control moves to the next tab..
Perhaps you could put some kind of button, or a check box onto your grid data window, to the far left or right, and only have the drill-down functionality occur when the clicked column equals your button or check box?

dw_grid.clicked event:
if dwo.name = check_box then
  //set detail height of rows below > 0
end if

that way, the rows only open up when the users want them to.  If you double click on the row, as long as the users know not to double click on the button that opens up the rows below, the portion of code in the clicked event will not fire off.
This is not possible as we cannot place a check box on the grid data window. Can you suggest some other solution.
Hi,

@staarship, are u saying placing a checkbox is a functional constraint or, technically not possible??

Technically there is no issue with placing a checkbox on a grid DW.
Please find attached a test Grid DW, import the same (PB 10.5)
Rename the file dw_test.txt to dw_test.srd and import it

Cheers,
Rosh
dw-test.txt
Well, unfortunately if the powers-that-be wont allow you to change anything to make this stuff work, then the answer to your question is simple.  There is no way to make the double click script fire without the clicked script firing as well.
ASKER CERTIFIED SOLUTION
Avatar of sandeep_patel
sandeep_patel
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Only change i made is in the clicked event i wrote Timer(0.2).. It is working...

Thanks...