| View previous topic :: View next topic |
| Author |
Message |
brotherS
Joined: 01 Jun 2005 Posts: 147
|
Posted: Mon Jan 01, 2007 9:26 pm Post subject: InputBox, font size |
|
|
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!  _________________ DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett. |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4016 Location: Pittsburgh
|
Posted: Mon Jan 01, 2007 9:54 pm Post subject: |
|
|
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 |
|
 |
brotherS
Joined: 01 Jun 2005 Posts: 147
|
Posted: Mon Jan 01, 2007 11:03 pm Post subject: |
|
|
InputBox is on the way out? Why?
DLL calls are far beyond my knowledge, that's why I asked for the font option  _________________ DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett. |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Mon Jan 01, 2007 11:44 pm Post subject: |
|
|
| brotherS wrote: | InputBox is on the way out? 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 |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Tue Jan 02, 2007 12:16 pm Post subject: |
|
|
| 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 |
|
 |
brotherS
Joined: 01 Jun 2005 Posts: 147
|
Posted: Tue Jan 02, 2007 5:07 pm Post subject: |
|
|
| 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  _________________ DonationCoder.com brings AHK to the newbies!
Fan of AutoHotkey? Consider an occasional donation to its developer, Chris Mallett. |
|
| Back to top |
|
 |
|