 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Little-Acorn
Joined: 06 Jul 2008 Posts: 111 Location: San Diego
|
Posted: Sun Nov 30, 2008 6:44 pm Post subject: Is it possible to make a smaller-than-usual button? |
|
|
I have been writing an application that has several buttons, edit boxes, and other things. It works fine, including the buttons.
The code for each button looks something like this:
C* Place button to Save Registers.
i=winio@('%`ap&',dxpos1,dypos3)
i=winio@('%^8bt[&Save]&',UPDATREG)
I know that if I change the %^8bt to %^6bt, the button will get shorter in its horizontal dimension.
My question is, is it possible to make a button which is smaller in both horizontal and vertical dimensions? I know how to make the text font smaller, but how about the button itself?
Thanx all! |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Sun Nov 30, 2008 7:11 pm Post subject: |
|
|
There must be more than one answer to this question, but probably the simplest is to use %tt instead of %bt.
You can also make custom buttons with %ib and &tb
However, if you shrink the font, don't the buttons shrink too?
Eddie |
|
Back to top |
|
 |
Little-Acorn
Joined: 06 Jul 2008 Posts: 111 Location: San Diego
|
Posted: Mon Dec 01, 2008 5:28 am Post subject: Re: |
|
|
LitusSaxonicum wrote: | There must be more than one answer to this question, but probably the simplest is to use %tt instead of %bt.
You can also make custom buttons with %ib and &tb
However, if you shrink the font, don't the buttons shrink too?
Eddie |
Thank you, Eddie! %tt looks like the answer I wanted! Excellent!
Yes, when you shrink the font, the button shrinks too. But I was hoping to have standard or close-to-standard size text, and just less empty space around it between the text and the edge of the button. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8209 Location: Salford, UK
|
Posted: Mon Dec 01, 2008 1:50 pm Post subject: |
|
|
Here are two more ways....
1. Use %di and design the dialog using a dialog editor or
2. Use %lw to get the handle of the button then use %sc to initialise the window and call resize_window@ within the %sc callback to set the size of the button to exactly what you want. |
|
Back to top |
|
 |
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2402 Location: Yateley, Hants, UK
|
Posted: Mon Dec 01, 2008 9:23 pm Post subject: |
|
|
Paul,
Your method (2) is a really rather clever approach - but I keep forgetting that a control is also a window! As for your method (1), I've regarded the %di format code as forever beyond my ken (FTN95.chm doesn't help me much!).
Little-Acorn,
I have a program that operates with a single window (just like "Calculator"). Unfortunately, this window is too large to fit when run on a PC with graphics resolution too low. So I call this routine at an early stage while setting up the window. Then all the buttons scale down, the window looks the same but it is smaller.
Code: | SUBROUTINE SET_FONT_DETAILS
C ---------------------------
C
C This routine looks at screen vertical resolution and selects an
C appropriate size for button fonts
C
C -----------------------------------------------------------------
DOUBLE PRECISION FACTOR
INCLUDE <WINDOWS.INS>
IX=GetSystemMetrics(SM_CXSCREEN)
IY=GetSystemMetrics(SM_CYSCREEN)
IF (IY .LT. 800) THEN
FACTOR = 0.8D0
IA=WINIO@('%fn[MS Sans Serif]%ts&',FACTOR)
ENDIF
RETURN
END |
I found it a better solution than %tt, and while %tt is the simplest solution, it isn't necessarily the best one.
Eddie |
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|