summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/gui_listview.pas16
-rw-r--r--src/gui/gui_memo.pas8
-rw-r--r--src/gui/gui_scrollbar.pas55
3 files changed, 49 insertions, 30 deletions
diff --git a/src/gui/gui_listview.pas b/src/gui/gui_listview.pas
index be3790da..12f8a2a8 100644
--- a/src/gui/gui_listview.pas
+++ b/src/gui/gui_listview.pas
@@ -929,14 +929,16 @@ begin
if ShowHeaders then
PaintHeaders;
- // this paints the small square remaining below the vscrollbar and to the right of the hscrollbar
- if FVScrollBar.Visible and FHScrollBar.Visible then begin
- Canvas.Color := clButtonFace;
- Canvas.FillRectangle(Width - 2 - FVScrollBar.Width,
- Height - 2 - FHScrollBar.Height,
- Width - 2,
- Height - 2);
+ // The little square in the bottom right corner
+ if FHScrollBar.Visible and FVScrollBar.Visible then
+ begin
+ Canvas.SetColor(clButtonFace);
+ Canvas.FillRectangle(FHScrollBar.Left+FHScrollBar.Width,
+ FVScrollBar.Top+FVScrollBar.Height,
+ FVScrollBar.Width,
+ FHScrollBar.Height);
end;
+
fpgStyle.DrawControlFrame(Canvas, 0,0,Width,Height);
diff --git a/src/gui/gui_memo.pas b/src/gui/gui_memo.pas
index 3f0915bc..1e7d3635 100644
--- a/src/gui/gui_memo.pas
+++ b/src/gui/gui_memo.pas
@@ -696,9 +696,11 @@ begin
// The little square in the bottom right corner
if FHScrollBar.Visible and FVScrollBar.Visible then
begin
- Canvas.SetColor(clWindowBackground);
- Canvas.FillRectangle(FHScrollBar.Width, FVScrollBar.Height,
- FVScrollBar.Width, FHScrollBar.Height);
+ Canvas.SetColor(clButtonFace);
+ Canvas.FillRectangle(FHScrollBar.Left+FHScrollBar.Width,
+ FVScrollBar.Top+FVScrollBar.Height,
+ FVScrollBar.Width,
+ FHScrollBar.Height);
end;
Canvas.EndDraw;
diff --git a/src/gui/gui_scrollbar.pas b/src/gui/gui_scrollbar.pas
index af53954a..6f16b2c7 100644
--- a/src/gui/gui_scrollbar.pas
+++ b/src/gui/gui_scrollbar.pas
@@ -43,7 +43,7 @@ type
FSliderDragPos: TfpgCoord;
FSliderDragStart: TfpgCoord;
FScrollTimer: TfpgTimer;
- FActiveButtonRect: TRect;
+ FActiveButtonRect: TfpgRect;
FMousePosition: TPoint;
procedure ScrollTimer(Sender: TObject);
procedure DrawButton(x, y, w, h: TfpgCoord; const imgname: string; Pressed: Boolean = False);
@@ -124,25 +124,36 @@ end;
procedure TfpgScrollBar.SetMax(const AValue: integer);
begin
- if AValue = FMax then Exit;
- if AValue < FMin then FMax := FMin
- else FMax := AValue;
- if FPosition > FMax then SetPosition(FMax);
+ if AValue = FMax then
+ Exit;
+ if AValue < FMin then
+ FMax := FMin
+ else
+ FMax := AValue;
+ if FPosition > FMax then
+ SetPosition(FMax);
end;
procedure TfpgScrollBar.SetMin(const AValue: integer);
begin
- if AValue = FMin then Exit;
- if AValue > FMax then FMin := FMax
- else FMin := AValue;
- if FPosition < FMin then SetPosition(FMin);
+ if AValue = FMin then
+ Exit;
+ if AValue > FMax then
+ FMin := FMax
+ else
+ FMin := AValue;
+ if FPosition < FMin then
+ SetPosition(FMin);
end;
procedure TfpgScrollBar.SetPosition(const AValue: integer);
begin
- if AValue < FMin then FPosition := FMin
- else if AValue > FMax then FPosition := FMax
- else FPosition := AValue;
+ if AValue < FMin then
+ FPosition := FMin
+ else if AValue > FMax then
+ FPosition := FMax
+ else
+ FPosition := AValue;
end;
procedure TfpgScrollBar.ScrollTimer(Sender: TObject);
@@ -153,13 +164,17 @@ begin
and (FMousePosition.Y < FActiveButtonRect.Bottom)
and (FMousePosition.Y > FActiveButtonRect.Top) then
begin
- if FStartBtnPressed then begin
+ if FStartBtnPressed then
+ begin
PositionChange(-FScrollStep);
- if Position = FMin then FScrollTimer.Enabled := False;
+ if Position = FMin then
+ FScrollTimer.Enabled := False;
end;
- if FEndBtnPressed then begin
+ if FEndBtnPressed then
+ begin
PositionChange(FScrollStep);
- if Position = FMax then FScrollTimer.Enabled := False;
+ if Position = FMax then
+ FScrollTimer.Enabled := False;
end;
end
else
@@ -246,13 +261,13 @@ begin
begin
PositionChange(-FScrollStep);
FStartBtnPressed := True;
- FActiveButtonRect := Rect(0, 0, Width, Width);
+ FActiveButtonRect.SetRect(0, 0, Width, Width);
end
else if y >= Height - Width then
begin
PositionChange(FScrollStep);
FEndBtnPressed := True;
- FActiveButtonRect := Rect(0,Height-Width, Width, Height);
+ FActiveButtonRect.SetRect(0,Height-Width, Width, Height);
end
else if (y >= Width + FSliderPos) and (y <= Width + FSliderPos + FSliderLength) then
begin
@@ -266,13 +281,13 @@ begin
begin
PositionChange(-FScrollStep);
FStartBtnPressed := True;
- FActiveButtonRect := Rect(0, 0, Height, Height);
+ FActiveButtonRect.SetRect(0, 0, Height, Height);
end
else if x >= Width - Height then
begin
PositionChange(FScrollStep);
FEndBtnPressed := True;
- FActiveButtonRect := Rect(Width-Height, 0, Width, Height);
+ FActiveButtonRect.SetRect(Width-Height, 0, Width, Height);
end
else if (x >= Height + FSliderPos) and (x <= Height + FSliderPos + FSliderLength) then
begin