TSButton 5 with the latest FWH and xHarbour releases

Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Post by Gale FORd »

What about adding the number to the cargo.
aBtn[n]:cargo := n
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Dear Gale,
You Know the sample child03 of the testbtn.prg of tsbutton ?
I must make a window where I can show many seats but I must use also a dbf to control if a seat is free or not.
I must create 20 seats for 8 lines ( 20x8) with tsbutton and write on it the number of the seat
When I click on each seat the program must show me a menu popup near to button and then I can insert the reservation but I need the number of the seat to make it .
I hope you understand me
I hope you can help me .....
Best Regards, Saludos

Falconi Silvio
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Post by Gale FORd »

You want a popup anytime you click the button, and the popup should know what button number was pressed?

For the bAction you need to perform your popup and pass the button object

Add the counter number to button cargo

Code: Select all


bAction := {|oBtn| menupopup( oBtn ) }

n := 1
for ?????
         @ Fila,(Col+nPassLarg) SBUTTON  aBtn[n] RESOURCE "omb3"   PIXEL;
            OF oWnd ;
            FONT oFont2 ;
            CAPTION cCaption ;
            COLOR CLR_WHITE, GetSysColor(15)  ;
               TEXT ON_CENTER ;
            NOBOX       ;
            TOOLTIP oemtoansi(cCaption) ;
            ACTION bAction
         aBtn[n]:cargo := n   // add this cargo
         n++
next ????
Change popup menu function to receive button object

Code: Select all

function MEnupopup( oBtn )
   Local oMenu, aRect ,nRow,nCol

   cpoltrona:= Val( oBtn:cCaption )

   ? 'Popup for button # '+ltrim(str( oBtn:cargo ))

   aRect := GetClientRect( oBtn:hWnd )

   MENU oMenu POPUP
      MENUITEM "&Nuova prenotazione"     action OCCUPARE(oBtn,.t.)
      MENUITEM "&Modifica prenotazione"  action OCCUPARE(oBtn,.f.)
      MENUITEM "&Mostra prenotazione"
   ENDMENU

   ACTIVATE POPUP oMenu AT aRect[ 3 ] + 1, aRect[ 2 ] OF  oBtn

RETURN NIL
The popup code in occupare should take oBtn and change image, change caption, store results to database, etc.

I did not test this. I do not know exactly how you want this to interact.
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Sorry, Not run ok

I need to insert eval(baction) to action command at sbutton control but

it not show the popmenu and make this eror

Code: Select all

? 'Popup for button # '+ltrim(str( oBtn:cargo ))
Error description: Error BASE/1004 Class: 'NIL' has no exported method: CARGO

Stack Calls
===========
Called from: => CARGO(0)
Called from: => PRENOTAMENU(395)
Called from: Spiaggia.prg => (b)BEA210(263)
Called from: Spiaggia.prg => (b)BEA210(312)
Called from: TSBUTTON.PRG => TSBUTTON:CLICK(804)
Called from: CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
Called from: TSBUTTON.PRG => TSBUTTON:HANDLEEVENT(1308)
Called from: WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: WINDOW.PRG => TMDIFRAME:ACTIVATE(0)
Called from: main.prg => MAIN(200)
Best Regards, Saludos

Falconi Silvio
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Post by Gale FORd »

I have uploaded a working sample that I hope gets you over the hump.

Left click toggles and right click opens popup menu.

http://hyperupload.com/download/020dca2 ... .ZIP.html
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Post by Gale FORd »

The link did not work right so you might have to copy and paste link
http://hyperupload.com/download/020dca2 ... P.ZIP.html
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

GOOOODDD !
the testsamp.prg run ok
BUT
when I clicked on each button it show the bitmap seatfull but must not show it : after only the user select the menu popup and insert the record of reservation it must show the bitmpa seatfull.

But it run ok and i can work on it now

Now I must try with dbfs and insert on left a browse with customers and when I click on a cusotmer the program must refresh the buttons retated

then the windows must be divide with a vertical splitter

If I found problems can write you ?

Thanks mr Gale,
Best Regards, Saludos

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

Post by Silvio »

How I can make to insert on each button the caption with the number of buttons ?

Regards
Best Regards, Saludos

Falconi Silvio
User avatar
E. Bartzokas
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Post by E. Bartzokas »

Silvio wrote:Dear Timm, have you correct the error ?

Best Regards,
Silvio,
I am using TSBUTTONS version 4.0 (at least the TSBUTTON.PRG says this at the beginning)

I am using this file below, named TSBUTTON.LIB.XBP to build the TSBUTTON.LIB. I am using xHB Builder of course, but keep in mind that in every new version of XHB or FWH, you'd need to recompile the library.

Here is the builder file:

Code: Select all

C_OUTPUTFOLDER = 
DEFFILE = 
INCLUDEFOLDERS = \fwh\include;include
LDEBUG = .F.
LGUI = .F.
LIBFOLDERS = 
LMT = .F.
LUSEDLL = .F.
MAPFILE = 
MYC_FLAGS =  
MYDEFINES = __HARBOUR__ ;__FLAT__ 
MYLINK_FLAGS = 
MYPRG_FLAGS = 
MYRC_FLAGS = 
MYSLY_FLAGS = 
OUTPUTFOLDER = xbp\obj
PRG_OUTPUTFOLDER = 
RC_OUTPUTFOLDER = 
SLY_OUTPUTFOLDER = 
TARGETFOLDER = xbp\lib 

[source\classes\TSBUTTON.PRG]
MYC_FLAGS = 
MYDEFINES = 
MYPRG_FLAGS = 

[source\classes\TSBAR.PRG]
MYC_FLAGS = 
MYDEFINES = 
MYPRG_FLAGS = 

[source\classes\TSLINES.PRG]
MYC_FLAGS = 
MYDEFINES = 
MYPRG_FLAGS = 

[source\classes\TSTSAY.PRG]
MYC_FLAGS = 
MYDEFINES = 
MYPRG_FLAGS = 

[source\function\BPAINT.C]
MYC_FLAGS = 
MYDEFINES = 
Copy this and create TSBUTTON.LIB.XBP, then run it and you'll have your library build in the folder .\XBP\LIB

Please let me know if it works for you.

Regarding the reservation bus application... I will test in a few minutes and will post a new message.

Kind regards
Evans
User avatar
E. Bartzokas
Posts: 114
Joined: Tue Feb 14, 2006 8:13 am
Location: Corinth, Greece

Post by E. Bartzokas »

Silvio wrote:How I can make to insert on each button the caption with the number of buttons ?

Regards
Silvio,
I have spent a few minutes with Bus Reservation, and to my surprise, I've seen that whoever wrote this library, says that you can use multiple bitmap (e.g. 4 images in one single BMP file).
This is something I've never done before... I couldn't make it to work, but, if you replace the resource bitmaps with 4 different ones (size 32 x 29 bytes each bitmap) you can make it work. At least it works for me, as expected!

Here are the code changes needed to TESTBTN.PRG:

Code: Select all

     @10,90 SBGROUP aBtn1 OF aChild[ 3 ] ;
             CAPTION aCapt1 ;
             SIZE 34, 34 PIXELS ;
             FONT oFont ;
             ACTION aAct1 ;  //             RESOURCE "Seatm", "Seatm", "Seatm", "Seatm" ; // multi bitmap
             RESOURCE "Seatm1", "Seatm2", "Seatm3", "Seatm4"  ;  // MODIFIED BY EVANS
             MESSAGE "Click izquierdo: Reservar Asientos.  " + ;
                     "Click derecho: Cancelar Reservaci≤n." ;
             COLORS CLR_WHITE, CLR_CYAN ;
             TEXT ON_CENTER ;
             LOOK W97

Please notice that there are two groups of seats in the window...
One above, and one below the middle of the bus. You'll have to copy/paste the RESOURCE... above to both places and replace the multi bitmap resource.

You'll also have to change the size of the child window to 260, 500 because the televisions are drawn on the window's frame!

Finally, you'll have to add these to your TESTBTN.RC file, right after the SEATM BITMAP... as follows:

Code: Select all

SEATM   BITMAP "..\bitmaps\SEATM.BMP"
SEATM1  BITMAP "..\bitmaps\SEATM1.BMP"
SEATM2  BITMAP "..\bitmaps\SEATM2.BMP"
SEATM3  BITMAP "..\bitmaps\SEATM3.BMP"
SEATM4  BITMAP "..\bitmaps\SEATM4.BMP"
If you need the above 4 bitmaps, I can email them to you by private email, otherwise, you may copy/paste each seat in SEATM.BMP into separate files named as above, or at your choice.

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

Post by Silvio »

the SPAce enviroment on sbgroup not run ok
Best Regards, Saludos

Falconi Silvio
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Hello Silvio,
Have you thought of using FW PocketPC for your software "Spiaggia, lettini, ombrelloni" ?
Regards
Otto


BTW: on fivewin.it there is an error
Pagine ASP error 'ASP 0126'

Impossibile trovare il file di inclusione

/Default.asp, line 15

Impossibile trovare il file di inclusione "config.asp".
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Otto,
Yes we 'are working to make it also to Pocket Pc but Now I must finish Pc Version 32 bit
there is another module we are working now : tpv
HAVE YOU SOME SAMPLE ?


BTW :FOR WWW.FIVEWIN.IT - THIS SITE IS NOT ON LINE
Best Regards, Saludos

Falconi Silvio
Post Reply