git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7198 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-11-23 15:50:00 +00:00
parent f131c02f88
commit b58836d2c6

View File

@ -258,6 +258,8 @@ type
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure Loaded; override;
//procedure GetDlgCode(var Code: TDlgCodes); override; //procedure GetDlgCode(var Code: TDlgCodes); override;
procedure BoundsChanged; override; procedure BoundsChanged; override;
//procedure FocusSet(PrevWnd: THandle); override; //procedure FocusSet(PrevWnd: THandle); override;
@ -888,11 +890,7 @@ begin
VertScrollBar.Tracking := Options.Tracking; VertScrollBar.Tracking := Options.Tracking;
DoubleBuffered := True; DoubleBuffered := True;
BorderStyle := bsSingle; BorderStyle := bsSingle;
// Width := 185;
// Height := 150;
TabStop := True; TabStop := True;
with GetControlClassDefaultSize do
SetInitialBounds(0, 0, CX, CY);
end; end;
destructor TJvCustomItemViewer.Destroy; destructor TJvCustomItemViewer.Destroy;
@ -949,8 +947,8 @@ end;
class function TJvCustomItemViewer.GetControlClassDefaultSize: TSize; class function TJvCustomItemViewer.GetControlClassDefaultSize: TSize;
begin begin
Result.CX := 185; Result.CX := 200; //185;
Result.CY := 150; Result.CY := 200; //150;
end; end;
procedure TJvCustomItemViewer.OptionsChanged; procedure TJvCustomItemViewer.OptionsChanged;
@ -1576,8 +1574,6 @@ end;
procedure TJvCustomItemViewer.SetSelectedIndex(const Value: Integer); procedure TJvCustomItemViewer.SetSelectedIndex(const Value: Integer);
begin begin
// if (FSelectedIndex <> Value) then
begin
if (FSelectedIndex >= 0) and (FSelectedIndex < Count) and (cdsSelected in Items[FSelectedIndex].State) then if (FSelectedIndex >= 0) and (FSelectedIndex < Count) and (cdsSelected in Items[FSelectedIndex].State) then
Items[FSelectedIndex].State := Items[FSelectedIndex].State - [cdsSelected]; Items[FSelectedIndex].State := Items[FSelectedIndex].State - [cdsSelected];
@ -1585,7 +1581,6 @@ begin
if (Value >= 0) and (Value < Count) and not (cdsSelected in Items[Value].State) then if (Value >= 0) and (Value < Count) and not (cdsSelected in Items[Value].State) then
Items[Value].State := Items[Value].State + [cdsSelected]; Items[Value].State := Items[Value].State + [cdsSelected];
end;
end; end;
procedure TJvCustomItemViewer.ToggleSelection(Index: Integer; procedure TJvCustomItemViewer.ToggleSelection(Index: Integer;
@ -1666,7 +1661,11 @@ procedure TJvCustomItemViewer.UpdateAll;
begin begin
if (csDestroying in ComponentState) or (Parent = nil) then if (csDestroying in ComponentState) or (Parent = nil) then
Exit; Exit;
HandleNeeded;
{ wp: Don't call HandleNeeded here!. If the viewer is inserted into a
PageControl all following pages will be hidden. }
// HandleNeeded;
if not HandleAllocated then if not HandleAllocated then
Exit; Exit;
@ -1766,6 +1765,13 @@ begin
FOnScroll(Self); FOnScroll(Self);
end; end;
procedure TJvCustomItemViewer.Loaded;
begin
inherited;
HandleNeeded;
UpdateAll;
end;
procedure TJvCustomItemViewer.MouseDown(Button: TMouseButton; Shift: TShiftState; procedure TJvCustomItemViewer.MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); X, Y: Integer);
begin begin