FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour funcionalidad en xBrowse
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM

funcionalidad en xBrowse

Posted: 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.



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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: funcionalidad en xBrowse

Posted: 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
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM

Re: funcionalidad en xBrowse

Posted: 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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: funcionalidad en xBrowse

Posted: Mon Sep 12, 2011 01: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
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM

Re: funcionalidad en xBrowse

Posted: Mon Sep 12, 2011 01: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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: funcionalidad en xBrowse

Posted: Mon Sep 12, 2011 04:09 PM
Please try this sample
Code (fw): Select all Collapse
#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
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM

Re: funcionalidad en xBrowse

Posted: Tue Sep 13, 2011 07: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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: funcionalidad en xBrowse

Posted: Tue Sep 13, 2011 08: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
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM

Re: funcionalidad en xBrowse

Posted: Tue Sep 13, 2011 08: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.
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM

Re: funcionalidad en xBrowse

Posted: 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.

Continue the discussion