Page 1 of 1

Using Xbrowser function bar in Xbrowse setup

PostPosted: Tue Apr 25, 2017 8:24 am
by Marc Venken
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 ?

Re: Using Xbrowser function bar in Xbrowse setup

PostPosted: Thu Apr 27, 2017 6:26 am
by nageswaragunupudi
Please try this sample
Code: Select all  Expand view
#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

Re: Using Xbrowser function bar in Xbrowse setup

PostPosted: Thu Apr 27, 2017 8:11 am
by Marc Venken
Thanks. Exactly what I needed

Re: Using Xbrowser function bar in Xbrowse setup

PostPosted: Thu Apr 27, 2017 2:52 pm
by joseluisysturiz
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

Re: Using Xbrowser function bar in Xbrowse setup

PostPosted: Sat Apr 29, 2017 9:18 pm
by Marc Venken
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: Select all  Expand view
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: Select all  Expand view
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

Re: Using Xbrowser function bar in Xbrowse setup

PostPosted: Sat Apr 29, 2017 9:27 pm
by nageswaragunupudi
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()

Re: Using Xbrowser function bar in Xbrowse setup

PostPosted: Sat Apr 29, 2017 9:28 pm
by nageswaragunupudi
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.

Re: Using Xbrowser function bar in Xbrowse setup

PostPosted: Sat Apr 29, 2017 11:47 pm
by joseluisysturiz
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 ...

Re: Using Xbrowser function bar in Xbrowse setup

PostPosted: Tue Jun 13, 2017 3:00 am
by joseluisysturiz
Algo sobre esto..? gracias... :shock: