FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Using Xbrowser function bar in Xbrowse setup
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Using Xbrowser function bar in Xbrowse setup
Posted: Tue Apr 25, 2017 08:24 AM

Can we activate the action bar ( arrows, print, exel, ....) that you see when we use

xbrowser(oSource)

in

@ 10,10 XBROWSE oBrw size 1200,500 PIXEL OF oDlg font oFont ;
DATASOURCE "leden" ;
COLUMNS aVelden;
AUTOSORT CELL LINES NOBORDER

Or can we make a button and call the functions from there ?

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Using Xbrowser function bar in Xbrowse setup
Posted: Thu Apr 27, 2017 06:26 AM
Please try this sample
Code (fw): Select all Collapse
#include "fivewin.ch"

REQUEST DBFCDX

function Main()

   local oDlg, oBar, oBrw

   USE CUSTOMER

   DEFINE DIALOG oDlg SIZE 900,500 PIXEL TRUEPIXEL
   DEFINE BUTTONBAR oBar OF oDlg SIZE 56,56 2013

   @ 70,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
      DATASOURCE Alias() AUTOCOLS FASTEDIT ;
      CELL LINES NOBORDER

   WITH OBJECT oBrw
      :nEditTypes    := EDIT_GET
      :CreateFromCode()
   END

   BrwBarBtns( oBar, oBrw )

   ACTIVATE DIALOG oDlg CENTERED

return nil

function BrwBarBtns( oBar, oBrw )

   local n := 1

   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\top.bmp" PROMPT "Top" TOOLTIP "Go Top" ;
      ACTION ( oBrw:GoTop(), oBrw:SetFocus() )
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\16x16\goto.bmp" PROMPT "GoTo" TOOLTIP "Go To Record" ;
      ACTION ( If( MsgGet( "GOTO RECORD", "Enter Rec No #", @n ), ;
         ( oBrw:BookMark := n, oBrw:Refresh() ), nil ), oBrw:SetFocus() )
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\bottom.bmp" PROMPT "Bottom" TOOLTIP "GoBottom" ;
      ACTION ( oBrw:GoBottom(), oBrw:SetFocus() )
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\new2.bmp" PROMPT "Add"  GROUP TOOLTIP "Add New Record" ;
      ACTION oBrw:EditSource( .t. )
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\edit.bmp" PROMPT "Edit" TOOLTIP "Edit Record" ;
      ACTION oBrw:EditSource()
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\16x16\delete0.bmp" PROMPT "Delete" TOOLTIP "Delete Record" ;
      ACTION ( If( MsgYesNo( "Delete Record?" ), oBrw:Delete(), nil ), oBrw:SetFocus() )
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\16x16\excel.bmp" PROMPT "Excel"  GROUP TOOLTIP "Export to Excel" ;
      ACTION oBrw:ToExcel()
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\printquick16.bmp" PROMPT "Print" TOOLTIP "Print Report" ;
      ACTION oBrw:Report()
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\close.bmp" PROMPT "Close" GROUP TOOLTIP "Close" ;
      ACTION oBrw:oWnd:End()

return nil

You can use this as a template.
You may adopt this to your taste, by changing bitmaps, prompts, bar style, size, etc.
The may also add some buttons or remove some buttons depending on your need.
Same code will work for RDD, ADO, MySql, etc
Regards



G. N. Rao.

Hyderabad, India
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Using Xbrowser function bar in Xbrowse setup
Posted: Thu Apr 27, 2017 08:11 AM

Thanks. Exactly what I needed

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 2064
Joined: Fri Jan 06, 2006 09:28 PM
Re: Using Xbrowser function bar in Xbrowse setup
Posted: Thu Apr 27, 2017 02:52 PM

Hi Mr. NAO, is there a way to place a few buttons in the footer in general way to go to, upload, download, quantity of records, print, etc.? That theme I suggested some time ago, when I can check what can be done, I think it would help a lot in the xbrowse style, thank you.

Using google translate

Ver...

viewtopic.php?f=6t=29954start=0hilit=barra+de+botones

Thank you

&&&

Dios no está muerto...



Gracias a mi Dios ante todo!
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Using Xbrowser function bar in Xbrowse setup
Posted: Sat Apr 29, 2017 09:18 PM
I have it perfectly working in normal oDlg or oWnd

But how to use this function when I want to use folders ?

I have a Dlg where I create buttons in a loop

Code (fw): Select all Collapse
nMove:=0
   nTop:= 80
   nLeft:= 1225
   for i = 1 to len(aPloegen)
      nMove+=30
      cPloeg = alltrim(aPloegen[i])
      if i = 14
         nMove:=30
         nTop:= 80
         nLeft:= 1315
      endif
      @ nTop+nMove,nLeft BTNBMP aBtn[i] OF oDlg SIZE 80, 25 NOBORDER PROMPT aPloegen[i] 2007 ACTION SET_SCOPE_ploegen(oBrw,::cCaption) font oBold CENTER
   next


than I create a folder with 4 tabs, each tab has a Xbrowse with the same database, only different fields.
I also Use Mr Rao's function to show options for the browse to happen.
Now it will always use the browse setting from the first folder, but how to changes the buttons behavior so that when folder 2 gets focus,
all buttons will act from the second browse (insite folder2)


Code (fw): Select all Collapse
function BrwBarBtns( oBar, oBrw )

   local n := 1

   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\top.bmp" PROMPT "Top" TOOLTIP "Go Top" ;
      ACTION ( oBrw:GoTop(), oBrw:SetFocus() )
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\16x16\goto.bmp" PROMPT "GoTo" TOOLTIP "Go To Record" ;
      ACTION ( If( MsgGet( "GOTO RECORD", "Enter Rec No #", @n ), ;
         ( oBrw:BookMark := n, oBrw:Refresh() ), nil ), oBrw:SetFocus() )
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\bottom.bmp" PROMPT "Bottom" TOOLTIP "GoBottom" ;
      ACTION ( oBrw:GoBottom(), oBrw:SetFocus() )
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\new2.bmp" PROMPT "Add"  GROUP TOOLTIP "Add New Record" ;
      ACTION oBrw:EditSource( .t. )
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\edit.bmp" PROMPT "Edit" TOOLTIP "Edit Record" ;
      ACTION oBrw:EditSource()
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\16x16\delete0.bmp" PROMPT "Delete" TOOLTIP "Delete Record" ;
      ACTION ( If( MsgYesNo( "Delete Record?" ), oBrw:Delete(), nil ), oBrw:SetFocus() )
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\16x16\excel.bmp" PROMPT "Excel"  GROUP TOOLTIP "Export to Excel" ;
      ACTION oBrw:ToExcel()
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\printquick16.bmp" PROMPT "Print" TOOLTIP "Print Report" ;
      ACTION oBrw:Report()
   DEFINE BUTTON OF oBar FILE "\fwh\bitmaps\close.bmp" PROMPT "Close" GROUP TOOLTIP "Close" ;
      ACTION oBrw:oWnd:End()

return nil
Marc Venken

Using: FWH 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Using Xbrowser function bar in Xbrowse setup
Posted: Sat Apr 29, 2017 09:27 PM

Many ways:
Here is one simple way.

Keep an array of aBrw[ 4 ]
Define the 4 browses on 4 folders as aBrw[ 1 ], aBrw[ 2 ]. .... etc/

Change the button actions like

ACTION aBrw[oFld:nOption]:GoTop()

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Using Xbrowser function bar in Xbrowse setup
Posted: Sat Apr 29, 2017 09:28 PM
joseluisysturiz wrote:Hi Mr. NAO, is there a way to place a few buttons in the footer in general way to go to, upload, download, quantity of records, print, etc.? That theme I suggested some time ago, when I can check what can be done, I think it would help a lot in the xbrowse style, thank you.

Using google translate

Ver...

viewtopic.php?f=6&t=29954&start=0&hilit=barra+de+botones

Thank you

Right now there is no way of placing buttons on footer or header of xbrowse.
Best way is to position the buttons to align just below the xbrowse.
Regards



G. N. Rao.

Hyderabad, India
Posts: 2064
Joined: Fri Jan 06, 2006 09:28 PM
Re: Using Xbrowser function bar in Xbrowse setup
Posted: Sat Apr 29, 2017 11:47 PM
nageswaragunupudi wrote:
joseluisysturiz wrote:Hi Mr. NAO, is there a way to place a few buttons in the footer in general way to go to, upload, download, quantity of records, print, etc.? That theme I suggested some time ago, when I can check what can be done, I think it would help a lot in the xbrowse style, thank you.

Using google translate

Ver...

viewtopic.php?f=6&t=29954&start=0&hilit=barra+de+botones

Thank you

Right now there is no way of placing buttons on footer or header of xbrowse.
Best way is to position the buttons to align just below the xbrowse.



If I understand, but that means that the buttons would be on, dialog, folder, etc ... and the good would be that the buttons were part of the xbrowse itself, more than everything when using several xbrowse in the same dialog..se that They will succeed, it has many advantages, thank you Mr. NAO.

Using google translator ...
Dios no está muerto...



Gracias a mi Dios ante todo!
Posts: 2064
Joined: Fri Jan 06, 2006 09:28 PM
Re: Using Xbrowser function bar in Xbrowse setup
Posted: Tue Jun 13, 2017 03:00 AM

Algo sobre esto..? gracias... :shock:

Dios no está muerto...



Gracias a mi Dios ante todo!

Continue the discussion