summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-11-03 15:33:33 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-11-03 15:33:33 +0000
commit049a32a2d057917d26656d54f93673dd394e89df (patch)
tree49f79b6201f191ede1ce3b01bb7b3296bbe620a0 /src/corelib
parentaae6921b382bbe1a6a0aff25d065494ab2a2abc7 (diff)
downloadfpGUI-049a32a2d057917d26656d54f93673dd394e89df.tar.xz
* Started working on a Calendar component.
* Created a new example project to test the calendar component. Please note it is NOT complete yet. * Added a ScrollBarStyle property to BaseGrid to control the ScrollBar visibility.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/gfx_popupwindow.pas53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/corelib/gfx_popupwindow.pas b/src/corelib/gfx_popupwindow.pas
index 2ce499da..3450b63d 100644
--- a/src/corelib/gfx_popupwindow.pas
+++ b/src/corelib/gfx_popupwindow.pas
@@ -16,17 +16,22 @@ type
TfpgPopupWindow = class(TfpgWidget)
private
FDontCloseWidget: TfpgWidget;
+ FPopupFrame: boolean;
+ procedure SetPopupFrame(const AValue: boolean);
protected
procedure MsgClose(var msg: TfpgMessageRec); message FPGM_CLOSE;
procedure AdjustWindowStyle; override;
procedure HandleShow; override;
procedure HandleHide; override;
procedure HandleClose; virtual;
+ procedure ProcessPopupFrame; virtual;
+ procedure DoPaintPopupFrame; virtual;
public
constructor Create(AOwner: TComponent); override;
procedure ShowAt(AWidget: TfpgWidget; x, y: TfpgCoord);
procedure Close; virtual;
property DontCloseWidget: TfpgWidget read FDontCloseWidget write FDontCloseWidget;
+ property PopupFrame: boolean read FPopupFrame write SetPopupFrame;
end;
@@ -170,6 +175,14 @@ end;
{ TfpgPopupWindow }
+procedure TfpgPopupWindow.SetPopupFrame(const AValue: boolean);
+begin
+ if FPopupFrame = AValue then
+ Exit; //==>
+ FPopupFrame := AValue;
+ ProcessPopupFrame;
+end;
+
procedure TfpgPopupWindow.MsgClose(var msg: TfpgMessageRec);
begin
HandleClose;
@@ -199,12 +212,52 @@ begin
HandleHide;
end;
+procedure TfpgPopupWindow.ProcessPopupFrame;
+var
+ i: integer;
+begin
+ if PopupFrame then
+ begin
+ for i := 0 to ComponentCount-1 do
+ begin
+ if Components[i] is TfpgWidget then
+ TfpgWidget(Components[i]).Anchors := [anRight, anBottom];
+ end;
+ // make space for the frame
+// Width := Width + 1;
+// Height := Height + 1;
+// UpdateWindowPosition;
+ HandleResize(Width+1, Height+1);
+ UpdateWindowPosition;
+
+ for i := 0 to ComponentCount-1 do
+ begin
+ if Components[i] is TfpgWidget then
+ TfpgWidget(Components[i]).Anchors := [anLeft, anTop];
+ end;
+ HandleResize(Width+1, Height+1);
+ UpdateWindowPosition;
+
+ Canvas.BeginDraw;
+ DoPaintPopupFrame;
+ Canvas.EndDraw;
+ end;
+end;
+
+procedure TfpgPopupWindow.DoPaintPopupFrame;
+begin
+ Canvas.SetLineStyle(1, lsSolid);
+ Canvas.SetColor(clWidgetFrame);
+ Canvas.DrawRectangle(0, 0, Width, Height);
+end;
+
constructor TfpgPopupWindow.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
WindowType := wtPopup;
FDontCloseWidget := nil;
Parent := nil;
+ FPopupFrame := False;
end;
procedure TfpgPopupWindow.ShowAt(AWidget: TfpgWidget; x, y: TfpgCoord);