[Gambas-user] Gambas IDE FOptions.class

R.Hansen r.hansen at ...79...
Thu Feb 27 12:16:54 CET 2003


at the first, Thanks to Benoit!! Really a nice work. 

I found a trivial eror in the gambas ide: I like my own editor colors
:-)) but if i changed any color, gambas crashed. The problem was
SetColor(Last, Dialog.Color). At this time it looks that LAST is not the
Label but a Timer or an other Control, 

I have changed the code in the FOptions.class as followed: 

PUBLIC SUB lblColor_MouseUp(X AS Integer, Y AS Integer, Button AS
Integer) 
  ' ** start RH 
  DIM hCtrl AS Control  
  DIM iIndex AS Integer 
  iIndex = LAST.Tag 
  ' ** end RH 
      
  LAST.Border = Border.Raised 
  
  IF X >= 0 AND Y >= 0 AND X < LAST.W AND Y < LAST.H THEN 
    
    Dialog.Color = LAST.Background 
    IF Dialog.SelectColor() THEN RETURN 

    ' ** start RH 

    FOR EACH hCtrl IN svwColor.Children 
  
      IF hCtrl.Tag = iIndex THEN 
        SetColor(hCtrl, Dialog.Color, TRUE) 
      ENDIF 
  
    NEXT    
    
    'SetColor(Last, Dialog.Color) 

   ' ** end rh 

  ENDIF 

END 

It's working but in my oppinion it must give another way without FOR
EACH. 
How can i address the Label directly? 

svwColor.Children(iIndex) dont work 
svwColor.lblColor(iIndex) dont work 
lblColor(iIndex) dont work 

What is my  error in reasoning?? 

Regards, 









More information about the User mailing list