gtk2: workaround Min >= Max for TTrackBar

git-svn-id: trunk@17104 -
This commit is contained in:
paul 2008-10-23 01:19:11 +00:00
parent b6bfdfc7a4
commit 57f365b076

View File

@ -323,12 +323,16 @@ begin
with ATrackBar do with ATrackBar do
begin begin
wHandle := Handle; wHandle := Handle;
Adjustment := gtk_range_get_adjustment (GTK_RANGE(Pointer(wHandle))); Adjustment := gtk_range_get_adjustment(GTK_RANGE(Pointer(wHandle)));
// min >= max cause s crash
Adjustment^.lower := Min; Adjustment^.lower := Min;
Adjustment^.upper := Max; if Min < Max then
Adjustment^.value := Position; Adjustment^.upper := Max
else
Adjustment^.upper := Min + 1;
Adjustment^.step_increment := LineSize; Adjustment^.step_increment := LineSize;
Adjustment^.page_increment := PageSize; Adjustment^.page_increment := PageSize;
Adjustment^.value := Position;
{ now do some of the more sophisticated features } { now do some of the more sophisticated features }
{ Hint: For some unknown reason we have to disable the draw_value first, { Hint: For some unknown reason we have to disable the draw_value first,
otherwise it's set always to true } otherwise it's set always to true }