[lazarus] how to implement TDBListBox.Readonly

Andrew Johnson acjgenius at earthlink.net
Mon Sep 15 12:07:28 EDT 2003


Hrmm. Ok, So I could let it change, and then just handle when it is changed and if readonly reset, to rematch the field? that would be easy enought to do for now.

And yes TDBRadioGroup would be a good one, its probably a bit more complicated then the ones I am doing(thus the reason I haven't looked yet), but very usefull to get going.

Andrew

From: Mattias Gaertner <nc-gaertnma at netcologne.de>
Sent: Sep 15, 2003 11:26 AM
To: lazarus at miraclec.com
Subject: Re: [lazarus] how to implement TDBListBox.Readonly

On Mon, 15 Sep 2003 08:17:26 -0400
Andrew Johnson <acjgenius at earthlink.net> wrote:

> Just to clarify here, we have a readonly property(all db aware controls
> do in delphi afaik), this sets the datalink readonly property to true or
> false. If its readonly then calling edit will validate false(I think)
> and apears to work in the DBEdit. now when the fieldlink is readonly we
> don't _want_ changes to happen same as when we aren't in editing(ala in
> browse) mode. Since a list set changes the field value to one in the
> list then we can't even let it change selection. So to make sure its
> properly readonly we need to prevent changing. I overrode click and
> keydown, but some messages still seem to be getting through. I tested
> this in Delphi4 and got what I expected - if I click something when
> readonly, nothing happens, in mine sometimes the selection changes...
> thats the issue.
> 
> I will try and implement keydown later too see if I can catch arrow,
> home page up/down and end there so they don't change selection.

I think, we should add the ReadOnly feature to TCustomListBox.
And there are other ways than keys to change the selection. Maybe you should
also implement a reset, when the selection changes.

I will take one of the other TDBxxx controls. What about TDBRadioGroup?






More information about the Lazarus mailing list