Re: [Lazarus] about checkbox in Object inspector

2015-03-01 Thread FreeMan


On 1.03.2015 12:55, Juha Manninen wrote:
On Sun, Mar 1, 2015 at 12:14 PM, FreeMan > 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 :)

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 define at first. I'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.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about checkbox in Object inspector

2015-03-01 Thread Juha Manninen
On Sun, Mar 1, 2015 at 12:14 PM, FreeMan 
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.
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
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about checkbox in Object inspector

2015-03-01 Thread FreeMan

On 1.03.2015 11:46, 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


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about checkbox in Object inspector

2015-03-01 Thread Juha Manninen
FreeMan, do other unelected checkboxes in your system look different than
the ones in Object Inspector?

Juha
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about checkbox in Object inspector

2015-03-01 Thread FreeMan

Thank you, Sandro and Juha of course

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 define at first. I'll look at it.


V.




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about checkbox in Object inspector

2015-02-28 Thread Juha Manninen
On Sat, Feb 28, 2015 at 6:37 PM, Vojtěch Čihák  wrote:
> You are right, I promised it in december. IIRC it should be in some
> UseOIThemedCheckBox define at first. I'll look at it.

Yes, 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

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about checkbox in Object inspector

2015-02-28 Thread Vojtěch Čihák

You are right, I promised it in december. IIRC it should be in some 
UseOIThemedCheckBox define at first. I'll look at it.
 
V.
__

Od: Juha Manninen 
Komu: Lazarus mailing list 
Datum: 28.02.2015 17:20
Předmět: Re: [Lazarus] about checkbox in Object inspector


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

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus 
<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about checkbox in Object inspector

2015-02-28 Thread 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

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about checkbox in Object inspector

2015-02-28 Thread Juha Manninen
On Sat, Feb 28, 2015 at 6:10 PM, 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

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about checkbox in Object inspector

2015-02-28 Thread Juha Manninen
On Sat, Feb 28, 2015 at 12:33 PM, 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;
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] about checkbox in Object inspector

2015-02-28 Thread 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.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus