Button ( text alignment )

Button ( text alignment )

Postby lailton.webmaster » Wed Mar 30, 2011 9: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: Select all  Expand view
//----------------------------------------------------------------------------------------------------------------------//
  #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:
Image
:D
Last edited by lailton.webmaster on Thu Mar 31, 2011 12:54 am, edited 1 time in total.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: Button ( text alignment )

Postby Daniel Garcia-Gil » Wed Mar 30, 2011 11:40 pm

Lailton

Thanks...

it's other way...
Code: Select all  Expand view

#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
 


Image
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Button ( text alignment )

Postby lailton.webmaster » Thu Mar 31, 2011 12:47 am

:D

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

My sugestion for next update.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 68 guests

cron