View Issue Details

IDProjectCategoryView StatusLast Update
0029089LazarusWidgetsetpublic2018-01-09 17:07
ReporterChris Rorden Assigned ToMattias Gaertner  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformMacBook RetinaOSOSX Darwin 
Product Version1.5 (SVN) 
Summary0029089: Cocoa TrackBar Tick Marks Off By One
DescriptionBy default Lazarus TrackBars show tick-marks (tickStyle = tsAuto). In most widget sets there is one tick for each possible value, so if you set Min=1 and Max=5 you will see 5 tick marks. However, the Cocoa widgetset shows one less than it is supposed to (e.g. 4 in this example). This means that it is impossible to precisely move the slider to a tick mark.
TagsNo tags attached.
Fixed in Revision52447
LazTarget-
WidgetsetCocoa
Attached Files

Activities

Felipe Monteiro de Carvalho

2015-11-28 20:02

developer   ~0087667

I can't reproduce. Could you attach a screenshot and maybe a minimum test project?

Chris Rorden

2016-05-26 16:21

reporter   ~0092803

See attached image of Cocoa vs Carbon

procedure TForm1.FormCreate(Sender: TObject);
begin
  {$IFDEF LCLCocoa} Caption := 'Cocoa';{$ENDIF}
  {$IFDEF LCLCarbon} Caption := 'Carbon';{$ENDIF}
   TrackBar1.Min := 1;
   TrackBar1.Max := 5;
   TrackBar1.Position := 3;
end;

Chris Rorden

2016-05-26 16:33

reporter  

cocoa_v_carbon.jpg (8,095 bytes)   
cocoa_v_carbon.jpg (8,095 bytes)   

Chris Rorden

2016-05-27 13:48

reporter   ~0092821

Can someone please implement this patch. I have tested this and it works nicely. The original code is off by one: if the track bar range goes from 1 to 5 it should have 5 tick marks, but the prior code generates 4 (5-1=4). I have tested it and it works fine. Once the patch is added to the SVN this issue can be closed.

cocoawscomctrls.pas
line 1167
- lTickCount := Min(lTickCount, ATrackBar.Max-ATrackBar.Min);
+ lTickCount := Min(lTickCount, 1+ATrackBar.Max-ATrackBar.Min);

Mattias Gaertner

2016-06-06 17:21

manager   ~0093072

Thanks!

Chris Rorden

2018-01-09 17:07

reporter   ~0105551

Fixed.

Issue History

Date Modified Username Field Change
2015-11-25 21:56 Chris Rorden New Issue
2015-11-25 22:07 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2015-11-25 22:07 Felipe Monteiro de Carvalho Status new => assigned
2015-11-28 20:02 Felipe Monteiro de Carvalho Note Added: 0087667
2016-05-26 16:21 Chris Rorden Note Added: 0092803
2016-05-26 16:33 Chris Rorden File Added: cocoa_v_carbon.jpg
2016-05-27 13:48 Chris Rorden Note Added: 0092821
2016-06-06 17:21 Mattias Gaertner Fixed in Revision => 52447
2016-06-06 17:21 Mattias Gaertner LazTarget => -
2016-06-06 17:21 Mattias Gaertner Note Added: 0093072
2016-06-06 17:21 Mattias Gaertner Status assigned => resolved
2016-06-06 17:21 Mattias Gaertner Resolution open => fixed
2016-06-06 17:21 Mattias Gaertner Assigned To Felipe Monteiro de Carvalho => Mattias Gaertner
2018-01-09 17:07 Chris Rorden Note Added: 0105551
2018-01-09 17:07 Chris Rorden Status resolved => closed