| View previous topic :: View next topic |
| Author |
Message |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Mon Feb 24, 2003 1:41 am Post subject: How can I change the statusbar text with mouse over? |
|
|
I wanna create a mouse over status bar change.
When I move the mouse over a button, or some other objects, I want the text in the statusbar displayed. Different text for each object.
How can I do this? _________________
 |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Feb 24, 2003 2:58 am Post subject: |
|
|
| Code: |
TITLE MouseOver
option decimalsep,"."
dialog create,MouseOver,-1,0,200,100
dialog add,BUTTON,Hello,5,5,65,25,Hello
dialog add,Status,Stat
dialog show
:Evloop
wait 0.1,event
goto @event()
:Timer
%%wintext = @wintext(@winatpoint(@mousepos(x),@mousepos(y)))
if @equal(%%wintext,Hello)
dialog set,Stat,Cursor over HelloBUTTON
else
dialog set,Stat,
end
goto Evloop
:HelloBUTTON
goto Evloop
:CLOSE
exit
|
Maybe this'll help give ya some basic ideas.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1754 Location: Space and Time
|
Posted: Mon Feb 24, 2003 2:58 am Post subject: |
|
|
How's about this:
| Code: |
DIALOG CREATE,Status Mouseover,-1,0,254,300
REM *** Modified by Dialog Designer on 2/23/2003 - 21:52 ***
DIALOG ADD,BUTTON,BUTTON1,24,32,64,24,BUTTON1
DIALOG ADD,BUTTON,BUTTON2,24,122,64,24,BUTTON2
DIALOG ADD,LIST,LIST1,74,30,180,132
DIALOG ADD,STATUS,STATUS1
DIALOG SHOW
rem Place here all the dialog elements which you want to check for
rem Mouseover events like this:
rem BUTTON1|EDIT1
%%mouseover = button1|button2|list1
Rem Set this variable to 1 if there is a title on your dialog.
rem If there is a Mouseover event, the name will be elementnameMOUSEOVER there will be
rem an elementnameMOUSEOUT when the cursor is moved off.
gosub Mouseover Start
:EVLOOP
wait event,0
%e = @event()
goto %e
:TIMER
gosub Mouseover Check
goto %%event
:Button1Mouseover
dialog set,status1,Over Button1
goto evloop
:Button1mouseout
dialog set,status1
goto evloop
:Button2Mouseover
dialog set,status1,Over Button2
goto evloop
:Button2mouseout
dialog set,status1
goto evloop
:list1Mouseover
dialog set,status1,Over List1
goto evloop
:list1mouseout
dialog set,status1
goto evloop
:CLOSE
stop
:mouseover start
if @null(%%mouseovercreate)
dialog add,list,mouseover,0,0,0,0
list add,mouseover,
%%mouseovercreate = true
end
repeat
parse "%a;%b",%%mouseover
%%remainder = @substr(%%mouseover,@sum(@len(%a),2),@len(%%mouseover))
if %a
list add,mouseover,%a
%%mouseover = %%remainder
end
until @null(%a)
exit
:Mouseover Check
if @greater(@count(mouseover),0)
%%xyz = 0
%%event =
repeat
%%item = @item(mouseover,%%xyz)
if @equal(%%DlgTitle,NOTITLE)
%y = @mousepos(y)
%x = @mousepos(x)
else
%y = @diff(@mousepos(y),22)
%x = @diff(@mousepos(x),3)
end
if @equal(1111,@greater(%x,@sum(@dlgpos(%%item,l),@dlgpos(,l)))@greater(@sum(@sum(@dlgpos(%%item,l),@dlgpos(%%item,w)),@dlgpos(,l)),%x)@greater(%y,@sum(@dlgpos(%%item,t),@dlgpos(,t)))@greater(@sum(@sum(@dlgpos(%%item,t),@dlgpos(%%item,h)),@dlgpos(,t)),%y))
if @both(@not(@equal(%%item,%%lastmouseover)),%%lastmouseover)
else
%%event = %%item"MOUSEOVER"
%%lastmouseover = %%item
end
end
%%xyz = @succ(%%xyz)
until @equal(%%xyz,@count(mouseover))
if @null(%%event)
if %%Lastmouseover
%%event = %%Lastmouseover"MOUSEOUT"
%%lastmouseover =
else
%%event = EVLOOP
end
end
end
exit
|
Hope this helps!  _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1754 Location: Space and Time
|
Posted: Mon Feb 24, 2003 2:59 am Post subject: |
|
|
Sorry Bill, you got to it before me!  _________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Mon Feb 24, 2003 3:01 am Post subject: |
|
|
I was hoping someone else hadn't beat me to it.  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Mon Feb 24, 2003 6:14 am Post subject: |
|
|
Thanks alot guys  _________________
 |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Mon Feb 24, 2003 8:52 am Post subject: |
|
|
Thanks guys.
I was actually hoping for an easier way to do this.
Maybe something like a style thing or something.
Maybe this could be a request on the new version of VDS?  _________________
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Feb 24, 2003 10:22 am Post subject: |
|
|
@wintext() doesn't work for all controls, but it's simple and
works for buttons.
This gets control text from any program the mouse is over,
so you'd hafta add code to limit it to your program window.
__________________________________________________________________________________________________________________________
| Code: |
OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
DIALOG CREATE,"Test Program",-1,0,200,50
DIALOG ADD,BUTTON,B1,5,5,60,22,"Button 1"
DIALOG ADD,BUTTON,B2,5,70,60,22,"Button 2"
DIALOG ADD,BUTTON,B3,5,135,60,22,"Button 3"
DIALOG ADD,STATUS,Stat
DIALOG SHOW
:B1BUTTON
:B2BUTTON
:B3BUTTON
:EVLOOP
REPEAT
WAIT ".01"
DIALOG SET, Stat, @wintext(@winatpoint(@mousepos(X),@mousepos(Y)))
%e = @event()
UNTIL %e
goto %e
:CLOSE
EXIT
|
Cheers, Mac  _________________ 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 |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Mon Feb 24, 2003 10:31 am Post subject: |
|
|
When I move the mouse out of the window I can see the code in the statusbar. Weird
Nice to see that you always remember the decimalsep option  _________________
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Feb 24, 2003 10:41 am Post subject: |
|
|
LOL, yeah - it's reading from the EDIT box in the VDS IDE.
@wintext() reads text from most controls, but not from TEXT
elements and a few others.
Cheers, Mac  _________________ 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 |
|
 |
GeoTrail Valued Contributor


Joined: 18 Feb 2003 Posts: 572 Location: Bergen, Norway
|
Posted: Mon Feb 24, 2003 10:47 am Post subject: |
|
|
Hmmm just got an idea.
Could that be used to retrieve the program source?
I mean, if I lost the original code, and I added a hidden code which would popup a dialog or something and I entered a secret text, could I then use the BIN command to write to entire code in a text file?
He he he probably a weird question
But hey, I got lots of those  _________________
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Feb 24, 2003 10:54 am Post subject: |
|
|
Well... ya could add a var containing the source code and retrieve
it that way, but the script that's in the EXE is seriously encrypted.
Cheers, Mac  _________________ 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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Mon Feb 24, 2003 10:57 am Post subject: |
|
|
| I don't know if I may tell this, but... [EDITED By Mac] |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Mon Feb 24, 2003 11:00 am Post subject: |
|
|
We prolly shouldn't go there Skit...  _________________ 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 |
|
 |
|
|
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
|
|