initialize variables at declaration instead in the unit initialization from Florian K�berle

git-svn-id: trunk@7426 -
This commit is contained in:
vincents 2005-07-26 08:45:15 +00:00
parent 21a9d058d9
commit 3c8fe5d206
9 changed files with 34 additions and 45 deletions

View File

@ -18,6 +18,7 @@ Darius Blaszijk
Dean Zobec Dean Zobec
Eric Chapman Eric Chapman
Felipe Monteiro de Carvalho Felipe Monteiro de Carvalho
Florian Koeberle
Francisco Manuel Francisco Manuel
GongYu GongYu
Hans-Joachim Ott Hans-Joachim Ott

View File

@ -2022,8 +2022,8 @@ uses
var var
// The interface knows, which TWinControl has the capture. This stores // The interface knows, which TWinControl has the capture. This stores
// what child control of this TWinControl has actually the capture. // what child control of this TWinControl has actually the capture.
CaptureControl: TControl; CaptureControl: TControl=nil;
DockSiteHash: TDynHashArray; DockSiteHash: TDynHashArray=nil;
procedure AdjustBorderSpace(var RemainingClientRect, CurBorderSpace: TRect; procedure AdjustBorderSpace(var RemainingClientRect, CurBorderSpace: TRect;
Left, Top, Right, Bottom: integer); Left, Top, Right, Bottom: integer);
@ -2933,13 +2933,9 @@ end;
{$ENDIF not VER1_0} {$ENDIF not VER1_0}
initialization initialization
//DebugLn('controls.pp - initialization'); //DebugLn('controls.pp - initialization');
Mouse := TMouse.Create; Mouse := TMouse.Create;
DragControl := nil;
CaptureControl := nil;
DefaultDockTreeClass := TDockTree; DefaultDockTreeClass := TDockTree;
DockSiteHash := nil;
RegisterIntegerConsts(TypeInfo(TCursor), @IdentToCursor, @CursorToIdent); RegisterIntegerConsts(TypeInfo(TCursor), @IdentToCursor, @CursorToIdent);
@ -2952,6 +2948,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.316 2005/07/26 08:45:15 vincents
initialize variables at declaration instead in the unit initialization from Florian Köberle
Revision 1.315 2005/07/22 11:15:56 mattias Revision 1.315 2005/07/22 11:15:56 mattias
updated russian translation for windows from Rostislav Okulov updated russian translation for windows from Rostislav Okulov

View File

@ -1202,7 +1202,7 @@ var
Application: TApplication; Application: TApplication;
Screen: TScreen; Screen: TScreen;
ExceptionObject: TExceptObject; ExceptionObject: TExceptObject;
HintWindowClass: THintWindowClass; HintWindowClass: THintWindowClass=THintWindow;
type type
TMessageBoxFunction = TMessageBoxFunction =
@ -1222,10 +1222,10 @@ uses
WSForms; // Widgetset uses circle is allowed WSForms; // Widgetset uses circle is allowed
var var
FocusMessages: Boolean; FocusMessages: Boolean=True;
FocusCount: Integer; FocusCount: Integer=0;
HandlingException: boolean; HandlingException: boolean=False;
HaltingProgram: boolean; HaltingProgram: boolean=False;
procedure Register; procedure Register;
begin begin
@ -1669,11 +1669,6 @@ end;
//============================================================================== //==============================================================================
initialization initialization
FocusCount := 0;
Focusmessages := True;
HandlingException := false;
HaltingProgram := false;
HintWindowClass := THintWindow;
LCLProc.OwnerFormDesignerModifiedProc:=@IfOwnerIsFormThenDesignerModified; LCLProc.OwnerFormDesignerModifiedProc:=@IfOwnerIsFormThenDesignerModified;
Screen:= TScreen.Create(nil); Screen:= TScreen.Create(nil);
Application:= TApplication.Create(nil); Application:= TApplication.Create(nil);

View File

@ -1418,8 +1418,8 @@ type
FormatID: TClipboardFormat); FormatID: TClipboardFormat);
var var
OnLoadGraphicFromClipboardFormat: TOnLoadGraphicFromClipboardFormat; OnLoadGraphicFromClipboardFormat: TOnLoadGraphicFromClipboardFormat=nil;
OnSaveGraphicToClipboardFormat: TOnSaveGraphicToClipboardFormat; OnSaveGraphicToClipboardFormat: TOnSaveGraphicToClipboardFormat=nil;
function TestStreamBitmapNativeType(const AStream: TStream): TBitmapNativeType; function TestStreamBitmapNativeType(const AStream: TStream): TBitmapNativeType;
function TestStreamIsBMP(const AStream: TStream): boolean; function TestStreamIsBMP(const AStream: TStream): boolean;
@ -1435,7 +1435,8 @@ function ReadXPMSize(XPM: PPChar; var Width, Height, ColorCount: integer
var var
{ Stores information about the current screen { Stores information about the current screen
- initialized on Interface startup } - initialized on Interface startup }
ScreenInfo: TScreenInfo; ScreenInfo: TScreenInfo=(PixelsPerInchX:72;PixelsPerInchY:72;
ColorDepth:24;Initialized:false;);
FontResourceCache: TFontHandleCache; FontResourceCache: TFontHandleCache;
PenResourceCache: TPenHandleCache; PenResourceCache: TPenHandleCache;
@ -1934,14 +1935,6 @@ begin
end; end;
initialization initialization
ScreenInfo.Initialized:=false;
ScreenInfo.ColorDepth:=24;
ScreenInfo.PixelsPerInchX:=72;
ScreenInfo.PixelsPerInchY:=72;
PicClipboardFormats:=nil;
PicFileFormats:=nil;
OnLoadGraphicFromClipboardFormat:=nil;
OnSaveGraphicToClipboardFormat:=nil;
FontResourceCache:=TFontHandleCache.Create; FontResourceCache:=TFontHandleCache.Create;
PenResourceCache:=TPenHandleCache.Create; PenResourceCache:=TPenHandleCache.Create;
BrushResourceCache:=TBrushHandleCache.Create; BrushResourceCache:=TBrushHandleCache.Create;
@ -1962,6 +1955,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.179 2005/07/26 08:45:15 vincents
initialize variables at declaration instead in the unit initialization from Florian Köberle
Revision 1.178 2005/07/19 08:31:21 vincents Revision 1.178 2005/07/19 08:31:21 vincents
added ColorBox (from Darius) to LCL added ColorBox (from Darius) to LCL

View File

@ -15,7 +15,7 @@
} }
var var
DragControl: TControl; // control, that started the drag DragControl: TControl=nil; // control, that started the drag
DragObject: TDragObject; // the drag information object DragObject: TDragObject; // the drag information object
DragObjectAutoFree: Boolean; // True, if DragObject was auto created DragObjectAutoFree: Boolean; // True, if DragObject was auto created
DragStartPos: TPoint; // mouse position at start of drag DragStartPos: TPoint; // mouse position at start of drag
@ -362,6 +362,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.9 2005/07/26 08:45:15 vincents
initialize variables at declaration instead in the unit initialization from Florian Köberle
Revision 1.8 2005/02/05 16:09:52 marc Revision 1.8 2005/02/05 16:09:52 marc
* first 64bit changes * first 64bit changes

View File

@ -268,8 +268,8 @@ end;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
var var
PicClipboardFormats: TPicClipboardFormats; PicClipboardFormats: TPicClipboardFormats=nil;
PicFileFormats: TPicFileFormatsList; PicFileFormats: TPicFileFormatsList=nil;
function GetPicFileFormats: TPicFileFormatsList; function GetPicFileFormats: TPicFileFormatsList;
begin begin

View File

@ -83,7 +83,7 @@ type
TInputDialogFunction = Function (const InputCaption, InputPrompt : String; TInputDialogFunction = Function (const InputCaption, InputPrompt : String;
MaskInput : Boolean; var Value : String) : Boolean; MaskInput : Boolean; var Value : String) : Boolean;
var var
InputDialogFunction: TInputDialogFunction; InputDialogFunction: TInputDialogFunction=nil;
type type
TPromptDialogFunction = Function(const DialogCaption, DialogMessage : String; TPromptDialogFunction = Function(const DialogCaption, DialogMessage : String;
@ -95,7 +95,7 @@ var
PromptDialogFunction: TPromptDialogFunction; PromptDialogFunction: TPromptDialogFunction;
var var
InterfaceObject: TWidgetSet; InterfaceObject: TWidgetSet=nil;
implementation implementation
@ -107,9 +107,6 @@ const
{$I intfbasewinapi.inc} {$I intfbasewinapi.inc}
{$I intfbaselcl.inc} {$I intfbaselcl.inc}
initialization
InputDialogFunction:=nil;
InterfaceObject:=nil;
finalization finalization
InputDialogFunction:=nil; InputDialogFunction:=nil;
@ -118,6 +115,9 @@ end.
{ {
$Log$ $Log$
Revision 1.56 2005/07/26 08:45:15 vincents
initialize variables at declaration instead in the unit initialization from Florian Köberle
Revision 1.55 2004/09/24 21:34:14 micha Revision 1.55 2004/09/24 21:34:14 micha
convert LM_CREATE message to interface methods convert LM_CREATE message to interface methods
remove SendMsgToInterface, CNSendMessage and related methods remove SendMsgToInterface, CNSendMessage and related methods

View File

@ -72,8 +72,8 @@ type
var var
SendApplicationMessageFunction: TSendApplicationMessageFunction; SendApplicationMessageFunction: TSendApplicationMessageFunction=nil;
OwnerFormDesignerModifiedProc: TOwnerFormDesignerModifiedProc; OwnerFormDesignerModifiedProc: TOwnerFormDesignerModifiedProc=nil;
function SendApplicationMessage(Msg: Cardinal; WParam: WParam; LParam: LParam):Longint; function SendApplicationMessage(Msg: Cardinal; WParam: WParam; LParam: LParam):Longint;
procedure OwnerFormDesignerModified(AComponent: TComponent); procedure OwnerFormDesignerModified(AComponent: TComponent);
@ -1942,8 +1942,6 @@ end;
initialization initialization
InitializeDebugOutput; InitializeDebugOutput;
SendApplicationMessageFunction:=nil;
OwnerFormDesignerModifiedProc:=nil;
InterfaceFinalizationHandlers:=TList.Create; InterfaceFinalizationHandlers:=TList.Create;
finalization finalization
InterfaceFinalizationHandlers.Free; InterfaceFinalizationHandlers.Free;

View File

@ -187,8 +187,8 @@ type
var var
LazarusResources: TLResourceList; LazarusResources: TLResourceList;
LRSObjectReaderClass: TLRSObjectReaderClass; LRSObjectReaderClass: TLRSObjectReaderClass=TLRSObjectReader;
LRSObjectWriterClass: TLRSObjectWriterClass; LRSObjectWriterClass: TLRSObjectWriterClass=TLRSObjectWriter;
function InitLazResourceComponent(Instance: TComponent; function InitLazResourceComponent(Instance: TComponent;
RootAncestor: TClass): Boolean; RootAncestor: TClass): Boolean;
@ -276,7 +276,7 @@ const
var var
ByteToStr: array[char] of shortstring; ByteToStr: array[char] of shortstring;
ByteToStrValid: boolean; ByteToStrValid: boolean=false;
procedure InitByteToStr; procedure InitByteToStr;
var var
@ -3155,9 +3155,6 @@ end;
procedure InternalInit; procedure InternalInit;
begin begin
LazarusResources:=TLResourceList.Create; LazarusResources:=TLResourceList.Create;
ByteToStrValid:=false;
LRSObjectReaderClass:=TLRSObjectReader;
LRSObjectWriterClass:=TLRSObjectWriter;
end; end;
initialization initialization