View Issue Details

IDProjectCategoryView StatusLast Update
0029645LazarusLCLpublic2018-01-09 17:08
ReporterChris Rorden Assigned ToBart Broersma  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformHaswell 4790 w GTX 970OSCentOS 
Product Version1.6RC1 
Target Version1.6 
Summary0029645: TFloatSpinEdit on GTK2 does not allow unconstrained min and max values
DescriptionI think this is a variation of the previously reported issues (0023266, 0028123), but the Linux GTK2 widgetset's TFloatSpinEdit does not behave the same as Delphi or Lazarus on Windows or OSX. Specifically, with other setups if you make the MinValue equal MaxValue then the entry is unconstrained. However, on GTK2 the value is locked to be precisely this value.
Steps To Reproduceprocedure TForm1.FormShow(Sender: TObject);
begin
  FloatSpinEdit1.MinValue := 0.0;
  FloatSpinEdit1.MaxValue := 0.0;
  //FloatSpinEdit1.MaxValue := 10.0;
  FloatSpinEdit1.Value := 2.0;
end;
TagsNo tags attached.
Fixed in Revisionr51619
LazTarget1.6
WidgetsetGTK 2
Attached Files

Relationships

related to 0023266 assignedZeljan Rikalo Lazarus while FloatSpinEdit.MinValue<>0 Keyboard input does not work correctly 
related to 0028123 assignedZeljan Rikalo Patches TFloatSpinEdit, TSpinEdit: Cannot enter value as expected 
has duplicate 0025735 closedBart Broersma Lazarus Behavior of TSpinEdit.MaxValue differs under Win32 and Gtk2 widgetsets 

Activities

Bart Broersma

2016-02-12 19:05

developer   ~0089977

IIRC then in the GTK2 WS code for UpdateControl, then WS Min and Max value are set to -MaxDouble and +MaxDouble if MinValue >= MaxValue.
This should make the widget behave as unconstrained.

class procedure TGtk2WSCustomFloatSpinEdit.UpdateControl(
  const ACustomFloatSpinEdit: TCustomFloatSpinEdit);
....

  if ACustomFloatSpinEdit.MaxValue >= ACustomFloatSpinEdit.MinValue then
  begin
    AMin := ACustomFloatSpinEdit.MinValue;
    AMax := ACustomFloatSpinEdit.MaxValue;
  end else
  begin
    AMin := -MaxDouble;
    AMax := MaxDouble;
  end;

Bart Broersma

2016-02-13 17:51

developer   ~0089993

Please test and close if OK.

Chris Rorden

2018-01-09 17:08

reporter   ~0105554

Fixed.

Issue History

Date Modified Username Field Change
2016-02-12 17:55 Chris Rorden New Issue
2016-02-12 18:23 Juha Manninen Relationship added related to 0023266
2016-02-12 18:23 Juha Manninen Relationship added related to 0028123
2016-02-12 19:05 Bart Broersma Note Added: 0089977
2016-02-13 17:49 Bart Broersma Assigned To => Bart Broersma
2016-02-13 17:49 Bart Broersma Status new => assigned
2016-02-13 17:51 Bart Broersma Fixed in Revision => r51619
2016-02-13 17:51 Bart Broersma LazTarget => 1.6
2016-02-13 17:51 Bart Broersma Note Added: 0089993
2016-02-13 17:51 Bart Broersma Status assigned => resolved
2016-02-13 17:51 Bart Broersma Resolution open => fixed
2016-02-13 17:51 Bart Broersma Target Version => 1.6
2016-02-20 17:41 Bart Broersma Relationship added has duplicate 0025735
2018-01-09 17:08 Chris Rorden Note Added: 0105554
2018-01-09 17:08 Chris Rorden Status resolved => closed