New txbrowse

New txbrowse

Postby Silvio.Falconi » 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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: New txbrowse

Postby Marc Venken » Fri Apr 12, 2024 2: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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1439
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: New txbrowse

Postby Silvio.Falconi » Fri Apr 12, 2024 3: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: New txbrowse

Postby FiveWiDi » Sat Apr 13, 2024 3: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 24.02 + Harbour 3.2.0dev (r2403071241), BCC 7.7 Windows 10
FiveWiDi
 
Posts: 1190
Joined: Mon Oct 10, 2005 2:38 pm

Re: New txbrowse

Postby Silvio.Falconi » Mon Apr 22, 2024 9: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

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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7070
Joined: Thu Oct 18, 2012 7:17 pm

Re: New txbrowse

Postby Marc Venken » 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.04 with Harbour
User avatar
Marc Venken
 
Posts: 1439
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: New txbrowse

Postby Silvio.Falconi » Mon Apr 22, 2024 7: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7070
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: MaxP and 68 guests