funcionalidad en xBrowse

funcionalidad en xBrowse

Postby lucasdebeltran » Mon Sep 12, 2011 12:23 pm

Hola,

Me gustaría saber cómo guardar la configuración de columnas de xBrowse cuando se hace click derecho y se desmarcan algunas columnas, de modo que la próxima vez que se inicie dicho xBrowse sólo se cargen las que el usuario ha marcado.

Image

Uploaded with ImageShack.us

Muchas gracias.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: funcionalidad en xBrowse

Postby nageswaragunupudi » Mon Sep 12, 2011 12:32 pm

cState := oBrw:SaveState()

Save the value of cState in any file on disk.

Next time when the program is run, read the value of cState and restore it by oBrw:RestoreState( cState ), after completely defining the browse.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: funcionalidad en xBrowse

Postby lucasdebeltran » Mon Sep 12, 2011 12:33 pm

And for all columns?.

The idea is let the user to choose the columns that he needs to be shown.

Thank you.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: funcionalidad en xBrowse

Postby nageswaragunupudi » Mon Sep 12, 2011 1:03 pm

lucasdebeltran wrote:And for all columns?.

The idea is let the user to choose the columns that he needs to be shown.

Thank you.

Yes. This saves the information of all columns about their status of visibility, position and widths
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: funcionalidad en xBrowse

Postby lucasdebeltran » Mon Sep 12, 2011 1:28 pm

Great.

And where I place savestate and loadstate?.

Thank you.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: funcionalidad en xBrowse

Postby nageswaragunupudi » Mon Sep 12, 2011 4:09 pm

Please try this sample
Code: Select all  Expand view
#include "FiveWin.Ch"
#include "xbrowse.ch"

//----------------------------------------------------------------------------//

REQUEST DBFCDX

//----------------------------------------------------------------------------//

function Main()

   local oDlg, oBrw, cState, cFile := "xbrstate.txt"

   USE CUSTOMER
   DEFINE DIALOG oDlg SIZE 600,400 PIXEL
   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      AUTOCOLS ALIAS "CUSTOMER" CELL LINES NOBORDER

   oBrw:CreateFromCode()

   if File( cFile )
      cState   := MemoRead( cFile )
      FErase( cFile )
      oBrw:RestoreState( cState )
   endif

   ACTIVATE DIALOG oDlg CENTERED ;
      VALID ( MemoWrit( cFile, oBrw:SaveState() ), .t. )

return (0)

//----------------------------------------------------------------------------//
 

Please indicate version of FWH and (x)Harbour you are using in your next posts.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: funcionalidad en xBrowse

Postby lucasdebeltran » Tue Sep 13, 2011 7:57 am

Hello.

It works perfect with FW 11.08 + Harbour 2.x.

Would be possible to implement a global set to handle this automatically?.

A.e., SET XBROWSESAVESTATE ON

And info coud be stored in the same .ini. For every xBrowse, section could be the name of the function where xbrowse is called.

I think it is a very interesting feature.

Thank you.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: funcionalidad en xBrowse

Postby nageswaragunupudi » Tue Sep 13, 2011 8:05 am

It is better to leave it to the programmer.
Different programmers may have different preferences to to store the saved state. You may like to save in ini file, some others somewhere else.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10308
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: funcionalidad en xBrowse

Postby lucasdebeltran » Tue Sep 13, 2011 8:50 am

In that case, the programer can edit that function to adapt to his needs.

But in general, saves many time of coding.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am

Re: funcionalidad en xBrowse

Postby lucasdebeltran » Fri Sep 16, 2011 12:22 pm

Mr Nao,

Could be possible ?

Thanks
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
 
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am


Return to FiveWin para Harbour/xHarbour

Who is online

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