diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-04-27 22:56:37 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-04-27 22:56:37 +0000 |
commit | dd63a78ef833d7fec32890e8c2ce53ad2a4ec1b6 (patch) | |
tree | 9f25310cab1ef71c931376e5136a86d8fda7ed10 | |
parent | 1bca93f58c45a5d0d36e68b527f20ad008832f33 (diff) | |
download | fpGUI-dd63a78ef833d7fec32890e8c2ce53ad2a4ec1b6.tar.xz |
* Removed unneeded Canvas.BeginDraw and Canvas.EndDraw calls.
-rw-r--r-- | src/gui/gui_bevel.pas | 13 | ||||
-rw-r--r-- | src/gui/gui_button.pas | 2 | ||||
-rw-r--r-- | src/gui/gui_checkbox.pas | 3 | ||||
-rw-r--r-- | src/gui/gui_combobox.pas | 3 | ||||
-rw-r--r-- | src/gui/gui_dialogs.pas | 2 | ||||
-rw-r--r-- | src/gui/gui_edit.pas | 4 | ||||
-rw-r--r-- | src/gui/gui_gauge.pas | 6 | ||||
-rw-r--r-- | src/gui/gui_label.pas | 7 | ||||
-rw-r--r-- | src/gui/gui_listbox.pas | 5 | ||||
-rw-r--r-- | src/gui/gui_memo.pas | 3 | ||||
-rw-r--r-- | src/gui/gui_panel.pas | 9 | ||||
-rw-r--r-- | src/gui/gui_progressbar.pas | 10 | ||||
-rw-r--r-- | src/gui/gui_radiobutton.pas | 3 | ||||
-rw-r--r-- | src/gui/gui_tab.pas | 10 |
14 files changed, 19 insertions, 61 deletions
diff --git a/src/gui/gui_bevel.pas b/src/gui/gui_bevel.pas index 1fe860a4..d5458f1f 100644 --- a/src/gui/gui_bevel.pas +++ b/src/gui/gui_bevel.pas @@ -15,6 +15,16 @@ Defines a Bevel control. Also known as a Panel or Frame control. } + + +{ ********************************************************** + + DO NOT USE! THIS UNIT IS DEPRECATED. + + Use gui_panel.pas instead. + + *********************************************************} + unit gui_bevel; {$mode objfpc}{$H+} @@ -95,7 +105,6 @@ end; procedure TfpgBevel.HandlePaint; begin - Canvas.BeginDraw; inherited HandlePaint; Canvas.Clear(BackgroundColor); @@ -131,8 +140,6 @@ begin Canvas.DrawLine(Width - 1, 0, Width - 1, Height - 1); if Shape in [bsBox, bsFrame, bsBottomLine] then Canvas.DrawLine(0, Height - 1, Width, Height - 1); - - Canvas.EndDraw; end; constructor TfpgBevel.Create(AOwner: TComponent); diff --git a/src/gui/gui_button.pas b/src/gui/gui_button.pas index 3e8a229d..46ad9aea 100644 --- a/src/gui/gui_button.pas +++ b/src/gui/gui_button.pas @@ -253,7 +253,6 @@ var lBtnFlags: TFButtonFlags; clr: TfpgColor; begin - Canvas.BeginDraw; // inherited HandlePaint; // Canvas.Clear(FBackgroundColor); // Do we need this? Canvas.ClearClipRect; @@ -342,7 +341,6 @@ begin x := 3; fpgStyle.DrawString(Canvas, x+pofs, y+pofs, AText, Enabled); - Canvas.EndDraw; end; procedure TfpgButton.DoPush; diff --git a/src/gui/gui_checkbox.pas b/src/gui/gui_checkbox.pas index 708759ea..5458a955 100644 --- a/src/gui/gui_checkbox.pas +++ b/src/gui/gui_checkbox.pas @@ -115,7 +115,6 @@ var ix: integer; img: TfpgImage; begin - Canvas.BeginDraw; inherited HandlePaint; Canvas.SetColor(FBackgroundColor); @@ -156,8 +155,6 @@ begin ty := 0; Canvas.SetTextColor(FTextColor); fpgStyle.DrawString(Canvas, tx, ty, FText, Enabled); - - Canvas.EndDraw; end; procedure TfpgCheckBox.HandleLMouseDown(x, y: integer; shiftstate: TShiftState); diff --git a/src/gui/gui_combobox.pas b/src/gui/gui_combobox.pas index 044582b3..125d7003 100644 --- a/src/gui/gui_combobox.pas +++ b/src/gui/gui_combobox.pas @@ -563,7 +563,6 @@ procedure TfpgAbstractComboBox.HandlePaint; var r: TfpgRect; begin - Canvas.BeginDraw; // inherited HandlePaint; Canvas.ClearClipRect; r.SetRect(0, 0, Width, Height); @@ -606,8 +605,6 @@ begin // Draw select item's text if HasText then fpgStyle.DrawString(Canvas, FMargin+1, FMargin, Text, Enabled); - - Canvas.EndDraw; end; procedure TfpgAbstractComboBox.PaintInternalButton; diff --git a/src/gui/gui_dialogs.pas b/src/gui/gui_dialogs.pas index 3a45fb16..f7c2060b 100644 --- a/src/gui/gui_dialogs.pas +++ b/src/gui/gui_dialogs.pas @@ -353,7 +353,6 @@ var n, y: integer; tw: integer; begin - Canvas.BeginDraw; inherited HandlePaint; Canvas.SetFont(FFont); @@ -367,7 +366,6 @@ begin Canvas.DrawString(10, y, FLines[n]); Inc(y, FLineHeight); end; - Canvas.EndDraw; end; procedure TfpgMessageBox.HandleShow; diff --git a/src/gui/gui_edit.pas b/src/gui/gui_edit.pas index 588113b8..00c5da44 100644 --- a/src/gui/gui_edit.pas +++ b/src/gui/gui_edit.pas @@ -363,8 +363,6 @@ var end; begin - Canvas.BeginDraw; - Canvas.ClearClipRect; r.SetRect(0, 0, Width, Height); case BorderStyle of @@ -415,8 +413,6 @@ begin DrawSelection; fpgCaret.UnSetCaret(Canvas); end; - - Canvas.EndDraw; end; procedure TfpgCustomEdit.HandleKeyChar(var AText: TfpgChar; diff --git a/src/gui/gui_gauge.pas b/src/gui/gui_gauge.pas index 62569bce..16d4fd74 100644 --- a/src/gui/gui_gauge.pas +++ b/src/gui/gui_gauge.pas @@ -315,7 +315,7 @@ begin Angle := Angle * 3.6; // Percentage to degrees Canvas.SetColor(TfpgColor($425d9b)); FillArcGradient (Canvas,Left, Top, Width, Height , 90, -Angle,TfpgColor($425d9b),TfpgColor($98b2ed)); - end; + end; end; procedure TfpgGauge.NeedleDraw; @@ -404,7 +404,7 @@ end; procedure TfpgGauge.HandlePaint; begin inherited HandlePaint; - Canvas.BeginDraw(True); +// Canvas.BeginDraw(True); {Paint Background and adjust FClientRect according style and BorderStyle} BackgroundDraw; {Paint foreground according selected Kind} @@ -422,7 +422,7 @@ begin {Add Text if required} if ShowText then TextDraw; - Canvas.EndDraw; +// Canvas.EndDraw; end; procedure TfpgGauge.SetGaugeKind(AValue: TGaugeKind); diff --git a/src/gui/gui_label.pas b/src/gui/gui_label.pas index 53ac5c59..96ed5d2b 100644 --- a/src/gui/gui_label.pas +++ b/src/gui/gui_label.pas @@ -215,7 +215,6 @@ var r: TfpgRect; lTxtFlags: TFTextFlags; begin - Canvas.BeginDraw; inherited HandlePaint; Canvas.ClearClipRect; r.SetRect(0, 0, Width, Height); @@ -233,7 +232,7 @@ begin Include(lTxtFlags, txtRight); taCenter: Include(lTxtFlags, txtHCenter); - end; + end; case FLayout of tlTop: Include(lTxtFlags, txtTop); @@ -241,10 +240,8 @@ begin Include(lTxtFlags, txtBottom); tlCenter: Include(lTxtFlags, txtVCenter); - end; - + end; FTextHeight := Canvas.DrawText(0, 0, Width, Height, FText, lTxtFlags); - Canvas.EndDraw; end; end. diff --git a/src/gui/gui_listbox.pas b/src/gui/gui_listbox.pas index 415e8db3..f606099a 100644 --- a/src/gui/gui_listbox.pas +++ b/src/gui/gui_listbox.pas @@ -561,7 +561,6 @@ var n: integer; r: TfpgRect; begin - Canvas.BeginDraw; inherited HandlePaint; Canvas.ClearClipRect; @@ -615,7 +614,7 @@ begin Canvas.FillRectangle(r); // This is just a test. - // BlueCurve theme :) + // Bluecurve theme :) if (n = FFocusItem) and FFocused then begin // outer dark border @@ -652,8 +651,6 @@ begin r.SetBottom(Height - FMargin); Canvas.FillRectangle(r); end; - - Canvas.EndDraw; end; constructor TfpgBaseListBox.Create(AOwner: TComponent); diff --git a/src/gui/gui_memo.pas b/src/gui/gui_memo.pas index e606c85a..4330c3f3 100644 --- a/src/gui/gui_memo.pas +++ b/src/gui/gui_memo.pas @@ -742,7 +742,6 @@ var c: integer; s: string; begin - Canvas.BeginDraw; Canvas.ClearClipRect; r.SetRect(0, 0, Width, Height); Canvas.DrawControlFrame(r); @@ -846,8 +845,6 @@ begin FVScrollBar.Width, FHScrollBar.Height); end; - - Canvas.EndDraw; end; procedure TfpgMemo.HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: boolean); diff --git a/src/gui/gui_panel.pas b/src/gui/gui_panel.pas index 085e77dc..7e03796c 100644 --- a/src/gui/gui_panel.pas +++ b/src/gui/gui_panel.pas @@ -227,7 +227,6 @@ end; procedure TfpgBevel.HandlePaint; begin - Canvas.BeginDraw; inherited HandlePaint; Canvas.Clear(BackgroundColor); @@ -264,8 +263,6 @@ begin Canvas.DrawLine(Width - 1, 0, Width - 1, Height - 1); if Shape in [bsBox, bsFrame, bsBottomLine] then Canvas.DrawLine(0, Height - 1, Width, Height - 1); - - Canvas.EndDraw; end; {TfpgPanel} @@ -369,7 +366,6 @@ procedure TfpgPanel.HandlePaint; var lTxtFlags: TFTextFlags; begin - Canvas.BeginDraw; inherited HandlePaint; Canvas.Clear(BackgroundColor); @@ -418,8 +414,6 @@ begin Include(lTxtFlags, txtVCenter); end; Canvas.DrawText(FMargin, FMargin, Width - FMargin * 2, Height - FMargin * 2, FText, lTxtFlags, FLineSpace); - - Canvas.EndDraw; end; constructor TfpgPanel.Create(Aowner: TComponent); @@ -502,7 +496,6 @@ var lTxtFlags: TFTextFlags; w: integer; begin - Canvas.BeginDraw; inherited HandlePaint; Canvas.Clear(Parent.BackgroundColor); @@ -614,8 +607,6 @@ begin Canvas.DrawText(w + FMargin, 0, FText, lTxtFlags); end; end; - - Canvas.EndDraw; end; constructor TfpgGroupBox.Create(Aowner: TComponent); diff --git a/src/gui/gui_progressbar.pas b/src/gui/gui_progressbar.pas index f7203272..8b9d4612 100644 --- a/src/gui/gui_progressbar.pas +++ b/src/gui/gui_progressbar.pas @@ -52,7 +52,6 @@ type property ShowCaption: boolean read FShowCaption write SetShowCaption; public constructor Create(AOwner: TComponent); override; - destructor Destroy; override; procedure StepIt; procedure StepBy(AStep: integer); property Font: TfpgFont read FFont; @@ -148,8 +147,7 @@ var x: TfpgCoord; y: TfpgCoord; begin - Canvas.BeginDraw; -// inherited HandlePaint; + inherited HandlePaint; Canvas.ClearClipRect; r.SetRect(0, 0, Width, Height); @@ -193,7 +191,6 @@ begin Canvas.Font := FFont; Canvas.DrawString(x, y, txt); end; - Canvas.EndDraw; end; constructor TfpgCustomProgressBar.Create(AOwner: TComponent); @@ -212,11 +209,6 @@ begin FFont := fpgStyle.DefaultFont; end; -destructor TfpgCustomProgressBar.Destroy; -begin - inherited Destroy; -end; - procedure TfpgCustomProgressBar.StepIt; begin Position := Position + Step; diff --git a/src/gui/gui_radiobutton.pas b/src/gui/gui_radiobutton.pas index d59f6f23..0ca1a11e 100644 --- a/src/gui/gui_radiobutton.pas +++ b/src/gui/gui_radiobutton.pas @@ -165,7 +165,6 @@ var img: TfpgImage; ix: integer; begin - Canvas.BeginDraw; inherited HandlePaint; Canvas.SetColor(FBackgroundColor); @@ -206,8 +205,6 @@ begin ty := 0; Canvas.SetTextColor(FTextColor); fpgStyle.DrawString(Canvas, tx, ty, FText, Enabled); - - Canvas.EndDraw; end; procedure TfpgRadioButton.HandleLMouseDown(x, y: integer; diff --git a/src/gui/gui_tab.pas b/src/gui/gui_tab.pas index ba88be8e..45d577fe 100644 --- a/src/gui/gui_tab.pas +++ b/src/gui/gui_tab.pas @@ -188,10 +188,8 @@ end; procedure TfpgTabSheet.HandlePaint; begin - Canvas.BeginDraw; -// inherited HandlePaint; + inherited HandlePaint; Canvas.Clear(FBackgroundColor); - Canvas.EndDraw; end; constructor TfpgTabSheet.Create(AOwner: TComponent); @@ -549,9 +547,7 @@ end; procedure TfpgPageControl.HandlePaint; begin - Canvas.BeginDraw; -// inherited HandlePaint; - + inherited HandlePaint; if SortPages then OrderSheets; Canvas.ClearClipRect; @@ -562,8 +558,6 @@ begin Canvas.SetColor(clInactiveWgFrame); Canvas.DrawRectangle(0, 0, Width, Height); RePaintTitles; - - Canvas.EndDraw; end; procedure TfpgPageControl.HandleShow; |