mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-04 00:58:20 +02:00
added hint for unimplemented IDE directives for non pascal sources
git-svn-id: trunk@5657 -
This commit is contained in:
parent
b4e039e934
commit
b2e93949f4
@ -63,6 +63,9 @@ type
|
||||
|
||||
TJITReaderErrorEvent = procedure(Sender: TObject; ErrorType: TJITFormError;
|
||||
var Action: TModalResult) of object;
|
||||
TJITPropertyNotFoundEvent = procedure(Sender: TObject; Reader: TReader;
|
||||
Instance: TPersistent; var PropName: string; IsPath: boolean;
|
||||
var Handled, Skip: Boolean) of object;
|
||||
|
||||
|
||||
{ TJITComponentList }
|
||||
@ -77,6 +80,7 @@ type
|
||||
FComponentPrefix: string;
|
||||
FCurUnknownClass: string;
|
||||
FCurUnknownProperty: string;
|
||||
FOnPropertyNotFound: TJITPropertyNotFoundEvent;
|
||||
procedure SetComponentPrefix(const AValue: string);
|
||||
protected
|
||||
FCurReadErrorMsg: string;
|
||||
@ -160,6 +164,8 @@ type
|
||||
BaseJITClass: TJITClass;
|
||||
property OnReaderError: TJITReaderErrorEvent
|
||||
read FOnReaderError write FOnReaderError;
|
||||
property OnPropertyNotFound: TJITPropertyNotFoundEvent
|
||||
read FOnPropertyNotFound write FOnPropertyNotFound;
|
||||
property CurReadJITComponent:TComponent read FCurReadJITComponent;
|
||||
property CurReadClass:TClass read FCurReadClass;
|
||||
property CurReadChild: TComponent read FCurReadChild;
|
||||
@ -822,13 +828,13 @@ end;
|
||||
|
||||
{
|
||||
TReader events.
|
||||
If a LFM is streamed back into the corresponfing TForm descendent, all methods
|
||||
and components are published members and TReader can set these values.
|
||||
Normally at runtime a LFM is streamed back into the corresponding TForm
|
||||
descendent, all methods and components are published members and TReader can
|
||||
set these values.
|
||||
But at design time we do not have the corresponding TForm descendent. And
|
||||
there is no compiled code, thus it must be produced it at runtime
|
||||
(just-in-time).
|
||||
}
|
||||
|
||||
procedure TJITComponentList.ReaderFindMethod(Reader: TReader;
|
||||
const FindMethodName: Ansistring; var Address: Pointer; var Error: Boolean);
|
||||
var NewMethod: TMethod;
|
||||
@ -850,8 +856,12 @@ procedure TJITComponentList.ReaderPropertyNotFound(Reader: TReader;
|
||||
Instance: TPersistent; var PropName: string; IsPath: Boolean;
|
||||
var Handled, Skip: Boolean);
|
||||
begin
|
||||
// this is pretty normal for extra properties in DefineProperties
|
||||
//writeln('TJITComponentList.ReaderPropertyNotFound ',Instance.ClassName,'.',PropName);
|
||||
// FCL in VER1_9_4 and below creates this event for DefineProperties too
|
||||
{$IFNDEF VER1_9_4}
|
||||
writeln('TJITComponentList.ReaderPropertyNotFound ',Instance.ClassName,'.',PropName);
|
||||
if Assigned(OnPropertyNotFound) then
|
||||
OnPropertyNotFound(Self,Reader,Instance,PropName,IsPath,Handled,Skip);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TJITComponentList.ReaderSetMethodProperty(Reader: TReader;
|
||||
|
@ -76,16 +76,16 @@ each control that's dropped onto the form
|
||||
constructor Create(AComponent: TComponent);
|
||||
destructor Destroy; override;
|
||||
|
||||
Function GetComponentType : ShortString; override;
|
||||
Function GetComponentHandle : LongInt; override;
|
||||
Function GetParent : TIComponentInterface; override;
|
||||
Function IsTControl : Boolean; override;
|
||||
Function GetPropCount : Integer; override;
|
||||
Function GetPropType(Index : Integer) : TTypeKind; override;
|
||||
Function GetPropTypeInfo(Index : Integer) : PTypeInfo;
|
||||
Function GetPropName(Index : Integer) : ShortString; override;
|
||||
Function GetPropTypeName(Index : Integer) : ShortString; override;
|
||||
Function GetPropTypebyName(Name : ShortString) : TTypeKind; override;
|
||||
Function GetComponentType: ShortString; override;
|
||||
Function GetComponentHandle: LongInt; override;
|
||||
Function GetParent: TIComponentInterface; override;
|
||||
Function IsTControl: Boolean; override;
|
||||
Function GetPropCount: Integer; override;
|
||||
Function GetPropType(Index: Integer): TTypeKind; override;
|
||||
Function GetPropTypeInfo(Index: Integer): PTypeInfo;
|
||||
Function GetPropName(Index: Integer): ShortString; override;
|
||||
Function GetPropTypeName(Index: Integer): ShortString; override;
|
||||
Function GetPropTypebyName(Name: ShortString): TTypeKind; override;
|
||||
|
||||
Function GetPropValue(Index : Integer; var Value) : Boolean; override;
|
||||
Function GetPropValuebyName(Name: ShortString; var Value) : Boolean; override;
|
||||
@ -127,6 +127,9 @@ each control that's dropped onto the form
|
||||
procedure SetObj_Inspector(AnObjectInspector: TObjectInspector); virtual;
|
||||
procedure JITListReaderError(Sender: TObject; ErrorType: TJITFormError;
|
||||
var Action: TModalResult); virtual;
|
||||
procedure JITListPropertyNotFound(Sender: TObject; Reader: TReader;
|
||||
Instance: TPersistent; var PropName: string; IsPath: boolean;
|
||||
var Handled, Skip: Boolean);
|
||||
|
||||
procedure OnDesignerMenuItemClick(Sender: TObject); virtual;
|
||||
function FindNonControlFormNode(LookupRoot: TComponent): TAVLTreeNode;
|
||||
@ -651,10 +654,12 @@ begin
|
||||
|
||||
JITFormList := TJITForms.Create;
|
||||
JITFormList.OnReaderError:=@JITListReaderError;
|
||||
|
||||
JITFormList.OnPropertyNotFound:=@JITListPropertyNotFound;
|
||||
|
||||
JITDataModuleList := TJITDataModules.Create;
|
||||
JITDataModuleList.OnReaderError:=@JITListReaderError;
|
||||
|
||||
JITDataModuleList.OnPropertyNotFound:=@JITListPropertyNotFound;
|
||||
|
||||
DesignerMenuItemClick:=@OnDesignerMenuItemClick;
|
||||
OnGetDesignerForm:=@GetDesignerForm;
|
||||
end;
|
||||
@ -1230,6 +1235,14 @@ begin
|
||||
@CompareLookupRootAndNonControlForm);
|
||||
end;
|
||||
|
||||
procedure TCustomFormEditor.JITListPropertyNotFound(Sender: TObject;
|
||||
Reader: TReader; Instance: TPersistent; var PropName: string;
|
||||
IsPath: boolean; var Handled, Skip: Boolean);
|
||||
begin
|
||||
writeln('TCustomFormEditor.JITListPropertyNotFound ',Sender.ClassName,
|
||||
' Instance=',Instance.ClassName,' PropName="',PropName,'" IsPath=',IsPath);
|
||||
end;
|
||||
|
||||
function TCustomFormEditor.GetPropertyEditorHook: TPropertyEditorHook;
|
||||
begin
|
||||
Result:=Obj_Inspector.PropertyEditorHook;
|
||||
|
11
ide/main.pp
11
ide/main.pp
@ -6429,6 +6429,9 @@ begin
|
||||
|
||||
end else begin
|
||||
// ToDo: load .lfi file
|
||||
MessageDlg('Not implemented',
|
||||
'Sorry, IDE directives are only implemented for pascal sources',
|
||||
mtInformation,[mbCancel],0);
|
||||
exit;
|
||||
end;
|
||||
Result:=mrOk;
|
||||
@ -8770,7 +8773,10 @@ function TMainIDE.BeginCodeTool(ADesigner: TDesigner;
|
||||
begin
|
||||
Result:=false;
|
||||
if (SourceNoteBook.NoteBook=nil)
|
||||
or (ToolStatus in [itCodeTools,itCodeToolAborting]) then exit;
|
||||
or (ToolStatus in [itCodeTools,itCodeToolAborting]) then begin
|
||||
debugln('TMainIDE.BeginCodeTool impossible ',dbgs(ord(ToolStatus)));
|
||||
exit;
|
||||
end;
|
||||
if ctfSwitchToFormSource in Flags then
|
||||
DoSwitchToFormSrc(ADesigner,ActiveSrcEdit,ActiveUnitInfo)
|
||||
else if Designer<>nil then
|
||||
@ -10448,6 +10454,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.736 2004/07/07 17:10:02 mattias
|
||||
added hint for unimplemented IDE directives for non pascal sources
|
||||
|
||||
Revision 1.735 2004/07/03 15:10:57 mattias
|
||||
added insert IFDEF tool from Colin
|
||||
|
||||
|
@ -580,7 +580,7 @@ var
|
||||
if EventString <> nil
|
||||
then begin
|
||||
EventString^ := #0;
|
||||
EventString^ := #0;
|
||||
// MG: should we set Event^.length := 0; or is this used for mem allocation?
|
||||
end;
|
||||
{MWE:.$EndIf}
|
||||
|
||||
@ -793,6 +793,7 @@ begin
|
||||
|
||||
if (EventString<>nil) and (Msg.CharCode <> ord(EventString^))
|
||||
then begin
|
||||
writeln('HandleGTKKeyUpDown A');
|
||||
// key was changed by lcl
|
||||
if Msg.CharCode=0 then
|
||||
StopKeyEvent('key_press_event')
|
||||
@ -3111,6 +3112,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.237 2004/07/07 17:10:02 mattias
|
||||
added hint for unimplemented IDE directives for non pascal sources
|
||||
|
||||
Revision 1.236 2004/06/29 21:25:52 marc
|
||||
* Fixed compilation for gtk2
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user