FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BtnBmp : Text Alignments
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
BtnBmp : Text Alignments
Posted: Mon May 16, 2016 03:28 PM
We know that by using the clause LEFT/RIGHT/TOP/BOTTOM while creating a bitmap, the prompt is aligned opposite to the bitmap.

Now there is a way to make finer adjustments in the alignment of text, right/center/left by adding a space on left,right or both sides of the prompt



"Prompt" --> Default alignment
"Prompt " --> Left Alignment
" Prompt" --> Right Alignment
" Prompt " --> Center (horizontally) Alignment.

Following sample, demonstrates the usage.
Code (fw): Select all Collapse
function BtnText1()

   local oDlg, oBtn, oFont

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-16

   DEFINE DIALOG oDlg SIZE 460,460 PIXEL TRUEPIXEL FONT oFont ;
      TITLE "BTNBMP TEXT ALIGNMENTS"

   @  20,20 BTNBMP oBtn FILE "..\bitmaps\32x32\task.bmp" ;
      PROMPT "Default" + CRLF + "Alignment" LEFT ;
      SIZE 200,60 PIXEL OF oDlg 2007

   @ 100,20 BTNBMP oBtn FILE "..\bitmaps\32x32\copy.bmp" ;
      PROMPT "Left" + CRLF + "Alignment " LEFT ;
      SIZE 200,60 PIXEL OF oDlg 2007

   @ 180,20 BTNBMP oBtn FILE "..\bitmaps\32x32\paste.bmp" ;
      PROMPT " Center" + CRLF + "Alignment " LEFT ;
      SIZE 200,60 PIXEL OF oDlg 2007

   @  20,240 BTNBMP oBtn FILE "..\bitmaps\32x32\task.bmp" ;
      PROMPT "Default" + CRLF + "Alignment" RIGHT ;
      SIZE 200,60 PIXEL OF oDlg 2007

   @ 100,240 BTNBMP oBtn FILE "..\bitmaps\32x32\copy.bmp" ;
      PROMPT " Right" + CRLF + "Alignment" RIGHT ;
      SIZE 200,60 PIXEL OF oDlg 2007

   @ 180,240 BTNBMP oBtn FILE "..\bitmaps\32x32\paste.bmp" ;
      PROMPT " Center" + CRLF + "Alignment " RIGHT ;
      SIZE 200,60 PIXEL OF oDlg 2007

   @ 260, 20 BTNBMP oBtn FILE "..\bitmaps\32x32\task.bmp" ;
      PROMPT "Left " TOP ;
      SIZE 128,80 PIXEL OF oDlg 2007

   @ 260,165 BTNBMP oBtn FILE "..\bitmaps\32x32\copy.bmp" ;
      PROMPT "Default" TOP ;
      SIZE 128,80 PIXEL OF oDlg 2007

   @ 260,312 BTNBMP oBtn FILE "..\bitmaps\32x32\paste.bmp" ;
      PROMPT " Right" TOP ;
      SIZE 128,80 PIXEL OF oDlg 2007

   @ 360, 20 BTNBMP oBtn FILE "..\bitmaps\32x32\task.bmp" ;
      PROMPT "Left " BOTTOM ;
      SIZE 128,80 PIXEL OF oDlg 2007

   @ 360,165 BTNBMP oBtn FILE "..\bitmaps\32x32\copy.bmp" ;
      PROMPT "Default" BOTTOM ;
      SIZE 128,80 PIXEL OF oDlg 2007

   @ 360,312 BTNBMP oBtn FILE "..\bitmaps\32x32\paste.bmp" ;
      PROMPT " Right" BOTTOM ;
      SIZE 128,80 PIXEL OF oDlg 2007

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: BtnBmp : Text Alignments
Posted: Mon May 16, 2016 04:28 PM

I have been doing that for columns in xbrowse. Otherwise the column line may sit right next to the first letter making it difficult to read. It's easy to do and makes the appearance better.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: BtnBmp : Text Alignments
Posted: Mon May 16, 2016 04:38 PM
TimStone wrote:I have been doing that for columns in xbrowse. Otherwise the column line may sit right next to the first letter making it difficult to read. It's easy to do and makes the appearance better.

Do you mean to say that the default margin we provide is not enough? Do you suggest we provide more margin on the left?
If you can please explain we see how we can provide a better and clearer presentation by default
Regards



G. N. Rao.

Hyderabad, India
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: BtnBmp : Text Alignments
Posted: Mon May 16, 2016 04:51 PM

When we allow the columns to autosize, I found sometimes they would be tight on the headers and the first and/or last letters would not display cleanly.

So I added a space before and after each header, and it all worked perfectly.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit

Continue the discussion