XBrowse Win7 Bar New Sample

Re: XBrowse Win7 Bar New Sample

Postby nageswaragunupudi » Mon Jan 03, 2011 2:00 pm

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10642
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBrowse Win7 Bar New Sample

Postby nageswaragunupudi » Mon Jan 03, 2011 2:07 pm

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10642
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBrowse Win7 Bar New Sample

Postby Silvio » Tue Jan 04, 2011 10:29 am

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
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: XBrowse Win7 Bar New Sample

Postby nageswaragunupudi » Tue Jan 04, 2011 12:24 pm

Mr. Silvio
As I advised, please set the datasource by one of the appropriate methods like SetRDD() or SetODBF() soon after creating the XBrowse.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10642
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBrowse Win7 Bar New Sample

Postby Silvio » Tue Jan 04, 2011 12:46 pm

YES NOW RUN OK
THANKS
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: XBrowse Win7 Bar New Sample

Postby James Bott » Tue Jan 04, 2011 1:34 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: XBrowse Win7 Bar New Sample

Postby James Bott » Tue Jan 04, 2011 1:38 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: XBrowse Win7 Bar New Sample

Postby ukservice » Wed Jan 05, 2011 9:00 am

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 )
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: XBrowse Win7 Bar New Sample

Postby MdaSolution » Wed Jan 05, 2011 11:02 am

NO you must copy the subclass Txbrowse7win Rao made
Go to thr first messageof this topic
FWH .. BC582.. xharbour
User avatar
MdaSolution
 
Posts: 401
Joined: Tue Jan 05, 2010 2:33 pm

Re: XBrowse Win7 Bar New Sample

Postby ukservice » Wed Jan 05, 2011 11:07 am

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.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: XBrowse Win7 Bar New Sample

Postby James Bott » Wed Jan 05, 2011 3:01 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: XBrowse Win7 Bar New Sample

Postby nageswaragunupudi » Wed Jan 05, 2011 4:04 pm

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10642
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBrowse Win7 Bar New Sample

Postby nageswaragunupudi » Wed Jan 05, 2011 4:06 pm

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10642
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: XBrowse Win7 Bar New Sample

Postby James Bott » Wed Jan 05, 2011 5:58 pm

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 )
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: XBrowse Win7 Bar New Sample

Postby nageswaragunupudi » Wed Jan 05, 2011 6:39 pm

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10642
Joined: Sun Nov 19, 2006 5:22 am
Location: India

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests