View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0014341 | Lazarus | IDE | public | 2009-08-13 22:00 | 2009-09-10 15:44 |
Reporter | Marcelo B Paula | Assigned To | Paul Ishenin | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.9.27 (SVN) | ||||
Target Version | 1.0.0 | Fixed in Version | 0.9.29 (SVN) | ||
Summary | 0014341: Components icons not showing correctly on GTK2 | ||||
Description | Non visual components icons do not show on GTK2. Environment: Lazarus SVN FPC 2.3.1 Linux Debian Etch - GTK2 | ||||
Tags | No tags attached. | ||||
Fixed in Revision | r21641 | ||||
LazTarget | 1.0 | ||||
Widgetset | GTK 2 | ||||
Attached Files |
|
duplicate of | 0013859 | closed | Paul Ishenin | TPopupmenu/TMainMenu icons are hidden behind panels |
has duplicate | 0014502 | closed | Paul Ishenin | Form Designer: Icons and Captions of non-visual components are not painted when the are placed above other components |
2009-08-13 22:00
|
|
|
They do show if parent is the Form. They don't if parent is some other control |
|
Yes, known bug wihout any solution. To workaround it you can switch off "Show component captions" option in the Form Editor options set of the IDE options. |
|
It's not absolutely impossible (see attachment), but I really don't know what's going on. The problem is, that in designer.pp: procedure TDesigner.DrawNonVisualComponents(aDDC: TDesignerDeviceContext); No text can be drawn directly to the aDDC.Canvas. FillRect, Pixels etc. work but not Textout and friends. Anybody knows why? Screenshot above taken with an ugly hack. A temporary bitmap where the text is written on. FontBmp:=TBitmap.create; FontBmp.Width:=TextRect.Right-TextRect.Left; FontBmp.Height:=TextRect.Bottom-TextRect.Top; FontBmp.Canvas.Brush.Color := clBtnFace; FontBmp.Canvas.FillRect(0,0,FontBmp.Width,FontBmp.Height); FontRect:=Rect(0,0,FontBmp.Width,FontBmp.Height); DrawText(FontBmp.Canvas.Handle, PChar(AComponent.Name), -1, FontRect, DT_CENTER or DT_VCENTER or DT_SINGLELINE or DT_NOCLIP); aDDC.Canvas.Draw(TextRect.Left,TextRect.Top,FontBmp); FontBmp.free; I think it's not a good solution but probably helps finding the problem. |
2009-08-14 22:10
|
|
2009-08-15 00:02
|
nonvis.diff (1,532 bytes)
Index: designer/designer.pp =================================================================== --- designer/designer.pp (Revision 21174) +++ designer/designer.pp (Arbeitskopie) @@ -2494,10 +2494,10 @@ procedure TDesigner.DrawNonVisualComponents(aDDC: TDesignerDeviceContext); var AComponent: TComponent; - Icon: TBitmap; + Icon, FontBmp: TBitmap; i, ItemLeft, ItemTop, ItemRight, ItemBottom: integer; Diff, ItemLeftTop: TPoint; - IconRect, TextRect: TRect; + IconRect, TextRect, FontRect: TRect; TextSize: TSize; IsSelected: Boolean; begin @@ -2539,9 +2538,16 @@ TextRect.Top := IconRect.Bottom + NonVisualCompBorder + 2; TextRect.Right := TextRect.Left + TextSize.cx; TextRect.Bottom := TextRect.Top + TextSize.cy; - aDDC.Canvas.FillRect(TextRect); - DrawText(aDDC.Canvas.Handle, PChar(AComponent.Name), -1, TextRect, + FontBmp:=TBitmap.create;//theo + FontBmp.Width:=TextRect.Right-TextRect.Left; + FontBmp.Height:=TextRect.Bottom-TextRect.Top; + FontBmp.Canvas.Brush.Color := clBtnFace; + FontBmp.Canvas.FillRect(0,0,FontBmp.Width,FontBmp.Height); + FontRect:=Rect(0,0,FontBmp.Width,FontBmp.Height); + DrawText(FontBmp.Canvas.Handle, PChar(AComponent.Name), -1, FontRect, DT_CENTER or DT_VCENTER or DT_SINGLELINE or DT_NOCLIP); + aDDC.Canvas.Draw(TextRect.Left,TextRect.Top,FontBmp); + FontBmp.free; end; // draw component icon if Assigned(FOnGetNonVisualCompIcon) then |
|
It is bad but it is the only one good working solution for this moment. gdk skips subwindow mode of gc when drawing pango context for unknown reason. Please test and close if ok. |
|
Ok. Worked!! Looking foward for definitive solution !! |
Date Modified | Username | Field | Change |
---|---|---|---|
2009-08-13 22:00 | Marcelo B Paula | New Issue | |
2009-08-13 22:00 | Marcelo B Paula | File Added: laz.PNG | |
2009-08-13 22:00 | Marcelo B Paula | Widgetset | => GTK 2 |
2009-08-13 22:47 | theo | Note Added: 0029834 | |
2009-08-14 19:09 | Paul Ishenin | LazTarget | => 1.0 |
2009-08-14 19:09 | Paul Ishenin | Note Added: 0029855 | |
2009-08-14 19:09 | Paul Ishenin | Status | new => confirmed |
2009-08-14 19:09 | Paul Ishenin | Target Version | => 1.0.0 |
2009-08-14 22:09 | theo | Note Added: 0029857 | |
2009-08-14 22:10 | theo | File Added: nonvis.png | |
2009-08-15 00:02 | theo | File Added: nonvis.diff | |
2009-09-07 10:08 | Paul Ishenin | Relationship added | has duplicate 0014502 |
2009-09-08 00:51 | Paul Ishenin | Relationship added | duplicate of 0013859 |
2009-09-10 03:49 | Paul Ishenin | Fixed in Revision | => r21641 |
2009-09-10 03:49 | Paul Ishenin | Status | confirmed => resolved |
2009-09-10 03:49 | Paul Ishenin | Fixed in Version | => 0.9.29 (SVN) |
2009-09-10 03:49 | Paul Ishenin | Resolution | open => fixed |
2009-09-10 03:49 | Paul Ishenin | Assigned To | => Paul Ishenin |
2009-09-10 03:49 | Paul Ishenin | Note Added: 0030580 | |
2009-09-10 15:44 | Marcelo B Paula | Status | resolved => closed |
2009-09-10 15:44 | Marcelo B Paula | Note Added: 0030595 |