replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Is it possible to make a smaller-than-usual button?
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 

Is it possible to make a smaller-than-usual button?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Little-Acorn



Joined: 06 Jul 2008
Posts: 111
Location: San Diego

PostPosted: Sun Nov 30, 2008 6:44 pm    Post subject: Is it possible to make a smaller-than-usual button? Reply with quote

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
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Sun Nov 30, 2008 7:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
Little-Acorn



Joined: 06 Jul 2008
Posts: 111
Location: San Diego

PostPosted: Mon Dec 01, 2008 5:28 am    Post subject: Re: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Dec 01, 2008 1:50 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2402
Location: Yateley, Hants, UK

PostPosted: Mon Dec 01, 2008 9:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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