AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

InputBox, font size

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
brotherS



Joined: 01 Jun 2005
Posts: 147

PostPosted: Mon Jan 01, 2007 9:26 pm    Post subject: InputBox, font size Reply with quote

For quite a while http://www.autohotkey.com/docs/commands/InputBox.htm says
"Font - Not yet implemented (leave blank). In the future it might accept something like verdana:8". I'd be happy to see that feature finally implemented. Thanks! Very Happy
_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4016
Location: Pittsburgh

PostPosted: Mon Jan 01, 2007 9:54 pm    Post subject: Reply with quote

AHK still does not support it, and InputBox most likely will be eliminated. However, setting any fonts should be possible with the WM_SETFONT message (0x0030)
http://msdn2.microsoft.com/en-us/library/ms632642.aspx
- wParam: Handle to the font. If this parameter is NULL, the control uses the default system font to draw text.
- lParam: The low-order word of lParam specifies whether the control should be redrawn immediately upon setting the font. If this parameter is TRUE, the control redraws itself.

The dll call to OleCreateFontIndirect should create the font handle
http://msdn2.microsoft.com/en-us/library/ms690144.aspx

The FONTDESC structure contains parameters used to create a font object through the OleCreateFontIndirect function.
http://msdn2.microsoft.com/en-us/library/ms692782.aspx

typedef struct tagFONTDESC
{
UINT cbSizeofstruct;
LPOLESTR lpstrName;
CY cySize;
SHORT sWeight;
SHORT sCharset;
BOOL fItalic;
BOOL fUnderline;
BOOL fStrikethrough;
} FONTDESC;

cbSizeofstruct: Size of the FONTDESC structure.

lpstrName: Pointer to the caller-owned string specifying the font name.

cySize: Initial point size of the font. Use the int64 parameter of the CURRENCY structure and scale your font size (in points) by 10000.

sWeight: Initial weight of the font. If the weight is below 550 (the average of FW_NORMAL, 400, and FW_BOLD, 700), then the Bold property is also initialized to FALSE. If the weight is above 550, the Bold property is set to TRUE.

sCharset: Initial character set of the font.

fItalic: Initial italic state of the font.

fUnderline: Initial underline state of the font.

fStrikethrough: Initial strikethrough state of the font.
Back to top
View user's profile Send private message
brotherS



Joined: 01 Jun 2005
Posts: 147

PostPosted: Mon Jan 01, 2007 11:03 pm    Post subject: Reply with quote

InputBox is on the way out? Shocked Why?

DLL calls are far beyond my knowledge, that's why I asked for the font option Cool
_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Mon Jan 01, 2007 11:44 pm    Post subject: Reply with quote

brotherS wrote:
InputBox is on the way out? Shocked Why?
I don't believe they are to be phased out, they are convenient shortcut (like MsgBox, unlike Progress and SplashImage).
But for custom input, using a GUI is probably a better way. It is likely that Chris didn't worked on this font parameter because InputBox and the above commands were made before Gui, but the later is much more flexible.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Tue Jan 02, 2007 12:16 pm    Post subject: Reply with quote

Yes, I think InputBox will be retained in v2 because using GUI instead would be far less convenient. However, it might be revised somewhat for v2, maybe even the font capability if it's easy to implement.
Back to top
View user's profile Send private message Send e-mail
brotherS



Joined: 01 Jun 2005
Posts: 147

PostPosted: Tue Jan 02, 2007 5:07 pm    Post subject: Reply with quote

Chris wrote:
Yes, I think InputBox will be retained in v2 because using GUI instead would be far less convenient.

That's exactly the reason why I didn't bother with the GUI syntax yet Very Happy
_________________
DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group