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 


[Open Source]: Windows Shell
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript Open Source Projects
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Aug 30, 2002 7:20 pm    Post subject: Reply with quote

Yes, looks like a good start, however I don't really know how to do that kind of stuff either.
_________________
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: Fri Aug 30, 2002 7:29 pm    Post subject: Reply with quote

Hey skit, Smile

Use the @both() function to combine two statements:

if @both(@equal(%1, %2), @equal(%3, %4))

And you can use @both(@both(), @both()) etc. for multiple checking.

BTW, I had just started about 5-10 minutes ago writing
basically the same thing you did for a mouseover... 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
Skit3000
Admin Team


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

PostPosted: Fri Aug 30, 2002 7:34 pm    Post subject: Reply with quote

Well, thanks Mac (and Protected who said it just a minute before you on MSN). I will update it, and I will use the @dlgpos() function...
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


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

PostPosted: Fri Aug 30, 2002 7:48 pm    Post subject: Reply with quote

Here's what I wound up with (I didn't add
a black border around the tooltip though).
__________________________________________________________________________________________________________________________
Code:

%%width = @sysinfo(SCREENWIDTH)
%%height = @sysinfo(SCREENHEIGHT)
%%barheight = @div(@sysinfo(SCREENHEIGHT), 16)
OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE VDS-indows
DIALOG CREATE,"Task Bar",@diff(%%height, %%barheight),0,%%width,%%barheight,NOTITLE,ONTOP
  DIALOG ADD,STYLE,Light,,,,$00EEEEEE
  DIALOG ADD,STYLE,S1,MS Sans Serif,8
  DIALOG ADD,STYLE,S2,MS Sans Serif,8,B

  DIALOG ADD,TEXT,Line1,0,0,%%width,2,,,Light
  DIALOG ADD,GROUP,Tray,4,@diff(%%width,150),146,@diff(%%barheight, 6)
  DIALOG ADD,TEXT,TrayBack,5,@diff(%%width,149),144,@diff(%%barheight, 8)

  DIALOG ADD,BUTTON,Start,4,2,56,@diff(%%barheight, 6),@chr(167)" Start",,S2
  DIALOG ADD,TEXT,Time,@diff(@div(%%barheight, 2),6),@diff(%%width, 54),,,@datetime(t),,S1

  rem -- Fake icons --
    DIALOG ADD,STYLE,F1,Wingdings,16,,B,DKBLUE
    DIALOG ADD,STYLE,F2,Wingdings,16,,B,YELLOW
    DIALOG ADD,STYLE,F3,Wingdings,16,,B,DKRED
    DIALOG ADD,STYLE,F4,Wingdings,16,,B,BLACK
    DIALOG ADD,TEXT,Fake1,@diff(@div(%%barheight, 2),10),@diff(%%width,149),20,20,@chr(58),,F1
    DIALOG ADD,TEXT,Fake2,@diff(@div(%%barheight, 2),10),@diff(%%width,129),20,20,@chr(60),,F2
    DIALOG ADD,TEXT,Fake3,@diff(@div(%%barheight, 2),10),@diff(%%width,109),20,20,@chr(88),,F3
    DIALOG ADD,TEXT,Fake4,@diff(@div(%%barheight, 2),10),@diff(%%width,92),30,20,@chr(44),,F4
DIALOG SHOW

:EVLOOP
  REPEAT
    WAIT ".01"
    DIALOG SET, Time, @datetime(t)
    GOSUB CheckMouseoverTime
    %e = @event()
  UNTIL %e
  goto %e

:StartBUTTON
  DIALOG POPUP,Run...|Shut Down,,56
  goto EVLOOP

:Run...MENU
  %i = @input(Run:)
  if %i
     RUN @chr(34)%i@chr(34)
  end
  goto EVLOOP

:Shut DownMENU
:CLOSE
  EXIT

rem ------------------- SUB -------------------

:CheckMouseoverTime
  if @both(@greater(@mousepos(X), @diff(%%width, 54)), @greater(@diff(%%width, 4), @mousepos(X)))
     if @both(@greater(@mousepos(Y), @sum(@diff(%%height, %%barheight),4)), @greater(@diff(%%height, 4), @mousepos(Y)))
        DIALOG CREATE,Mouseover,@diff(%%height, %%barheight),@diff(%%width, 120),120,15,NOTITLE,ONTOP
          DIALOG ADD,Style,MoS1,MS Sans Serif,8,C,$00CCFFFF,BLACK
          DIALOG ADD,TEXT,MoT1,0,0,120,15,@datetime(DDDDDD),,MoS1
        DIALOG SHOW
        REPEAT
          WAIT ".01"
        UNTIL @greater(@diff(%%width, 54), @mouse(X))@greater(@diff(%%height, %%barheight), @mouse(Y))
        DIALOG CLOSE
        %e = @event()
        %e = ""
        WINDOW ACTIVATE, "Task Bar"
     end
  end
  exit

EDIT - Added line to make sure VDS Task Bar is reactivated
after tooltip.

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


Last edited by Mac on Fri Aug 30, 2002 8:15 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Aug 30, 2002 7:50 pm    Post subject: Reply with quote

Skit3000 wrote:
Quote:
It will show ALL running programs + some programs without a name....
I've tried before to make my own shell, but it never worked proper...


Here's something I tried but didn't work...
Code:
list create,1
  list winlist,1,N
  info @count(1)
  %%index = 0
  repeat
  %%item = @item(1,%%index)
  if %%item
  list delete,1,%%item
  end
  wait .1
  %%index = @succ(%%index)
  if @equal(%%index,212)
  warn @text(1)
  end
  until @equal(%%index,@count(1))
  info @text(1)

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


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

PostPosted: Fri Aug 30, 2002 7:56 pm    Post subject: Reply with quote

Well Mac, your way is a lot better (and complexer) then mine.
But still, I can't get it to work to use @both(). If I do that the pop-up will always show if I'm with the mouse on the Taskbar...
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Aug 30, 2002 8:03 pm    Post subject: Reply with quote

On Windows XP Home edition, in the tooltip gosub you should add window activate,Task Bar after closing the dialog because otherwise the Windows taskbar goes over the VDS taskbar...
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


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

PostPosted: Fri Aug 30, 2002 8:07 pm    Post subject: Reply with quote

Hi all.
I've made something that adds the opened programs to the taskbar.
The only problem is that the opened programs are hard to get (I ain't get it to work). It is also a little slow because it must be 'repainted' every time something changes...

I also added a Startmenu which usses a list in this format:

Programs|map|Notepad|run:notepad.exe
Shutdown|script|exit

You must parse it in %1 & %2, so you can see that Programs is a map.
Then parse the second 2 parameters, so you can see Notepad is a link (run:) to notepad.exe
After Shutdown is script, which means that the :Exit must be started...

Code:

%%taskbarheight = 26
rem must use %%firsttime = true, otherwise the taskbar wouldn't be loaded
%%firsttime = true
list create,7
option decimalsep,.
  DIALOG CREATE,Task Bar,@diff(@sysinfo(SCREENHEIGHT),%%taskbarheight),0,@sysinfo(SCREENWIDTH),%%taskbarheight,NOTITLE,ONTOP
rem  DIALOG CREATE,Task Bar,100,0,500,26,NOTITLE,ONTOP
  DIALOG ADD,GROUP,GROUP1,0,0,1500,500
  DIALOG ADD,BUTTON,Start,4,6,64,@diff(%%taskbarheight,6),--= Start =--
  DIALOG ADD,GROUP,TIMEGROUP,3,@diff(@sysinfo(SCREENWIDTH),57),55,@diff(%%taskbarheight,4)
  DIALOG ADD,TEXT,TIMETEXT,7,@diff(@sysinfo(SCREENWIDTH),50),45,15,@datetime(hh:nn:ss),HAND,CLICK
  DIALOG SHOW

:Evloop
wait event,1
%%event = @event(D)
parse "%%event;%%dialogid",%%event
if @equal(%%event,@datetime(dddd d mmmm yyyy)MENU)
  goto evloop
  end
if @equal(@substr(%%event,1,4),OPEN)
  rem You can't make any buttons or events that start with 'open'
  %%windownumber = @strdel(%%event,1,4)
  wait 2
  %%windownumber = @strdel(%%windownumber,@diff(@len(%%event),9),@len(%%event))
  %%sdfsdf = @item(7,%%windownumber)
  window activate,@item(7,%%windownumber)
  goto evloop
  end
 
goto %%event

:Timer
dialog set,Timetext,@datetime(hh:nn:ss)
  %%minheight = 1
  list create,9
  list create,8
  list winlist,9,N
  %z = 0

rem --- Doesn't work proper...
  repeat
    if @greater(@winpos(@item(9,%z),H),%%minheight)
      if @both(@greater(@winpos(@item(9,%z),S),0),@greater(4,@winpos(@item(9,%z),S)))
        list add,8,@item(9,%z)
      end
    end
    %z = @succ(%z)
  until @equal(%z,@count(9))
  list close,9
rem --- List 8 must have all the opened programs in it...


if @not(@equal(@count(7),@count(8)))
  if @not(@equal(%%firsttime,true))
    %%openedprograms = 1
    repeat
    dialog remove,open%%openedprograms
    %%openedprograms = @succ(%%openedprograms)
    until @equal(@count(7),%%openedprograms)
   %%firsttime = false
    end
   
  %%firsttime = true
  %%openedprograms = @count(8)
  %%openedprogramswidth = @div(@diff(@sysinfo(SCREENWIDTH),150),%%openedprograms)
  repeat
  dialog add,button,open%%openedprograms,4,@fadd(50,@prod(%%openedprogramswidth,%%openedprograms)),%%openedprogramswidth,@diff(%%taskbarheight,6),@item(8,%%openedprograms)
  %%openedprograms = @pred(%%openedprograms)
  until @equal(%%openedprograms,0)
  list assign,7,8
  end
  list close,8
goto evloop

:StartBUTTON
  DIALOG CREATE,Start menu,@diff(@diff(@sysinfo(SCREENHEIGHT),%%taskbarheight),309),5,201,313,NOTITLE,ONTOP
  DIALOG ADD,GROUP,Startmenugroup1,0,0,201,313
  DIALOG ADD,STYLE,Startmenustyle1,Courier New,12,B,BACKGROUND,FOREGROUND
  DIALOG ADD,LIST,Startmenulist,24,10,180,278,CLICK
  DIALOG ADD,TEXT,TEXT1,8,10,,,Startmenu,STARTMENUSTYLE1
  DIALOG SHOW
 
list create,9
list loadtext,9
"Programs|map|Notepad|run:notepad.exe
"Programs|map|Paint  |run:mspaint.exe
"Programs|map|VDS    |map|Visual dialog script|run:vds.exe
"Run     |script|run
"Shutdown|script|shutdown
%z = 0
option fieldsep,|
repeat
parse "%1",@item(9,%z)
if @not(@match(Startmenulist,%1))
  list add,Startmenulist,%1
  end
%z = @succ(%z)
until @equal(%z,@count(9)) 
list close,9

:Startmenuloop
wait event
%%event = @event(D)
parse "%%event;%%dialogid",%%event

if @not(@equal(%%event,STARTMENULIST))
  dialog close
  goto evloop
  end

goto startmenuloop


:TimetextCLICK
dialog popup,@datetime(dddd d mmmm yyyy),@mousepos(x),@mousepos(y)
goto evloop

:Close
if @not(@equal(%%dialogid),0)
  goto evloop
  end
exit
Back to top
View user's profile Send private message
noveltech
Contributor
Contributor


Joined: 16 Sep 2002
Posts: 105

PostPosted: Wed Sep 18, 2002 5:11 pm    Post subject: Taskbar location at top of screen instead of bottom Reply with quote

Could someone provide solution for Garrett's Auto Hide Taskbar Example {Above} to place taskbar at top of screen instead of bottom?

Thank you. Mike
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2146
Location: A House

PostPosted: Wed Sep 18, 2002 6:53 pm    Post subject: Reply with quote

Now on the top of the screen.

Code:
  option ErrorTrap,ErrorBranch
  option Decimalsep,.
  option Fieldsep,|
  option Scale,96
  option Sleeptime,100
  title VDS-indows
  %%programname = VDS-indows
  window HIDE,Program Manager
  dialog CREATE,VDS-indows,0,0,@sysinfo(SCREENWIDTH),32,NOTITLE,ONTOP
  dialog ADD,STYLE,CENETERED,,,C,,
  dialog ADD,BUTTON,BACK,-2,-2,@sum(@sysinfo(SCREENWIDTH),4),34," ",
  dialog ADD,BUTTON,start,4,6,64,24,Start
  dialog ADD,GROUP,GROUP1,2,@diff(@sysinfo(SCREENWIDTH),93),90,26
  dialog ADD,TEXT,TIMEBACK,3,@diff(@sysinfo(SCREENWIDTH),92),88,24
  dialog ADD,TEXT,TIME,9,@diff(@sysinfo(SCREENWIDTH),89),84,11,@datetime(t),@datetime(dddddd),CENETERED
  dialog SHOW
  dialog DISABLE,BACK
  %%status = 1

:Evloop
  wait event,0
  %e = @event()
  goto %E

:Timer
  if @not(@equal(@dlgtext(time),@datetime(t)))
    dialog set,time,@datetime(t)
  end
  if @equal(%%Status,0)
    parse "%X;%Y",@mousepos()
    if @not(@greater(%Y,5))
      %%null = 2
      repeat
        window Position,VDS-indows,0,0,@sysinfo(SCREENWIDTH),%%Null
        %%null = @succ(%%Null)
      until @equal(%%Null,33)
      %%status = 1
      %%visibletimer = 0
    end
    goto evloop
  end
  if @equal(%%Status,1)
    parse "%X;%Y",@mousepos()
    if @greater(%Y,32)
      %%visibletimer = @succ(%%VisibleTimer)
      if @greater(%%VisibleTimer,10)
        %%null = 32
        repeat
          window Position,VDS-indows,0,0,@sysinfo(SCREENWIDTH),%%Null
          %%null = @fsub(%%Null,1)
        until @equal(%%Null,1)
        %%status = 0
      end
      goto evloop
    end

    goto evloop

:startBUTTON
    dialog POPUP,Run...|Shut Down,30,24
    goto evloop

:run...menu
    %%run = @input(Run:)
    if @ok()
      run @chr(34)%%run@chr(34)
    end
    goto evloop

:shut downmenu
    if @ask(Do you want to exit this script?)
      rem warn You can also shut down the computer by changing this code...
      goto Close
    end
    goto evloop

:Close
    window NORMAL,Program Manager
    exit

:ErrorBranch
    window NORMAL,Program Manager
    %%null = @msgbox("An error has occured with the "@chr(34)%%ProgramName@chr(34)@cr()"program. You may wish to write down the following"@cr()"information and report this to author of the program:"@cr()@cr()"Error Code:"@tab()@error(E)@cr()"Line Number:"@tab()@error(N)@cr()"Event Status:"@tab()%E@cr()@cr()"Please report the error information to:"@cr()@tab()"??????",Program Error,$010)
    stop
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 -> Visual DialogScript Open Source Projects 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