[lazarus] some questions about design

Stefan Hille stoppok at osibisa.ms.sub.org
Tue Jan 4 17:05:02 EST 2000


On Mon, Jan 03, 2000 at 11:08:15AM +0100, Marc Weustink wrote:
> + From: Stefan Hille [mailto:stoppok at osibisa.ms.sub.org]
> +
> + Hi,
> +
> + hope you've all recovered now from your millenium parties;-)
> 
> :-)
> 
> + Ok, here some things I've noticed during the last days of development:
> +
> + - There's a problem with all classes derived from TGraphicControl.
> +   (currently these are TPaintBox and TBevel).
> +   The problem is, that there are a lot of places where these
> +   are casted to TWinControl, although TGraphicControl is
> +   derived from TControl.
> 
> Hmm... odd, I first thought this was an historical point, but since the
> introduction (1.15) is had been derived from TControl. I think these casts
> should be altered.

Do you mean that we should derive TGraphicControl from TWinControl or that
we move some properties from TWinCOntrol to TControl?
I have no particular opinion about this. 

> + - To keep the properties of TTrackBar / TCheckBox up to date
> +   I introduced some messages (LM_GETCHECKBOX...) which will
> +   sync the state of the lazarus object with that one of the
> +   GTK library. I think that we'll need more of these messages
> +   in the future and I'd like to create one special
> +   message for this. In the gtk interface we could then make a
> +   new procedure which makes a "case fCompStyle of". Thus we
> +   could avoid a lot of different messages.
> +   Any comments?
> 
> You mean a message like LM_UPDATEVALUES ??? Sounds ok for me.

Ok, I did that today and introduced the following new messages

  - LM_GETVALUE      - to get the value from the interface
  - LM_SETVALUE      - to set the value when it was changed by the
                       application
  - LM_SETPROPERTIES - to set all properties for a component
  
Example:

  TTrackBar uses

    LM_GetValue      never, because any change is handled in the OnChange
                     callback

    LM_SetValue      when someone set the Position property
    LM_SetProperties when any other property is changed that requires an
                     update of the GTK object

  TCheckBox uses

    LM_GetValue      whenever the 'checked' property is read
    LM_SetValue      whenever the 'checked' property is written

bye,

  Stefan

-- 
---------------------------------------------------------
Stefan Hille          email: stoppok at osibisa.ms.sub.org 
48155 Muenster	      voice: 0251/664695 






More information about the Lazarus mailing list