View Issue Details

IDProjectCategoryView StatusLast Update
0021741LazarusLCLpublic2012-04-24 14:49
ReporterDavid Jenkins Assigned ToZeljan Rikalo  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version0.9.30.5 (SVN) 
Summary0021741: Add ScrollRect procedure to TCarbonWidget
DescriptionAdd ScrollRect procedure to TCarbonWidget that calls HIViewScrollRect. This scrolls the portion of the window bounded by ARect AND invalidates it. If ARect is null then whole window is scrolled.

Patch against rev 36681 is attached
TagsNo tags attached.
Fixed in Revision36957
LazTarget-
WidgetsetCarbon
Attached Files

Activities

2012-04-13 17:07

 

carbondef.pp.patch (1,341 bytes)   
--- /Users/djenkins/laz-changes/11253/carbondef.pp	2012-04-11 15:24:52.000000000 
+++ /Users/djenkins/laz-changes/11253/carbondef.pp.ss	2012-04-11 15:25:36.000000000 
@@ -125,6 +125,7 @@
     procedure SetCursor(ACursor: HCURSOR); virtual;
     
     procedure ScrollBy(DX, DY: Integer); virtual;
+    procedure ScrollRect(DX, DY: Integer; ARect: TRect); virtual;
     procedure SetFocus; virtual; abstract;
     procedure SetColor(const AColor: TColor); virtual; abstract;
     function SetScrollInfo(SBStyle: Integer; const ScrollInfo: TScrollInfo): Integer; virtual;
@@ -979,6 +980,23 @@
 end;
 
 {------------------------------------------------------------------------------
+  Method:  TCarbonWidget.ScrollRect
+  Params:  DX, DY
+
+  Scrolls the content delimited by a bounding Rect
+ ------------------------------------------------------------------------------}
+procedure TCarbonWidget.ScrollRect(DX, DY: Integer; ARect: TRect);
+var
+  R: CGRect;
+const
+  SName = 'ScrollRect';
+begin
+  R := RectToCGRect(ARect);
+  OSError(HIViewScrollRect(Content, @R, DX, DY),
+	Self, SName, 'HIViewScrollRect');
+end;
+
+{------------------------------------------------------------------------------
   Method:  TCarbonWidget.SetScrollInfo
   Params:  SBStyle    - Scrollbar type (SB_VERT, SB_HORZ)
            ScrollInfo - Scrolling info
carbondef.pp.patch (1,341 bytes)   

Zeljan Rikalo

2012-04-14 10:04

developer   ~0058569

And where it's usage ? I see only ScrollRect() in patch, but it's not used anywhere ...

2012-04-19 15:27

 

svn_patch-21741 (1,394 bytes)   
Index: lcl/interfaces/carbon/carbondef.pp
===================================================================
--- lcl/interfaces/carbon/carbondef.pp	(revision 36681)
+++ lcl/interfaces/carbon/carbondef.pp	(working copy)
@@ -125,6 +125,7 @@
     procedure SetCursor(ACursor: HCURSOR); virtual;
     
     procedure ScrollBy(DX, DY: Integer); virtual;
+    procedure ScrollRect(DX, DY: Integer; ARect: TRect); virtual;
     procedure SetFocus; virtual; abstract;
     procedure SetColor(const AColor: TColor); virtual; abstract;
     function SetScrollInfo(SBStyle: Integer; const ScrollInfo: TScrollInfo): Integer; virtual;
@@ -979,6 +980,23 @@
 end;
 
 {------------------------------------------------------------------------------
+  Method:  TCarbonWidget.ScrollRect
+  Params:  DX, DY
+
+  Scrolls the content delimited by a bounding Rect
+ ------------------------------------------------------------------------------}
+procedure TCarbonWidget.ScrollRect(DX, DY: Integer; ARect: TRect);
+var
+  R: CGRect;
+const
+  SName = 'ScrollRect';
+begin
+  R := RectToCGRect(ARect);
+  OSError(HIViewScrollRect(Content, @R, DX, DY),
+	Self, SName, 'HIViewScrollRect');
+end;
+
+{------------------------------------------------------------------------------
   Method:  TCarbonWidget.SetScrollInfo
   Params:  SBStyle    - Scrollbar type (SB_VERT, SB_HORZ)
            ScrollInfo - Scrolling info
svn_patch-21741 (1,394 bytes)   

Zeljan Rikalo

2012-04-21 17:10

developer   ~0058843

Please test and close if ok

Issue History

Date Modified Username Field Change
2012-04-13 17:07 David Jenkins New Issue
2012-04-13 17:07 David Jenkins File Added: carbondef.pp.patch
2012-04-13 17:07 David Jenkins Widgetset => Carbon
2012-04-14 10:04 Zeljan Rikalo Note Added: 0058569
2012-04-19 15:27 David Jenkins File Added: svn_patch-21741
2012-04-21 17:10 Zeljan Rikalo Fixed in Revision => 36957
2012-04-21 17:10 Zeljan Rikalo LazTarget => -
2012-04-21 17:10 Zeljan Rikalo Status new => resolved
2012-04-21 17:10 Zeljan Rikalo Resolution open => fixed
2012-04-21 17:10 Zeljan Rikalo Assigned To => Zeljan Rikalo
2012-04-21 17:10 Zeljan Rikalo Note Added: 0058843
2012-04-24 14:49 David Jenkins Status resolved => closed