FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour New txbrowse
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
New txbrowse
Posted: Fri Apr 12, 2024 10:34 AM

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

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: New txbrowse
Posted: Fri Apr 12, 2024 02:23 PM
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
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: New txbrowse
Posted: Fri Apr 12, 2024 03:58 PM
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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 1445
Joined: Mon Oct 10, 2005 02:38 PM
Re: New txbrowse
Posted: Sat Apr 13, 2024 03:56 PM

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,

Un Saludo

Carlos G.



FiveWin 25.12 + Harbour 3.2.0dev (r2502110321), BCC 7.7 Windows 11 Home

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: New txbrowse
Posted: Mon Apr 22, 2024 09:13 AM
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



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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: New txbrowse
Posted: Mon Apr 22, 2024 12:20 PM
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.
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: New txbrowse
Posted: Mon Apr 22, 2024 07:44 PM
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.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion