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


Joined: 07 Aug 2004 Posts: 340
|
Posted: Thu Dec 08, 2005 1:06 pm Post subject: Use @FONTDLG() |
|
|
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,
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 |
|
 |
bbelcher Contributor

Joined: 30 Jul 2002 Posts: 172
|
Posted: Thu Dec 08, 2005 2:33 pm Post subject: |
|
|
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,
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 |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Dec 09, 2005 12:02 am Post subject: |
|
|
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 |
|
 |
|
|
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
|
|