mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 06:49:12 +02:00
gtk intf: fixed check for TCustomPage
git-svn-id: trunk@10455 -
This commit is contained in:
parent
0657f035a2
commit
ab060cfe43
@ -1821,7 +1821,6 @@ var
|
|||||||
VariableTypeName: String;
|
VariableTypeName: String;
|
||||||
DefinitionNode: TCodeTreeNode;
|
DefinitionNode: TCodeTreeNode;
|
||||||
ClassContext: TFindContext;
|
ClassContext: TFindContext;
|
||||||
PropertyTypeName: String;
|
|
||||||
begin
|
begin
|
||||||
// find variable for object
|
// find variable for object
|
||||||
|
|
||||||
@ -1850,7 +1849,8 @@ var
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// check if identifier is a variable
|
// check if identifier is a variable or property
|
||||||
|
VariableTypeName:='';
|
||||||
if (ChildContext.Node.Desc=ctnVarDefinition) then begin
|
if (ChildContext.Node.Desc=ctnVarDefinition) then begin
|
||||||
DefinitionNode:=ChildContext.Tool.FindTypeNodeOfDefinition(
|
DefinitionNode:=ChildContext.Tool.FindTypeNodeOfDefinition(
|
||||||
ChildContext.Node);
|
ChildContext.Node);
|
||||||
@ -1863,11 +1863,24 @@ var
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// check if variable has a compatible type
|
|
||||||
if LFMObject.TypeName<>'' then begin
|
|
||||||
VariableTypeName:=ChildContext.Tool.ExtractDefinitionNodeType(
|
VariableTypeName:=ChildContext.Tool.ExtractDefinitionNodeType(
|
||||||
ChildContext.Node);
|
ChildContext.Node);
|
||||||
if (CompareIdentifiers(PChar(VariableTypeName),
|
end else if (ChildContext.Node.Desc=ctnProperty) then begin
|
||||||
|
DefinitionNode:=ChildContext.Node;
|
||||||
|
VariableTypeName:=
|
||||||
|
ChildContext.Tool.ExtractPropType(ChildContext.Node,false,false);
|
||||||
|
end else begin
|
||||||
|
LFMTree.AddError(lfmeObjectIncompatible,LFMObject,
|
||||||
|
LFMObjectName+' is not a variable'
|
||||||
|
+CreateFootNote(ChildContext),
|
||||||
|
LFMObject.NamePosition);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// check if variable/property has a compatible type
|
||||||
|
if (VariableTypeName<>'') then begin
|
||||||
|
if (LFMObject.TypeName<>'')
|
||||||
|
and (CompareIdentifiers(PChar(VariableTypeName),
|
||||||
PChar(LFMObject.TypeName))<>0)
|
PChar(LFMObject.TypeName))<>0)
|
||||||
then begin
|
then begin
|
||||||
ChildContext.Node:=DefinitionNode;
|
ChildContext.Node:=DefinitionNode;
|
||||||
@ -1877,31 +1890,11 @@ var
|
|||||||
LFMObject.NamePosition);
|
LFMObject.NamePosition);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// check if variable/property type exists
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end else if (ChildContext.Node.Desc=ctnProperty) then begin
|
|
||||||
// check if variable has a compatible type
|
|
||||||
DefinitionNode:=ChildContext.Node;
|
|
||||||
if LFMObject.TypeName<>'' then begin
|
|
||||||
PropertyTypeName:=
|
|
||||||
ChildContext.Tool.ExtractPropType(ChildContext.Node,false,false);
|
|
||||||
if (CompareIdentifiers(PChar(PropertyTypeName),
|
|
||||||
PChar(LFMObject.TypeName))<>0)
|
|
||||||
then begin
|
|
||||||
ChildContext.Node:=DefinitionNode;
|
|
||||||
LFMTree.AddError(lfmeObjectIncompatible,LFMObject,
|
|
||||||
PropertyTypeName+' expected, but '+LFMObject.TypeName+' found.'
|
|
||||||
+CreateFootNote(ChildContext),
|
|
||||||
LFMObject.NamePosition);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end else begin
|
|
||||||
LFMTree.AddError(lfmeObjectIncompatible,LFMObject,
|
|
||||||
LFMObjectName+' is not a variable'
|
|
||||||
+CreateFootNote(ChildContext),
|
|
||||||
LFMObject.NamePosition);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
|
|
||||||
// find class node
|
// find class node
|
||||||
ClassContext:=FindClassNodeForLFMObject(LFMObject,LFMObject.TypeNamePosition,
|
ClassContext:=FindClassNodeForLFMObject(LFMObject,LFMObject.TypeNamePosition,
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
}
|
}
|
||||||
|
|
||||||
procedure DrawNotebookPageIcon(Page: TPage; Widget: PGtkWidget);
|
procedure DrawNotebookPageIcon(Page: TCustomPage; Widget: PGtkWidget);
|
||||||
var
|
var
|
||||||
NoteBook: TCustomNotebook;
|
NoteBook: TCustomNotebook;
|
||||||
NoteBookWidget: PGtkWidget;
|
NoteBookWidget: PGtkWidget;
|
||||||
@ -41,13 +41,13 @@ end;
|
|||||||
function PageIconWidgetExposeAfter(Widget: PGtkWidget; Event: PGDKEventExpose;
|
function PageIconWidgetExposeAfter(Widget: PGtkWidget; Event: PGDKEventExpose;
|
||||||
Data: gPointer): GBoolean; cdecl;
|
Data: gPointer): GBoolean; cdecl;
|
||||||
var
|
var
|
||||||
ThePage: TPage;
|
ThePage: TCustomPage;
|
||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
//DebugLn('PageIconWidgetExposeAfter ',DbgS(Widget));
|
//DebugLn('PageIconWidgetExposeAfter ',DbgS(Widget));
|
||||||
EventTrace('PageIconWidgetExposeAfter', Data);
|
EventTrace('PageIconWidgetExposeAfter', Data);
|
||||||
if (Event^.Count > 0) then exit;
|
if (Event^.Count > 0) then exit;
|
||||||
ThePage:=TObject(Data) as TPage;
|
ThePage:=TObject(Data) as TCustomPage;
|
||||||
DrawNotebookPageIcon(ThePage,Widget);
|
DrawNotebookPageIcon(ThePage,Widget);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -55,12 +55,12 @@ end;
|
|||||||
function PageIconWidgetDrawAfter(Widget: PGtkWidget; area: PGDKRectangle;
|
function PageIconWidgetDrawAfter(Widget: PGtkWidget; area: PGDKRectangle;
|
||||||
data: gPointer) : GBoolean; cdecl;
|
data: gPointer) : GBoolean; cdecl;
|
||||||
var
|
var
|
||||||
ThePage: TPage;
|
ThePage: TCustomPage;
|
||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
//DebugLn('PageIconWidgetDrawAfter ',DbgS(Widget),' ',Area^.x,',',Area^.y);
|
//DebugLn('PageIconWidgetDrawAfter ',DbgS(Widget),' ',Area^.x,',',Area^.y);
|
||||||
EventTrace('PageIconWidgetDrawAfter', Data);
|
EventTrace('PageIconWidgetDrawAfter', Data);
|
||||||
ThePage:=TObject(Data) as TPage;
|
ThePage:=TObject(Data) as TCustomPage;
|
||||||
DrawNotebookPageIcon(ThePage,Widget);
|
DrawNotebookPageIcon(ThePage,Widget);
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
Loading…
Reference in New Issue
Block a user