mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 02:16:09 +02:00
gtk2: workaround Min >= Max for TTrackBar
git-svn-id: trunk@17104 -
This commit is contained in:
parent
b6bfdfc7a4
commit
57f365b076
@ -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 }
|
||||||
|
Loading…
Reference in New Issue
Block a user