summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2009-04-07 11:43:30 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2009-04-07 11:43:30 +0200
commita6964c90281beb31f89103006c7eceb9f22cf439 (patch)
treea88a6c05693cec75e1d1e13e5dff7f76780bd10d
parent1f0f4f83720e3b6f008e6c2dea3dee625d62d3ec (diff)
downloadfpGUI-a6964c90281beb31f89103006c7eceb9f22cf439.tar.xz
Added support for changing the tabs in the PageControl while
in the Form Designer. It's not perfect, but workable. ;-)
-rw-r--r--src/corelib/fpg_widget.pas1
-rw-r--r--uidesigner/vfddesigner.pas31
-rw-r--r--uidesigner/vfdwidgetclass.pas2
-rw-r--r--uidesigner/vfdwidgets.pas1
4 files changed, 22 insertions, 13 deletions
diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas
index 7d69f657..604b2d11 100644
--- a/src/corelib/fpg_widget.pas
+++ b/src/corelib/fpg_widget.pas
@@ -514,6 +514,7 @@ var
mb: TMouseButton;
IsDblClick: boolean;
begin
+// writeln('TfpgWidget.MsgMouseUp');
if FFormDesigner <> nil then
begin
FFormDesigner.Dispatch(msg);
diff --git a/uidesigner/vfddesigner.pas b/uidesigner/vfddesigner.pas
index 9c8e27c8..c866f3bb 100644
--- a/uidesigner/vfddesigner.pas
+++ b/uidesigner/vfddesigner.pas
@@ -314,7 +314,6 @@ var
pmenu: TfpgPopupMenu;
begin
// writeln('TFormDesigner.MsgMouseUp');
- msg.Stop := True;
FDragging := False;
shift := (ssShift in msg.Params.mouse.shiftstate);
@@ -327,6 +326,12 @@ begin
else if not wgd.FVFDClass.Container then
wgc := nil;
+ // Should we block mouse msg to actual widget?
+ if Assigned(wgd) then
+ msg.Stop := wgd.FVFDClass.BlockMouseMsg
+ else
+ msg.Stop := True;
+
if wgc <> nil then
begin
DeSelectAll;
@@ -373,18 +378,18 @@ begin
UpdatePropWin;
- if msg.Params.mouse.Buttons = 3 then {right mouse button }
- begin
- if TfpgWidget(msg.Dest).ClassType = TfpgPageControl then
- begin
- writeln('Right click on page control');
- wgd := WidgetDesigner(TfpgWidget(msg.dest));
- if wgd <> nil then
- pmenu := wgd.FVFDClass.CreatePopupMenu(TfpgWidget(msg.dest));
- if Assigned(pmenu) then
- pmenu.ShowAt(wgd.Widget, msg.Params.mouse.x, msg.Params.mouse.y);
- end;
- end;
+ //if msg.Params.mouse.Buttons = 3 then {right mouse button }
+ //begin
+ //if TfpgWidget(msg.Dest).ClassType = TfpgPageControl then
+ //begin
+ //writeln('Right click on page control');
+ //wgd := WidgetDesigner(TfpgWidget(msg.dest));
+ //if wgd <> nil then
+ //pmenu := wgd.FVFDClass.CreatePopupMenu(TfpgWidget(msg.dest));
+ //if Assigned(pmenu) then
+ //pmenu.ShowAt(wgd.Widget, msg.Params.mouse.x, msg.Params.mouse.y);
+ //end;
+ //end;
end;
procedure TFormDesigner.MsgMouseMove(var msg: TfpgMessageRec);
diff --git a/uidesigner/vfdwidgetclass.pas b/uidesigner/vfdwidgetclass.pas
index 98d89f31..b2dd6e6d 100644
--- a/uidesigner/vfdwidgetclass.pas
+++ b/uidesigner/vfdwidgetclass.pas
@@ -77,6 +77,7 @@ type
WidgetIconName: string;
NameBase: string;
Container: boolean;
+ BlockMouseMsg: boolean;
constructor Create(aClass: TWidgetClass);
destructor Destroy; override;
function AddProperty(apropname: string; apropclass: TVFDPropertyClass; desc: string): TVFDWidgetProperty;
@@ -115,6 +116,7 @@ begin
Description := '';
NameBase := 'Widget';
Container := False;
+ BlockMouseMsg := True;
end;
function TVFDWidgetClass.CreateWidget(AOwner: TComponent): TfpgWidget;
diff --git a/uidesigner/vfdwidgets.pas b/uidesigner/vfdwidgets.pas
index 65057c84..a60427d0 100644
--- a/uidesigner/vfdwidgets.pas
+++ b/uidesigner/vfdwidgets.pas
@@ -554,6 +554,7 @@ begin
wc.AddProperty('TabPosition', TPropertyEnum, '');
wc.WidgetIconName := 'vfd.pagecontrol';
wc.Container := True;
+ wc.BlockMouseMsg := False;
RegisterVFDWidget(wc);
// TabSheet