FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Button ( text alignment )
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Button ( text alignment )
Posted: Wed Mar 30, 2011 09:54 PM
I wanna share mode of change alignment of a button native. ( yet don't have in sintax option RIGHT or LEFT and by default is Centered )

Well is simple look:

@ 5,5 Button oBtn Prompt Replicate(" ",2)+"&1 - Cheque" Of oDlg Size 190,18 Pixel
SetAlignTextButton( oBtn, "LEFT" )


Function:
Code (fw): Select all Collapse
//----------------------------------------------------------------------------------------------------------------------//
  #define BS_LEFT             0x00000100L
  #define BS_RIGHT            0x00000200L
  #define BS_CENTER           0x00000300L
  #define BS_TOP              0x00000400L
  #define BS_BOTTOM           0x00000800L
  #define BS_VCENTER          0x00000C00L
//----------------------------------------------------------------------------------------------------------------------//
  Function SetAlignTextButton( oButton, cType )
   If cType == "LEFT"
      oButton:nStyle:=nOr(oButton:nStyle,BS_LEFT)
   ElseIf cType == "RIGHT"
      oButton:nStyle:=nOr(oButton:nStyle,BS_RIGHT)
   ENDIF
  Return Nil
//----------------------------------------------------------------------------------------------------------------------//


My Result:

:-)
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Button ( text alignment )
Posted: Wed Mar 30, 2011 11:40 PM
Lailton

Thanks...

it's other way...
Code (fw): Select all Collapse
#include "Fivewin.ch"

#define BS_LEFT             0x00000100
#define BS_RIGHT            0x00000200


Function Main()
Local oWnd
Local oBtnA, oBtnB, oBtnC

Define Window oWnd

@ 2,2 ButtonBmp oBtnA Prompt "teste A" Textleft   Of oWnd Size 150,30
@ 6,2 ButtonBmp oBtnB Prompt "teste B" Textright  Of oWnd Size 150,30

__ChangeStyleWindow( oBtnA:hWnd, BS_LEFT)
__ChangeStyleWindow( oBtnB:hWnd, BS_RIGHT)

ActivaTe Window oWnd

Return Nil


Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Button ( text alignment )
Posted: Thu Mar 31, 2011 12:47 AM

Maybe can change sintax of button to add this feature =]

My sugestion for next update.

:D

Continue the discussion