View previous topic :: View next topic |
Author |
Message |
trapper Contributor
Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Wed Feb 02, 2005 9:01 pm Post subject: @MOUSEDOWN Problem in Tables |
|
|
I've found that @mousedown() is not being cleared after I click on an item in Tables.
Code: | DIALOG CREATE,Mousedown Test in Table,-1,0,461,289
DIALOG ADD,TABLE,TABLE1,11,6,342,269,Column 1[80]|Column 2[80]|Column 3[80],CLICK
DIALOG ADD,SHAPE,SHAPE1,17,387,50,50,YELLOW,BLACK,,CIRCLE
DIALOG SHOW
# Initially hide shape1
DIALOG HIDE, SHAPE1
LIST ADD, TABLE1, Here@tab()is some@tab()text
LIST ADD, TABLE1, Here@tab()is some@tab()text
LIST ADD, TABLE1, Here@tab()is some@tab()text
LIST ADD, TABLE1, Here@tab()is some@tab()text
LIST ADD, TABLE1, Here@tab()is some@tab()text
LIST ADD, TABLE1, Here@tab()is some@tab()text
:Evloop
wait event,0.1
goto @event()
:Timer
if @mousedown(L)
DIALOG SHOW, SHAPE1
else
DIALOG HIDE, SHAPE1
end
goto Evloop
|
If you click, or click and drag, anywhere on the dialog the yellow shape shows. It shows while the left mouse button is down.
Now click on an item in column 1 of the Table... the yellow shape shows but doesn't disappear once the left mousebutton is up. It actually requires another click away from an item to clear @mousedown().
Edit: A doubleclick works ok, but not a single click
Does anyone know of a way to clear @mousedown after clicking on an item in the table? (Generating another mouseclick away from the item works, but is not viable because of the wierd feedback it gives to the user.)
Regards. _________________ John Trappett |
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Feb 03, 2005 9:09 am Post subject: |
|
|
I think the problem is that @mousedown() doesn't actually return whether the mouse is down, it just returns which button was last clicked. You probably need to use some API to check the actual current state of the mouse button. _________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
trapper Contributor
Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Thu Feb 03, 2005 8:01 pm Post subject: |
|
|
Jules,
Thanks for that. Can you assist with the API check? ... or anyone?
Regards.
EDIT: I did a search and found some code by SnarlingSheep which helped. The following now seems to work as I want:
Code: | LOADLIB user32.dll
DIALOG CREATE,Mousedown Test in Table,-1,0,461,289
DIALOG ADD,TABLE,TABLE1,11,6,342,269,Column 1[80]|Column 2[80]|Column 3[80],CLICK
DIALOG ADD,SHAPE,SHAPE1,17,387,50,50,YELLOW,BLACK,,CIRCLE
DIALOG SHOW
# Initially hide shape1
DIALOG HIDE, SHAPE1
LIST ADD, TABLE1, Here@tab()is some@tab()text
LIST ADD, TABLE1, Here@tab()is some@tab()text
LIST ADD, TABLE1, Here@tab()is some@tab()text
LIST ADD, TABLE1, Here@tab()is some@tab()text
LIST ADD, TABLE1, Here@tab()is some@tab()text
LIST ADD, TABLE1, Here@tab()is some@tab()text
:Evloop
wait event,0.01
goto @event()
:Close
FREELIB user32.dll
exit
:Timer
if @unequal(@LIB(user32,GetAsyncKeyState,INT:,$01),0)
DIALOG SHOW, SHAPE1
else
DIALOG HIDE, SHAPE1
end
goto Evloop
|
_________________ John Trappett |
|
Back to top |
|
|
trapper Contributor
Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Thu Feb 03, 2005 8:49 pm Post subject: |
|
|
Hmmm.. the only problem now is that it doesn't work in the main application I want it for.
I load User32.DLL and use this exact same line in the test:
Code: | if @unequal(@LIB(user32,GetAsyncKeyState,INT:,$01),0) |
.. but I get a dialog box Error: Operation Invalid at that line.
Any ideas?
Regards. _________________ John Trappett |
|
Back to top |
|
|
trapper Contributor
Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Thu Feb 03, 2005 9:09 pm Post subject: |
|
|
Found the problem...
I also use CodeScript's VDS Table Control API to turn off the headers in one of my tables...
Code: | TBLCTRL Noheaders,~FAVES |
If I comment out that line the call to User32 works perfectly... when the TBLCTRL line is left in I get the error.
I'll email CodeScript so that he is aware of it.
Regards. _________________ John Trappett |
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Fri Feb 04, 2005 9:48 am Post subject: |
|
|
Perhaps TBLCTRL is unloading user32? In which case, you just need to load it again right before using it. _________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
trapper Contributor
Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Sun Feb 06, 2005 1:26 am Post subject: |
|
|
Spot on Jules! That was it exactly.
Thanks for the help.
Regards. _________________ John Trappett |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|