FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Buttons on meta-files
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Buttons on meta-files
Posted: Tue Aug 28, 2007 12:09 PM

Hello,

A application that I wrote is generating drawing by using meta-files.
Then I display them and by using oMeta:blClicked := {|nRow, nCol, nKeyFlags| myfunc(nRow, nCol, nKeyFlags)} I check where the mouse is clicked, then I jump to another drawing.
I was wondering that I can use some kind of buttons, it would me easyer because than I don't calculate the area's where the mouse can be clicked. The area's are not always on the same place, and the number of areas can be different.

Thanks,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Buttons on meta-files
Posted: Tue Aug 28, 2007 12:51 PM

Marc,

You can place a pushbutton on top of a metafile, the usual way:

@ ..., ... BUTTON ... OF oMetaFile SIZE ..., ... ACTION ...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Buttons on meta-files
Posted: Thu Aug 30, 2007 04:04 AM

Thanks Antonio, it's working very nice.

Is there a way to change the color. I already used button1:color(..,..) but this seems not to work.
I use FWH707

Thanks,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Buttons on meta-files
Posted: Thu Aug 30, 2007 07:24 AM

Marc,

If you need to change the buttons colors, then use a BTNBMP instead of a BUTTON:

@ ..., ... BTNBMP ... OF oMetaFile SIZE ..., ... ACTION ...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Buttons on meta-files
Posted: Thu Aug 30, 2007 01:00 PM

Antonio,

What is the use of the 3th bitmap? The second is the one displayed while pressing the button, I never see the 3th.

Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Buttons on meta-files
Posted: Thu Aug 30, 2007 01:19 PM

Marc,

It is shown when the button is disabled

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Buttons on meta-files
Posted: Fri Aug 31, 2007 07:53 AM

Antonio,

Do I have to release the buttons while ending the window with the buttons?

If I call the BTNBMP the first time, everthing is fine. The second time, the text in the buttons are missind, and the other text on the screen are bold.

I already tried oBtn:end() with no result.

Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Buttons on meta-files
Posted: Fri Aug 31, 2007 09:26 AM

Marc,

> Do I have to release the buttons while ending the window with the buttons?

No, its not needed as they will be automatically destroyed

>
If I call the BTNBMP the first time, everthing is fine. The second time, the text in the buttons are missind, and the other text on the screen are bold.
>

Have you defined a font for the buttons ? If yes, do this: oFont:nCount++

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Buttons on meta-files
Posted: Fri Aug 31, 2007 12:34 PM
Antonio,

Do I have to put this each time before creating a button like this :
aadd(metatoetsen,nil)
schermfont :nCount++
@ y_cor(y+4), x_cor(x-1 ) BTNBMP metatoetsen[len(metatoetsen)] RESOURCE 'GEEL','GEEL2' PROMPT text of oMeta SIZE x_cor(52),x_cor(13) FONT schermfont action ganaarpunt(text) PIXEL

aadd(metatoetsen,nil)
schermfont :nCount++
@ y_cor(y+4), x_cor(x-11) BTNBMP metatoetsen[len(metatoetsen)] RESOURCE 'GEEL','GEEL2' PROMPT ct   of oMeta SIZE x_cor(10),x_cor(13) FONT schermfont action ganaarpunt(text) PIXEL


Marc
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Buttons on meta-files
Posted: Fri Aug 31, 2007 12:49 PM

Marc,

Just one call to schermfont:nCount++ should be enought

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion