mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 15:39:20 +02:00
fixed freeing synedit PrimarySelection and sending gtklist DrawItem msg for destroing controls
git-svn-id: trunk@5691 -
This commit is contained in:
parent
852d652b26
commit
bddd2f7bdc
@ -259,10 +259,12 @@ type
|
|||||||
xtLongWord, // longword
|
xtLongWord, // longword
|
||||||
xtWord, // word
|
xtWord, // word
|
||||||
xtSmallInt, // smallint
|
xtSmallInt, // smallint
|
||||||
|
xtByte, // byte
|
||||||
xtCompilerFunc,// SUCC, PREC, LOW, HIGH, ORD, LENGTH, COPY (1.1)
|
xtCompilerFunc,// SUCC, PREC, LOW, HIGH, ORD, LENGTH, COPY (1.1)
|
||||||
xtNil // nil = pointer, class, procedure, method, ...
|
xtNil // nil = pointer, class, procedure, method, ...
|
||||||
);
|
);
|
||||||
TExpressionTypeDescs = set of TExpressionTypeDesc;
|
// Do not use this: TExpressionTypeDescs = set of TExpressionTypeDesc;
|
||||||
|
// There are too many enums, so the set would be big and slow
|
||||||
|
|
||||||
const
|
const
|
||||||
ExpressionTypeDescNames: array[TExpressionTypeDesc] of string = (
|
ExpressionTypeDescNames: array[TExpressionTypeDesc] of string = (
|
||||||
@ -299,6 +301,7 @@ const
|
|||||||
'LongWord',
|
'LongWord',
|
||||||
'Word',
|
'Word',
|
||||||
'SmallInt',
|
'SmallInt',
|
||||||
|
'Byte',
|
||||||
'CompilerFunc',
|
'CompilerFunc',
|
||||||
'Nil'
|
'Nil'
|
||||||
);
|
);
|
||||||
@ -306,7 +309,7 @@ const
|
|||||||
xtAllTypes = [Low(TExpressionTypeDesc)..High(TExpressionTypeDesc)]-[xtNone];
|
xtAllTypes = [Low(TExpressionTypeDesc)..High(TExpressionTypeDesc)]-[xtNone];
|
||||||
xtAllPredefinedTypes = xtAllTypes-[xtContext];
|
xtAllPredefinedTypes = xtAllTypes-[xtContext];
|
||||||
xtAllIntegerTypes = [xtInt64, xtQWord, xtConstOrdInteger, xtLongint,
|
xtAllIntegerTypes = [xtInt64, xtQWord, xtConstOrdInteger, xtLongint,
|
||||||
xtLongWord, xtWord, xtCardinal, xtSmallInt];
|
xtLongWord, xtWord, xtCardinal, xtSmallInt, xtByte];
|
||||||
xtAllBooleanTypes = [xtBoolean, xtByteBool, xtLongBool];
|
xtAllBooleanTypes = [xtBoolean, xtByteBool, xtLongBool];
|
||||||
xtAllRealTypes = [xtReal, xtConstReal, xtSingle, xtDouble, xtExtended,
|
xtAllRealTypes = [xtReal, xtConstReal, xtSingle, xtDouble, xtExtended,
|
||||||
xtCurrency, xtComp];
|
xtCurrency, xtComp];
|
||||||
@ -785,6 +788,8 @@ begin
|
|||||||
Result:=xtCardinal
|
Result:=xtCardinal
|
||||||
else if CompareIdentifiers(Identifier,'SMALLINT')=0 then
|
else if CompareIdentifiers(Identifier,'SMALLINT')=0 then
|
||||||
Result:=xtSmallInt
|
Result:=xtSmallInt
|
||||||
|
else if CompareIdentifiers(Identifier,'BYTE')=0 then
|
||||||
|
Result:=xtByte
|
||||||
else
|
else
|
||||||
Result:=xtNone;
|
Result:=xtNone;
|
||||||
end;
|
end;
|
||||||
@ -6244,6 +6249,7 @@ begin
|
|||||||
xtLongint,
|
xtLongint,
|
||||||
xtLongWord,
|
xtLongWord,
|
||||||
xtSmallInt,
|
xtSmallInt,
|
||||||
|
xtByte,
|
||||||
xtWord:
|
xtWord:
|
||||||
Result:=ExpressionTypeDescNames[ExprType.Desc];
|
Result:=ExpressionTypeDescNames[ExprType.Desc];
|
||||||
|
|
||||||
|
@ -1165,6 +1165,7 @@ begin
|
|||||||
Add('LONGINT' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
Add('LONGINT' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
Add('COPY' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
Add('COPY' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
Add('SMALLINT' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
Add('SMALLINT' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
|
Add('BYTE' ,{$ifdef FPC}@{$endif}AllwaysTrue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
WordIsPredefinedDelphiIdentifier:=TKeyWordFunctionList.Create;
|
WordIsPredefinedDelphiIdentifier:=TKeyWordFunctionList.Create;
|
||||||
|
@ -7453,6 +7453,10 @@ begin
|
|||||||
{$IFNDEF DisableDoubleBuf}
|
{$IFNDEF DisableDoubleBuf}
|
||||||
FreeAndNil(BufferBitmap);
|
FreeAndNil(BufferBitmap);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$IFDEF SYN_LAZARUS}
|
||||||
|
if PrimarySelection.OnRequest=@PrimarySelectionRequest then
|
||||||
|
PrimarySelection.OnRequest:=nil;
|
||||||
|
{$ENDIF}
|
||||||
inherited DestroyWnd;
|
inherited DestroyWnd;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -134,6 +134,11 @@ procedure SaveStringList(XMLConfig: TXMLConfig; List: TStrings;
|
|||||||
function FindProgram(const Programname, BaseDirectory: string;
|
function FindProgram(const Programname, BaseDirectory: string;
|
||||||
WithBaseDirectory: boolean): string;
|
WithBaseDirectory: boolean): string;
|
||||||
|
|
||||||
|
const DateAsCfgStrFormat='YYYYMMDD';
|
||||||
|
|
||||||
|
function DateToCfgStr(const Date: TDateTime): string;
|
||||||
|
function CfgStrToDate(const s: string; var Date: TDateTime): boolean;
|
||||||
|
|
||||||
// text conversion
|
// text conversion
|
||||||
function TabsToSpaces(const s: string; TabWidth: integer): string;
|
function TabsToSpaces(const s: string; TabWidth: integer): string;
|
||||||
function CommentLines(const s: string): string;
|
function CommentLines(const s: string): string;
|
||||||
@ -1211,6 +1216,44 @@ begin
|
|||||||
Delim,Flags);
|
Delim,Flags);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function DateToCfgStr(const Date: TDateTime): string;
|
||||||
|
begin
|
||||||
|
try
|
||||||
|
Result:=FormatDateTime(DateAsCfgStrFormat,Date);
|
||||||
|
except
|
||||||
|
Result:='';
|
||||||
|
end;
|
||||||
|
//debugln('DateToCfgStr "',Result,'"');
|
||||||
|
end;
|
||||||
|
|
||||||
|
function CfgStrToDate(const s: string; var Date: TDateTime): boolean;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
Year, Month, Day: word;
|
||||||
|
begin
|
||||||
|
//debugln('CfgStrToDate "',s,'"');
|
||||||
|
Result:=true;
|
||||||
|
if length(s)<>length(DateAsCfgStrFormat) then begin
|
||||||
|
Result:=false;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
try
|
||||||
|
Year:=0;
|
||||||
|
Month:=0;
|
||||||
|
Day:=0;
|
||||||
|
for i:=1 to length(DateAsCfgStrFormat) do begin
|
||||||
|
case DateAsCfgStrFormat[i] of
|
||||||
|
'Y': Year:=Year*10+ord(s[i])-ord('0');
|
||||||
|
'M': Month:=Month*10+ord(s[i])-ord('0');
|
||||||
|
'D': Day:=Day*10+ord(s[i])-ord('0');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
Date:=EncodeDate(Year,Month,Day);
|
||||||
|
except
|
||||||
|
Result:=false;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{-------------------------------------------------------------------------------
|
{-------------------------------------------------------------------------------
|
||||||
TabsToSpaces
|
TabsToSpaces
|
||||||
|
|
||||||
|
@ -70,6 +70,7 @@ begin
|
|||||||
GtkListItemLCLListTag));
|
GtkListItemLCLListTag));
|
||||||
if LCLList=nil then
|
if LCLList=nil then
|
||||||
RaiseException('gtkListItemDrawAfterCB LCLList=nil');
|
RaiseException('gtkListItemDrawAfterCB LCLList=nil');
|
||||||
|
if [csDestroying,csLoading]*LCLList.Owner.ComponentState<>[] then exit;
|
||||||
|
|
||||||
// get itemindex and area
|
// get itemindex and area
|
||||||
ItemIndex:=g_list_index(GtkList^.children,Data);
|
ItemIndex:=g_list_index(GtkList^.children,Data);
|
||||||
@ -961,6 +962,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.27 2004/07/17 14:24:31 mattias
|
||||||
|
fixed freeing synedit PrimarySelection and sending gtklist DrawItem msg for destroing controls
|
||||||
|
|
||||||
Revision 1.26 2004/07/03 11:11:08 mattias
|
Revision 1.26 2004/07/03 11:11:08 mattias
|
||||||
TGTKListStringList now keeps selection on Put and Move
|
TGTKListStringList now keeps selection on Put and Move
|
||||||
|
|
||||||
|
@ -43,7 +43,23 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
{ TPackageLink }
|
{ TPackageLink
|
||||||
|
There are several types of package links.
|
||||||
|
|
||||||
|
Global: These are collected from the lazarus source directory.
|
||||||
|
EnvironmentOptions.LazarusDirectory+'packager/globallinks/*.lpl'
|
||||||
|
This way packages can install/uninstal themselves to one lazarus
|
||||||
|
source directory, and this lazarus directory can then be shared
|
||||||
|
by several users/configs.
|
||||||
|
|
||||||
|
User: These are collected from the user config directory, from the file
|
||||||
|
packagelinks.xml.
|
||||||
|
These links are maintained by the IDE. Everytime the user opens a
|
||||||
|
package a user link is created, so that the next time the package
|
||||||
|
can be automatically opened. The list is checked by the IDE from
|
||||||
|
time to time and missing packages are first marked and after several
|
||||||
|
months deleted from the list.
|
||||||
|
}
|
||||||
|
|
||||||
TPkgLinkOrigin = (
|
TPkgLinkOrigin = (
|
||||||
ploGlobal,
|
ploGlobal,
|
||||||
@ -53,7 +69,11 @@ type
|
|||||||
|
|
||||||
TPackageLink = class(TLazPackageID)
|
TPackageLink = class(TLazPackageID)
|
||||||
private
|
private
|
||||||
|
FAutoCheckExists: boolean;
|
||||||
FFilename: string;
|
FFilename: string;
|
||||||
|
FLastCheck: TDateTime;
|
||||||
|
FLastCheckValid: boolean;
|
||||||
|
FNotFoundCount: integer;
|
||||||
FOrigin: TPkgLinkOrigin;
|
FOrigin: TPkgLinkOrigin;
|
||||||
procedure SetFilename(const AValue: string);
|
procedure SetFilename(const AValue: string);
|
||||||
procedure SetOrigin(const AValue: TPkgLinkOrigin);
|
procedure SetOrigin(const AValue: TPkgLinkOrigin);
|
||||||
@ -64,6 +84,10 @@ type
|
|||||||
public
|
public
|
||||||
property Origin: TPkgLinkOrigin read FOrigin write SetOrigin;
|
property Origin: TPkgLinkOrigin read FOrigin write SetOrigin;
|
||||||
property Filename: string read FFilename write SetFilename;
|
property Filename: string read FFilename write SetFilename;
|
||||||
|
property AutoCheckExists: boolean read FAutoCheckExists write FAutoCheckExists;
|
||||||
|
property NotFoundCount: integer read FNotFoundCount write FNotFoundCount;
|
||||||
|
property LastCheckValid: boolean read FLastCheckValid write FLastCheckValid;
|
||||||
|
property LastCheck: TDateTime read FLastCheck write FLastCheck;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -79,7 +103,7 @@ type
|
|||||||
private
|
private
|
||||||
FGlobalLinks: TAVLTree; // tree of TPackageLink sorted for ID
|
FGlobalLinks: TAVLTree; // tree of TPackageLink sorted for ID
|
||||||
FModified: boolean;
|
FModified: boolean;
|
||||||
FUserLinks: TAVLTree; // tree of TPackageLink
|
FUserLinks: TAVLTree; // tree of TPackageLink sorted for ID
|
||||||
fUpdateLock: integer;
|
fUpdateLock: integer;
|
||||||
FStates: TPkgLinksStates;
|
FStates: TPkgLinksStates;
|
||||||
function FindLeftMostNode(LinkTree: TAVLTree;
|
function FindLeftMostNode(LinkTree: TAVLTree;
|
||||||
@ -178,6 +202,7 @@ end;
|
|||||||
constructor TPackageLink.Create;
|
constructor TPackageLink.Create;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
FAutoCheckExists:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TPackageLink.Destroy;
|
destructor TPackageLink.Destroy;
|
||||||
@ -387,6 +412,17 @@ begin
|
|||||||
NewPkgLink.Version.LoadFromXMLConfig(XMLConfig,ItemPath+'Version/',
|
NewPkgLink.Version.LoadFromXMLConfig(XMLConfig,ItemPath+'Version/',
|
||||||
LazPkgXMLFileVersion);
|
LazPkgXMLFileVersion);
|
||||||
NewPkgLink.Filename:=XMLConfig.GetValue(ItemPath+'Filename/Value','');
|
NewPkgLink.Filename:=XMLConfig.GetValue(ItemPath+'Filename/Value','');
|
||||||
|
NewPkgLink.AutoCheckExists:=
|
||||||
|
XMLConfig.GetValue(ItemPath+'AutoCheckExists/Value',true);
|
||||||
|
NewPkgLink.LastCheckValid:=
|
||||||
|
XMLConfig.GetValue(ItemPath+'LastCheckValid/Value',false);
|
||||||
|
if NewPkgLink.LastCheckValid then begin
|
||||||
|
NewPkgLink.LastCheckValid:=
|
||||||
|
CfgStrToDate(XMLConfig.GetValue(ItemPath+'LastCheck/Value',''),
|
||||||
|
NewPkgLink.FLastCheck);
|
||||||
|
end;
|
||||||
|
NewPkgLink.NotFoundCount:=
|
||||||
|
XMLConfig.GetValue(ItemPath+'NotFoundCount/Value',0);
|
||||||
|
|
||||||
if NewPkgLink.MakeSense then
|
if NewPkgLink.MakeSense then
|
||||||
FUserLinks.Add(NewPkgLink)
|
FUserLinks.Add(NewPkgLink)
|
||||||
@ -457,6 +493,14 @@ begin
|
|||||||
XMLConfig.SetDeleteValue(ItemPath+'Name/Value',CurPkgLink.Name,'');
|
XMLConfig.SetDeleteValue(ItemPath+'Name/Value',CurPkgLink.Name,'');
|
||||||
CurPkgLink.Version.SaveToXMLConfig(XMLConfig,ItemPath+'Version/');
|
CurPkgLink.Version.SaveToXMLConfig(XMLConfig,ItemPath+'Version/');
|
||||||
XMLConfig.SetDeleteValue(ItemPath+'Filename/Value',CurPkgLink.Filename,'');
|
XMLConfig.SetDeleteValue(ItemPath+'Filename/Value',CurPkgLink.Filename,'');
|
||||||
|
XMLConfig.SetDeleteValue(ItemPath+'LastCheckValid/Value',
|
||||||
|
CurPkgLink.LastCheckValid,false);
|
||||||
|
if CurPkgLink.LastCheckValid then
|
||||||
|
XMLConfig.SetDeleteValue(ItemPath+'LastCheck/Value',
|
||||||
|
DateToCfgStr(CurPkgLink.LastCheck),'');
|
||||||
|
XMLConfig.SetDeleteValue(ItemPath+'NotFoundCount/Value',
|
||||||
|
CurPkgLink.NotFoundCount,0);
|
||||||
|
|
||||||
ANode:=FUserLinks.FindSuccessor(ANode);
|
ANode:=FUserLinks.FindSuccessor(ANode);
|
||||||
end;
|
end;
|
||||||
XMLConfig.SetDeleteValue(Path+'Count',FUserLinks.Count,0);
|
XMLConfig.SetDeleteValue(Path+'Count',FUserLinks.Count,0);
|
||||||
|
Loading…
Reference in New Issue
Block a user