Jump to content

TW3CheckBox appearing double


Recommended Posts

Hi, when using TW3Checkbox the actual box itself seems to render twice, am i doing something wrong?

This is the code i'm using to generate the boxes:

  EnglishCheckBox := TW3CheckBox.Create(fPanel);
  EnglishCheckBox.Caption := 'English Assessment';
  EnglishCheckBox.Checked := false;

  MathCheckBox := TW3CHeckBox.Create(fPanel);
  MathCheckBox.Caption := 'Math Assessment';
  MathCheckBox.Checked := false;

  EnglishCheckBox.SetBounds(Perc(0.35,fPanel.width),fPanel.Height-50,500,50);
  MathCheckBox.SetBounds(Perc(0.55,fPanel.width),fPanel.Height-50,500,50);

Which results in this:

52ffb15fd9.png

 

Note: "Perc" is a simple function that returns an integer.

Link to post
Share on other sites
  • Moderators

I'm a bit confused

 

There is an issue with TW3CheckBox

see

http://forums.smartmobilestudio.com/index.php?/topic/4050-checkbox-does-not-display-a-checkmark/?hl=checkbox

 

which prevents rendering any checkmarks until the '-webkit-appearance: none' line from the css is deleted

 

I cannot reproduce your issue with double checkbox renderings though

 

which version are you on ?

Link to post
Share on other sites

Had a look through the RTL's code: 
 

{ **************************************************************************** }
{ TW3CheckBox                                                                  }
{ **************************************************************************** }

procedure TW3CheckBox.InitializeObject;
begin
  inherited;
  FLabel := TW3CheckBoxLabel.Create(Self);
  FMark := TW3CheckMark.Create(Self);

  FLabel.Font.Color := clBlack;
  FLabel.Caption := 'Checkbox';
  //FLabel.Container.OnClick := HandleLabelClick;
  FLabel.OnClick := HandleLabelClick;

  FMark := TW3CheckMark.Create(Self);
  FMark.SetSize(16,16);

end;

The FMark CheckMark object gets created twice, commenting out one of them removes the issue.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...