Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-02

about checkbox in Object inspector

11 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

FreeMan

fpc & lazarus svn yosemite qt x64
Is it possible change tick color ?, 'cos hard viewing if its checked and not row focused.
Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150228/b2954905/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: dfadbihh.
Type: image/jpeg
Size: 12476 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150228/b2954905/attachment-0001.jpe>

Reply by email

Juha Manninen
to FreeMan
FreeMan wrote
fpc & lazarus svn yosemite qt x64 Is it possible change tick color ?, 'cos hard viewing if its checked and not row focused.

It is drawn using theme services. It is supposed to look identical with the other ticks in your system. Does it not?
I copy below the function used for drawing the boolean editor checkboxes. BTW, now it also works for Set element types.

Sandro Cumerlato and Vojtech Cihak planned to use a new customdrawn checkbox there.
TCheckboxThemed is already added to LazControls but not yet used for anything.
It will solve some alignment problems but likely not your tick's visual appearance because it also will use theme services.

Anyway, if there is a bug then it is in theme services, not in property editor code.

Regards,
Juha

---
function TPropertyEditor.DrawCheckbox(ACanvas: TCanvas; const ARect: TRect;
  IsTrue: Boolean): TRect;
// Draws a Checkbox using theme services for editing booleans.
// Returns the output rectangle adjusted for new text location.
var
  Details: TThemedElementDetails;
  Check: TThemedButton;
  Sz: TSize;
  TopMargin: Integer;
  VisVal: String;
begin
  VisVal := GetVisualValue;
  // Draw the box using theme services.
  if (VisVal = '') or (VisVal = oisMixed) then
    Check := tbCheckBoxMixedNormal
  else if IsTrue then
    Check := tbCheckBoxCheckedNormal
  else
    Check := tbCheckBoxUncheckedNormal;
  Details := ThemeServices.GetElementDetails(Check);
  Sz := ThemeServices.GetDetailSize(Details);
  TopMargin := (ARect.Bottom - ARect.Top - Sz.cy) div 2;
  Result := ARect;
  Inc(Result.Top, TopMargin);
  // Left varies by widgetset and theme etc. Real Checkbox itself has a
left margin.
  Inc(Result.Left, 2);                // ToDo: How to find out the real
margin?
  Result.Right := Result.Left + Sz.cx;
  Result.Bottom := Result.Top + Sz.cy;
  ThemeServices.DrawElement(ACanvas.Handle, Details, Result, nil);
  // Text will be written after the box.
  Result := ARect;
  Inc(Result.Left, Sz.cx + 4);
end;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150228/68d1d92f/attachment.html>

Reply by email

Juha Manninen
to Juha Manninen
Juha Manninen wrote
Anyway, if there is a bug then it is in theme services, not in property editor code.

Oops! In fact the code does not check if the row is selected. I must study the issue more.
I realized it maybe 2.5 seconds after sending the mail.

Juha

Reply by email

Juha Manninen
to Juha Manninen

Ok, one more try:
My original analysis is correct. On the selected row you see a real CheckBox places there by Object Inspector.
Theme services are used only for the fake CheckBoxes drawn on the non-selected lines.

Juha

Reply by email

Juha Manninen
to Vojtěch Čihák
Vojt?ch ?ih?k wrote
You are right, I promised it in december. IIRC it should be in some UseOIThemedCheckBox 'll , UseOIThemedCheckBox define sounds good.

Otherwise no hurry. I am actually happy that 1.4 is released with this "real CheckBox" solution as it works pretty well.

If you start to implement the customdrawn checkbox solution, please communicate with Sandro Cumerlato. I told him that I don't want to be a middle man, now I tell the same thing for you. Maybe he is shy, maybe both of you are shy, I don't know. Yet it would be unfortunate if 2 people worked on the same feature without knowing of each other.

Juha

Reply by email

FreeMan
to Juha Manninen
Juha Manninen wrote
FreeMan, do other unelected checkboxes in your system look different than the ones in Object Inspector? Juha

My test screens I get, system setting --> dock settings and lazarus on tform I added two tcheckbox and second, I mean on bottom checkbox is checked.
First screenshot I get system form is active, lazarus form is background

second screenshot, I get when lazarus form is active, system form is background

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150301/d81386f4/attachment-0001.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: ijjcbjeb.
Type: image/jpeg
Size: 9308 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150301/d81386f4/attachment-0002.jpe> -------------- next part --------------
A non-text attachment was scrubbed...
Name: ajeeefcb.
Type: image/jpeg
Size: 10168 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150301/d81386f4/attachment-0003.jpe>

Reply by email

Juha Manninen
to FreeMan
FreeMan wrote 5 lines
My test screens I get, system setting --> dock settings and lazarus on tform I added two tcheckbox and second, I mean on bottom checkbox is checked. First screenshot I get system form is active, lazarus form is background

The two checkboxes on a Lazarus form are real checkboxes using the widgetset (in this case QT) control.
They are not customdrawn using theme services, the theme service version in OI apparently matches with the real one.
What if you bind to Carbon instead of QT?
In any case this is not in my area of expertise. I don't even have a Mac.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150301/f9ed9abc/attachment.html>

Reply by email

FreeMan
to Juha Manninen
Juha Manninen wrote 14 lines
On Sun, Mar 1, 2015 at 12:14 PM, FreeMan < <mailto:>> wrote: My test screens I get, system setting --> dock settings and lazarus on tform I added two tcheckbox and second, I mean on bottom checkbox is checked. First screenshot I get system form is active, lazarus form is background The two checkboxes on a Lazarus form are real checkboxes using the widgetset (in this case QT) control. They are not customdrawn using theme services, the theme service version in OI apparently matches with the real one.

we will wait, maybe can early fix come somewhere :)

Show quoted text 7 lines
On 28.02.2015 18:37, Vojt?ch ?ih?k wrote: > > You are right, I promised it in december. IIRC it should be in some > UseOIThemedCheckBox 'll look at it. > What if you bind to Carbon instead of QT?

Sorry, I didn't understand. are meaning "did you try in carbon?"

In any case this is not in my area of expertise. I don't even have a Mac. Juha

just let you know, if you interest it, vmware file in the torrent, next year I tested a few time, then I bought macbook. But I'm not sure is it legal or not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150301/3c14e104/attachment.html>

Reply by email