Page 1 of 1

Browser doesnt Justify properly

Posted: Thu Jun 25, 2009 8:41 pm
by nspmadero
I want to show 3 columns, 2 numbers and 1 string
The code goes like this:

Code: Select all

@ 110, 3 BROWSE Explora_Dist WIDTH 405 HEIGHT 315 ;
  HEADERS { "No.Dist.", "Nombre", "No.Patro"} WIDTHS {60, 245, 60} ;
  WORKAREA Dist FIELDS {"Dist->NoDist" , "Dist->Nombre" , "Dist->NoPatro"} VALUE 1 ;
  FONT "Arial" SIZE 9 ;
  JUSTIFY { BROWSE_JTFY_RIGHT, BROWSE_JTFY_LEFT, BROWSE_JTFY_RIGHT } ;
  ON CHANGE { || DistMuestra () }
Notice the 1st number, i want it justified to the right, but it always appears to the left.

Re: Browser doesnt Justify properly

Posted: Thu Jun 25, 2009 11:21 pm
by Roberto Lopez
nspmadero wrote:I want to show 3 columns, 2 numbers and 1 string
The code goes like this:

Code: Select all

@ 110, 3 BROWSE Explora_Dist WIDTH 405 HEIGHT 315 ;
  HEADERS { "No.Dist.", "Nombre", "No.Patro"} WIDTHS {60, 245, 60} ;
  WORKAREA Dist FIELDS {"Dist->NoDist" , "Dist->Nombre" , "Dist->NoPatro"} VALUE 1 ;
  FONT "Arial" SIZE 9 ;
  JUSTIFY { BROWSE_JTFY_RIGHT, BROWSE_JTFY_LEFT, BROWSE_JTFY_RIGHT } ;
  ON CHANGE { || DistMuestra () }
Notice the 1st number, i want it justified to the right, but it always appears to the left.

From HMG reference (Browse control):

Code: Select all

The leftmost column in a browse control must be left aligned. 
Browse inherits this limitation from ListView Windows control.

A 'dirty trick' to workaround this, is to create a 'dummy' first column with zero width.

Regards,

Roberto.

Re: Browser doesnt Justify properly

Posted: Fri Jun 26, 2009 3:02 am
by Rathinagiri
A 'dirty trick' to workaround this, is to create a 'dummy' first column with zero width.
I like this. :) Thanks Roberto.

Re: Browser doesnt Justify properly

Posted: Fri Jun 26, 2009 4:43 am
by nspmadero
Thanks for the tip :)