MG: renamed designerstr.pas to objinspstrconsts.pas

git-svn-id: trunk@3351 -
This commit is contained in:
lazarus 2002-09-16 14:46:05 +00:00
parent c10b07e7b0
commit 093d68ba1a
7 changed files with 271 additions and 208 deletions

1
.gitattributes vendored
View File

@ -113,7 +113,6 @@ designer/customeditor.pp svneol=native#text/pascal
designer/designer.pp svneol=native#text/pascal
designer/designermenu.pp svneol=native#text/pascal
designer/designerprocs.pas svneol=native#text/pascal
designer/designerstr.pas svneol=native#text/pascal
designer/filesystem.pp svneol=native#text/pascal
designer/graphpropedits.pas svneol=native#text/pascal
designer/jitforms.pp svneol=native#text/pascal

View File

@ -33,7 +33,7 @@
- Get and Set property access parameter lists
- predefined funcs Pred, Succ, Val, Low, High
- find declaration in dead code
- make @Proc context sensitive
- make @Proc context sensitive (started but not complete)
- operator overloading
- ppu, ppw, dcu files
}
@ -73,55 +73,114 @@ type
TFindDeclarationTool = class;
TVariableAtomType = (
vatNone, vatSpace, vatIdentifier, vatPreDefIdentifier, vatPoint, vatAS,
vatINHERITED, vatUp, vatRoundBracketOpen, vatRoundBracketClose,
vatEdgedBracketOpen, vatEdgedBracketClose, vatAddrOp);
vatNone, // undefined
vatSpace, // empty or space
vatIdentifier, // an identifier
vatPreDefIdentifier, // an identifier with special meaning to the compiler
vatPoint, // .
vatAS, // AS keyword
vatINHERITED, // INHERITED keyword
vatUp, // ^
vatRoundBracketOpen, // (
vatRoundBracketClose,// )
vatEdgedBracketOpen, // [
vatEdgedBracketClose,// ]
vatAddrOp // @
);
const
// for nicer output
VariableAtomTypeNames: array[TVariableAtomType] of string =
('<None>','Space','Ident','PreDefIdent','Point','AS','INHERITED','Up^ ',
'Bracket(','Bracket)','Bracket[','Bracket]', 'AddrOperator@ ');
('<None>',
'Space',
'Ident',
'PreDefIdent',
'Point',
'AS',
'INHERITED',
'Up^ ',
'Bracket(',
'Bracket)',
'Bracket[',
'Bracket]',
'AddrOperator@ '
);
type
// searchpath delimiter is semicolon
TOnGetSearchPath = function(Sender: TObject): string of object;
TOnGetCodeToolForBuffer = function(Sender: TObject;
Code: TCodeBuffer): TFindDeclarationTool of object;
// flags/states for searching
TFindDeclarationFlag = (
fdfSearchInParentNodes, // if identifier not found in current context,
// proceed in prior nodes on same lvl and parents
fdfSearchInAncestors, // if context is a class, search also in
// ancestors/interfaces
fdfSearchInParentNodes, // if identifier not found in current context,
// proceed in prior nodes on same lvl and parents
fdfIgnoreCurContextNode,// skip context and proceed in prior/parent context
fdfIgnoreUsedUnits, // stay in current source
fdfSearchForward, // instead of searching in prior nodes, search in
// next nodes (successors)
fdfExceptionOnNotFound, // raise exception if identifier not found
// predefined identifiers will not raise
fdfExceptionOnPredefinedIdent,// raise an exception even if the identifier
// is an predefined exception
fdfIgnoreUsedUnits, // stay in current source
fdfSearchForward, // instead of searching in prior nodes, search in
// next nodes (successors)
fdfIgnoreClassVisibility,//find inaccessible private+protected fields
fdfClassPublished,
fdfClassPublic,
fdfClassProtected,
fdfClassPrivate,
fdfIgnoreMissingParams, // found proc fits, even if parameters are missing
fdfOnlyCompatibleProc, // incompatible procs are ignored
fdfFunctionResult, // if function is found, return result type
fdfIgnoreOverloadedProcs,// ignore param lists and take the first proc found
fdfFindVariable, // do not search for the base type of a variable,
// instead return the variable declaration
fdfFunctionResult, // if function is found, return result type
fdfCollect, // return every reachable identifier
fdfTopLvlResolving // set, when searching for an identifier of the
// top lvl variable
);
TFindDeclarationFlags = set of TFindDeclarationFlag;
const
// for nicer output
FindDeclarationFlagNames: array[TFindDeclarationFlag] of string = (
'fdfSearchInAncestors',
'fdfSearchInParentNodes',
'fdfIgnoreCurContextNode',
'fdfIgnoreUsedUnits',
'fdfSearchForward',
'fdfExceptionOnNotFound',
'fdfExceptionOnPredefinedIdent',
'fdfIgnoreClassVisibility',
'fdfClassPublished',
'fdfClassPublic',
'fdfClassProtected',
'fdfClassPrivate',
'fdfIgnoreMissingParams',
'fdfOnlyCompatibleProc',
'fdfIgnoreOverloadedProcs',
'fdfFindVariable',
'fdfFunctionResult',
'fdfCollect',
'fdfTopLvlResolving'
);
type
// flags/states for result
TFoundDeclarationFlag = (
fdfDoNotCache
);
TFoundDeclarationFlags = set of TFoundDeclarationFlag;
TFindDeclarationParams = class;
TFindContext = record
@ -137,11 +196,38 @@ type
The Freepascal compiler can automatically convert them
}
TExpressionTypeDesc = (
xtNone, xtContext, xtChar, xtReal, xtSingle, xtDouble,
xtExtended, xtCurrency, xtComp, xtInt64, xtCardinal, xtQWord, xtBoolean,
xtByteBool, xtLongBool, xtString, xtAnsiString, xtShortString, xtWideString,
xtPChar, xtPointer, xtFile, xtText, xtConstOrdInteger, xtConstString,
xtConstReal, xtConstSet, xtConstBoolean, xtLongInt, xtWord, xtNil);
xtNone, // undefined
xtContext, // a node
xtChar, // char
xtReal, // real
xtSingle, // single
xtDouble, // double
xtExtended, // extended
xtCurrency, // currency
xtComp, // comp
xtInt64, // int64
xtCardinal, // cardinal
xtQWord, // qword
xtBoolean, // boolean
xtByteBool, // bytebool
xtLongBool, // longbool
xtString, // string
xtAnsiString,// ansistring
xtShortString,// shortstring
xtWideString,// widestring
xtPChar, // pchar
xtPointer, // pointer
xtFile, // file
xtText, // text
xtConstOrdInteger,// enums, number, integer
xtConstString,// string, string constant, char constant
xtConstReal, // real number
xtConstSet, // [] set
xtConstBoolean,// true, false
xtLongint, // longint
xtWord, // word
xtNil // nil = pointer, class, procedure, method, ...
);
TExpressionTypeDescs = set of TExpressionTypeDesc;
const
@ -155,7 +241,7 @@ const
xtAllTypes = [Low(TExpressionTypeDesc)..High(TExpressionTypeDesc)]-[xtNone];
xtAllPredefinedTypes = xtAllTypes-[xtContext];
xtAllIntegerTypes = [xtInt64, xtQWord, xtConstOrdInteger, xtLongInt, xtWord];
xtAllIntegerTypes = [xtInt64, xtQWord, xtConstOrdInteger, xtLongint, xtWord];
xtAllBooleanTypes = [xtBoolean, xtByteBool, xtLongBool];
xtAllRealTypes = [xtReal, xtConstReal, xtSingle, xtDouble, xtExtended,
xtCurrency, xtComp];
@ -196,7 +282,7 @@ type
const
TypeCompatibilityNames: array[TTypeCompatibility] of string = (
'Exact',
'Compatible', // convertable, but not usable for var params
'Compatible', // convertable, but not allowed for var params
'Incompatible'
);
@ -293,6 +379,9 @@ type
procedure ClearFoundProc;
end;
{ TFindDeclarationTool }
TFindDeclarationTool = class(TPascalParserTool)
private
FInterfaceIdentifierCache: TInterfaceIdentifierCache;
@ -448,28 +537,6 @@ const
fdfDefaultForExpressions = [fdfSearchInParentNodes, fdfSearchInAncestors,
fdfExceptionOnNotFound]+fdfAllClassVisibilities;
FindDeclarationFlagNames: array[TFindDeclarationFlag] of string = (
'fdfSearchInParentNodes',
'fdfSearchInAncestors',
'fdfIgnoreCurContextNode',
'fdfExceptionOnNotFound',
'fdfExceptionOnPredefinedIdent',
'fdfIgnoreUsedUnits',
'fdfSearchForward',
'fdfIgnoreClassVisibility',
'fdfClassPublished',
'fdfClassPublic',
'fdfClassProtected',
'fdfClassPrivate',
'fdfIgnoreMissingParams',
'fdfOnlyCompatibleProc',
'fdfFunctionResult',
'fdfIgnoreOverloadedProcs',
'fdfFindVariable',
'fdfCollect',
'fdfTopLvlResolving'
);
function ExprTypeToString(ExprType: TExpressionType): string;
function CreateFindContext(NewTool: TFindDeclarationTool;
NewNode: TCodeTreeNode): TFindContext;

View File

@ -1,15 +0,0 @@
unit DesignerStr;
{$mode objfpc}{$H+}
interface
resourcestring
// component editors commands
liscAdd = '&Add';
liscDelete = '&Delete';
implementation
end.

View File

@ -51,7 +51,8 @@ uses
{$else}
mwCustomEdit, mwPasSyn, mwHighlighter,
{$endif}
Laz_XMLCfg, CodeTemplateDialog, KeyMapping, InputHistory, IDEOptionDefs, LazarusIDEStrConsts;
Laz_XMLCfg, CodeTemplateDialog, KeyMapping, InputHistory, IDEOptionDefs,
LazarusIDEStrConsts;
type
{$ifdef NEW_EDITOR_SYNEDIT}
@ -72,7 +73,8 @@ type
lshCPP, lshPerl);
TAdditionalHilightAttribute = (ahaNone, ahaTextBlock, ahaExecutionPoint,
ahaEnabledBreakpoint, ahaDisabledBreakpoint, ahaInvalidBreakpoint, ahaErrorLine);
ahaEnabledBreakpoint, ahaDisabledBreakpoint, ahaInvalidBreakpoint,
ahaErrorLine);
const
EditorOptsFormatVersion = 2;
@ -2895,7 +2897,7 @@ function TEditorOptionsForm.KeyMappingRelationToString(
var s:AnsiString;
begin
with KeyRelation do begin
Result:=copy(Name,1,37);
Result:=copy(EditorCommandLocalizedName(Command,Name),1,37);
if length(Result)<37 then begin
SetLength(s,(37-length(Result)));
FillChar(s[1],length(s),' ');

View File

@ -329,6 +329,7 @@ procedure TLazFindReplaceDialog.TextToFindComboBoxKeyDown(
Sender: TObject; var Key:Word; Shift:TShiftState);
var Component: TFindDlgComponent;
begin
//writeln('TLazFindReplaceDialog.TextToFindComboBoxKeyDown Key=',Key);
if (Key=VK_RETURN) then
OkButtonClick(Sender)
else if (Key=VK_ESCAPE) then

View File

@ -299,6 +299,8 @@ function ShowKeyMappingEditForm(Index:integer;
function KeyStrokesConsistencyErrors(ASynEditKeyStrokes:TSynEditKeyStrokes;
Protocol: TStrings; var Index1,Index2:integer):integer;
function EditorCommandToDescriptionString(cmd: word):AnsiString;
function EditorCommandLocalizedName(cmd: word;
const DefaultName: string): string;
function StrToVKCode(const s: string): integer;
var KeyMappingEditForm: TKeyMappingEditForm;
@ -316,6 +318,11 @@ const
VirtualKeyStrings: TStringHashList = nil;
function EditorCommandLocalizedName(cmd: word;
const DefaultName: string): string;
begin
Result:=DefaultName;
end;
function StrToVKCode(const s: string): integer;
var
@ -747,14 +754,14 @@ var
VK_LWIN :AddStr('left windows key');
VK_RWIN :AddStr('right windows key');
VK_APPS :AddStr('application key');
VK_NUMPAD0..VK_NUMPAD9:AddStr('Numpad '+IntToStr(Key-VK_NUMPAD0));
VK_NUMPAD0..VK_NUMPAD9: begin AddStr('Numpad ');AddStr(IntToStr(Key-VK_NUMPAD0)); end;
VK_MULTIPLY :AddStr('*');
VK_ADD :AddStr('+');
VK_SEPARATOR :AddStr('|');
VK_SUBTRACT :AddStr('-');
VK_DECIMAL :AddStr('.');
VK_DIVIDE :AddStr('/');
VK_F1..VK_F24 :AddStr('F'+IntToStr(Key-VK_F1+1));
VK_F1..VK_F24 :begin AddStr('F'); AddStr(IntToStr(Key-VK_F1+1)); end;
VK_NUMLOCK :AddStr('Numlock');
VK_SCROLL :AddStr('Scroll');
VK_EQUAL :AddStr('=');
@ -1025,10 +1032,7 @@ begin
ACaption:='No No No';
AText:=' The key "'+KeyAndShiftStateToStr(NewKey1,NewShiftState1)+'"'
+' is already connected to "'+DummyRelation.Name+'".';
// Application.MessageBox(PChar(AText),PChar(ACaption),0);
MessageDlg(ACaption,AText,mterror,[mbok],0);
exit;
end;
NewKey2:=StrToVKCode(Key2KeyComboBox.Text);

View File

@ -27,6 +27,10 @@
* *
***************************************************************************
}
{
Note: All resource strings should be prefixed with 'lis'
}
unit LazarusIDEStrConsts;
{$mode objfpc}{$H+}
@ -282,7 +286,8 @@ resourcestring
//palletes, for example 'ðÒÉÍÅÒÙ' and 'Samples'
ideDataAccess = 'Data Access';
ideInterbase = 'Interbase Data Access';
//Environment dialogue
//Environment dialog
dlgEnvOpts = 'Environment Options';
dlgDesktop = 'Desktop';
dlgFrmEditor = 'Form Editor';