View Issue Details

IDProjectCategoryView StatusLast Update
0020195LazarusLCLpublic2011-12-24 11:54
ReporterZex AtillaAssigned ToFelipe Monteiro de Carvalho 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.9.30Product Build 
Target Version1.0.0Fixed in Version0.9.31 (SVN) 
Summary0020195: Canvas.Frame does nothing
DescriptionSeems that Canvas.Frame function is missing an implementation. Canvas.FrameRect works, but Canvas.Frame doesn't. At least under Windows XP.
TagsNo tags attached.
Fixed in Revision34379
LazTarget1.0
WidgetsetWin32/Win64
Attached Files

Activities

Zeljan Rikalo

2011-10-30 14:04

developer   ~0053639

Please attach example.

Zex Atilla

2011-11-10 16:41

reporter   ~0053979

Create an empty form with a button and add this code:


procedure TForm1.Button1Click(Sender: TObject);
begin
  Canvas.Pen.Color := clBlue; // Canvas.Frame uses (or should use) Pen
  Canvas.Brush.Color := clGreen; // Canvas.FrameRect uses Brush
  Canvas.Frame(100, 100, 300, 200); // this doesn't work
  Canvas.FrameRect(105, 105, 305, 205); // this works
end;

Zeljan Rikalo

2011-11-11 08:01

developer   ~0053995

hm...I don't see TCanvas.Frame at embarcadero site .. only FrameRect , I think it must be removed ...
http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/!!MEMBERTYPE_Methods_Graphics_TCanvas.html

Zex Atilla

2011-12-22 19:12

reporter   ~0055229

They probably just kept the FrameRect (which uses Brush instead of Pen).

Felipe Monteiro de Carvalho

2011-12-22 21:10

developer   ~0055233

Yes, Frame looks non-sensical. But maybe we should deprecate it before removing?

Zeljan Rikalo

2011-12-22 21:51

developer   ~0055234

+1

Felipe Monteiro de Carvalho

2011-12-22 22:23

developer   ~0055235

Mattias added it, so maybe we should wait for input from him:

http://svn.freepascal.org/cgi-bin/viewvc.cgi?view=rev&root=lazarus&revision=2701

Felipe Monteiro de Carvalho

2011-12-23 09:31

developer   ~0055238

Or another idea: Remove the LCLIntf implementation and add the trivial/cross-widgetset implementation for this routine:

OldBrushStyle := Brush.Style;
Brush.Style := bsClear;
Rectangle();
Brush.Style := OldBrushStyle;

Felipe Monteiro de Carvalho

2011-12-24 11:54

developer   ~0055254

I fixed like my last comment. Please test and close if ok. I see that LCL-Carbon had a wrong idea about this routine, thinking it is about a "native frame", but it is not. It is really only a rectangle border using the Pen and that's how it is defined in TCanvas and how it was started in gtk.

Issue History

Date Modified Username Field Change
2011-09-08 17:59 Zex Atilla New Issue
2011-09-08 17:59 Zex Atilla Widgetset => Win32/Win64
2011-10-07 14:44 Vincent Snijders LazTarget => 1.0
2011-10-07 14:44 Vincent Snijders Status new => acknowledged
2011-10-07 14:44 Vincent Snijders Target Version => 1.0.0
2011-10-30 14:04 Zeljan Rikalo Note Added: 0053639
2011-10-30 14:04 Zeljan Rikalo Status acknowledged => feedback
2011-11-10 16:41 Zex Atilla Note Added: 0053979
2011-11-11 08:01 Zeljan Rikalo Note Added: 0053995
2011-12-22 19:12 Zex Atilla Note Added: 0055229
2011-12-22 21:10 Felipe Monteiro de Carvalho Note Added: 0055233
2011-12-22 21:51 Zeljan Rikalo Note Added: 0055234
2011-12-22 22:23 Felipe Monteiro de Carvalho Note Added: 0055235
2011-12-23 09:31 Felipe Monteiro de Carvalho Note Added: 0055238
2011-12-24 11:54 Felipe Monteiro de Carvalho Fixed in Revision => 34379
2011-12-24 11:54 Felipe Monteiro de Carvalho Status feedback => resolved
2011-12-24 11:54 Felipe Monteiro de Carvalho Fixed in Version => 0.9.31 (SVN)
2011-12-24 11:54 Felipe Monteiro de Carvalho Resolution open => fixed
2011-12-24 11:54 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2011-12-24 11:54 Felipe Monteiro de Carvalho Note Added: 0055254