Booking xbrowse example

Booking xbrowse example

Postby Antonio Linares » Mon Jul 10, 2023 6:13 am

Original idea by Silvio, implemented by Mr. Rao

You can drag & drop the reservations using the mouse

booking.prg
Code: Select all  Expand view
#include "fivewin.ch"

function Main()

   local oDlg, oBrw, oFont, oCur
   local aData := Array( 6, 11 )
   local n
   local aColors := { METRO_AMBER, METRO_OLIVE, CLR_HMAGENTA, CLR_HBLUE, CLR_HRED, CLR_HGREEN, CLR_RED, CLR_MAGENTA, CLR_GREEN }
   AEval( aData, { |a,i| AFill( a, 0 ), a[ 1 ] := "Camera n." + Str(i,1,0) } )

   SET DATE ITALIAN

   DEFINE CURSOR oCur DRAG
   DEFINE FONT oFont NAME "VERDANA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 760,430 PIXEL TRUEPIXEL ;
      RESIZABLE FONT oFont

   @ 5,5 XBROWSE oBrw SIZE 0,400 PIXEL OF oDlg DATASOURCE aData ;
      COLUMNS 1,2,3,4,5,6,7,8,9,10,11 ;
      HEADERS "", "AM","PM","AM","PM","AM","PM","AM","PM","AM","PM" ;
      NOBORDER STYLE FLAT

   WITH OBJECT oBrw
      :nWidths             := 60
      :nRowHeight          := 60
      :nHeaderHeight       := 60
      :nColDividerStyle    := ;
      :nRowDividerStyle    := LINESTYLE_LIGHTGRAY
      :nMarqueeStyle       := MARQSTYLE_SOLIDCELL
      :lDrawBorder         := .t.
      :nDataStrAligns      := AL_CENTER
      :lDisplayZeros       := .f.
      :nFreeze             := 1
      :lLockFreeze         := .t.
      :lAllowColSwapping   := .f.
      :lAllowColHiding     := .f.
      :lAllowRowSizing     := .f.
      :lAllowSizings       := .f.
      :lColChangeNotify    := .t.

      :bClrStd := <|b,oCol|
         local nClr  := CLR_WHITE
         if oCol != nil .and. !Empty( oCol:Value )
            nClr  := aColors[ oCol:Value ]
         endif
         return { ContrastClr( nClr ), nClr }
         >

      for n := 2 to 10 step 2
         :SetGroupHeader( DTOC( Date() + n/2 - 1 ), n, n + 1, nil, nil, 30 )
      next
      WITH OBJECT :aCols[ 1 ]
         :nWidth     := aData[ 1, 1 ] + "9999"
         :bClrStd    := ;
         :bClrHeader := { || { CLR_BLACK, RGB(125,135,249) } }
         :nDataStrAlign := AL_CENTER
      END

      :bPopUp     := { |oCol| CellMenu( oCol ) }
      :lRecordSelector  := .f.
      :lFitGridHeight   := .t.

      // drag and drop

      :bChange       := < ||
                           local oCol := oBrw:SelectedCol()
                           if oCol:nArrayCol > 1 .and. !Empty( oCol:Value )
                              oBrw:oDragCursor := oCur
                           else
                              oBrw:oDragCursor := nil
                           endif
                           return nil
                           >

      :bDragBegin    := < |r,c,f|
                           SetDropInfo( { oBrw:nArrayAt, oBrw:SelectedCol():nArrayCol } )
                           return nil
                           >
      :bDropOver     := < |u,r,c,f|
                           oBrw:SetPos( r, c, .t. )
                           oBrw:SelectedCol():Value := aData[ u[ 1 ], u[ 2 ] ]
                           aData[ u[ 1 ], u[ 2 ] ] := 0
                           XEval( oBrw:bChange, oBrw )
                           oBrw:Refresh()
                           return nil
                        >

      //

      :nColSel    := 2
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont
   RELEASE CURSOR oCur

return nil
   
   //----------------------------------------------------------------------------//
   
   static function CellMenu( oCol )
   
      local oPop, oItem, oBrw, nVal, n
   
      if oCol:nCreationOrder > 1
         nVal  := oCol:Value
         oBrw  := oCol:oBrw
         MENU oPop POPUP 2010
            MENUITEM "Reserve To:"
            MENU
            for n := 1 to 9
               MENUITEM "Customer-" + Str(n,1,0) BLOCK Reserve( oCol, n )
            next
            ENDMENU
            MENUITEM "Cancel" WHEN nVal > 0 ACTION ;
               ( oCol:Value := 0, oBrw:RefreshCurrent() )
         ENDMENU
   
      endif
   
   return oPop
   
   static function Reserve( oCol, n )
   return { || oCol:Value := n, oCol:oBrw:RefreshCurrent() }

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Booking xbrowse example

Postby Detlef » Wed Jul 12, 2023 9:18 am

This works great, Antonio.
It demonstrates the power of xbrowse and fwh.
Thanks for this great example. :D

Only a little glitch...
When the program starts and you reserve a first cell to a customer you can not immediately drag and drop this cell.
First you must click at an other cell. Then after drag and drop works well.

Regards,
Detlef
User avatar
Detlef
 
Posts: 205
Joined: Mon Feb 07, 2022 9:54 pm

Re: Booking xbrowse example

Postby Antonio Linares » Wed Jul 12, 2023 9:26 am

Thank you dear Detlef,

Mr. Rao is working on an enhanced version. Lets wait a little for him to deliver it

Its another great work from Mr. Rao :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Booking xbrowse example

Postby Detlef » Wed Jul 12, 2023 9:46 am

Its another great work from Mr. Rao :-)

That's true! :D
User avatar
Detlef
 
Posts: 205
Joined: Mon Feb 07, 2022 9:54 pm

Re: Booking xbrowse example

Postby Silvio.Falconi » Fri Jul 21, 2023 9:25 am

As I told you, I use on reserva.dbf a field "type" to show the type of Rome, so I need this visualizzation, there are rooms with the same number buy with type different.

sample:

Camera n.1 SS
Camera n.1 DD

For evening or morning (AM -PM) I use two logic field.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Booking xbrowse example

Postby Silvio.Falconi » Tue Sep 19, 2023 7:19 am

Antonio Linares wrote:Thank you dear Detlef,

Mr. Rao is working on an enhanced version. Lets wait a little for him to deliver it

Its another great work from Mr. Rao :-)


Antonio,

when a an enhanced version ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Booking xbrowse example

Postby Antonio Linares » Tue Sep 19, 2023 9:21 am

Dear Silvio,

I just asked Mr. Rao

waiting for his answer
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Booking xbrowse example

Postby Detlef » Fri Dec 29, 2023 3:32 pm

Is there some progress? I'm very interested too about this topic.

I wish you all a very happy, healthy and successful new year.
Regards, Detlef
User avatar
Detlef
 
Posts: 205
Joined: Mon Feb 07, 2022 9:54 pm

Re: Booking xbrowse example

Postby Antonio Linares » Fri Dec 29, 2023 3:40 pm

Dear Detlef,

I just asked Mr. Rao about it

wish you too a very happy, healthy and successful new year :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Booking xbrowse example

Postby Otto » Sat Dec 30, 2023 7:46 am

Hello friends,

Why not try recreating this example as a proof of concept to demonstrate the power of WebView as a WebView example?

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: Booking xbrowse example

Postby Antonio Linares » Sat Dec 30, 2023 8:25 am

Dear Otto,

thats a nice idea :-)

Surely you may be able to help us with some existing web code to start with
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Booking xbrowse example

Postby Silvio.Falconi » Sat Dec 30, 2023 12:32 pm

Antonio Linares wrote:Dear Otto,

thats a nice idea :-)

Surely you may be able to help us with some existing web code to start with


Yes but before It Need to have a usefull prg in Windows with the features i list above and the possibilty to insert a reservation clickinking with the mouse One or more cells , or moving the reservation to another room or period.


in this way the example of nages is nice but in Italy it is unusable at least for what I need and what they require both for hotels and for other businesses in the sector
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Re: Booking xbrowse example

Postby Otto » Sat Dec 30, 2023 6:28 pm

Silvio,

Webview allows the use of prg programs, just as you create them, while still utilizing web technologies.
You should really look at the examples in the FIVEWIN samples.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: Booking xbrowse example

Postby Otto » Sat Dec 30, 2023 6:54 pm

Dear Antonio,
I am glad you like the idea. I have indeed already developed a planner with html/javascript for mod harbour.

I have not integrated anything except bootstrap and jquery.

Therefore, I believe one would only need to embed the html into a Fivewin webview.

I have already posted several webview examples.

Best regards,
Otto


https://forums.fivetechsupport.com/viewtopic.php?f=3&t=11204&p=265558&hilit=planner&sid=c439ca4174db5684c6b3d89dd21ba93f&sid=c439ca4174db5684c6b3d89dd21ba93f#p265558

Image

Image




Image

Image

Image

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: Booking xbrowse example

Postby Silvio.Falconi » Sat Dec 30, 2023 11:00 pm

Otto wrote:Silvio,

Webview allows the use of prg programs, just as you create them, while still utilizing web technologies.
You should really look at the examples in the FIVEWIN samples.

Best regards,
Otto


As I told you many times I not want make web application
HTML/JavaScript and others languages
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6772
Joined: Thu Oct 18, 2012 7:17 pm

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 78 guests