You've already forked lazarus-ccr
jvcllaz: Fix TJvItemViewer "hiding" pages in a PageControl (https://forum.lazarus.freepascal.org/index.php/topic,47499.msg340236.html#msg340236).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7198 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -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,16 +1574,13 @@ end;
|
|||||||
|
|
||||||
procedure TJvCustomItemViewer.SetSelectedIndex(const Value: Integer);
|
procedure TJvCustomItemViewer.SetSelectedIndex(const Value: Integer);
|
||||||
begin
|
begin
|
||||||
// if (FSelectedIndex <> Value) then
|
if (FSelectedIndex >= 0) and (FSelectedIndex < Count) and (cdsSelected in Items[FSelectedIndex].State) then
|
||||||
begin
|
Items[FSelectedIndex].State := Items[FSelectedIndex].State - [cdsSelected];
|
||||||
if (FSelectedIndex >= 0) and (FSelectedIndex < Count) and (cdsSelected in Items[FSelectedIndex].State) then
|
|
||||||
Items[FSelectedIndex].State := Items[FSelectedIndex].State - [cdsSelected];
|
|
||||||
|
|
||||||
FSelectedIndex := Value;
|
FSelectedIndex := Value;
|
||||||
|
|
||||||
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
|
||||||
|
Reference in New Issue
Block a user