mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-18 11:49:28 +02:00
fixed compilation for fpc 1.0.10
git-svn-id: trunk@5745 -
This commit is contained in:
parent
513788c44b
commit
21b270c41c
@ -36,7 +36,8 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
Buttons, AVGLvlTree, PropEdits, LazarusIDEStrConsts, ComponentReg;
|
||||
Buttons, AVGLvlTree, PropEdits, LazarusIDEStrConsts, ComponentReg,
|
||||
FormEditingIntf, LFMTrees;
|
||||
|
||||
type
|
||||
TChangeClassDlg = class(TForm)
|
||||
@ -105,21 +106,29 @@ end;
|
||||
|
||||
function ChangePersistentClass(ADesigner: TIDesigner; APersistent: TPersistent;
|
||||
NewClass: TClass): TModalResult;
|
||||
var
|
||||
ComponentStream: TMemoryStream;
|
||||
begin
|
||||
// select only this persistent
|
||||
GlobalDesignHook.SelectOnlyThis(APersistent);
|
||||
// stream selection
|
||||
|
||||
// parse
|
||||
|
||||
// change class
|
||||
|
||||
// check properties
|
||||
|
||||
// delete selection
|
||||
|
||||
// insert streamed selection
|
||||
|
||||
ComponentStream:=nil;
|
||||
try
|
||||
// select only this persistent
|
||||
GlobalDesignHook.SelectOnlyThis(APersistent);
|
||||
// stream selection
|
||||
ComponentStream:=TMemoryStream.Create;
|
||||
FormEditingHook.SaveSelectionToStream(ComponentStream);
|
||||
// parse
|
||||
|
||||
// change class
|
||||
|
||||
// check properties
|
||||
|
||||
// delete selection
|
||||
|
||||
// insert streamed selection
|
||||
|
||||
finally
|
||||
ComponentStream.Free;
|
||||
end;
|
||||
Result:=mrCancel;
|
||||
end;
|
||||
|
||||
@ -289,7 +298,7 @@ var
|
||||
begin
|
||||
// create/clear tree
|
||||
if FClasses=nil then
|
||||
FClasses:=TAvgLvlTree.Create(@CompareClasses)
|
||||
FClasses:=TAvgLvlTree.CreateObjectCompare(@CompareClasses)
|
||||
else
|
||||
FClasses.Clear;
|
||||
// add class of ThePersistent
|
||||
|
@ -216,13 +216,14 @@ type
|
||||
|
||||
procedure Modified; override;
|
||||
Procedure SelectOnlyThisComponent(AComponent:TComponent); override;
|
||||
procedure CopySelection;
|
||||
procedure CutSelection;
|
||||
function CanPaste: Boolean;
|
||||
procedure PasteSelection;
|
||||
procedure DeleteSelection;
|
||||
procedure CopySelection; override;
|
||||
procedure CutSelection; override;
|
||||
function CanPaste: Boolean; override;
|
||||
procedure PasteSelection; override;
|
||||
procedure DeleteSelection; override;
|
||||
function CopySelectionToStream(s: TStream): boolean; override;
|
||||
function InvokeComponentEditor(AComponent: TComponent;
|
||||
MenuIndex: integer): boolean;
|
||||
MenuIndex: integer): boolean; override;
|
||||
procedure DoProcessCommand(Sender: TObject; var Command: word;
|
||||
var Handled: boolean);
|
||||
|
||||
@ -400,7 +401,7 @@ begin
|
||||
SelectOnlyThisComponent(TControl(ControlSelection[i].Persistent).Parent);
|
||||
end;
|
||||
|
||||
function TDesigner.DoCopySelectionToClipboard: boolean;
|
||||
function TDesigner.CopySelectionToStream(s: TStream): boolean;
|
||||
|
||||
function UnselectDistinctControls: boolean;
|
||||
var
|
||||
@ -421,8 +422,8 @@ function TDesigner.DoCopySelectionToClipboard: boolean;
|
||||
// check if not the top level component is selected
|
||||
CurParent:=TControl(ControlSelection[i].Persistent).Parent;
|
||||
if CurParent=nil then begin
|
||||
MessageDlg('Can not copy top level component.',
|
||||
'Copying a whole form is not implemented.',
|
||||
MessageDlg(lisCanNotCopyTopLevelComponent,
|
||||
lisCopyingAWholeFormIsNotImplemented,
|
||||
mtError,[mbCancel],0);
|
||||
exit;
|
||||
end;
|
||||
@ -440,79 +441,13 @@ function TDesigner.DoCopySelectionToClipboard: boolean;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function CopySelectionToStream(AllComponentsStream: TStream): boolean;
|
||||
var
|
||||
i: Integer;
|
||||
BinCompStream: TMemoryStream;
|
||||
TxtCompStream: TMemoryStream;
|
||||
CurComponent: TComponent;
|
||||
Driver: TBinaryObjectWriter;
|
||||
Writer: TWriter;
|
||||
begin
|
||||
Result:=false;
|
||||
for i:=0 to ControlSelection.Count-1 do begin
|
||||
if not ControlSelection[i].IsTComponent then continue;
|
||||
|
||||
BinCompStream:=TMemoryStream.Create;
|
||||
TxtCompStream:=TMemoryStream.Create;
|
||||
try
|
||||
// write component binary stream
|
||||
try
|
||||
CurComponent:=TComponent(ControlSelection[i].Persistent);
|
||||
|
||||
Driver := TBinaryObjectWriter.Create(BinCompStream, 4096);
|
||||
Try
|
||||
Writer := TWriter.Create(Driver);
|
||||
Try
|
||||
Writer.Root:=FLookupRoot;
|
||||
Writer.WriteComponent(CurComponent);
|
||||
Finally
|
||||
Writer.Destroy;
|
||||
end;
|
||||
Finally
|
||||
Driver.Free;
|
||||
end;
|
||||
|
||||
//BinCompStream.WriteComponent(CurComponent);
|
||||
except
|
||||
on E: Exception do begin
|
||||
MessageDlg('Unable to stream selected components',
|
||||
'There was an error during writing the selected component '
|
||||
+CurComponent.Name+':'+CurComponent.ClassName+':'#13
|
||||
+E.Message,
|
||||
mtError,[mbCancel],0);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
BinCompStream.Position:=0;
|
||||
// convert binary to text stream
|
||||
try
|
||||
ObjectBinaryToText(BinCompStream,TxtCompStream);
|
||||
except
|
||||
on E: Exception do begin
|
||||
MessageDlg('Unable convert binary stream to text',
|
||||
'There was an error while converting the binary stream of the '
|
||||
+'selected component '
|
||||
+CurComponent.Name+':'+CurComponent.ClassName+':'#13
|
||||
+E.Message,
|
||||
mtError,[mbCancel],0);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
// add text stream to the all stream
|
||||
TxtCompStream.Position:=0;
|
||||
AllComponentsStream.CopyFrom(TxtCompStream,TxtCompStream.Size);
|
||||
finally
|
||||
BinCompStream.Free;
|
||||
TxtCompStream.Free;
|
||||
end;
|
||||
end;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
var
|
||||
AllComponentsStream: TMemoryStream;
|
||||
AllComponentText: string;
|
||||
i: Integer;
|
||||
BinCompStream: TMemoryStream;
|
||||
TxtCompStream: TMemoryStream;
|
||||
CurComponent: TComponent;
|
||||
Driver: TBinaryObjectWriter;
|
||||
Writer: TWriter;
|
||||
begin
|
||||
Result:=false;
|
||||
if (ControlSelection.Count=0) then exit;
|
||||
@ -521,6 +456,71 @@ begin
|
||||
// unselect all controls, that do not have the same parent
|
||||
if not UnselectDistinctControls then exit;
|
||||
|
||||
for i:=0 to ControlSelection.Count-1 do begin
|
||||
if not ControlSelection[i].IsTComponent then continue;
|
||||
|
||||
BinCompStream:=TMemoryStream.Create;
|
||||
TxtCompStream:=TMemoryStream.Create;
|
||||
try
|
||||
// write component binary stream
|
||||
try
|
||||
CurComponent:=TComponent(ControlSelection[i].Persistent);
|
||||
|
||||
Driver := TBinaryObjectWriter.Create(BinCompStream, 4096);
|
||||
Try
|
||||
Writer := TWriter.Create(Driver);
|
||||
Try
|
||||
Writer.Root:=FLookupRoot;
|
||||
Writer.WriteComponent(CurComponent);
|
||||
Finally
|
||||
Writer.Destroy;
|
||||
end;
|
||||
Finally
|
||||
Driver.Free;
|
||||
end;
|
||||
|
||||
//BinCompStream.WriteComponent(CurComponent);
|
||||
except
|
||||
on E: Exception do begin
|
||||
MessageDlg(lisUnableToStreamSelectedComponents,
|
||||
Format(lisThereWasAnErrorDuringWritingTheSelectedComponent, [
|
||||
CurComponent.Name, CurComponent.ClassName, #13, E.Message]),
|
||||
mtError,[mbCancel],0);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
BinCompStream.Position:=0;
|
||||
// convert binary to text stream
|
||||
try
|
||||
ObjectBinaryToText(BinCompStream,TxtCompStream);
|
||||
except
|
||||
on E: Exception do begin
|
||||
MessageDlg(lisUnableConvertBinaryStreamToText,
|
||||
Format(lisThereWasAnErrorWhileConvertingTheBinaryStreamOfThe, [
|
||||
CurComponent.Name, CurComponent.ClassName, #13, E.Message]),
|
||||
mtError,[mbCancel],0);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
// add text stream to the all stream
|
||||
TxtCompStream.Position:=0;
|
||||
s.CopyFrom(TxtCompStream,TxtCompStream.Size);
|
||||
finally
|
||||
BinCompStream.Free;
|
||||
TxtCompStream.Free;
|
||||
end;
|
||||
end;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
function TDesigner.DoCopySelectionToClipboard: boolean;
|
||||
var
|
||||
AllComponentsStream: TMemoryStream;
|
||||
AllComponentText: string;
|
||||
begin
|
||||
Result:=false;
|
||||
if (ControlSelection.Count=0) then exit;
|
||||
|
||||
AllComponentsStream:=TMemoryStream.Create;
|
||||
try
|
||||
// copy components to stream
|
||||
@ -536,9 +536,9 @@ begin
|
||||
ClipBoard.AsText:=AllComponentText;
|
||||
except
|
||||
on E: Exception do begin
|
||||
MessageDlg('Unable copy components to clipboard',
|
||||
'There was an error while copying the component stream to clipboard:'#13
|
||||
+E.Message,
|
||||
MessageDlg(lisUnableCopyComponentsToClipboard,
|
||||
Format(lisThereWasAnErrorWhileCopyingTheComponentStreamToCli, [#13,
|
||||
E.Message]),
|
||||
mtError,[mbCancel],0);
|
||||
exit;
|
||||
end;
|
||||
@ -803,10 +803,9 @@ begin
|
||||
except
|
||||
on E: Exception do begin
|
||||
writeln('TDesigner.InvokeComponentEditor ERROR: ',E.Message);
|
||||
MessageDlg('Error in '+CompEditor.ClassName,
|
||||
'The component editor of class "'+CompEditor.ClassName+'"'
|
||||
+'has created the error:'#13
|
||||
+'"'+E.Message+'"',
|
||||
MessageDlg(Format(lisErrorIn, [CompEditor.ClassName]),
|
||||
Format(lisTheComponentEditorOfClassHasCreatedTheError, ['"',
|
||||
CompEditor.ClassName, '"', #13, '"', E.Message, '"']),
|
||||
mtError,[mbOk],0);
|
||||
end;
|
||||
end;
|
||||
@ -1079,8 +1078,8 @@ Begin
|
||||
if (ControlSelection.SelectionForm<>nil)
|
||||
and (ControlSelection.SelectionForm<>Form)
|
||||
then begin
|
||||
MessageDlg('Invalid multiselection',
|
||||
'Multiselected components must be of a single form.',
|
||||
MessageDlg(lisInvalidMultiselection,
|
||||
fdInvalidMutliselectionText,
|
||||
mtInformation,[mbOk],0);
|
||||
end else begin
|
||||
ControlSelection.Add(MouseDownComponent);
|
||||
@ -1248,7 +1247,7 @@ var
|
||||
and (ControlSelection.SelectionForm<>Form)
|
||||
then begin
|
||||
MessageDlg(fdInvalidMutliselectionCap,
|
||||
'Multiselected components must be of a single form.',
|
||||
fdInvalidMutliselectionText,
|
||||
mtInformation,[mbOk],0);
|
||||
exit;
|
||||
end;
|
||||
@ -1574,8 +1573,8 @@ begin
|
||||
exit;
|
||||
if (ControlSelection.LookupRootSelected) then begin
|
||||
if ControlSelection.Count>1 then
|
||||
MessageDlg('Invalid delete',
|
||||
'The root component can not be deleted.',mtInformation,
|
||||
MessageDlg(lisInvalidDelete,
|
||||
lisTheRootComponentCanNotBeDeleted, mtInformation,
|
||||
[mbOk],0);
|
||||
exit;
|
||||
end;
|
||||
@ -1872,11 +1871,10 @@ begin
|
||||
except
|
||||
on E: Exception do begin
|
||||
writeln('TDesigner.OnComponentEditorVerbMenuItemClick ERROR: ',E.Message);
|
||||
MessageDlg('Error in '+PopupMenuComponentEditor.ClassName,
|
||||
'The component editor of class "'+PopupMenuComponentEditor.ClassName+'"'#13
|
||||
+'invoked with verb #'+IntToStr(Verb)+' "'+VerbCaption+'"'#13
|
||||
+'has created the error:'#13
|
||||
+'"'+E.Message+'"',
|
||||
MessageDlg(Format(lisErrorIn, [PopupMenuComponentEditor.ClassName]),
|
||||
Format(lisTheComponentEditorOfClassInvokedWithVerbHasCreated, ['"',
|
||||
PopupMenuComponentEditor.ClassName, '"', #13, IntToStr(Verb), '"',
|
||||
VerbCaption, '"', #13, #13, '"', E.Message, '"']),
|
||||
mtError,[mbOk],0);
|
||||
end;
|
||||
end;
|
||||
|
@ -107,6 +107,7 @@ function GetComponentHeight(AComponent: TComponent): integer;
|
||||
|
||||
procedure InvalidateDesignerRect(aHandle: HWND; ARect: pRect);
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
|
@ -98,14 +98,14 @@ each control that's dropped onto the form
|
||||
Function GetComponentCount: Integer; override;
|
||||
Function GetComponent(Index : Integer): TIComponentInterface; override;
|
||||
|
||||
Function Select : Boolean; override;
|
||||
Function Focus : Boolean; override;
|
||||
Function Delete : Boolean; override;
|
||||
Function Select: Boolean; override;
|
||||
Function Focus: Boolean; override;
|
||||
Function Delete: Boolean; override;
|
||||
|
||||
function GetComponentEditor: TBaseComponentEditor;
|
||||
property Designer: TComponentEditorDesigner read GetDesigner write FDesigner;
|
||||
|
||||
property Component : TComponent read FComponent;
|
||||
property Component: TComponent read FComponent;
|
||||
end;
|
||||
|
||||
|
||||
@ -140,15 +140,19 @@ each control that's dropped onto the form
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
|
||||
// selection
|
||||
Function AddSelected(Value : TComponent) : Integer;
|
||||
Procedure DeleteComponent(AComponent: TComponent; FreeComponent: boolean);
|
||||
Function FindComponentByName(const Name : ShortString) : TIComponentInterface; override;
|
||||
Function FindComponent(AComponent: TComponent): TIComponentInterface; override;
|
||||
|
||||
function SaveSelectionToStream(s: TStream): Boolean; override;
|
||||
Procedure ClearSelected;
|
||||
|
||||
// JIT forms
|
||||
function IsJITComponent(AComponent: TComponent): boolean;
|
||||
function GetJITListOfType(AncestorType: TComponentClass): TJITComponentList;
|
||||
function FindJITList(AComponent: TComponent): TJITComponentList;
|
||||
function GetDesignerForm(AComponent: TComponent): TCustomForm;
|
||||
function GetDesignerForm(AComponent: TComponent): TCustomForm; override;
|
||||
function FindNonControlForm(LookupRoot: TComponent): TNonControlForm;
|
||||
function CreateNonControlForm(LookupRoot: TComponent): TNonControlForm;
|
||||
procedure RenameJITComponent(AComponent: TComponent;
|
||||
@ -160,10 +164,16 @@ each control that's dropped onto the form
|
||||
const OldMethodName, NewMethodName: shortstring);
|
||||
procedure SaveHiddenDesignerFormProperties(AComponent: TComponent);
|
||||
|
||||
// designers
|
||||
function DesignerCount: integer; override;
|
||||
function GetDesigner(Index: integer): TIDesigner; override;
|
||||
function GetCurrentDesigner: TIDesigner; override;
|
||||
function GetDesignerByComponent(AComponent: TComponent): TIDesigner; override;
|
||||
|
||||
// component editors
|
||||
function GetComponentEditor(AComponent: TComponent): TBaseComponentEditor;
|
||||
|
||||
// component creation
|
||||
function CreateUniqueComponentName(AComponent: TComponent): string;
|
||||
function CreateUniqueComponentName(const AClassName: string;
|
||||
OwnerComponent: TComponent): string;
|
||||
@ -180,8 +190,8 @@ each control that's dropped onto the form
|
||||
ParentControl: TWinControl): TIComponentInterface; override;
|
||||
Procedure SetComponentNameAndClass(CI: TIComponentInterface;
|
||||
const NewName, NewClassName: shortstring);
|
||||
Procedure ClearSelected;
|
||||
|
||||
|
||||
// keys
|
||||
function TranslateKeyToDesignerCommand(Key: word; Shift: TShiftState): word;
|
||||
public
|
||||
property Selection: TPersistentSelectionList read FSelection
|
||||
@ -777,6 +787,17 @@ Begin
|
||||
Result:=nil;
|
||||
end;
|
||||
|
||||
function TCustomFormEditor.SaveSelectionToStream(s: TStream): boolean;
|
||||
var
|
||||
ADesigner: TIDesigner;
|
||||
begin
|
||||
ADesigner:=GetCurrentDesigner;
|
||||
if ADesigner is TComponentEditorDesigner then
|
||||
Result:=TComponentEditorDesigner(ADesigner).CopySelectionToStream(s)
|
||||
else
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
function TCustomFormEditor.IsJITComponent(AComponent: TComponent): boolean;
|
||||
begin
|
||||
Result:=JITFormList.IsJITForm(AComponent)
|
||||
@ -916,6 +937,26 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCustomFormEditor.GetCurrentDesigner: TIDesigner;
|
||||
begin
|
||||
Result:=nil;
|
||||
if (Selection<>nil) and (Selection.Count>0) and (Selection[0] is TComponent)
|
||||
then
|
||||
Result:=GetDesignerByComponent(TComponent(Selection[0]));
|
||||
end;
|
||||
|
||||
function TCustomFormEditor.GetDesignerByComponent(AComponent: TComponent
|
||||
): TIDesigner;
|
||||
var
|
||||
AForm: TCustomForm;
|
||||
begin
|
||||
AForm:=GetDesignerForm(AComponent);
|
||||
if AForm=nil then
|
||||
Result:=nil
|
||||
else
|
||||
Result:=AForm.Designer;
|
||||
end;
|
||||
|
||||
function TCustomFormEditor.GetComponentEditor(AComponent: TComponent
|
||||
): TBaseComponentEditor;
|
||||
var
|
||||
|
@ -76,8 +76,8 @@ implementation
|
||||
function CheckDelphiFileExt(const Filename: string): TModalResult;
|
||||
begin
|
||||
if CompareFileExt(Filename,'.pas',false)<>0 then begin
|
||||
Result:=MessageDlg('Not a Delphi unit',
|
||||
'The file "'+Filename+'" is not a Delphi unit.',
|
||||
Result:=MessageDlg(lisNotADelphiUnit,
|
||||
Format(lisTheFileIsNotADelphiUnit, ['"', Filename, '"']),
|
||||
mtError,[mbCancel,mbAbort],0);
|
||||
exit;
|
||||
end;
|
||||
@ -104,7 +104,7 @@ begin
|
||||
// create base path to LCL compiled units <LazarusSrcDir>/lcl/units/
|
||||
LCLPath:=TrimFilename(LazarusSrcDir+SetDirSeparators('/lcl/units/'));
|
||||
NextStartPos:=1;
|
||||
writeln('CheckFilenameForLCLPaths UnitPath="',UnitPath,'" LCLPath="',LCLPath,'"');
|
||||
//writeln('CheckFilenameForLCLPaths UnitPath="',UnitPath,'" LCLPath="',LCLPath,'"');
|
||||
if GetNextUsedDirectoryInSearchPath(UnitPath,LCLPath,NextStartPos)='' then
|
||||
begin
|
||||
LCLPath:=LCLPath+'$(TargetCPU)'+PathDelim+'$(TargetOS)';
|
||||
@ -158,14 +158,14 @@ var
|
||||
begin
|
||||
LazarusFilename:=ConvertDelphiToLazarusFilename(DelphiFilename);
|
||||
LFMFilename:='';
|
||||
writeln('RenameDelphiUnitToLazarusUnit Unit "',DelphiFilename,'" -> "',LazarusFilename,'"');
|
||||
//writeln('RenameDelphiUnitToLazarusUnit Unit "',DelphiFilename,'" -> "',LazarusFilename,'"');
|
||||
Result:=RenameFileWithErrorDialogs(DelphiFilename,LazarusFilename,[mbAbort]);
|
||||
if Result<>mrOK then exit;
|
||||
if RenameDFMFile then begin
|
||||
DFMFilename:=FindDFMFileForDelphiUnit(DelphiFilename);
|
||||
if DFMFilename<>'' then begin
|
||||
LFMFilename:=ConvertDFMToLFMFilename(DFMFilename,false);
|
||||
writeln('RenameDelphiUnitToLazarusUnit Unit "',DFMFilename,'" -> "',LFMFilename,'"');
|
||||
//writeln('RenameDelphiUnitToLazarusUnit Unit "',DFMFilename,'" -> "',LFMFilename,'"');
|
||||
Result:=RenameFileWithErrorDialogs(DFMFilename,LFMFilename,[mbAbort]);
|
||||
if Result<>mrOK then exit;
|
||||
end;
|
||||
@ -205,7 +205,7 @@ begin
|
||||
end;
|
||||
// converting dfm file, without renaming unit -> keep case
|
||||
LFMFilename:=ConvertDFMToLFMFilename(DFMFilename,true);
|
||||
writeln('ConvertDFMFileToLFMFile LFMFilename="',LFMFilename,'"');
|
||||
//writeln('ConvertDFMFileToLFMFile LFMFilename="',LFMFilename,'"');
|
||||
try
|
||||
LFMStream.SaveToFile(LFMFilename);
|
||||
except
|
||||
@ -256,9 +256,8 @@ begin
|
||||
[lbfCheckIfText,lbfUpdateFromDisk]);
|
||||
if Result<>mrOk then exit;
|
||||
end else if LFMMustExist then begin
|
||||
Result:=MessageDlg('LFM file not found',
|
||||
'Unit: '+UnitFileName+#13
|
||||
+'LFM file: '+LFMFilename,
|
||||
Result:=MessageDlg(lisLFMFileNotFound,
|
||||
Format(lisUnitLFMFile, [UnitFileName, #13, LFMFilename]),
|
||||
mtError,[mbCancel,mbAbort],0);
|
||||
end;
|
||||
end;
|
||||
|
@ -39,8 +39,6 @@ type
|
||||
protected
|
||||
procedure SetObj_Inspector(AnObjectInspector: TObjectInspector); override;
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
procedure PaintAllDesignerItems;
|
||||
end;
|
||||
|
||||
@ -69,19 +67,7 @@ end;
|
||||
procedure TFormEditor.SetObj_Inspector(AnObjectInspector: TObjectInspector);
|
||||
begin
|
||||
if AnObjectInspector=Obj_Inspector then exit;
|
||||
|
||||
inherited SetObj_Inspector(AnObjectInspector);
|
||||
|
||||
end;
|
||||
|
||||
constructor TFormEditor.Create;
|
||||
Begin
|
||||
inherited Create;
|
||||
end;
|
||||
|
||||
destructor TFormEditor.destroy;
|
||||
Begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TFormEditor.PaintAllDesignerItems;
|
||||
|
@ -263,6 +263,8 @@ resourcestring
|
||||
lisUnableToConvertFileError = 'Unable to convert file %s%s%s%sError: %s';
|
||||
lisUnableToWriteFileError = 'Unable to write file %s%s%s%sError: %s';
|
||||
lisErrorCreatingLrs = 'Error creating lrs';
|
||||
lisLFMFileNotFound = 'LFM file not found';
|
||||
lisUnitLFMFile = 'Unit: %s%sLFM file: %s';
|
||||
lisUnableToConvertLfmToLrsAndWriteLrsFile = 'Unable to convert lfm to lrs '
|
||||
+'and write lrs file.';
|
||||
lisUnableToLoadOldResourceFileTheResourceFileIs = 'Unable to load old '
|
||||
@ -1029,7 +1031,28 @@ resourcestring
|
||||
|
||||
// Form designer
|
||||
fdInvalidMutliselectionCap='Invalid mutliselection';
|
||||
lisInvalidMultiselection = 'Invalid multiselection';
|
||||
lisUnableConvertBinaryStreamToText = 'Unable convert binary stream to text';
|
||||
lisUnableToStreamSelectedComponents = 'Unable to stream selected components';
|
||||
lisCanNotCopyTopLevelComponent = 'Can not copy top level component.';
|
||||
lisCopyingAWholeFormIsNotImplemented = 'Copying a whole form is not '
|
||||
+'implemented.';
|
||||
lisThereWasAnErrorDuringWritingTheSelectedComponent = 'There was an error '
|
||||
+'during writing the selected component %s:%s:%s%s';
|
||||
lisThereWasAnErrorWhileConvertingTheBinaryStreamOfThe = 'There was an error '
|
||||
+'while converting the binary stream of the selected component %s:%s:%s%s';
|
||||
lisUnableCopyComponentsToClipboard = 'Unable copy components to clipboard';
|
||||
lisThereWasAnErrorWhileCopyingTheComponentStreamToCli = 'There was an error '
|
||||
+'while copying the component stream to clipboard:%s%s';
|
||||
lisErrorIn = 'Error in %s';
|
||||
lisTheComponentEditorOfClassInvokedWithVerbHasCreated = 'The component '
|
||||
+'editor of class %s%s%s%sinvoked with verb #%s %s%s%s%shas created the '
|
||||
+'error:%s%s%s%s';
|
||||
lisTheComponentEditorOfClassHasCreatedTheError = 'The component editor of '
|
||||
+'class %s%s%shas created the error:%s%s%s%s';
|
||||
fdInvalidMutliselectionText='Multiselected components must be of a single form.';
|
||||
lisInvalidDelete = 'Invalid delete';
|
||||
lisTheRootComponentCanNotBeDeleted = 'The root component can not be deleted.';
|
||||
fdmAlignWord='Align';
|
||||
fdmMirrorHorizontal='Mirror horizontal';
|
||||
fdmMirrorVertical='Mirror vertical';
|
||||
@ -1396,6 +1419,8 @@ resourcestring
|
||||
+'s is missing.%s%sHint for newbies:%sCreate a lazarus application and '
|
||||
+'put the file into the project directory.';
|
||||
lisLCLUnitPathMissing = 'LCL unit path missing';
|
||||
lisNotADelphiUnit = 'Not a Delphi unit';
|
||||
lisTheFileIsNotADelphiUnit = 'The file %s%s%s is not a Delphi unit.';
|
||||
lisCodeToolsDefsErrorReading = 'Error reading %s%s%s%s%s';
|
||||
lisCodeToolsDefsErrorReadingProjectInfoFile = 'Error reading project info '
|
||||
+'file %s%s%s%s%s';
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
author:
|
||||
Radek Cervinka, radek.cervinka@centrum.cz
|
||||
Mattias Gaertner
|
||||
|
||||
contributors:
|
||||
Mattias Gaertner
|
||||
@ -154,13 +155,13 @@ type
|
||||
end;
|
||||
|
||||
var
|
||||
RegisteredActions: TRegisteredActionCategories = nil;
|
||||
RegisteredActions: TRegisteredActionCategories;
|
||||
|
||||
type
|
||||
TNotifyActionListChange = procedure;
|
||||
|
||||
var
|
||||
NotifyActionListChange: TNotifyActionListChange = nil;
|
||||
NotifyActionListChange: TNotifyActionListChange;
|
||||
|
||||
procedure RegisterActions(const ACategory: string;
|
||||
const AClasses: array of TBasicActionClass;
|
||||
@ -257,9 +258,7 @@ begin
|
||||
if AActionList=nil then
|
||||
Raise Exception.Create('ShowActionListEditor AActionList=nil');
|
||||
if ActionListEditorForm=nil then
|
||||
begin
|
||||
ActionListEditorForm:=TActionListEditor.Create(Application);
|
||||
end;
|
||||
ActionListEditorForm.Designer:=ADesigner;
|
||||
ActionListEditorForm.SetActionList(AActionList);
|
||||
ActionListEditorForm.ShowOnTop;
|
||||
@ -638,10 +637,12 @@ var
|
||||
IsDouble: Boolean;
|
||||
j: Integer;
|
||||
AClass: TBasicActionClass;
|
||||
l: Integer;
|
||||
begin
|
||||
if length(AClasses)=0 then exit;
|
||||
l:=High(AClasses)-Low(AClasses)+1;
|
||||
if l=0 then exit;
|
||||
CurCount:=FCount;
|
||||
inc(FCount,length(AClasses));
|
||||
inc(FCount,l);
|
||||
// add all classes (ignoring doubles)
|
||||
ReAllocMem(FItems,SizeOf(TBasicActionClass)*FCount);
|
||||
for i:=Low(AClasses) to High(AClasses) do begin
|
||||
@ -784,6 +785,8 @@ begin
|
||||
end;
|
||||
|
||||
initialization
|
||||
NotifyActionListChange:=nil;
|
||||
ActionListEditorForm:=nil;
|
||||
RegisteredActions:=TRegisteredActionCategories.Create;
|
||||
RegisterActionsProc := @RegisterActions;
|
||||
UnRegisterActionsProc := @UnregisterActions;
|
||||
|
@ -38,6 +38,15 @@ type
|
||||
FForm: TCustomForm;
|
||||
function GetPropertyEditorHook: TPropertyEditorHook; virtual; abstract;
|
||||
public
|
||||
procedure CopySelection; virtual; abstract;
|
||||
procedure CutSelection; virtual; abstract;
|
||||
function CanPaste: Boolean; virtual; abstract;
|
||||
procedure PasteSelection; virtual; abstract;
|
||||
procedure DeleteSelection; virtual; abstract;
|
||||
function CopySelectionToStream(s: TStream): boolean; virtual; abstract;
|
||||
function InvokeComponentEditor(AComponent: TComponent;
|
||||
MenuIndex: integer): boolean; virtual; abstract;
|
||||
|
||||
procedure DrawDesignerItems(OnlyIfNeeded: boolean); virtual; abstract;
|
||||
function CreateUniqueComponentName(const AClassName: string
|
||||
): string; virtual; abstract;
|
||||
|
@ -82,6 +82,7 @@ type
|
||||
protected
|
||||
function GetDesigner(Index: integer): TIDesigner; virtual; abstract;
|
||||
public
|
||||
// components
|
||||
Function FindComponentByName(const Name : ShortString) : TIComponentInterface; virtual; abstract;
|
||||
Function FindComponent(AComponent: TComponent): TIComponentInterface; virtual; abstract;
|
||||
|
||||
@ -95,8 +96,16 @@ type
|
||||
Root: TComponent;
|
||||
ParentControl: TWinControl
|
||||
): TIComponentInterface; virtual; abstract;
|
||||
|
||||
// designers
|
||||
function DesignerCount: integer; virtual; abstract;
|
||||
property Designer[Index: integer]: TIDesigner read GetDesigner;
|
||||
function GetCurrentDesigner: TIDesigner; virtual; abstract;
|
||||
function GetDesignerForm(AComponent: TComponent): TCustomForm; virtual; abstract;
|
||||
function GetDesignerByComponent(AComponent: TComponent): TIDesigner; virtual; abstract;
|
||||
|
||||
// selection
|
||||
function SaveSelectionToStream(s: TStream): Boolean; virtual; abstract;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -96,7 +96,7 @@ type
|
||||
procedure WriteReportToStream(s: TStream; var StreamSize: TStreamSeekType);
|
||||
function ReportAsString: string;
|
||||
constructor Create(OnCompareMethod: TListSortCompare);
|
||||
constructor Create(OnCompareMethod: TObjectSortCompare);
|
||||
constructor CreateObjectCompare(OnCompareMethod: TObjectSortCompare);
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
end;
|
||||
@ -497,7 +497,8 @@ begin
|
||||
FOnCompare:=OnCompareMethod;
|
||||
end;
|
||||
|
||||
constructor TAvgLvlTree.Create(OnCompareMethod: TObjectSortCompare);
|
||||
constructor TAvgLvlTree.CreateObjectCompare(
|
||||
OnCompareMethod: TObjectSortCompare);
|
||||
begin
|
||||
inherited Create;
|
||||
FOnObjectCompare:=OnCompareMethod;
|
||||
|
@ -798,8 +798,11 @@ begin
|
||||
end
|
||||
else if (FDataLink.DataSet<>nil)and FDatalink.Active then begin
|
||||
F := GetDsFieldFromGridColumn(FromIndex);
|
||||
if F<>nil then
|
||||
if F<>nil then begin
|
||||
{$IFDEF VER1_0_10}
|
||||
TProtFields(FDatalink.DataSet.Fields).SetFieldIndex( F, ToIndex - FixedCols );
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
i := GetGridColumnFromField(CurField);
|
||||
if (i>FixedCols) and (i<>Col) then begin
|
||||
@ -1767,6 +1770,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.11 2004/08/06 06:51:15 mattias
|
||||
fixed compilation for fpc 1.0.10
|
||||
|
||||
Revision 1.10 2004/08/04 09:35:38 mattias
|
||||
implemented setting TTabSheet.TabIndex
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user