forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Attributes of font using Choose_Font

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
wosl



Joined: 31 Jan 2008
Posts: 30

PostPosted: Sun Feb 10, 2008 9:43 pm    Post subject: Attributes of font using Choose_Font Reply with quote

I'm looking for attributes of the font selected by the Choose_Font functions. How can I get the font name, size and the attributes (underline, bold, italic etc.)?

Any help appreciated ...

Wosl
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Sun Feb 10, 2008 10:31 pm    Post subject: Reply with quote

choose_font@ is only used with %gr. It fires up the standard dialog box for selecting a font. The dialog gives a choice of font name, bold, italic etc.

If you want to create a font then you can use the Window API funtion CreateFont which you can use in your code and is documented at http://msdn2.microsoft.com/en-us/library/ms534214(VS.85).aspx
Back to top
View user's profile Send private message AIM Address
wosl



Joined: 31 Jan 2008
Posts: 30

PostPosted: Mon Feb 11, 2008 4:40 pm    Post subject: Reply with quote

Thank you for your response!

I guess here is a misunderstanding. I don't want to create a new font (CreateFont). I just want to know the parameters of the font which the user has been selected.

Using the standard dialog box (chosse_font@ & %gr) I have currently two problems:

1. I can not set the default font name, size, bold/underline, italic switch before starting the dialog the first time or for subsequent calls.

2. When the user has selected a font, size, bold, underline etc. I don't see this selections for further postprocessing. In other words how can I detect which selection the user did for the text size, underline etc ...?

Wosl
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Mon Feb 11, 2008 5:21 pm    Post subject: Reply with quote

If you want users to select a font using the standard Microsoft font dialog then you will need to call the Windows API function called ChooseFont which is decribed at http://msdn2.microsoft.com/en-us/library/ms646914(VS.85).aspx

The easiest way to do this may be to write a function in C using the Silverfrost C compiler SCC. This function should call ChooseFont. The new function can then be called from your Fortran code. This will avoid the problem of trying to emulate the CHOOSEFONT structure in Fortran.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
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


Powered by phpBB © 2001, 2005 phpBB Group