Using Xbrowser function bar in Xbrowse setup

Using Xbrowser function bar in Xbrowse setup

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

Re: Using Xbrowser function bar in Xbrowse setup

Postby nageswaragunupudi » Thu Apr 27, 2017 6:26 am

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
Regards

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

Re: Using Xbrowser function bar in Xbrowse setup

Postby Marc Venken » Thu Apr 27, 2017 8:11 am

Thanks. Exactly what I needed
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1338
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Using Xbrowser function bar in Xbrowse setup

Postby joseluisysturiz » Thu Apr 27, 2017 2: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=6&t=29954&start=0&hilit=barra+de+botones

Thank you
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: Using Xbrowser function bar in Xbrowse setup

Postby Marc Venken » Sat Apr 29, 2017 9: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: 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
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1338
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Using Xbrowser function bar in Xbrowse setup

Postby nageswaragunupudi » Sat Apr 29, 2017 9: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
User avatar
nageswaragunupudi
 
Posts: 10206
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Using Xbrowser function bar in Xbrowse setup

Postby nageswaragunupudi » Sat Apr 29, 2017 9: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
User avatar
nageswaragunupudi
 
Posts: 10206
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Using Xbrowser function bar in Xbrowse setup

Postby joseluisysturiz » 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!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela

Re: Using Xbrowser function bar in Xbrowse setup

Postby joseluisysturiz » Tue Jun 13, 2017 3:00 am

Algo sobre esto..? gracias... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 10 guests