Extend a Fivewin class

Post Reply
oliveiros junior
Posts: 127
Joined: Tue Mar 20, 2007 3:13 pm

Extend a Fivewin class

Post by oliveiros junior »

Hello everyone, good morning!

I would like to know if it is possible to add a method to an existing class. Ex.: Add the ChangeText method to the TBtnBmp class.

If so, would there be any practical example?

I need to add some information to an object and I would like not to touch the Fivewin classes.

Thank you in advance for everyone's attention.

Oliveiros Junior
User avatar
nageswaragunupudi
Posts: 10701
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 3 times
Contact:

Re: Extend a Fivewin class

Post by nageswaragunupudi »

1) Are you using xHarbour or Harbour? Depending on your answer, we will advise you how to add a new method.

2) Please reconsider. It is possible to changetext of BtnBmp using the Existing methods. No need to have any additional method for this. Can you explain what exactly are you looking for.
Regards

G. N. Rao.
Hyderabad, India
oliveiros junior
Posts: 127
Joined: Tue Mar 20, 2007 3:13 pm

Re: Extend a Fivewin class

Post by oliveiros junior »

Hello Mr Rao,

I'm using FWH, version 23.07;

My goal is to be able to write various information about the button, different positions.

Ex.:
+------------------------------------------------------------------------------------+
| xxxxxxx ...................................................................... |
| xxxxxxx .......................................XXXXX XXXXXX( image) |
| |
+------------------------------------------------------------------------------------+

I made a multi-button Loop for testing and tried a few things that didn't work using existing methods.

As:

For nX = 1 To Len( oDlg1:aItem )

@ nLinha, nColuna + 50 BTNBMP aBtns[ nX ];
PROMPT "" RIGHT;
FLAT NOBORDER FONT oFontTxt COLOR CLR_BLACK, CLR_WHITE ;
SIZE oDlg1:nLargura - 100, 100 OF oDlg1:oPanel

aBtns[ nX ]:nRound := 20
aBtns[ nX ]:lTransparent := .F.

//aBtns[ nX ]:bPainted := { || aBtns[ nX ]:SayText( 'Linha 1',{ 0, 0, 40, 140 }, 'R', oFontTxt, { CLR_GREEN, CLR_BLACK } ) }

//aBtns[ nX ]:SayText( 'Linha 1',{ 0, 0, 40, 140 }, 'R', oFontTxt, { CLR_GREEN, CLR_BLACK } )

nLinha += 110
Next

Another need I have is to have a wide button with an image aligned to the left and for the action to only be executed if the click occurs on the image.

Thank you in advance for your attention!

Oliveiros Junior
Post Reply