ShinobiSoft Professional Member
Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Sat Dec 21, 2002 11:44 pm Post subject: Font Handle Converter |
|
|
To enable this in your programs, you'll need to run a similar routine from
your script before showing the dialog. One other drawback is that you
have to leave the elements created on the dialog for this to wrok properly.
Code: |
TITLE Font Handle Converter
rem You could load all of the font names from the registry here
list create,1
list loadtext,1
"Arial
"Courier New
"Ms Sans Serif
"Tahoma
"Times New Roman
"Verdana
rem Use this list to write the font names and handles to
list create,2
dialog create,Handle Converter,-1,0,250,220
dialog add,Style,StL1,Courier New,9,,White,LtBlue
dialog add,List,L1,0,0,250,200,,StL1,DBLCLICK
dialog add,Status,Stat,DblClick list to change to that font
dialog show
%%st = 1
%c = @count(1)
%x = 0
list add,2,HANDLE@tab()@tab()FONT
repeat
list seek,1,%x
dialog add,Style,St%%st,@item(1),10
dialog add,EDIT,Ed%%st,0,0,0,0,,,St%%st
%%fHandle = @sendmsg(~Ed%%st, $0031,0,0)
list add,2,%%fHandle@tab()@tab()@item(1)
%%st = @succ(%%st)
%x = @succ(%x)
until @equal(%x,%c)
list assign,L1,@text(2)
list close,2
:Evloop
wait event
goto @event()
:L1DBLCLICK
if @greater(@index(1),0)
%%font = @substr(@item(L1),1,@pred(@pos(@tab(),@item(L1))))
%G = @sendmsg(~L1, $0030,%%font,1)
end
goto Evloop
:CLOSE
exit
|
_________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|