Buttons on meta-files

Buttons on meta-files

Postby Marc Vanzegbroeck » 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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42102
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Marc Vanzegbroeck » Thu Aug 30, 2007 4: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Antonio Linares » Thu Aug 30, 2007 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42102
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Marc Vanzegbroeck » Thu Aug 30, 2007 1: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Antonio Linares » Thu Aug 30, 2007 1:19 pm

Marc,

It is shown when the button is disabled
regards, saludos

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

Postby Marc Vanzegbroeck » Fri Aug 31, 2007 7: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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Antonio Linares » Fri Aug 31, 2007 9: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42102
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Marc Vanzegbroeck » Fri Aug 31, 2007 12:34 pm

Antonio,

Do I have to put this each time before creating a button like this :
Code: Select all  Expand view  RUN
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
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Antonio Linares » Fri Aug 31, 2007 12:49 pm

Marc,

Just one call to schermfont:nCount++ should be enought
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 122 guests