FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TButton Icon Alignment
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
TButton Icon Alignment
Posted: Thu Jul 23, 2020 07:57 PM
To All

I have 4 identical sized TButtons 52 x 20 that each have a 16 bit icon .. I can not ( further ) change the width of the Button Prompts ..



Notice how the second button Icon is out of alignment .. Here is the code .. I realize the length of the Prompt is longer than the other 3 and seems to push the icon farther left .. There is plenty of room if there was a way to insert a space to right pad the icon to line up all 4 icons ..

Please note that I continue to widen the button with very little changes in the calculation placement of the icon .. any help would be appreciated.

Thanks
Rick Lipkin

Code (fw): Select all Collapse
REDEFINE BTNBMP oBtn2 ID 252 OF oGrps   ;
         RESOURCE "COMMENT" ;
         PROMPT "Comment" LEFT 2007;
         ACTION ( _ViewMemo2( cMode, oRsTrav, "Request",oBtn1,oBtn2,oBtn3,oBtn4,oBtn5, "2" ,@cComments, 400, cPrevAppr, oFontb ),LightGreyGrad());
         GRADIENT GreyButtonGrad()
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: TButton Icon Alignment
Posted: Mon Jul 27, 2020 12:29 PM

Any news ??

Thanks
Rick Lipkin

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TButton Icon Alignment
Posted: Mon Jul 27, 2020 04:53 PM

For the purpose of testing, can you change the prompt as "abc" (shorter text) ?

Regards



G. N. Rao.

Hyderabad, India
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: TButton Icon Alignment
Posted: Tue Jul 28, 2020 12:55 PM
Rao

Using a fixed length Prompt "Abc" does make all the button icons line up correctly .. unfortunitly, not all captions will have the same length...



It would be nice if you could add a space before the Resource to be able to force the icon to the right to correct the spacing when needed ..

Code (fw): Select all Collapse
REDEFINE BTNBMP oBtn2 ID 252 OF oGrps   ;
         RESOURCE space(1)+"COMMENT" ;
         PROMPT "Comment" LEFT 2007;
         ACTION ( _ViewMemo2( cMode, oRsTrav, "Request",oBtn1,oBtn2,oBtn3,oBtn4,oBtn5, "2" ,@cComments, 400, cPrevAppr, oFontb ),LightGreyGrad());
         GRADIENT GreyButtonGrad()


Rick Lipkin
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TButton Icon Alignment
Posted: Tue Jul 28, 2020 05:02 PM

Then you need to increase the width of the buttons to provide enough room to accommodate both bitmap and the prompt.

Regards



G. N. Rao.

Hyderabad, India
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: TButton Icon Alignment
Posted: Wed Jul 29, 2020 01:33 PM
Rao

I realized that .. was hoping for another possible solution .. This form is quite complex and there is just no room to enlarge the buttons ....



Rick Lipkin
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TButton Icon Alignment
Posted: Wed Jul 29, 2020 02:16 PM

Try specifying oBtn:aBmpRect := { t, l, b, r } in pixels.
Then bitmap will be positioned inside the specified rectangle.
Specify the same rect to all the buttons.

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion