summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-11-11 12:05:17 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-11-12 11:04:00 +0200
commitd74d11783f8dfcb1e0bce8717ad20460c6a863fb (patch)
tree71d2f5ef90952845c2c1d0fef25ef8fbb658ee30 /src/gui
parentf603a1963f8788926c6c6d84925abb3f153062df (diff)
downloadfpGUI-d74d11783f8dfcb1e0bce8717ad20460c6a863fb.tar.xz
Added "call stack debugging" for internal use.
It's disabled by default. Enabling can be done via project level or inside each unit at the beginning of such units.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/fpg_form.pas36
1 files changed, 31 insertions, 5 deletions
diff --git a/src/gui/fpg_form.pas b/src/gui/fpg_form.pas
index 2eb6e899..a0cd1e98 100644
--- a/src/gui/fpg_form.pas
+++ b/src/gui/fpg_form.pas
@@ -20,6 +20,8 @@ unit fpg_form;
{$mode objfpc}{$H+}
+{.$Define CStackDebug}
+
interface
uses
@@ -159,9 +161,6 @@ uses
fpg_main,
fpg_popupwindow,
fpg_menu
- {$IFDEF DEBUG}
- ,dbugintf
- {$ENDIF}
;
type
@@ -170,6 +169,7 @@ type
end;
+
function WidgetParentForm(wg: TfpgWidget): TfpgForm;
var
w: TfpgWidget;
@@ -323,7 +323,14 @@ begin
end;
procedure TfpgBaseForm.Show;
+{$IFDEF CStackDebug}
+var
+ itf: IInterface;
+{$ENDIF}
begin
+ {$IFDEF CStackDebug}
+ itf := DebugMethodEnter('TfpgBaseForm.Show - ' + ClassName + ' ('+Name+')');
+ {$ENDIF}
FVisible := True;
HandleShow;
end;
@@ -391,13 +398,29 @@ begin
end;
procedure TfpgBaseForm.HandleMove(x, y: TfpgCoord);
+{$IFDEF CStackDebug}
+var
+ itf: IInterface;
+{$ENDIF}
begin
+ {$IFDEF CStackDebug}
+ itf := DebugMethodEnter('TfpgBaseForm.HandleMove - ' + ClassName + ' ('+Name+')');
+ DebugLn(Format('x:%d y:%d', [x, y]));
+ {$ENDIF}
ClosePopups;
inherited HandleMove(x, y);
end;
procedure TfpgBaseForm.HandleResize(awidth, aheight: TfpgCoord);
+{$IFDEF CStackDebug}
+var
+ i: iinterface;
+{$ENDIF}
begin
+ {$IFDEF CStackDebug}
+ DebugMethodEnter('TfpgBaseForm.HandleResize - ' + ClassName + ' ('+Name+')');
+ DebugLn(Format('w:%d h:%d', [awidth, aheight]));
+ {$ENDIF}
ClosePopups;
inherited HandleResize(awidth, aheight);
end;
@@ -407,9 +430,12 @@ procedure TfpgBaseForm.HandleKeyPress(var keycode: word;
var
i: integer;
wg: TfpgWidget;
+{$IFDEF CStackDebug}
+ itf: IInterface;
+{$ENDIF}
begin
- {$IFDEF DEBUG}
- SendDebug(Classname + '.Keypress');
+ {$IFDEF Debug}
+ itf := DebugMethodEnter('TfpgBaseForm.HandleKeyPress - ' + ClassName + ' ('+Name+')');
{$ENDIF}
// find the TfpgMenuBar
if not consumed then