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..
Editors IDEsProgramming

Avatar of undefined
Last Comment
staarship

8/22/2022 - Mon
diasroshan

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
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..
BHDGroup

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?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
staarship

ASKER
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..
BHDGroup

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.
staarship

ASKER
This is not possible as we cannot place a check box on the grid data window. Can you suggest some other solution.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
diasroshan

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
BHDGroup

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
sandeep_patel

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
staarship

ASKER
Only change i made is in the clicked event i wrote Timer(0.2).. It is working...

Thanks...
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23