summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-10 10:54:38 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-10 10:54:38 +0000
commit594a6a445ca92fb76f8f971d707f6c4b9901692a (patch)
treed07ed4afffd87cb94d1b265dbbe1956dbb7e7f86 /src/gui
parent9b9092ae02ce595d1895506206d4321bc7e57af4 (diff)
downloadfpGUI-594a6a445ca92fb76f8f971d707f6c4b9901692a.tar.xz
* Resizing widgets now take into account the MinWidth and MinHeight
properties. In affect you now cannot resize components into the negative with the UI Designer. * UI Designer: On deleting a component from a form, resets the Object Inspector. * Fixed 'division by zero' errors for the ListView and Memo components when they get resized to smaller that 2x2 pixels in size.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui_listview.pas14
-rw-r--r--src/gui/gui_memo.pas13
2 files changed, 23 insertions, 4 deletions
diff --git a/src/gui/gui_listview.pas b/src/gui/gui_listview.pas
index 422e17f3..183ac8bf 100644
--- a/src/gui/gui_listview.pas
+++ b/src/gui/gui_listview.pas
@@ -1496,13 +1496,23 @@ begin
if FVScrollBar.Max = 0 then
FVScrollBar.SliderSize := 1
else
- FVScrollBar.SliderSize := FVScrollBar.Height / (FVScrollBar.Max + FVScrollBar.Height);
+ begin
+ if (FVScrollBar.Max + FVScrollBar.Height) > 0 then
+ FVScrollBar.SliderSize := FVScrollBar.Height / (FVScrollBar.Max + FVScrollBar.Height)
+ else
+ FVScrollBar.SliderSize := 0.5;
+ end;
FVScrollBar.RepaintSlider;
if FHScrollBar.Max = 0 then
FHScrollBar.SliderSize := 1
else
- FHScrollBar.SliderSize := FHScrollBar.Width / (FHScrollBar.Max + FHScrollBar.Width);
+ begin
+ if (FHScrollBar.Max + FHScrollBar.Width) > 0 then
+ FHScrollBar.SliderSize := FHScrollBar.Width / (FHScrollBar.Max + FHScrollBar.Width)
+ else
+ FHScrollBar.SliderSize := 0.5;
+ end;
FHScrollBar.RepaintSlider;
diff --git a/src/gui/gui_memo.pas b/src/gui/gui_memo.pas
index f151203e..e1c910ad 100644
--- a/src/gui/gui_memo.pas
+++ b/src/gui/gui_memo.pas
@@ -518,8 +518,17 @@ begin
if FVScrollBar.Visible then
begin
FVScrollBar.Min := 1;
- FVScrollBar.SliderSize := VisibleLines / LineCount;
- FVScrollBar.Max := LineCount - VisibleLines + 1;
+ // TODO: Look at calculation of vlines value to improve this!
+ if LineCount > 0 then
+ begin
+ FVScrollBar.SliderSize := VisibleLines / LineCount;
+ FVScrollBar.Max := LineCount - VisibleLines + 1;
+ end
+ else
+ begin
+ FVScrollBar.SliderSize := 0.5;
+ FVScrollBar.Max := 10;
+ end;
FVScrollBar.Position := FFirstLine;
FVScrollBar.RepaintSlider;
end;