View Issue Details

IDProjectCategoryView StatusLast Update
0001858JEDI VCL00 JVCL Componentspublic2004-06-24 00:43
ReporteranonymousAssigned Touser72 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001858: ReadOnly property not working for TJvCheckBox in JVCL 3.0
DescriptionI can always check or uncheck the TJvCheckBox after setting the ReadOnly property to true. Is it not applicable to TJvCheckBox?
Additional InformationI am using Delphi 7 in Windows 2000.
TagsNo tags attached.

Activities

user72

2004-06-14 02:50

  ~0004552

If you change the Checked property in code, ReadOnly is automatically set to false and I can't see any way to fix that (setting ReadOnly to true again doesn't help)...

anonymous

2004-06-14 18:37

viewer   ~0004557

Do you mean we couldn't use ReadOnly property if we changed the checked property in code? So the ReadOnly property is meaningless in this component?

user72

2004-06-15 02:23

  ~0004559

> So the ReadOnly property is meaningless in this component?
Seems so, at least when want to set Checked in code.

ReadOnly is really only a wrapper for the ancestors ClickDisabled property, implemented in VCL. It seems it was never supposed to be used this way. I have tried to coax ClickDisabled into working as it was intended but haven't been succesful yet. If you have any suggestions or solutions, now would be a good time :)

anonymous

2004-06-22 08:03

viewer   ~0004597

> ReadOnly is really only a wrapper for the ancestors ClickDisabled property

In the original code (attached below) ReadOnly was implemented by overriding Toggle method. Worked OK... why was it changed?


  TJvCheckBox = class(TCheckBox)
  private
    FReadOnly: Boolean;
    procedure SetReadOnly(const Value: Boolean);
    procedure BMSetCheck(var Msg: TMessage); message BM_SETCHECK;
  public
    procedure Toggle; override;
    constructor Create(AOwner: TComponent); override;
  published
    property ReadOnly: Boolean read FReadOnly write SetReadOnly default False; end;

implementation

constructor TJvCheckBox.Create(AOwner: TComponent);
begin
  inherited;
  FReadOnly := False;
  ...
end;

procedure TJvCheckBox.BMSetCheck(var Msg: TMessage);
begin
  if(not ReadOnly)then inherited;
  Invalidate;
end;

procedure TJvCheckBox.Toggle;
begin
  if not(ReadOnly)then begin
     inherited;
     FAutoSave.SaveValue(Checked);
     if Assigned(FAssociated) then
       FAssociated.Enabled := Checked;
  end;
end;

procedure TJvCheckBox.SetReadOnly(const Value: Boolean);
begin
  if FReadOnly <> Value then begin
     FReadOnly := Value;
  end;
end;

user72

2004-06-24 00:43

  ~0004606

> Worked OK... why was it changed?
Dunno, but I've changed it back again.

Issue History

Date Modified Username Field Change
2004-06-14 01:31 anonymous New Issue
2004-06-14 02:50 user72 Note Added: 0004552
2004-06-14 18:37 anonymous Note Added: 0004557
2004-06-15 02:23 user72 Note Added: 0004559
2004-06-22 08:03 anonymous Note Added: 0004597
2004-06-24 00:43 user72 Status new => resolved
2004-06-24 00:43 user72 Resolution open => fixed
2004-06-24 00:43 user72 Assigned To => user72
2004-06-24 00:43 user72 Note Added: 0004606