From 27b4260ca539231514aa053706c060eff1568695 Mon Sep 17 00:00:00 2001 From: graemeg Date: Tue, 7 Aug 2007 09:51:23 +0000 Subject: * Fixed a minor bug where the CoreLib examples did not show the main window --- examples/corelib/eventtest/eventtest.lpr | 1 + examples/corelib/helloworld/helloworld.pas | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/corelib/eventtest/eventtest.lpr b/examples/corelib/eventtest/eventtest.lpr index 5ba36a09..46556971 100644 --- a/examples/corelib/eventtest/eventtest.lpr +++ b/examples/corelib/eventtest/eventtest.lpr @@ -225,6 +225,7 @@ end; procedure TMainForm.Show; begin AllocateWindowHandle; + DoSetWindowVisible(True); // We can't set a title if we don't have a window handle. So we do that here // and not in the constructor. SetWindowTitle('fpGFX event test'); diff --git a/examples/corelib/helloworld/helloworld.pas b/examples/corelib/helloworld/helloworld.pas index 52e56158..93176687 100644 --- a/examples/corelib/helloworld/helloworld.pas +++ b/examples/corelib/helloworld/helloworld.pas @@ -52,6 +52,7 @@ end; procedure TMainWindow.Show; begin AllocateWindowHandle; + DoSetWindowVisible(True); // We can't set a title if we don't have a window handle. So we do that here // and not in the constructor. SetWindowTitle('fpGFX Hello World'); @@ -60,20 +61,20 @@ end; procedure TMainWindow.MsgPaint(var msg: TfpgMessageRec); var Color: TfpgColor; - r: TfpgRect; + r: TRect; i: Integer; begin Canvas.BeginDraw; // begin double buffering Color := 0; r.Left := 0; - r.Width := FWidth; + r.Right := FWidth-1; for i := 0 to FHeight-1 do begin Color := $ff - (i * $ff) div FHeight; // shades of Blue Canvas.SetColor(Color); r.Top := i; - r.Height := i + 1; + r.Bottom := i + 1; Canvas.DrawRectangle(r); end; @@ -87,7 +88,7 @@ begin Canvas.DrawString((Width - Canvas.Font.TextWidth(HelloWorldString)) div 2 - 1, (Height - Canvas.Font.Height) div 2 - 1, HelloWorldString); - Canvas.EndDraw(0, 0, FWidth, FHeight); + Canvas.EndDraw; end; procedure TMainWindow.MsgClose(var msg: TfpgMessageRec); -- cgit v1.2.3-70-g09d2