[Gambas-user] Re: Treeview data

R. Stormo rohnny at ...1248...
Sun Feb 26 12:37:03 CET 2006


Benoit Minisini wrote:
> 
> 
> 
> You must put your CTextBox inside another MyTextBox control, i.e. replace 
> inheritance by composition in terms of OOP.
> 
> The CTextBox will raise its KeyPress events, you will get in MyTextBox,
> and 
> then MyTextBox will raise its own event.
> 
> 

I have to do something wrong because of what ever I do. I only manage to
fire one keypress event.
I have tried different attach option that do fire only one at the time. 

cTextBoxClass
INHERITS TextBox

PUBLIC Extra AS String

PUBLIC SUB _new()
  ME.Extra = "Hello Extra"
  object.Attach(ME, ME, "my")      
END

PUBLIC SUB my_keyPress()
    message("Internal sub - Should fire first ")   
END


cTextBox1 Class

' Gambas class file
INHERITS cTextBox


PUBLIC Extra AS String 

PUBLIC SUB _New(x AS Integer, y AS Integer, width AS Integer, height AS
Integer)
  ME.X = x
  ME.Y = y
  ME.Width = width
  ME.Height = height  
  ME.Extra = "Hello Extra"
  'object.Attach(ME.Parent, ME, "ma")    
END
PUBLIC SUB ma_keyPress()  
  message("Internal sub - 2 , should not fire")    
END


Form1 

 
PRIVATE tBox AS CtextBox1 
PUBLIC SUB Form_Open()
  tBox = NEW CtextBox1(10, 10, 100, 20, ME) AS "tBox"
END
PUBLIC SUB tBox_KeyPress()
  Message("External Sub - " & tBox.Extra)    
END


-- 
Regards
	Rohnny Stormo


-----------------------------------------
Gambas brings Basic to Linux.
My Gambas Community http://forum.stormweb.no
--
View this message in context: http://www.nabble.com/Treeview-data-t1184255.html#a3131676
Sent from the gambas-user forum at Nabble.com.





More information about the User mailing list