View Issue Details

IDProjectCategoryView StatusLast Update
0009234LazarusLCLpublic2009-12-24 14:52
ReporterLuiz AmericoAssigned ToLuiz Americo 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSUbuntuOS VersionFeist Fawn 7.04
Product Version0.9.23 (SVN)Product Build 
Target Version1.0.0Fixed in Version0.9.29 (SVN) 
Summary0009234: DrawFrameControl raises an exception in gtk when drawing in a bitmap canvas
DescriptionThe attached example works in win32 but not in gtk, raising an EInterfaceException
TagsNo tags attached.
Fixed in Revision23260
LazTarget1.0
WidgetsetGTK
Attached Files
  • DrawFrameControl.zip (2,740 bytes)
  • drawframe_gtk.diff (677 bytes)
    Index: lcl/interfaces/gtk/gtkwinapi.inc
    ===================================================================
    --- lcl/interfaces/gtk/gtkwinapi.inc	(revision 23051)
    +++ lcl/interfaces/gtk/gtkwinapi.inc	(working copy)
    @@ -2661,9 +2661,13 @@
       if IsValidDC(DC) then 
       begin
         Widget:=TGtkDeviceContext(DC).Widget;
    -    ClientWidget:=GetFixedWidget(Widget);
    -    if ClientWidget<>nil then
    -      Widget:=ClientWidget;
    +    //It's possible to draw in a DC without a widget, e.g., a Bitmap
    +    if Widget <> nil then
    +    begin
    +      ClientWidget:=GetFixedWidget(Widget);
    +      if ClientWidget<>nil then
    +        Widget:=ClientWidget;
    +    end;
       end else
         Widget:=nil;
     
    
    drawframe_gtk.diff (677 bytes)

Activities

2007-07-09 15:39

 

DrawFrameControl.zip (2,740 bytes)

2009-12-13 12:45

 

drawframe_gtk.diff (677 bytes)
Index: lcl/interfaces/gtk/gtkwinapi.inc
===================================================================
--- lcl/interfaces/gtk/gtkwinapi.inc	(revision 23051)
+++ lcl/interfaces/gtk/gtkwinapi.inc	(working copy)
@@ -2661,9 +2661,13 @@
   if IsValidDC(DC) then 
   begin
     Widget:=TGtkDeviceContext(DC).Widget;
-    ClientWidget:=GetFixedWidget(Widget);
-    if ClientWidget<>nil then
-      Widget:=ClientWidget;
+    //It's possible to draw in a DC without a widget, e.g., a Bitmap
+    if Widget <> nil then
+    begin
+      ClientWidget:=GetFixedWidget(Widget);
+      if ClientWidget<>nil then
+        Widget:=ClientWidget;
+    end;
   end else
     Widget:=nil;
 
drawframe_gtk.diff (677 bytes)

Luiz Americo

2009-12-13 12:46

developer   ~0033026

The attached patch fixes this issue

Issue History

Date Modified Username Field Change
2007-07-09 15:39 Luiz Americo New Issue
2007-07-09 15:39 Luiz Americo File Added: DrawFrameControl.zip
2007-07-09 15:39 Luiz Americo Widgetset => GTK
2007-07-09 15:45 Vincent Snijders LazTarget => 1.0
2007-07-09 15:45 Vincent Snijders Status new => acknowledged
2008-04-24 09:57 Vincent Snijders Target Version => 1.0.0
2009-12-13 12:45 Luiz Americo File Added: drawframe_gtk.diff
2009-12-13 12:46 Luiz Americo Note Added: 0033026
2009-12-24 14:51 Luiz Americo Fixed in Revision => 23260
2009-12-24 14:51 Luiz Americo Status acknowledged => resolved
2009-12-24 14:51 Luiz Americo Fixed in Version => 0.9.29 (SVN)
2009-12-24 14:51 Luiz Americo Resolution open => fixed
2009-12-24 14:51 Luiz Americo Assigned To => Luiz Americo
2009-12-24 14:52 Luiz Americo Status resolved => closed