FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveLinux / FiveDroid (Android) Controlling alignment of SAYs
Posts: 464
Joined: Tue May 16, 2006 07:47 AM
Controlling alignment of SAYs
Posted: 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:

HB_FUNC( SAYSETALIGN )
{

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


In say.prg:

   METHOD SetAlignment( fHAlign, fVAlign ) INLINE SaySetAlign( ::hWnd, fHAlign, fVAlign )


And in your program code something like:

@  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

Continue the discussion