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 


Use @FONTDLG()

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
filip
Valued Contributor
Valued Contributor


Joined: 07 Aug 2004
Posts: 340

PostPosted: Thu Dec 08, 2005 1:06 pm    Post subject: Use @FONTDLG() Reply with quote

How to change font on this clock ?

Code:
OPTION DECIMALSEP,"."

 title Clock Test
 
  %%ScreenHeight = @sysinfo(screenheight)
  %%ScreenWidth  = @sysinfo(screenwidth)
 
 %%H = @FSUB(%%ScreenHeight,32)
 %%W = @FSUB(%%ScreenWidth,Cool
 
  DIALOG CREATE,Clock Test,-1,0,%%ScreenWidth,%%ScreenHeight,NOTITLE,COLOR black
  DIALOG add,GRADIENT,GRADIENT1,0,0,,,,,,FIT,,EDGESTOHCENTER
  DIALOG ADD,STYLE,STYLE1,Arial Rounded MT Bold,160,BC
  DIALOG ADD,TEXT,TIME,217,0,%%ScreenWidth,250,,,STYLE1,CLICK
  DIALOG ADD,BUTTON,SETFONT,0,0,100,35,Font setup
  DIALOG SHOW
  goto timer
 
:Evloop
  wait event,0.1
  %E = @event()
  goto %E
 
  :TIMECLICK
 :GRADIENT1CLICK
 goto close
 
:Timer
  %%RawDate = @datetime(hh|nn|ss|AM/PM)
  PARSE "%%Hour;%%Minute;%%Second;%%AMPM",%%RawDate
  dialog set,TIME,%%Hour:%%Minute:%%Second
  goto evloop
 
  :SETFONTBUTTON
  %%FONTset = @fontdlg(Courier New)
  if @not(@null(%%FONTset))
  parse "%%fFace;%%fSize",%%FONTset
   DIALOG ADD,STYLE,STYLE2,%%fFace,%%fSize
  dialog set,Text1,TIME,,,,Style2
  end
  goto evloop
 
:Close
Back to top
View user's profile Send private message Send e-mail
bbelcher
Contributor
Contributor


Joined: 30 Jul 2002
Posts: 172

PostPosted: Thu Dec 08, 2005 2:33 pm    Post subject: Reply with quote

I think you have to remove then readd the text and style elements to make it work.

Their might be a better way but this works.



Code:

OPTION DECIMALSEP,"."

  title Clock Test

  %%ScreenHeight = @sysinfo(screenheight)
  %%ScreenWidth  = @sysinfo(screenwidth)

  %%H = @FSUB(%%ScreenHeight,32)
  %%W = @FSUB(%%ScreenWidth,Cool

  DIALOG CREATE,Clock Test,-1,0,%%ScreenWidth,%%ScreenHeight,NOTITLE,COLOR black
  DIALOG add,GRADIENT,GRADIENT1,0,0,,,,,,FIT,,EDGESTOHCENTER
  DIALOG ADD,STYLE,STYLE1,Arial Rounded MT Bold,160,BC
  DIALOG ADD,TEXT,TIME,217,0,%%ScreenWidth,250,,,STYLE1,CLICK
  DIALOG ADD,BUTTON,SETFONT,0,0,100,35,Font setup
  DIALOG SHOW
  goto timer

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

:TIMECLICK
:GRADIENT1CLICK
  goto close

:Timer
  %%RawDate = @datetime(hh|nn|ss|AM/PM)
  PARSE "%%Hour;%%Minute;%%Second;%%AMPM",%%RawDate
  dialog set,TIME,%%Hour:%%Minute:%%Second
  goto evloop

:SETFONTBUTTON
  %%FONTset = @fontdlg(Courier New)
  if @not(@null(%%FONTset))
    parse "%%fFace;%%fSize",%%FONTset

#remove text element and style -------------------
   dialog remove,time
   dialog remove,style1
#remove text element and style --------------------

#re add the element and style ----------------------
    DIALOG ADD,STYLE,STYLE1,%%fFace,%%fSize,BC
    DIALOG ADD,TEXT,TIME,217,0,%%ScreenWidth,250,,,STYLE1,CLICK
#re add the element and style ----------------------
  end
  goto evloop

:Close
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Dec 09, 2005 12:02 am    Post subject: Reply with quote

the font is determined by the line

Code:
 DIALOG ADD,STYLE,STYLE1,Arial Rounded MT Bold,160,BC


in

Code:
dialog create
...
...
...
dialog show


just change the style to one you like

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help 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