Controlling alignment of SAYs

Controlling alignment of SAYs

Postby xProgrammer » Sat May 03, 2008 11:33 am

Hi Antonio (and fellow FiveLinuxers)

I have enhanced the TSay class so you can set the alignment of your SAYs.

In says.c:

Code: Select all  Expand view
HB_FUNC( SAYSETALIGN )
{

   GtkWidget * hWnd = (GtkWidget * ) hb_parnl( 1 );
   
   gtk_misc_set_alignment( ( GtkMisc * ) hWnd, hb_parnd( 2 ), hb_parnd( 3 ) );
}


In say.prg:

Code: Select all  Expand view
   METHOD SetAlignment( fHAlign, fVAlign ) INLINE SaySetAlign( ::hWnd, fHAlign, fVAlign )


And in your program code something like:

Code: Select all  Expand view
@  30,  10 SAY sayKey VAR "Key" OF dlgPATIENT SIZE 90, 25 PIXEL
sayKey:SetAlignment( 0.0, 0.5 )


Next step is to include in #xcommand @ <row>, <col> SAY

By the way fHAlign is a float with 0.0 meaning left align, 1.0 meaning right align, fVAlign is a float with 0.0 meaning top align, 1.0 meaning bottom align. So the example above puts the label text at the left hand side centered vertically.

Happy to provide more information if required.

xProgrammer
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Return to FiveLinux / FiveDroid (Android)

Who is online

Users browsing this forum: No registered users and 5 guests

cron