Page 1 of 1

New txbrowse

PostPosted: Fri Apr 12, 2024 10:34 am
by Silvio.Falconi
I need to use a particular xbrowse and have some particular buttons at my foot, this in all the dialogs and I was wondering if I could create an already defined xbrowse without having to copy the same lines every time for each procedure.

Furthermore, in the xbrowse columns I need to set many (default) columns but in reality the end user can only show some of them at the beginning, the procedure must show the standard columns.

I found how to do it but I don't want to modify the original class

Re: New txbrowse

PostPosted: Fri Apr 12, 2024 2:23 pm
by Marc Venken
Silvio,

You can keep the original class and add your own data to it as far as I read this post :

https://forums.fivetechsupport.com/viewtopic.php?f=3&t=37281https://forums.fivetechsupport.com/viewtopic.php?f=3&t=37281

Re: New txbrowse

PostPosted: Fri Apr 12, 2024 3:58 pm
by Silvio.Falconi
Marc Venken wrote:Silvio,

You can keep the original class and add your own data to it as far as I read this post :

https://forums.fivetechsupport.com/viewtopic.php?f=3&t=37281https://forums.fivetechsupport.com/viewtopic.php?f=3&t=37281


I make somethig with Override but I can add or modify a method but I not Know how create new datas

Re: New txbrowse

PostPosted: Sat Apr 13, 2024 3:56 pm
by FiveWiDi
Hola silvio,

Tengo una clase:

CLASS TFactur_1 FROM TIMPRIME
CLASSDATA lRegistered AS LOGICAL
DATA oFont_6
.....

que cuando la compilo da este .ppo:

_HB_CLASS TFactur_1 ; function TFactur_1 ( ... ) ; STATIC s_oClass ; LOCAL nScope, oClass, oInstance ; IF s_oClass == NIL .AND. __clsLockDef( @s_oClass ) ; BEGIN SEQUENCE ; nScope := 1 ; ( ( nScope ) ) ; oClass := iif( .F.,, HBClass():new( "TFactur_1", iif( .T., { @TIMPRIME() }, { @HBObject() } ), @TFactur_1() ) ) ;
_HB_MEMBER { AS LOGICAL lRegistered } ; oClass:AddMultiClsData( "LOGICAL",, nScope + iif( .F., 16, 0 ) + iif( .T., 32, 0 ) + iif( .F., 256, 0 ) + iif( .F., 2048, 0 ), {"lRegistered"}, .F. )
_HB_MEMBER { oFont_6 } ; oClass:AddMultiData(,, nScope + iif( .F., 16, 0 ) + iif( .F., 256, 0 ) + iif( .F., 2048, 0 ), {"oFont_6"}, .F. )

Quizás puedes utilizar _HB_MEMBER{....

Saludos,

Re: New txbrowse

PostPosted: Mon Apr 22, 2024 9:13 am
by Silvio.Falconi
best solution

@ 103,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE oDbf COLUMNS aCols ;
AUTOSORT FONT oFont;
NOBORDER CELL LINES CLASS TMyBrowse()

CLASS TMyBrowse FROM TXBrowse
CLASSDATA lRegistered AS LOGICAL
DATA aCols2Hide AS ARRAY INIT Array(0)
DATA aDefaultCols INIT ARRAY( 0 )
DATA aPreviousCols INIT ARRAY( 0 )
METHOD New (nRow, nCol, nWidth, nHeight, oWnd)
METHOD SetUserCols(lDefCols)
ENDCLASS

this is useful because there can be many columns to display, the end user can display the ones he wants, the programmer recommends the basic columns


result

Image

Nageswarao never included the possibility of having default columns and those suggested by the programmer and those predefined by the end user, I made some changes created by Francisco and created a sub class of xbrowse

this is to avoid that every time a new version of fwh comes out I don't have to rewrite the changes on the original class

Re: New txbrowse

PostPosted: Mon Apr 22, 2024 12:20 pm
by Marc Venken
Nageswarao never included the possibility of having default columns and those suggested by the programmer and those predefined by the end user, I made some changes created by Francisco and created a sub class of xbrowse


Is it not a option to set the colums, save the state of xbrowse (selected from users) and the let the users select one of the saved states ?

I still like the idea to subclass xbrowse for our own purposes, and will look into it.

Re: New txbrowse

PostPosted: Mon Apr 22, 2024 7:44 pm
by Silvio.Falconi
Marc Venken wrote:
Nageswarao never included the possibility of having default columns and those suggested by the programmer and those predefined by the end user, I made some changes created by Francisco and created a sub class of xbrowse


Is it not a option to set the colums, save the state of xbrowse (selected from users) and the let the users select one of the saved states ?

I still like the idea to subclass xbrowse for our own purposes, and will look into it.


Yes.
Imagine you have many fields for customer archive.
the programmer makes all the fields available to the end user but for space reasons sets some columns (defined columns) you end user wants to select the columns to display because you don't like the columns displayed, in the menu there is the possibility to return back i.e. to display xbrowse with the previous columns, obviously the state is saved. xbrowse's setcolumns() method has been changed and loaded at the beginning of the procedure in override mode. by doing this way I don't need to go and modify the original xbrowse class every time, so I always have the compatible fwh version.

We noticed a problem in xbrowse when using the SetMultiSelectCol() method, sometimes it saves the column where the checkbox is located as col-1, col-2, col-3, col4 each time so in the state it increases by one field which doesn't actually exist, but this error only happened once and we are trying to understand the error.