Page 3 of 5

Re: XBrowse Win7 Bar New Sample

PostPosted: Mon Jan 03, 2011 2:00 pm
by nageswaragunupudi
Mr. Silvio

Before you use
Code: Select all  Expand view
oApp():oGrid:SetBackGround("c:\work\fwh\bitmaps\five.bmp", 1 )
 

you must have already assigned the datasource ( cAlias, oRs,oDbf. etc. with methods like SetRDD/SetADO,etc and preferably define atleast some columns ).
My advice is that the datasource be defined soon after creating the xbrowse.

Re: XBrowse Win7 Bar New Sample

PostPosted: Mon Jan 03, 2011 2:07 pm
by nageswaragunupudi
Addressing a limited point.

Code: Select all  Expand view
MyBrowse( oData,aColumns,aHeaders, aSizes,aPictures,xRights,aSearch,bOnLClick,aM_Bitmaps)

   <code>
    @ 0,0 XBROWSE oBrw OF oWnd DATASOURCE oData ;
           COLUMNS aColumns HEADERS aHeaders ;
           SIZES aSizes PICTURES aPictures ;
           CELL LINES
    WITH OBJECT oBrw
         <code>
          :AddBitmap( aM_Bitmaps )
         <othercode>
     END
     <othercode>
return nil
 

Yes. Some of the parameters can be NIL also.

Re: XBrowse Win7 Bar New Sample

PostPosted: Tue Jan 04, 2011 10:29 am
by Silvio
MR RAO,

I made :
// OPEN DATABASE
oDHard:=Apri_dbf("Hardware",.T.,.T.,aIdx)
(oDHard)->(OrdSetFocus(2))

// CREATE Dialog and XBROWSE
oApp():oDlg := TMia():New(oApp():oWndMain)
oApp():oDlg:cTitle := i18n('Gestione Hardware')
oApp():oDlg:SetColor(0,RGB(143,172,230))
oApp():oWndMain:oClient := oApp():oDlg
oApp():oDlg:NewGrid7( nSplit )


// INSERT COLUMNS

oCol:= oApp():oGrid:AddCol()
oCol:AddResource("sort3")
oCol:AddResource("sort4")
oCol:AddResource( 'TREE_AULE')
oCol:bBmpData := { || 3 }
oCol:bStrData := { || ( oDHard)->Laboratory}
oCol:cHeader := "Aula/lab"
oCol:nWidth :=120
oCol:nHeadBmpNo := 1
oCol:nHeadBmpAlign := AL_RIGHT
oCol:oDataFont := oFontGrid
oCol:bLClickHeader :={ ||(Sel_Index(1,oDHard) , oApp():oTab:nOption:=1,oApp():oTab:refresh()) }



.......
( the other columns)
......

WITH OBJECT oApp():oGrid
:nMarqueeStyle = 7 // MARQSTYLE_HIGHLWIN7 // for Windows 7 style

END

oApp():oGrid:SetBackGround("c:\work\fwh\bitmaps\five.bmp", 1 )

oApp():oGrid:CreateFromCode()

oApp():oGrid:nRowHeight :=40
oApp():oGrid:nHeaderHeight := 36


IT MAKE ERROR


I TRIED TO INSERT
oApp():oGrid:SetBackGround("c:\work\fwh\bitmaps\five.bmp", 1 )

ALSO AFTER THE COMMAND oApp():oGrid:CreateFromCode()

BUT IT MAKE THE SAME ERROR

Re: XBrowse Win7 Bar New Sample

PostPosted: Tue Jan 04, 2011 12:24 pm
by nageswaragunupudi
Mr. Silvio
As I advised, please set the datasource by one of the appropriate methods like SetRDD() or SetODBF() soon after creating the XBrowse.

Re: XBrowse Win7 Bar New Sample

PostPosted: Tue Jan 04, 2011 12:46 pm
by Silvio
YES NOW RUN OK
THANKS

Re: XBrowse Win7 Bar New Sample

PostPosted: Tue Jan 04, 2011 1:34 pm
by James Bott
Adolfo,

OK, but instead of "real browses" I would refer to them as "complex browses." Granted many, if not most, will be too complex to completely define with a single command line.

Regarding OJB size, I am guessing that what Rao was refering to is not just TBRows():new() but rather trying to eliminate some of the other OOP syntax lines of code. There is a lot of code built into the xbrowse class that is used when you make command line specifications. When this is utilized, then you can eliminate some of the other OOP syntax. This would eliminate some lines of code in the app because code in the class handles it. This would create a smaller OBJ, but not much smaller, I would think. If you had dozens of browses, then maybe the size reduction would be more significant.

Regards,
James

Re: XBrowse Win7 Bar New Sample

PostPosted: Tue Jan 04, 2011 1:38 pm
by James Bott
Rao,

Please explain the advantage of using TXBrow() instead of TXBrowse():New(). I see that TXBrow() uses a codeblock to call TXBrowse() but I don't understand what the significance of that is.

Regards,
James

Re: XBrowse Win7 Bar New Sample

PostPosted: Wed Jan 05, 2011 9:00 am
by ukservice
Hello,

Mr. Rao, can you please indicate how to modify those methods in xbrowse.prg?.

Thank you.

METHOD Adjust()
METHOD FullPaint() INLINE ( ::lTransparent .or. ::lMergeVert .or. ::nMarqueeStyle == MARQSTYLE_HIGHLWIN7 )
METHOD DrawLine( lSelected, nRowSel )

Re: XBrowse Win7 Bar New Sample

PostPosted: Wed Jan 05, 2011 11:02 am
by MdaSolution
NO you must copy the subclass Txbrowse7win Rao made
Go to thr first messageof this topic

Re: XBrowse Win7 Bar New Sample

PostPosted: Wed Jan 05, 2011 11:07 am
by ukservice
Mr. Mda,

I prefer to modify xbrowse.prg as I have more than 200 Xbrowses!!!.

I don´t know where to place the modifications in xbrowse.org (at the beginning or end of methods).

Thank you.

Re: XBrowse Win7 Bar New Sample

PostPosted: Wed Jan 05, 2011 3:01 pm
by James Bott
UKService,

All you need to do is to add the new class to your app and then change xbrowse.ch to call the new class instead of TXBrowse().

Regards,
James

Re: XBrowse Win7 Bar New Sample

PostPosted: Wed Jan 05, 2011 4:04 pm
by nageswaragunupudi
James Bott wrote:UKService,

All you need to do is to add the new class to your app and then change xbrowse.ch to call the new class instead of TXBrowse().

Regards,
James

Mr. James and Mr. UKService

We do NOT need to change anything in xbrowse.ch or anywhere else in the libraries at all.

Just write one line of code at the beginning of the application:
Code: Select all  Expand view
SET XBROWSE TO TXbrWin7()

or
Code: Select all  Expand view
SetXBrowse( { || TXBrWin7() } )


This is the only one line to be added at the beginning of the application. NO OTHER CHANGES.

Conditions:
1. Works perfectly where browses are created by command syntax.
2. Or if Oops style is used browses are created by oBrw := TXBrows():New(...) but not TXBrowse():New() (As recommended by FWH)

XBrowse libraries and architecture are specially built to facilitate use of inherited classes without any changes in the commands or libraries.

Re: XBrowse Win7 Bar New Sample

PostPosted: Wed Jan 05, 2011 4:06 pm
by nageswaragunupudi
James Bott wrote:Rao,

Please explain the advantage of using TXBrow() instead of TXBrowse():New(). I see that TXBrow() uses a codeblock to call TXBrowse() but I don't understand what the significance of that is.

Regards,
James

Mr. James

I hope my earlier posting answers your question.
FWH advises to use TXBrows():New() or command sytax, so that using inherited classes is made extremely simple.

This architecture is devised and implemented keeping in view that real life applications may have hundreds of browses and it is difficult to keep making changes in hundreds of places.

Re: XBrowse Win7 Bar New Sample

PostPosted: Wed Jan 05, 2011 5:58 pm
by James Bott
Rao,

2. Or if Oops style is used browses are created by oBrw := TXBrows():New(...) but not TXBrowse():New() (As recommended by FWH)


OK, I see the advantage of using this syntax. However, for UKService, assuming he is currently using TXBrowse():New(), he would have to change all 200 of these to the TBrow() syntax. If he were to change the xbrowse.ch file, then he only needs to make one change.

Also, you refer to TXBrow():New() but TXBrow is a function so the proper syntax is just TXBrow() is that not correct? Further it only seems to accept a single codeblock as a parameter, so I don't understand how this is used.

Regards,
James

Code: Select all  Expand view
Function TXBrows( bChild )

   if bXBrowse == nil
      bXBrowse    := { || TXBrowse() }
   endif

   if ValType( bChild ) == 'B' .and. ; // retained for backward compatibility
      ValType( Eval( bChild ) ) == 'O' .and. ;
      Eval( bChild ):IsKindOf( TXBrowse() )

      bXBrowse    := bChild
   endif

return Eval( bXBrowse )

Re: XBrowse Win7 Bar New Sample

PostPosted: Wed Jan 05, 2011 6:39 pm
by nageswaragunupudi
OK, I see the advantage of using this syntax. However, for UKService, assuming he is currently using TXBrowse():New(), he would have to change all 200 of these to the TBrow() syntax. If he were to change the xbrowse.ch file, then he only needs to make one change.

Also, you refer to TXBrow():New() but TXBrow is a function so the proper syntax is just TXBrow() is that not correct? Further it only seems to accept a single codeblock as a parameter, so I don't understand how this is used.

TXBrows():new(oWnd) // not TXBrow()

It is easier to change "TXBrowse(" to "TXBrows(" in one stroke in all sources with a single operation with any program editor. Anyway we are changing to what FWH recommends.

Changing xbrowse.ch does not help. It calls functions. FWH library never internally uses TXBrowse():new() to construct xbrowse. Even internally it calls only TXBrows():New()

I can assure you that this system is quite robust and works perfectly.

Use either command syntax or TXBrows():New().

You can use any derived class for the whole application or different derived c;asses fpr different browses, everything works smoothly.

CaveAt: Resources need to be changed.