forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


@MOUSEDOWN Problem in Tables

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Wed Feb 02, 2005 9:01 pm    Post subject: @MOUSEDOWN Problem in Tables Reply with quote

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
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Thu Feb 03, 2005 9:09 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Thu Feb 03, 2005 8:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Thu Feb 03, 2005 8:49 pm    Post subject: Reply with quote

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

Any ideas?

Regards.

_________________
John Trappett
Back to top
View user's profile Send private message
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Thu Feb 03, 2005 9:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Fri Feb 04, 2005 9:48 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Sun Feb 06, 2005 1:26 am    Post subject: Reply with quote

Spot on Jules! That was it exactly. Very Happy

Thanks for the help.

Regards.

_________________
John Trappett
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group