View Issue Details

IDProjectCategoryView StatusLast Update
0021744LazarusLCLpublic2012-04-23 22:46
ReporterDavid Jenkins Assigned ToZeljan Rikalo  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version0.9.30.5 (SVN) 
Summary0021744: Add FHasPaint to TCarbonWidget to allow for owner draw
DescriptionWe need carbon to respond to owner draw for TBitBtn.

Suggested change is to add FHasPaint to TCarbonWidget and then modify CarbonCommon_Draw to check the FHasPaint property before calling CallNextEventHandler() so that owner draws replace widget draw instead of being below or on top of widget draw.

Patches against rev 36681 attached.
TagsNo tags attached.
Fixed in Revision36956
LazTarget-
WidgetsetCarbon
Attached Files

Activities

2012-04-13 18:40

 

carbondef.pp.patch (1,054 bytes)   
--- /Users/djenkins/laz-changes/13613/carbondef.pp	2012-04-09 12:10:26.000000000 
+++ /Users/djenkins/laz-changes/13613/carbondef.pp.ss	2012-04-09 12:12:00.000000000 
@@ -67,6 +67,7 @@
     FProperties: TStringList;
     FCursor: HCURSOR;
     FHasCaret: Boolean;
+    FHasPaint: Boolean;
     FResizing: Boolean;
     FBoundsReported: Boolean;
     function GetPainting: Boolean;
@@ -148,6 +149,7 @@
     property Cursor: HCURSOR read FCursor;
     property ScrollOffset: TPoint read GetScrollOffset write SetScrollOffset; // scrolled offset of  ScrollingWinControl
     property HasCaret: Boolean read FHasCaret write FHasCaret;
+    property HasPaint: Boolean read FHasPaint write FHasPaint;
     property Painting: Boolean read GetPainting;
     property Properties[AIndex: String]: Pointer read GetProperty write SetProperty;
     property Resizing: Boolean read FResizing write FResizing;
@@ -709,6 +711,7 @@
   Widget := nil;
   Context := nil;
   FHasCaret := False;
+  FHasPaint := False;
   FResizing := False;
   FBoundsReported := False;
   
carbondef.pp.patch (1,054 bytes)   

2012-04-13 18:40

 

carbonprivatecommon.inc.patch (554 bytes)   
--- /Users/djenkins/laz-changes/13613/carbonprivatecommon.inc	2012-04-09 14:06:01.000000000 
+++ /Users/djenkins/laz-changes/13613/carbonprivatecommon.inc.ss	2012-04-09 14:08:57.000000000 
@@ -97,7 +97,9 @@
     AWidget.Context.Reset;
 
     // let carbon draw/update
-    Result := CallNextEventHandler(ANextHandler, AEvent);
+    if not AWidget.HasPaint then
+      Result := CallNextEventHandler(ANextHandler, AEvent)
+    else Result := 0;
 
     if (AWidget is TCarbonControl) and
       (cceDraw in (AWidget as TCarbonControl).GetValidEvents) then

2012-04-19 21:09

 

svn_patch-21744 (1,725 bytes)   
Index: lcl/interfaces/carbon/carbonprivatecommon.inc
===================================================================
--- lcl/interfaces/carbon/carbonprivatecommon.inc	(revision 36681)
+++ lcl/interfaces/carbon/carbonprivatecommon.inc	(working copy)
@@ -97,7 +97,9 @@
     AWidget.Context.Reset;
 
     // let carbon draw/update
-    Result := CallNextEventHandler(ANextHandler, AEvent);
+    if not AWidget.HasPaint then
+      Result := CallNextEventHandler(ANextHandler, AEvent)
+    else Result := 0;
 
     if (AWidget is TCarbonControl) and
       (cceDraw in (AWidget as TCarbonControl).GetValidEvents) then
Index: lcl/interfaces/carbon/carbondef.pp
===================================================================
--- lcl/interfaces/carbon/carbondef.pp	(revision 36681)
+++ lcl/interfaces/carbon/carbondef.pp	(working copy)
@@ -67,6 +67,7 @@
     FProperties: TStringList;
     FCursor: HCURSOR;
     FHasCaret: Boolean;
+    FHasPaint: Boolean;
     FResizing: Boolean;
     FBoundsReported: Boolean;
     function GetPainting: Boolean;
@@ -148,6 +149,7 @@
     property Cursor: HCURSOR read FCursor;
     property ScrollOffset: TPoint read GetScrollOffset write SetScrollOffset; // scrolled offset of  ScrollingWinControl
     property HasCaret: Boolean read FHasCaret write FHasCaret;
+    property HasPaint: Boolean read FHasPaint write FHasPaint;
     property Painting: Boolean read GetPainting;
     property Properties[AIndex: String]: Pointer read GetProperty write SetProperty;
     property Resizing: Boolean read FResizing write FResizing;
@@ -709,6 +711,7 @@
   Widget := nil;
   Context := nil;
   FHasCaret := False;
+  FHasPaint := False;
   FResizing := False;
   FBoundsReported := False;
   
svn_patch-21744 (1,725 bytes)   

Zeljan Rikalo

2012-04-21 17:07

developer   ~0058842

Please test and close if ok.

Issue History

Date Modified Username Field Change
2012-04-13 18:40 David Jenkins New Issue
2012-04-13 18:40 David Jenkins File Added: carbondef.pp.patch
2012-04-13 18:40 David Jenkins Widgetset => Carbon
2012-04-13 18:40 David Jenkins File Added: carbonprivatecommon.inc.patch
2012-04-19 21:09 David Jenkins File Added: svn_patch-21744
2012-04-21 17:07 Zeljan Rikalo Fixed in Revision => 36956
2012-04-21 17:07 Zeljan Rikalo LazTarget => -
2012-04-21 17:07 Zeljan Rikalo Status new => resolved
2012-04-21 17:07 Zeljan Rikalo Resolution open => fixed
2012-04-21 17:07 Zeljan Rikalo Assigned To => Zeljan Rikalo
2012-04-21 17:07 Zeljan Rikalo Note Added: 0058842
2012-04-23 22:46 David Jenkins Status resolved => closed