summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/gui/menutest/menutest.lpi13
-rw-r--r--src/corelib/fpgfx.pas8
-rw-r--r--src/corelib/gfx_popupwindow.pas2
-rw-r--r--src/gui/gui_menu.pas14
4 files changed, 26 insertions, 11 deletions
diff --git a/examples/gui/menutest/menutest.lpi b/examples/gui/menutest/menutest.lpi
index 7a9e8f6b..f0850059 100644
--- a/examples/gui/menutest/menutest.lpi
+++ b/examples/gui/menutest/menutest.lpi
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <PathDelim Value="/"/>
+ <PathDelim Value="\"/>
<Version Value="5"/>
<General>
<Flags>
@@ -9,7 +9,7 @@
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
- <IconPath Value="./"/>
+ <IconPath Value=".\"/>
<TargetFileExt Value=""/>
</General>
<VersionInfo>
@@ -17,13 +17,14 @@
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
+ <DestinationDirectory Value="$(TestDir)\publishedproject\"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+ <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
@@ -42,9 +43,15 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
+ <PathDelim Value="\"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
+ <Linking>
+ <Debugging>
+ <GenerateDebugInfo Value="True"/>
+ </Debugging>
+ </Linking>
<Other>
<CustomOptions Value="-FUunits
"/>
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas
index c2c64cfe..e67989b4 100644
--- a/src/corelib/fpgfx.pas
+++ b/src/corelib/fpgfx.pas
@@ -284,6 +284,8 @@ function fpgRect(ALeft, ATop, AWidth, AHeight: integer): TfpgRect;
// Debug rountines
procedure PrintRect(var Rect: TRect);
procedure PrintRect(var Rect: TfpgRect);
+procedure DumpStack;
+
implementation
@@ -459,6 +461,12 @@ begin
' bottom=', Rect.Bottom, ' width=', Rect.Width, ' height=', Rect.Height);
end;
+procedure DumpStack;
+begin
+ writeln(' Stack trace:');
+ Dump_Stack(StdOut, get_frame);
+end;
+
{ TfpgTimer }
procedure TfpgTimer.SetEnabled(const AValue: boolean);
diff --git a/src/corelib/gfx_popupwindow.pas b/src/corelib/gfx_popupwindow.pas
index ca6c0a42..2ce499da 100644
--- a/src/corelib/gfx_popupwindow.pas
+++ b/src/corelib/gfx_popupwindow.pas
@@ -224,8 +224,8 @@ end;
procedure TfpgPopupWindow.Close;
begin
- PopupListRemove(self);
HandleHide;
+ PopupListRemove(self);
end;
diff --git a/src/gui/gui_menu.pas b/src/gui/gui_menu.pas
index 58aacda6..eab5e6d6 100644
--- a/src/gui/gui_menu.pas
+++ b/src/gui/gui_menu.pas
@@ -100,7 +100,7 @@ type
FItems: TList;
FFocusItem: integer;
procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override;
- procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override;
+ procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override;
procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override;
procedure HandlePaint; override;
procedure HandleShow; override;
@@ -567,11 +567,11 @@ var
begin
// Close all previous popups
for n := 1 to VisibleCount do
- with VisibleItem(n) do
- begin
- if (SubMenu <> nil) and (SubMenu.HasHandle) then
- SubMenu.Close;
- end;
+ with VisibleItem(n) do
+ begin
+ if (SubMenu <> nil) and (SubMenu.HasHandle) then
+ SubMenu.Close;
+ end;
end;
function TfpgMenuBar.MenuFocused: boolean;
@@ -722,7 +722,7 @@ begin
// repaint;
end;
-procedure TfpgPopupMenu.HandleLMouseUp(x, y: integer; shiftstate: TShiftState);
+procedure TfpgPopupMenu.HandleLMouseDown(x, y: integer; shiftstate: TShiftState);
var
newf: integer;
mi: TfpgMenuItem;