Re: [lazarus] TCheckListBox

2008-01-10 Thread Damien Gerard


On Jan 11, 2008, at 2:23 AM, Paul Ishenin wrote:


Damien Gerard wrote:

I have a little issue with TCheckListBox.
It is impossible to set by han if an items is checked or not.
After reading the code, I have found the following code :
procedure TCustomCheckListBox.SetChecked(const AIndex: Integer;
 const AValue: Boolean);
begin
 SetState(AIndex, cbChecked);
end;
May be it should be :
procedure TCustomCheckListBox.SetChecked(const AIndex: Integer;
 const AValue: Boolean);
begin
 if AValue then
   SetState(AIndex, cbChecked)
 else
   SetState(AIndex, cbUnchecked);
end;
With this modification it works well for me.


Thanks, my fault. Applied in r13718.



Thanks

--
Damien Gerard
[EMAIL PROTECTED]

Le temps n'a pas d'importance. Seul le code est important
   -- (f00ty)




_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TCheckListBox

2008-01-10 Thread Paul Ishenin

Damien Gerard wrote:


I have a little issue with TCheckListBox.

It is impossible to set by han if an items is checked or not.
After reading the code, I have found the following code :

procedure TCustomCheckListBox.SetChecked(const AIndex: Integer;
  const AValue: Boolean);
begin
  SetState(AIndex, cbChecked);
end;


May be it should be :


procedure TCustomCheckListBox.SetChecked(const AIndex: Integer;
  const AValue: Boolean);
begin
  if AValue then
SetState(AIndex, cbChecked)
  else
SetState(AIndex, cbUnchecked);
end;

With this modification it works well for me.



Thanks, my fault. Applied in r13718.

Best regards,
Paul Ishenin.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] TCheckListBox: problem 2 details

2006-05-26 Thread Burkhard Carstens
Am Freitag, 26. Mai 2006 19:09 schrieb Burkhard Carstens:
> Lazarus 0.9.15 svn r9356, Linux, gtk1
>
[..]
> second problem:
> Sometime when selecting an item with the mouse, the (check)listbox
> scolls to the last item and selects that instaed of the clicked item.
>
> This is the same for TListBox and TCheckListBox

Ok, this happen, when you move the mouse while clicking, i.e. press 
button, move mouse, release button.
The moment, you move the mouse, the last item in the list gets selected, 
then selection jumps back to the item under mouse cursor. This is a 
problem when the listbox has more items than it can display, because 
when it jumps to the last item, it scroll that one "in view" and 
afterward, the item under mouse cursor is just not the one you wanteted 
to click ...

This happens once per click, i.e. press button, move mouse, selection 
jumps to the end, selection jumps back to cursor. now you can move the 
mouse without the jumping, until you release the mouse button.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives