diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-08-07 09:51:23 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-08-07 09:51:23 +0000 |
commit | 27b4260ca539231514aa053706c060eff1568695 (patch) | |
tree | 6f36651eb45d5b2c163eaeda21a0474eb84a6be4 /examples | |
parent | f11fffeb438a1d3457629d183fe96657d12c9546 (diff) | |
download | fpGUI-27b4260ca539231514aa053706c060eff1568695.tar.xz |
* Fixed a minor bug where the CoreLib examples did not show the main window
Diffstat (limited to 'examples')
-rw-r--r-- | examples/corelib/eventtest/eventtest.lpr | 1 | ||||
-rw-r--r-- | examples/corelib/helloworld/helloworld.pas | 9 |
2 files changed, 6 insertions, 4 deletions
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); |