FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour ajustar columna XBrowse(SOLUCIONADO)
Posts: 607
Joined: Mon Mar 04, 2013 04:32 PM
ajustar columna XBrowse(SOLUCIONADO)
Posted: Sun Oct 27, 2019 11:04 AM
Hola amigos:

Estoy intentando pasar los Browses a Xbrowses , en algunas columnas observo que no se ajustan como antes.

mirad esta en el campo codigo.



Como puedo hacer que se ajuste al ancho de la columna de texto, en este caso para que se vea bien toda la cabecera.

Gracias por vuestra inestimeble ayuda.

Jose.
Fwh 24.07 64 bits + Harbour 64 bits 3.2dev(r2407221137) + MSVC64
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: ajustar columna XBrowse
Posted: Sun Oct 27, 2019 01:25 PM
Esto puede darte una idea

Code (fw): Select all Collapse
ListVentWidth :=  oDialog:nWidth;

xBrowse oBrw OF oDialog ;
FIELDSIZES ( ListVentWidth * .10 ) , ( ListVentWidth * .50 ) , ( ListVentWidth * .15 ) , ( ListVentWidth * .25 );

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 607
Joined: Mon Mar 04, 2013 04:32 PM
Re: ajustar columna XBrowse
Posted: Sun Oct 27, 2019 06:42 PM

Hola Bayron.

Muchisimas gracias. Funciona perfecto. aunque esto ya es opinion mia

el mas antiguo Browse realiza bien el calculo de las columnas y el mas moderno debes de definirlo por codigo.
no es muy logico la verdad.

Mr. Rao, posibilidad de arreglar esto ?

Saludos.

Jose.

Fwh 24.07 64 bits + Harbour 64 bits 3.2dev(r2407221137) + MSVC64
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: ajustar columna XBrowse(SOLUCIONADO)
Posted: Mon Oct 28, 2019 12:06 PM

Al margen del comentario que pueda hace Mr Rao, creo que eso ocurre cuando aparece el "bitmap" que indica el orden en el que está ordenada esa columna

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ajustar columna XBrowse(SOLUCIONADO)
Posted: Mon Oct 28, 2019 12:41 PM
Mr. Jose

Code (fw): Select all Collapse
Como puedo hacer que se ajuste al ancho de la columna de texto, en este caso para que se vea bien toda la cabecera.


I am surprised that in your case the header does not look good. But it should automatically look good.
Hope you are testing with FWH1905 or later.

I tried to reproduce the problem at my end, but it is working correctly.
This is the test program I tried here.
Code (fw): Select all Collapse
#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local oDlg, oBrw, oFont

   USE CUSTOMER VIA "DBFCDX"
   FW_CdxCreate()

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 600,400 PIXEL TRUEPIXEL FONT oFont TITLE FWVERSION

   @ 40,40 XBROWSE oBrw SIZE -60,-40 PIXEL OF oDlg ;
      DATASOURCE "CUSTOMER" ;
      COLUMNS "STRZERO(ID,4)","FIRST","LAST" ;
      HEADERS "CODIGO" ;
      CELL LINES NOBORDER ;
      FOOTERS AUTOSORT

   WITH OBJECT oBrw
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil




Here the header appears correctly with automatic calculation of column widths.

How can you help me to reproduce the problem?

We try our best to ensure that XBrowse should work as expected without any extra code by the programmer for colsizes, alignments, number formats, etc.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ajustar columna XBrowse(SOLUCIONADO)
Posted: Mon Oct 28, 2019 01:07 PM
I did another test. I created a DBF similar to your image above.
This is the program:
Code (fw): Select all Collapse
#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local oDlg, oBrw, oFont

   CreateDBF()

   USE TEST VIA "DBFCDX"

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 500,300 PIXEL TRUEPIXEL FONT oFont TITLE FWVERSION

   @ 40,40 XBROWSE oBrw SIZE -40,-40 PIXEL OF oDlg ;
      DATASOURCE "TEST" AUTOCOLS ;
      CELL LINES NOBORDER ;
      FOOTERS AUTOSORT

   WITH OBJECT oBrw

      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil

function CreateDBF()

   local aStru := ;
      {  { "CODIGO", "C", 4, 0 } ;
      ,  { "CIF",    "C", 9, 0 } ;
      ,  { "NOMBRE", "C",20, 0 } ;
      }

   DBCREATE( "TEST", aStru, "DBFCDX", .T., "TST" )
   FW_ArrayToDBF( ;
      {  { "0001", "", "HOTEL PLAYA" } ;
      ,  { "0002", "016308363", "ANOZ, DEMETRIO" } ;
      ,  { "0003", "", "WIEDEMAN" } ;
      ,  { "0004", "", "KREIGER"  } ;
      ,  { "0005", "", "MODESTO"  } ;
      } )

   FW_CdxCreate()

   CLOSE TST

return nil




Even this is working correctly.
How can you help me to recreate your problem?

Did you by any chance set the column widths yourself in your program?
Regards



G. N. Rao.

Hyderabad, India
Posts: 607
Joined: Mon Mar 04, 2013 04:32 PM
Re: ajustar columna XBrowse(SOLUCIONADO)
Posted: Mon Oct 28, 2019 06:58 PM
Hi. Mr. Rao

First of all thank you for your effort and attention in helping me. I value it very much.
You are right that it works well in your examples, I do not get the arrow, look at the image.



the code that fails me is this

Code (fw): Select all Collapse
@ 2, 0 XBROWSE oBrw  DATASOURCE cAlias ;
          COLUMNS "Codigo", "cif", "Nombre", "direc" ;
          HEADERS "CODIGO", "C.I.F.", "NOMBRE", "DIRECCION" CELL LINES ;
          WHEN cAlias->( LastRec() ) > 0 OF oWndObr


I don't know what the problem may be, anyway thank you very much

Jose.
Fwh 24.07 64 bits + Harbour 64 bits 3.2dev(r2407221137) + MSVC64
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ajustar columna XBrowse(SOLUCIONADO)
Posted: Tue Oct 29, 2019 12:04 AM

Please click on headers to see arrows

Regards



G. N. Rao.

Hyderabad, India
Posts: 607
Joined: Mon Mar 04, 2013 04:32 PM
Re: ajustar columna XBrowse(SOLUCIONADO)
Posted: Tue Oct 29, 2019 08:31 AM
nageswaragunupudi wrote:Please click on headers to see arrows


Yes. Thanks. :-)
Fwh 24.07 64 bits + Harbour 64 bits 3.2dev(r2407221137) + MSVC64

Continue the discussion