mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 18:30:54 +02:00
Win32,WinCE,Carbon: fixed saving checkbox state inside TCheckListBox when moving items. issue #20589
git-svn-id: trunk@33172 -
This commit is contained in:
parent
b2cfc29c58
commit
bec12a3edc
@ -67,6 +67,7 @@ type
|
||||
constructor Create(AOwner: TCarbonListBox);
|
||||
procedure Clear; override;
|
||||
procedure Delete(Index: Integer); override;
|
||||
procedure Move(CurIndex, NewIndex: Integer); override;
|
||||
procedure Sort; override;
|
||||
procedure Exchange(Index1, Index2: Integer); override;
|
||||
public
|
||||
@ -96,7 +97,7 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
CarbonProc;
|
||||
CarbonProc, CarbonWSCheckLst, CheckLst;
|
||||
|
||||
{ TCarbonComboBoxStrings }
|
||||
|
||||
@ -288,6 +289,20 @@ begin
|
||||
FOwner.DeleteItem(Index);
|
||||
end;
|
||||
|
||||
procedure TCarbonListBoxStrings.Move(CurIndex, NewIndex: Integer);
|
||||
var
|
||||
AState: TCheckBoxState;
|
||||
begin
|
||||
if Owner is TCustomCheckListBox then
|
||||
AState := TCarbonWSCustomCheckListBox.GetState(TCustomCheckListBox(Owner), CurIndex);
|
||||
|
||||
inherited Move(CurIndex, NewIndex);
|
||||
|
||||
if Owner is TCustomCheckListBox then
|
||||
TCarbonWSCustomCheckListBox.SetState(TCustomCheckListBox(Owner), NewIndex, AState);
|
||||
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCarbonListBoxStrings.Sort
|
||||
|
||||
|
@ -548,6 +548,15 @@ begin
|
||||
inherited Delete(Index);
|
||||
end;
|
||||
|
||||
procedure TWin32CheckListBoxStrings.Move(CurIndex, NewIndex: Integer);
|
||||
var
|
||||
AState: TCheckBoxState;
|
||||
begin
|
||||
AState := State[CurIndex];
|
||||
inherited Move(CurIndex, NewIndex);
|
||||
State[NewIndex] := AState;
|
||||
end;
|
||||
|
||||
function TWin32CheckListBoxStrings.GetObject(Index: Integer): TObject;
|
||||
begin
|
||||
Result:= GetItemRecord(Index, false)^.TheObject;
|
||||
|
@ -128,6 +128,7 @@ Type
|
||||
class procedure DeleteItemRecord(const List: HWND; const Index: integer);
|
||||
procedure Clear; override;
|
||||
procedure Delete(Index: Integer); override;
|
||||
procedure Move(CurIndex, NewIndex: Integer); override;
|
||||
property Enabled[Index: Integer]: Boolean read GetEnabled write SetEnabled;
|
||||
property State[Index: Integer]: TCheckBoxState read GetState write SetState;
|
||||
end;
|
||||
|
@ -454,6 +454,15 @@ begin
|
||||
inherited Delete(Index);
|
||||
end;
|
||||
|
||||
procedure TWinCECheckListBoxStrings.Move(CurIndex, NewIndex: Integer);
|
||||
var
|
||||
AState: TCheckBoxState;
|
||||
begin
|
||||
AState := State[CurIndex];
|
||||
inherited Move(CurIndex, NewIndex);
|
||||
State[NewIndex] := AState;
|
||||
end;
|
||||
|
||||
function TWinCECheckListBoxStrings.GetObject(Index: Integer): TObject;
|
||||
begin
|
||||
Result:= GetItemRecord(Index, false)^.TheObject;
|
||||
|
@ -113,6 +113,7 @@ type
|
||||
class procedure DeleteItemRecord(const List: HWND; const Index: integer);
|
||||
procedure Clear; override;
|
||||
procedure Delete(Index: Integer); override;
|
||||
procedure Move(CurIndex, NewIndex: Integer); override;
|
||||
property State[AIndex: Integer]: TCheckBoxState read GetState write SetState;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user