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 


NOTITLE Imitation Windows Dialog

 
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: Fri Aug 09, 2002 1:57 pm    Post subject: NOTITLE Imitation Windows Dialog Reply with quote

This example is the same as the one Mac posted in the VDS 3 Source Code, except I have altered it to use the @mousedown() function to automatically release the window when dragging it...:

Code:
rem -- NOTITLE window with fake title bar, minimizes to systray.
rem -- Has fake icon, but you can load icons with a BITMAP element.

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE By Mac
DIALOG CREATE,"Fake Title Bar",-1,0,400,300,NOTITLE
  DIALOG ADD,STYLE,Border1,,,,WHITE
  DIALOG ADD,STYLE,Border2,,,,$00665555
  DIALOG ADD,STYLE,Style0,MS Sans Serif,8,B,DKBLUE,WHITE
  DIALOG ADD,STYLE,Style1,Impact,12,B
  DIALOG ADD,STYLE,Style2,Wingdings,10
  DIALOG ADD,STYLE,Style3,MS Serif,14
  DIALOG ADD,STYLE,Style4,MS Sans Serif,8,B,BACKGRND
  DIALOG ADD,STYLE,Style5,,,,DKBLUE,WHITE
  DIALOG ADD,STYLE,Style6,Wingdings,14,,,CYAN

  rem -- Add bottom and right first --
  DIALOG ADD,TEXT,Bottom,298,1,398,2,,,Border2
  DIALOG ADD,TEXT,Right,1,398,2,298,,,Border2
  DIALOG ADD,TEXT,Top,1,1,398,1,,,Border1
  DIALOG ADD,TEXT,Left,1,1,1,298,,,Border1

  rem -- Add SysBars first --
  DIALOG ADD,TEXT,SysBar,4,4,340,18,,,,Style0,CLICK
  DIALOG ADD,TEXT,SysBar2,4,340,56,18,,,,Style0
  DIALOG ADD,TEXT,SysTitle,6,28,,,"Fake Title Bar - Minimizes to System Tray",,,Style0,CLICK,TRANSPARENT
  DIALOG ADD,TEXT,SysIcon,3,6,,,@chr(58),,Style6,CLICK,TRANSPARENT

  rem -- Titlebar buttons --
  DIALOG ADD,BUTTON,SysMin,6,344,16,14,"-",,Style1
  DIALOG ADD,BUTTON,SysMax,6,360,16,14,@chr(114),,Style2
  DIALOG DISABLE,SysMax
  DIALOG ADD,BUTTON,SysExit,6,378,16,14,@chr(215),,Style3

  rem -- Smoke and mirrors "Menu" replacement (no hotkeys) --
  DIALOG ADD,TEXT,FileBkGrnd,24,5,25,18," "&File" ",,Style5
  DIALOG ADD,TEXT,File,24,5,25,18," "&File" ",,CLICK

  DIALOG ADD,EDIT,E1,40,3,393,235,,,MULTI,SCROLL

  rem -- Status bar replacement (STATUS element is at top of NOTITLE)--
  DIALOG ADD,EDIT,Stat,277,3,393,20,,,READONLY,Style4
DIALOG SHOW

rem -- Dialog status --
%%visible = 1

:EVLOOP
  if %%visible
     rem -- Move focus from titlebar buttons --
     DIALOG FOCUS, E1
     DIALOG SET, Stat, "Click title bar to move window..."
  end
  WAIT EVENT
  goto @event()

:SysIconCLICK
  DIALOG POPUP,"&Minimize"|-|"&Close        Alt+F4"
  %e = @event()
  if %e
     goto %e
  end
  goto EVLOOP

:SysBarCLICK
:SysTitleCLICK
  if @equal(@click(B), "RIGHT")
     goto SysIconCLICK
  end
  %%x1 = @diff(@mousepos(X), @winpos("Fake Title Bar",L))
  %%y1 = @diff(@mousepos(Y), @winpos("Fake Title Bar",T))
  DIALOG SET, Stat, "Click again to release window..."
  REPEAT
    %x = @diff(@mousepos(X),%%x1)
    %y = @diff(@mousepos(Y),%%y1)
    if @greater(0, %x)
       %x = 0
    end
    if @greater(0, %y)
       %y = 0
    end
    WINDOW POSITION,"Fake Title Bar",%y,%x
    WAIT ".01"
  UNTIL @not(@mousedown())
  goto EVLOOP
:MinimizeMENU
:SysMinBUTTON
  %%visible = ""
  DIALOG ADD,TASKICON,TaskBar,," Fake Title Bar "
  DIALOG HIDE
  goto EVLOOP

:TaskBarCLICK
  %%visible = 1
  DIALOG SHOW
  DIALOG REMOVE, TaskBar
  goto EVLOOP

:FileCLICK
  DIALOG HIDE, File
  DIALOG POPUP,&New...|&Open...|&Save...|&Save As...|-|&Exit,40,5
  %e = @event()
  DIALOG SHOW, File
  if %e
     goto %e
  end
  goto EVLOOP

:New...MENU
  DIALOG CLEAR, E1
  goto EVLOOP

:Open...MENU
  %f = @filedlg()
  if %f
     if @greater(@file(%f, Z), 32000)
        INFO "File is too large for this program..."@tab()
        goto EVLOOP
     end
     LIST CREATE, 1
     LIST LOADFILE, 1, %f
     DIALOG SET, E1, @text(1)
     LIST CLOSE, 1
  end
  goto EVLOOP

:Save...MENU
:Save As...MENU
  if @dlgtext(E1)
     if %f
        %f = @filedlg(,,%f,SAVE)
     else
        %f = @filedlg(,,,SAVE)
     end
     if %f
        LIST CREATE, 1
        LIST ASSIGN, 1, @dlgtext(E1)
        LIST SAVEFILE, 1, %f
        LIST CLOSE, 1
     end
  else
     INFO Nothing to save...@tab()
  end
  goto EVLOOP

:Close        Alt+F4MENU
:ExitMENU
:SysExitBUTTON
:CLOSE
  EXIT

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 4 Source Code 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