added TFrame definition, no implementation

git-svn-id: trunk@4534 -
This commit is contained in:
mattias 2003-08-27 09:20:44 +00:00
parent 312703c997
commit 115757e25e
6 changed files with 196 additions and 13 deletions

1
.gitattributes vendored
View File

@ -773,6 +773,7 @@ lcl/include/customcombobox.inc svneol=native#text/pascal
lcl/include/customcontrol.inc svneol=native#text/pascal
lcl/include/customedit.inc svneol=native#text/pascal
lcl/include/customform.inc svneol=native#text/pascal
lcl/include/customframe.inc svneol=native#text/pascal
lcl/include/customgroupbox.inc svneol=native#text/pascal
lcl/include/customlabel.inc svneol=native#text/pascal
lcl/include/customlabelededit.inc svneol=native#text/pascal

View File

@ -243,6 +243,75 @@ type
end;
{ TCustomFrame - not implemented yet }
TCustomFrame = class(TScrollingWinControl)
private
procedure AddActionList(ActionList: TCustomActionList);
procedure RemoveActionList(ActionList: TCustomActionList);
protected
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
procedure Notification(AComponent: TComponent;
Operation: TOperation); override;
procedure SetParent(AParent: TWinControl); override;
public
constructor Create(AOwner: TComponent); override;
end;
TCustomFrameClass = class of TCustomFrame;
{ TFrame - not implemented yet }
TFrame = class(TCustomFrame)
published
property Align;
property Anchors;
property AutoScroll;
property AutoSize;
property Constraints;
//property DockSite;
property DragCursor;
property DragKind;
property DragMode;
property Enabled;
property Color nodefault;
property Ctl3D;
property Font;
property ParentColor;
property ParentCtl3D;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property OnClick;
property OnConstrainedResize;
property OnContextPopup;
property OnDblClick;
//property OnDockDrop;
//property OnDockOver;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnEnter;
property OnExit;
//property OnGetSiteInfo;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnMouseWheel;
property OnMouseWheelDown;
property OnMouseWheelUp;
property OnResize;
property OnStartDock;
property OnStartDrag;
//property OnUnDock;
end;
{ TCustomForm }
TIDesigner = class;
@ -321,6 +390,7 @@ type
procedure WMShowWindow(var message: TLMShowWindow); message LM_SHOWWINDOW;
procedure WMSize(var message: TLMSize); message LM_Size;
protected
FActionLists: TList;
function CloseQuery : boolean; virtual;
function FormUpdating: boolean;
procedure Activate; dynamic;
@ -1371,6 +1441,7 @@ end;
{$I controlscrollbar.inc}
{$I scrollingwincontrol.inc}
{$I scrollbox.inc}
{$I customframe.inc}
{$I customform.inc}
{$I screen.inc}
{$I application.inc}

View File

@ -43,7 +43,8 @@ begin
FItems:= NewStrings;
UpdateSorted;
CNSendMessage(LM_SETITEMINDEX, Self, Pointer(FItemIndex));
if FItemIndex <> -1 then
CNSendMessage(LM_SETITEMINDEX, Self, Pointer(FItemIndex));
CNSendMessage(LM_SETPROPERTIES, Self, nil);
end;
@ -788,6 +789,9 @@ end;
{
$Log$
Revision 1.30 2003/08/27 09:20:44 mattias
added TFrame definition, no implementation
Revision 1.29 2003/07/26 13:26:56 mattias
fixed WindowProc

View File

@ -115,6 +115,7 @@ begin
FreeThenNil(FMenu);
FreeThenNil(FIcon);
Screen.RemoveForm(Self);
FreeThenNil(FActionLists);
//writeln('[TCustomForm.Destroy] B ',Name,':',ClassName);
inherited Destroy;
//writeln('[TCustomForm.Destroy] END ',Name,':',ClassName);
@ -140,36 +141,38 @@ End;
{------------------------------------------------------------------------------
Method: TCustomForm.Notification
------------------------------------------------------------------------------}
Procedure TCustomForm.Notification(AComponent : TComponent;
Operation : TOperation);
Procedure TCustomForm.Notification(AComponent: TComponent;
Operation: TOperation);
Begin
inherited Notification(AComponent,Operation);
case Operation of
opInsert:
begin
{if AComponent is TCustomActionList then
begin
if FActionLists = nil then FActionLists := TList.Create;
if AComponent is TCustomActionList then begin
if FActionLists=nil then FActionLists:=TList.Create;
FActionLists.Add(AComponent);
end
else }if not (csLoading in ComponentState) and (Menu = nil) and
(AComponent.Owner = Self) and (AComponent is TMainMenu) then
Menu := TMainMenu(AComponent);
else if not (csLoading in ComponentState) and (Menu = nil)
and (AComponent.Owner=Self) and (AComponent is TMainMenu) then
Menu:=TMainMenu(AComponent);
end;
opRemove:
begin
{if (FActionLists <> nil) and (AComponent is TCustomActionList) then
if (FActionLists<>nil) and (AComponent is TCustomActionList) then
FActionLists.Remove(AComponent)
else
begin}
begin
if Menu = AComponent then Menu := nil;
//if WindowMenu = AComponent then WindowMenu := nil;
//if ObjectMenuItem = AComponent then ObjectMenuItem := nil;
//end;
end;
if FActiveControl=AComponent then FActiveControl:=nil;
end;
end;
if FDesigner <> nil then FDesigner.Notification(AComponent,Operation);
if FDesigner<>nil then FDesigner.Notification(AComponent,Operation);
End;
{------------------------------------------------------------------------------
@ -1423,6 +1426,9 @@ end;
{ =============================================================================
$Log$
Revision 1.110 2003/08/27 09:20:44 mattias
added TFrame definition, no implementation
Revision 1.109 2003/08/12 21:35:11 mattias
TApplication now descends from TCustomApplication

100
lcl/include/customframe.inc Normal file
View File

@ -0,0 +1,100 @@
// included by forms.pp
{
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.LCL, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
}
{ TCustomFrame }
procedure TCustomFrame.AddActionList(ActionList: TCustomActionList);
var
ParentForm: TCustomForm;
begin
ParentForm:=GetParentForm(Self);
if ParentForm<>nil then begin
if ParentForm.FActionLists=nil then
ParentForm.FActionLists:=TList.Create;
ParentForm.FActionLists.Add(ActionList);
end;
end;
procedure TCustomFrame.RemoveActionList(ActionList: TCustomActionList);
var
ParentForm: TCustomForm;
begin
ParentForm:=GetParentForm(Self);
if (ParentForm<>nil) and (ParentForm.FActionLists<>nil) then
ParentForm.FActionLists.Remove(ActionList);
end;
procedure TCustomFrame.GetChildren(Proc: TGetChildProc; Root: TComponent);
begin
inherited GetChildren(Proc, Root);
end;
procedure TCustomFrame.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited Notification(AComponent, Operation);
case Operation of
opInsert:
if AComponent is TCustomActionList then
AddActionList(TCustomActionList(AComponent));
opRemove:
if AComponent is TCustomActionList then
RemoveActionList(TCustomActionList(AComponent));
end;
end;
procedure TCustomFrame.SetParent(AParent: TWinControl);
procedure UpdateActionLists(Operation: TOperation);
var
i: Integer;
AComponent: TComponent;
begin
for i:=0 to ComponentCount-1 do begin
AComponent:=Components[i];
if AComponent is TCustomActionList then
case Operation of
opInsert: AddActionList(TCustomActionList(AComponent));
opRemove: RemoveActionList(TCustomActionList(AComponent));
end;
end;
end;
begin
if Parent<>nil then UpdateActionLists(opRemove);
if (Parent=nil) and HandleAllocated then
DestroyHandle;
inherited SetParent(AParent);
if Parent<>nil then UpdateActionLists(opInsert);
end;
constructor TCustomFrame.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
ControlStyle:=[csAcceptsControls,csCaptureMouse,csClickEvents,csSetCaption,
csDoubleClicks];
if (ClassType<>TFrame) and not (csDesignInstance in ComponentState) then begin
if not InitInheritedComponent(Self,TFrame) then
raise EResNotFound.CreateFmt(rsResourceNotFound, [ClassName]);
end else begin
SetInitialBounds(0,0,320,240);
end;
end;
// included by forms.pp

View File

@ -174,6 +174,7 @@ ResourceString
+'Plz check if the unit "interfaces" was added to the programs uses clause.';
rsCanNotFocus = 'Can not focus';
rsListIndexExceedsBounds = 'List index exceeds bounds (%d)';
rsResourceNotFound = 'Resource %s not found';