Changeset 55 for trunk/Packages
- Timestamp:
- Aug 23, 2012, 6:43:26 AM (12 years ago)
- Location:
- trunk/Packages/Common
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UCommon.pas
r54 r55 7 7 uses 8 8 {$IFDEF Windows}Windows,{$ENDIF} 9 Classes, SysUtils, StrUtils, Dialogs, Process, 9 Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, 10 10 FileUtil; //, ShFolder, ShellAPI; 11 11 … … 404 404 Browser, Params: string; 405 405 begin 406 try 406 OpenURL(URL); 407 {try 407 408 Process := TProcess.Create(nil); 408 409 Browser := ''; … … 415 416 finally 416 417 Process.Free; 417 end; 418 end;} 418 419 end; 419 420 -
trunk/Packages/Common/ULastOpenedList.pas
r54 r55 23 23 destructor Destroy; override; 24 24 procedure LoadToMenuItem(MenuItem: TMenuItem; ClickAction: TNotifyEvent); 25 procedure LoadFromRegistry( Root: HKEY; Key: string);26 procedure SaveToRegistry( Root: HKEY; Key: string);25 procedure LoadFromRegistry(Context: TRegistryContext); 26 procedure SaveToRegistry(Context: TRegistryContext); 27 27 procedure AddItem(FileName: string); 28 28 published … … 87 87 end; 88 88 89 procedure TLastOpenedList.LoadFromRegistry( Root: HKEY; Key: string);89 procedure TLastOpenedList.LoadFromRegistry(Context: TRegistryContext); 90 90 var 91 91 I: Integer; … … 96 96 with Registry do 97 97 try 98 RootKey := Root;99 OpenKey( Key, True);98 RootKey := Context.RootKey; 99 OpenKey(Context.Key, True); 100 100 Items.Clear; 101 101 I := 0; … … 112 112 end; 113 113 114 procedure TLastOpenedList.SaveToRegistry( Root: HKEY; Key: string);114 procedure TLastOpenedList.SaveToRegistry(Context: TRegistryContext); 115 115 var 116 116 I: Integer; … … 120 120 with Registry do 121 121 try 122 RootKey := Root;123 OpenKey( Key, True);122 RootKey := Context.RootKey; 123 OpenKey(Context.Key, True); 124 124 for I := 0 to Items.Count - 1 do 125 125 WriteString('File' + IntToStr(I), UTF8Decode(Items[I])); -
trunk/Packages/Common/UMemory.pas
r54 r55 24 24 constructor Create; 25 25 destructor Destroy; override; 26 procedure WriteMemory(Position: Integer; Memory: TMemory); 27 procedure ReadMemory(Position: Integer; Memory: TMemory); 26 28 property Data: PByte read FData; 27 29 property Size: Integer read FSize write SetSize; … … 108 110 end; 109 111 112 procedure TMemory.WriteMemory(Position: Integer; Memory: TMemory); 113 begin 114 Move(Memory.FData, PByte(@FData + Position)^, Memory.Size); 115 end; 116 117 procedure TMemory.ReadMemory(Position: Integer; Memory: TMemory); 118 begin 119 Move(PByte(@FData + Position)^, Memory.FData, Memory.Size); 120 end; 121 110 122 end. 111 123 -
trunk/Packages/Common/URegistry.pas
r54 r55 17 17 rrKeyDynData = HKEY($80000006)); 18 18 19 TRegistryContext = record 20 RootKey: HKEY; 21 Key: string; 22 end; 23 19 24 { TRegistryEx } 20 25 … … 29 34 DefaultValue: Double): Double; 30 35 function DeleteKeyRecursive(const Key: string): Boolean; 36 function OpenKey(const Key: string; CanCreate: Boolean): Boolean; 31 37 end; 32 38 39 function RegContext(RootKey: HKEY; Key: string): TRegistryContext; 40 41 33 42 implementation 43 44 function RegContext(RootKey: HKEY; Key: string): TRegistryContext; 45 begin 46 Result.RootKey := RootKey; 47 Result.Key := Key; 48 end; 34 49 35 50 { TRegistryEx } … … 83 98 end; 84 99 100 function TRegistryEx.OpenKey(const Key: string; CanCreate: Boolean): Boolean; 101 begin 102 {$IFDEF Linux} 103 CloseKey; 104 {$ENDIF} 105 Result := inherited OpenKey(Key, CanCreate); 106 end; 107 85 108 function TRegistryEx.ReadBoolWithDefault(const Name: string; 86 109 DefaultValue: Boolean): Boolean;
Note:
See TracChangeset
for help on using the changeset viewer.