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 


Mouse over Dialog
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Dec 29, 2002 2:04 pm    Post subject: Reply with quote

Is it just me or is this a bug? The following code doesn't work, with
@dlgtext(). Confused From the help file:

Quote:
This function is used to read the text that appears in dialog window controls (controls are buttons, text and list boxes which may appear in a window). The string <control name> identifies the control that is the target of the function.


Copyright 1995 - 2002 S.A.D.E. s.a.r.l. / All rights are reserved.


Code:
title Mouseover Test
  DIALOG CREATE,Button Mouseover,-1,0,240,160
  DIALOG ADD,BUTTON,BUTTON1,57,51,,,BUTTON1
  DIALOG ADD,STATUS,STAT
  DIALOG SHOW
:timer
%%dlgtext = @dlgtext(BUTTON1)
info %%dlgtext

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Dec 29, 2002 2:17 pm    Post subject: Reply with quote

Doesn't work for me either. But you can use @sendmsg():

Code:

title Mouseover Test
DIALOG CREATE,Button Mouseover,-1,0,240,160
  DIALOG ADD,BUTTON,BUTTON1,5,5,80,20,"BUTTON #1"
  DIALOG ADD,STATUS,STAT
DIALOG SHOW
WAIT

%%text = @sendmsg(@winexists(~BUTTON1),$0D,90,@STRBUF())
INFO %%text

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Dec 29, 2002 7:41 pm    Post subject: Mouseover Elements Reply with quote

It's getting better and better... Wink

Code:
REM ONLY TESTED ON VDS 3.51
OPTION DECIMALSEP,.
  DIALOG CREATE,MOUSEOVER,-1,0,333,251
  DIALOG ADD,BUTTON,BUTTON1,10,8,64,24,BUTTON1
  DIALOG ADD,LIST,LIST1,38,8,314,144
  DIALOG ADD,EDIT,EDIT1,10,76,246,19,EDIT1
  DIALOG ADD,PROGRESS,PROGRESS1,186,8,314,24
  DIALOG ADD,CHECK,CHECK1,214,10,64,18,CHECK1
  DIALOG ADD,STATUS,STATUS1,STATUS1
  DIALOG SHOW
rem       TITLEBAR | DIALOG ELEMENTS TO CHECK
%%Mouseover = "TRUE|BUTTON1|LIST1|EDIT1|PROGRESS1|CHECK1|STATUS1"
rem If there is a title bar, use TRUE, otherwise FALSE...
gosub Mouseover Start


:Evloop
wait event,0.1
goto @event()

:Timer
gosub Mouseover Check
goto %%event


:BUTTON1MOUSEOVER
:LIST1MOUSEOVER
:EDIT1MOUSEOVER
:PROGRESS1MOUSEOVER
:CHECK1MOUSEOVER
:STATUS1MOUSEOVER
dialog set,status1,MOUSEOVER: %%Mouseover (%%event)
goto evloop

:MOUSEOUT
dialog set,status1,MOUSEOUT: Last mouseover: %%Lastmouseover
goto evloop

:BUTTON1BUTTON
info You pressed the button!
goto evloop

:Close
exit



rem Include this in all your scripts...
rem -----------------------------------



:Mouseover Start
list create,9
parse "%%Title",%%mouseover
%%Mouseover = @strdel(%%mouseover,1,@pos(|,%%mouseover))
if @equal(%%title,true)
  %%title = 20
  else
  %%title = 0
  end
repeat
list add,9,@substr(%%Mouseover,1,@pred(@pos(|,%%Mouseover)))
%%Mouseover = @strdel(%%mouseover,1,@pos(|,%%mouseover))
until @equal(@pos(|,%%Mouseover),0)
list add,9,%%mouseover
%z = 0
repeat
list put,9,@item(9,%z)|@dlgpos(@item(9,%z),L)|@fadd(@dlgpos(@item(9,%z),T),%%title)|@dlgpos(@item(9,%z),W)|@dlgpos(@item(9,%z),H)
%z = @succ(%z)
until @equal(%z,@count(9))
exit

:Mouseover Check
%z = 0
%%mousex = @mousepos(x)
%%mousey = @mousepos(y)
%%mouseover =
repeat
parse "%%elementn;%%elementl;%%elementt;%%elementw;%%elementh",@item(9,%z)
%%elementl = @fadd(%%elementl,@dlgpos(,L))
%%elementt = @fadd(%%elementt,@dlgpos(,T))
%%elementw = @fadd(%%elementw,%%elementl)
%%elementh = @fadd(%%elementh,%%elementt)
if @both(@greater(%%mousey,%%elementt),@greater(%%elementh,%%mousey))
  if @both(@greater(%%mousex,%%elementl),@greater(%%elementw,%%mousex))
    if @not(@equal(%%mouseover,%%elementn))
      %%Mouseover = %%elementn
     %%Lastmouseover = %%Mouseover
      %%event = %%mouseover"MOUSEOVER"
     %%firsttime = true
     end
    end
  end
%z = @succ(%z)
until @equal(%z,@count(9))
if @both(@equal(%%mouseover,),@equal(%%firsttime,true))
  %%firsttime = false
  %%event = MOUSEOUT
  end
if @equal(%%event,)
  %%event = EVLOOP
  end
exit
Back to top
View user's profile Send private message
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Mon Dec 30, 2002 12:20 am    Post subject: Reply with quote

You right Skit, it is. Cool

Code:

OPTION DECIMALSEP,.
  DIALOG CREATE,MOUSEOVER,-1,0,333,251
  DIALOG ADD,BUTTON,BUTTON1,10,8,64,24,BUTTON1
  DIALOG ADD,LIST,LIST1,38,8,314,144
  DIALOG ADD,EDIT,EDIT1,10,76,246,19,EDIT1
  DIALOG ADD,PROGRESS,PROGRESS1,186,8,314,24
  DIALOG ADD,CHECK,CHECK1,214,10,64,18,CHECK1
  DIALOG ADD,STATUS,STATUS1,STATUS1
  DIALOG SHOW
  %%Mouseover = BUTTON1|LIST1|EDIT1|PROGRESS1|CHECK1|STATUS1
gosub mouseover start
 
:evloop
wait event,0.1
goto @event()

:timer
gosub Mouseover Check
goto %%event

:button1button
info You pressed the button.  Way to go.
goto evloop

:close
exit

:BUTTON1MOUSEOVER
:LIST1MOUSEOVER
:EDIT1MOUSEOVER
:PROGRESS1MOUSEOVER
:CHECK1MOUSEOVER
:STATUS1MOUSEOVER
dialog set,status1,MOUSEOVER: %%Mouseover (%%event)
goto evloop

:MOUSEOUT
dialog set,status1,MOUSEOUT: Last mouseover: %%Lastmouseover
goto evloop


rem----------------Include in all code------------------------------------

:mouseover start
list create,9
repeat
parse "%a;%b",%%mouseover
%%remainder = @substr(%%mouseover,@sum(@len(%a),2),@len(%%mouseover))
if @null(%a)
else
list add,9,%a|@winexists(@win(~%a))
%%mouseover = %%remainder
end
until @null(%a)
exit

:mouseover check
list seek,9,0
:mouseloop
parse "%a;%b",@item(9)
%%check = @winatpoint(@mousepos(X),@mousepos(Y))
if @equal(%%check,%b)
%%event = %amouseover
%%mouseover = %a
goto mousedone
end
if @equal(@pred(@count(9)),@index(9))
if @null(%%mouseover)
else
%%lastmouseover = %%mouseover
%%mouseover = ""
end
goto mousedone
else
list seek,9,@succ(@index(9))
goto mouseloop
end
:mousedone
if @null(%%mouseover)
%%event = mouseout
else
end
exit


NodNarb
Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Mon Dec 30, 2002 4:08 am    Post subject: Reply with quote

Ok, so better becomes a matter of opinion. I benchmarked my example against Skits....out of 600 points possible Skits scored a 596 and mine scored a 594. My code is easier to understand (in my opinion) and is a little bit smaller, and does not require a boolean parameter for the title bar.

You'll have to decide for yourself which one is better Wink

NodNarb

PS I also created a non-modular version which only scored a 595 on the benchmark.

PSS If someone could optimize my code to win out...it would be much appreciated LOL
Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Mon Dec 30, 2002 4:22 am    Post subject: Reply with quote

Winds up those benchmarks where on mouseout only!

When you benchmark while mouseovering list1 results are as follows:

(Out of 600)
NodNarb Modular: 586
Skit Modular: 582
NodNarb Non-Modular: 582

Still a matter of opinion though Wink

NodNarb
Back to top
View user's profile Send private message AIM Address
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 737
Location: The Netherlands

PostPosted: Mon Dec 30, 2002 4:28 am    Post subject: Reply with quote

NodNarb,

Despite of your feelings you expressed about VDS in our previous discussion I'll just say it
again: if you are seriously concerned about these numbers you should use something other
than VDS, probably preferably assembler language.

Just to reassure: you are free to post whatever you like, I'm just posting my opinion about
it.

Tommy
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 641
Location: Evansville, IN

PostPosted: Mon Dec 30, 2002 4:51 am    Post subject: Reply with quote

Yeah I know this is just a very basic (most likely very incorrect) benchmark.

Project Managers spend quite a bit of time and money on actually comparing applications before a big purchase or deciding on which solution is "better".

I agree with you on this Tommy; VDS is powerful, especially for GUI design, but as far as benchmarking is concerned it is completely inappropriate.

However, for fun here's what I did.

Part 1 of NodNarb's Bogus Benchmark

Add this after -> wait event,0.1 <- on each mouseover code
Code:

%%benchcount = @succ(%%benchcount)
dialog set,edit1,%%benchcount


Part 2 of NodNarb's Bugus Benchmark

Here's the exe code I used, must be compiled and the VDS Window countaining the mouseover you want to bechmark must be the last active window before clicking on the exe file.

For mouseover of List1
Code:

window send,visual dialogscript,@key(f9)
window click,mouseover,100,100
wait 60
window send,visual dialogscript,@ctrl(@key(f2))


For mouseout
Code:

window send,visual dialogscript,@key(f9)
wait 60
window send,visual dialogscript,@ctrl(@key(f2))


My fault for adding the post "A Better MouseOver" to begin with, as "Better" is an extremely subjective word.

NodNarb
Back to top
View user's profile Send private message AIM Address
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Dec 30, 2002 6:52 am    Post subject: Reply with quote

LOL, I think someone has too much free time... Razz Laughing

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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