Changeset 74
- Timestamp:
- Dec 17, 2016, 6:33:13 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r73 r74 5 5 Width = 860 6 6 Caption = 'LazFuck' 7 ClientHeight = 5 617 ClientHeight = 554 8 8 ClientWidth = 860 9 9 Menu = MainMenu1 … … 18 18 Left = 0 19 19 Height = 28 20 Top = 5 3320 Top = 526 21 21 Width = 860 22 22 Panels = < … … 131 131 object PageControlRight: TPageControl 132 132 Left = 467 133 Height = 50 7133 Height = 500 134 134 Top = 26 135 135 Width = 393 … … 141 141 object TabSheetDebug: TTabSheet 142 142 Caption = 'Debug' 143 ClientHeight = 49 9144 ClientWidth = 3 59143 ClientHeight = 494 144 ClientWidth = 319 145 145 object PanelInput: TPanel 146 146 Left = 0 147 147 Height = 64 148 148 Top = 0 149 Width = 3 59149 Width = 319 150 150 Align = alTop 151 151 BevelOuter = bvNone … … 157 157 Height = 5 158 158 Top = 64 159 Width = 3 59159 Width = 319 160 160 Align = alTop 161 161 ResizeAnchor = akTop … … 165 165 Height = 259 166 166 Top = 69 167 Width = 3 59167 Width = 319 168 168 Align = alTop 169 169 BevelOuter = bvNone … … 175 175 Height = 5 176 176 Top = 328 177 Width = 3 59177 Width = 319 178 178 Align = alTop 179 179 ResizeAnchor = akTop … … 183 183 Height = 86 184 184 Top = 333 185 Width = 3 59185 Width = 319 186 186 Align = alTop 187 187 BevelOuter = bvNone … … 193 193 Height = 5 194 194 Top = 419 195 Width = 3 59195 Width = 319 196 196 Align = alTop 197 197 ResizeAnchor = akTop … … 199 199 object PanelMemory: TPanel 200 200 Left = 0 201 Height = 7 5201 Height = 70 202 202 Top = 424 203 Width = 3 59203 Width = 319 204 204 Align = alClient 205 205 BevelOuter = bvNone … … 210 210 object Splitter1: TSplitter 211 211 Left = 462 212 Height = 50 7212 Height = 500 213 213 Top = 26 214 214 Width = 5 … … 218 218 object PanelLeft: TPanel 219 219 Left = 0 220 Height = 50 7220 Height = 500 221 221 Top = 26 222 222 Width = 462 223 223 Align = alClient 224 224 BevelOuter = bvNone 225 ClientHeight = 50 7225 ClientHeight = 500 226 226 ClientWidth = 462 227 227 TabOrder = 4 228 228 object PageControlMain: TPageControl 229 229 Left = 0 230 Height = 3 84230 Height = 377 231 231 Top = 0 232 232 Width = 462 … … 246 246 Left = 0 247 247 Height = 118 248 Top = 38 9248 Top = 382 249 249 Width = 462 250 250 ActivePage = TabSheetMessages … … 261 261 Left = 0 262 262 Height = 5 263 Top = 3 84263 Top = 377 264 264 Width = 462 265 265 Align = alBottom … … 1005 1005 object AAbout: TAction 1006 1006 Caption = 'About' 1007 OnExecute = AAboutExecute 1007 1008 end 1008 1009 object AHelp: TAction -
trunk/Forms/UFormMain.pas
r73 r74 113 113 ToolButton8: TToolButton; 114 114 ToolButton9: TToolButton; 115 procedure AAboutExecute(Sender: TObject); 115 116 procedure ABreakpointToggleExecute(Sender: TObject); 116 117 procedure AExitExecute(Sender: TObject); … … 170 171 UCore, UFormCPU, UFormOptions, UFormMessages, UFormTargets, UFormOutput, UFormInput, 171 172 UFormMemory, UFormSourceCode, UFormTargetCode, UTargetInterpretter, UFormLog, 172 UBFTarget ;173 UBFTarget, UFormAbout; 173 174 174 175 resourcestring … … 187 188 procedure TFormMain.FormShow(Sender: TObject); 188 189 begin 190 // TODO: Transparent image scaling not working properly under linux Gtk2 191 // Also screen DPI is not correctly detected under linux Gtk2 192 {$IFDEF WINDOWS} 189 193 with Core.ScaleDPI do begin 190 194 ApplyToAll(DesignDPI); 191 195 ScaleImageList(ImageListMain, DesignDPI); 192 196 end; 197 {$ENDIF} 198 193 199 Core.CoolTranslator1.Translate; 194 200 LoadFromRegistry(HKEY(Core.ApplicationInfo.RegistryRoot), Core.ApplicationInfo.RegistryKey); … … 503 509 end; 504 510 511 procedure TFormMain.AAboutExecute(Sender: TObject); 512 begin 513 FormAbout := TFormAbout.Create(nil); 514 try 515 FormAbout.ApplicationInfo := Core.ApplicationInfo; 516 FormAbout.CoolTranslator := Core.CoolTranslator1; 517 FormAbout.ShowModal; 518 finally 519 FreeAndNil(FormAbout); 520 end; 521 end; 522 505 523 procedure TFormMain.AProgramPauseExecute(Sender: TObject); 506 524 begin -
trunk/Languages/LazFuckIDE.cs.po
r72 r74 28 28 msgstr "Form3" 29 29 30 #: tformabout.buttonclose.caption 31 #, fuzzy 32 msgctxt "tformabout.buttonclose.caption" 33 msgid "Close" 34 msgstr "ZavÅÃt" 35 36 #: tformabout.buttonhomepage.caption 37 msgid "Home page" 38 msgstr "" 39 40 #: tformabout.caption 41 #, fuzzy 42 msgctxt "tformabout.caption" 43 msgid "About" 44 msgstr "O programu" 45 46 #: tformabout.labelappname.caption 47 #, fuzzy 48 msgctxt "tformabout.labelappname.caption" 49 msgid "LazFuck" 50 msgstr "LazFuck" 51 52 #: tformabout.labelcontent.caption 53 #, fuzzy 54 msgctxt "tformabout.labelcontent.caption" 55 msgid " " 56 msgstr " " 57 58 #: tformabout.labeldescription.caption 59 msgid "Simple BrainFuck IDE written in Lazarus/FPC." 60 msgstr "" 61 30 62 #: tformcompilers.caption 31 63 msgctxt "tformcompilers.caption" … … 826 858 msgstr "Cesta pÅekladaÄe" 827 859 860 #: uformabout.slicense 861 msgid "License" 862 msgstr "" 863 864 #: uformabout.sreleasedate 865 msgid "Release date" 866 msgstr "" 867 868 #: uformabout.sversion 869 msgid "Version" 870 msgstr "" 871 828 872 #: uformcpu.sstepspersecond 829 873 msgctxt "uformcpu.sstepspersecond" -
trunk/Languages/LazFuckIDE.po
r72 r74 18 18 msgstr "" 19 19 20 #: tformabout.buttonclose.caption 21 msgctxt "TFORMABOUT.BUTTONCLOSE.CAPTION" 22 msgid "Close" 23 msgstr "" 24 25 #: tformabout.buttonhomepage.caption 26 msgid "Home page" 27 msgstr "" 28 29 #: tformabout.caption 30 msgctxt "TFORMABOUT.CAPTION" 31 msgid "About" 32 msgstr "" 33 34 #: tformabout.labelappname.caption 35 msgctxt "TFORMABOUT.LABELAPPNAME.CAPTION" 36 msgid "LazFuck" 37 msgstr "" 38 39 #: tformabout.labelcontent.caption 40 msgctxt "TFORMABOUT.LABELCONTENT.CAPTION" 41 msgid " " 42 msgstr "" 43 44 #: tformabout.labeldescription.caption 45 msgid "Simple BrainFuck IDE written in Lazarus/FPC." 46 msgstr "" 47 20 48 #: tformcompilers.caption 21 49 msgctxt "tformcompilers.caption" … … 813 841 msgstr "" 814 842 843 #: uformabout.slicense 844 msgid "License" 845 msgstr "" 846 847 #: uformabout.sreleasedate 848 msgid "Release date" 849 msgstr "" 850 851 #: uformabout.sversion 852 msgid "Version" 853 msgstr "" 854 815 855 #: uformcpu.sstepspersecond 816 856 msgctxt "uformcpu.sstepspersecond" -
trunk/LazFuckIDE.lpi
r72 r74 97 97 </Item6> 98 98 </RequiredPackages> 99 <Units Count="2 3">99 <Units Count="24"> 100 100 <Unit0> 101 101 <Filename Value="LazFuckIDE.lpr"/> … … 228 228 <IsPartOfProject Value="True"/> 229 229 </Unit22> 230 <Unit23> 231 <Filename Value="Forms\UFormAbout.pas"/> 232 <IsPartOfProject Value="True"/> 233 <ComponentName Value="FormAbout"/> 234 <HasResources Value="True"/> 235 <ResourceBaseClass Value="Form"/> 236 </Unit23> 230 237 </Units> 231 238 </ProjectOptions> -
trunk/LazFuckIDE.lpr
r67 r74 5 5 uses 6 6 {$IFDEF UNIX}//{$IFDEF UseCThreads} 7 cthreads, 7 cthreads, clocale, 8 8 //{$ENDIF} 9 9 {$ENDIF} -
trunk/Packages/Common/UCommon.pas
r73 r74 6 6 7 7 uses 8 {$IFDEF Windows}Windows,{$ENDIF} 8 {$ifdef Windows}Windows,{$endif} 9 {$ifdef Linux}baseunix,{$endif} 9 10 Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, 10 11 FileUtil; //, ShFolder, ShellAPI; … … 69 70 function GetDirCount(Dir: string): Integer; 70 71 function MergeArray(A, B: array of string): TArrayOfString; 72 function LoadFileToStr(const FileName: TFileName): AnsiString; 71 73 72 74 … … 305 307 end; 306 308 end; 309 {$endif} 307 310 308 311 function ComputerName: string; … … 324 327 {$endif} 325 328 {$ifdef unix} 326 begin 327 Result := GetHostName; 329 var 330 Name: UtsName; 331 begin 332 fpuname(Name); 333 Result := Name.Nodename; 328 334 end; 329 335 {$endif} 330 336 337 {$ifdef windows} 331 338 function LoggedOnUserNameEx(Format: TUserNameFormat): string; 332 339 const … … 443 450 444 451 procedure OpenWebPage(URL: string); 445 var446 Process: TProcess;447 Browser, Params: string;448 452 begin 449 453 OpenURL(URL); 450 {try451 Process := TProcess.Create(nil);452 Browser := '';453 //FindDefaultBrowser(Browser, Params);454 //Process.Executable := Browser;455 //Process.Parameters.Add(Format(Params, [ApplicationInfo.HomePage]);456 Process.CommandLine := 'cmd.exe /c start ' + URL;457 Process.Options := [poNoConsole];458 Process.Execute;459 finally460 Process.Free;461 end;}462 454 end; 463 455 … … 501 493 end; 502 494 495 function LoadFileToStr(const FileName: TFileName): AnsiString; 496 var 497 FileStream: TFileStream; 498 Read: Integer; 499 begin 500 Result := ''; 501 FileStream := TFileStream.Create(FileName, fmOpenRead); 502 try 503 if FileStream.Size > 0 then begin 504 SetLength(Result, FileStream.Size); 505 Read := FileStream.Read(Pointer(Result)^, FileStream.Size); 506 SetLength(Result, Read); 507 end; 508 finally 509 FileStream.Free; 510 end; 511 end; 512 503 513 504 514 -
trunk/Packages/Common/UPersistentForm.pas
r73 r74 8 8 9 9 uses 10 Classes, SysUtils, Forms, URegistry, LCLIntf, Registry ;10 Classes, SysUtils, Forms, URegistry, LCLIntf, Registry, Controls, ComCtrls; 11 11 12 12 type … … 19 19 FMinVisiblePart: Integer; 20 20 FRegistryContext: TRegistryContext; 21 procedure LoadControl(Control: TControl); 22 procedure SaveControl(Control: TControl); 21 23 public 22 24 FormNormalSize: TRect; … … 49 51 50 52 { TPersistentForm } 53 54 procedure TPersistentForm.LoadControl(Control: TControl); 55 var 56 I: Integer; 57 WinControl: TWinControl; 58 Count: Integer; 59 begin 60 if Control is TListView then begin 61 with Form, TRegistryEx.Create do 62 try 63 RootKey := RegistryContext.RootKey; 64 OpenKey(RegistryContext.Key + '\Forms\' + Form.Name + '\' + Control.Name, True); 65 for I := 0 to TListView(Control).Columns.Count - 1 do begin 66 if ValueExists('ColWidth' + IntToStr(I)) then 67 TListView(Control).Columns[I].Width := ReadInteger('ColWidth' + IntToStr(I)); 68 end; 69 finally 70 Free; 71 end; 72 end; 73 74 if Control is TWinControl then begin 75 WinControl := TWinControl(Control); 76 if WinControl.ControlCount > 0 then begin 77 for I := 0 to WinControl.ControlCount - 1 do begin 78 if WinControl.Controls[I] is TControl then begin 79 LoadControl(WinControl.Controls[I]); 80 end; 81 end; 82 end; 83 end; 84 end; 85 86 procedure TPersistentForm.SaveControl(Control: TControl); 87 var 88 I: Integer; 89 WinControl: TWinControl; 90 begin 91 if Control is TListView then begin 92 with Form, TRegistryEx.Create do 93 try 94 RootKey := RegistryContext.RootKey; 95 OpenKey(RegistryContext.Key + '\Forms\' + Form.Name + '\' + Control.Name, True); 96 for I := 0 to TListView(Control).Columns.Count - 1 do begin 97 WriteInteger('ColWidth' + IntToStr(I), TListView(Control).Columns[I].Width); 98 end; 99 finally 100 Free; 101 end; 102 end; 103 104 if Control is TWinControl then begin 105 WinControl := TWinControl(Control); 106 if WinControl.ControlCount > 0 then begin 107 for I := 0 to WinControl.ControlCount - 1 do begin 108 if WinControl.Controls[I] is TControl then begin 109 SaveControl(WinControl.Controls[I]); 110 end; 111 end; 112 end; 113 end; 114 end; 51 115 52 116 procedure TPersistentForm.LoadFromRegistry(RegistryContext: TRegistryContext); … … 181 245 Form.BoundsRect := FormNormalSize; 182 246 end; 247 LoadControl(Form); 183 248 end; 184 249 … … 191 256 FormWindowState := Form.WindowState; 192 257 SaveToRegistry(RegistryContext); 258 SaveControl(Form); 193 259 end; 194 260 -
trunk/Packages/Common/UScaleDPI.pas
r73 r74 309 309 end; 310 310 311 if Control is TCoolBar then 312 with TCoolBar(Control) do begin 313 BeginUpdate; 314 for I := 0 to Bands.Count - 1 do 315 with Bands[I] do begin 316 MinWidth := ScaleX(MinWidth, FromDPI.X); 317 MinHeight := ScaleY(MinHeight, FromDPI.Y); 318 Width := ScaleX(Width, FromDPI.X); 319 //Control.Invalidate; 320 end; 321 EndUpdate; 322 end; 323 311 324 if Control is TToolBar then begin 312 325 ToolBarControl := TToolBar(Control); -
trunk/Packages/CoolTranslator/UCoolTranslator.pas
r72 r74 6 6 7 7 uses 8 Classes, SysUtils, Forms, ExtCtrls, Controls, Contnrs, 9 Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages, LCLType, 10 LazFileUtils, LazUTF8; 8 Classes, SysUtils, Forms, ExtCtrls, Controls, Contnrs, LazFileUtils, LazUTF8, 9 Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages, LCLType; 11 10 12 11 type … … 47 46 procedure TranslateProperty(Component: TPersistent; PropInfo: PPropInfo); 48 47 function IsExcluded(Component: TPersistent; PropertyName: string): Boolean; 48 function GetLangFileDir: string; 49 49 public 50 50 ComponentExcludes: TComponentExcludesList; 51 51 Languages: TLanguageList; 52 procedure Translate; 52 53 procedure LanguageListToStrings(Strings: TStrings); 53 procedure Translate;54 54 procedure TranslateResourceStrings(PoFileName: string); 55 55 procedure TranslateUnitResourceStrings(UnitName: string; PoFileName: string); … … 151 151 I: Integer; 152 152 LocaleShort: string; 153 SearchMask: string; 153 154 begin 154 155 FPOFiles.Clear; … … 158 159 //ShowMessage(ExtractFileDir(Application.ExeName) + 159 160 // DirectorySeparator + 'Languages' + ' ' + '*.' + LocaleShort + '.po'); 160 FileList := FindAllFiles(ExtractFileDir(UTF8Encode(Application.ExeName)) + 161 DirectorySeparator + FPOFilesFolder, '*.' + LocaleShort + '.po'); 161 SearchMask := '*'; 162 if LocaleShort <> '' then SearchMask := SearchMask + '.' + LocaleShort; 163 SearchMask := SearchMask + '.po'; 164 FileList := FindAllFiles(GetLangFileDir, SearchMask); 162 165 for I := 0 to FileList.Count - 1 do begin 163 166 FileName := FileList[I]; 164 167 //FileName := FindLocaleFileName('.po'); 165 if FileExistsUTF8(FileName) then FPOFiles.Add(TPOFile.Create(FileName)); 168 if FileExists(FileName) and ( 169 ((LocaleShort = '') and (Pos('.', FileName) = Pos('.po', FileName))) or 170 (LocaleShort <> '')) then FPOFiles.Add(TPOFile.Create(FileName)); 166 171 end; 167 172 finally … … 175 180 FPoFilesFolder := AValue; 176 181 ReloadFiles; 182 CheckLanguageFiles; 177 183 end; 178 184 … … 191 197 PropInfo: PPropInfo; 192 198 PropList: PPropList; 199 Excludes: TComponentExcludes; 193 200 begin 194 201 Count := GetTypeData(Component.ClassInfo)^.PropCount; … … 243 250 if (UpperCase(PropType.Name) = 'TTRANSLATESTRING') then 244 251 //if not IsExcluded(Component, PropInfo^.Name) then 245 SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, Get StrProp(Component, PropInfo)));252 SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, GetWideStrProp(Component, PropInfo))); 246 253 end; 247 254 tkClass: begin … … 284 291 end; 285 292 293 function TCoolTranslator.GetLangFileDir: string; 294 begin 295 Result := FPOFilesFolder; 296 if Copy(Result, 1, 1) <> DirectorySeparator then 297 Result := ExtractFileDir(UTF8Encode(Application.ExeName)) + 298 DirectorySeparator + Result; 299 end; 300 286 301 procedure TCoolTranslator.LanguageListToStrings(Strings: TStrings); 287 302 var … … 316 331 I: Integer; 317 332 begin 333 Result := ''; 318 334 if Text <> '' then begin 319 335 for I := 0 to FPoFiles.Count - 1 do begin … … 342 358 var 343 359 I: Integer; 344 begin 360 LangDir: string; 361 begin 362 LangDir := GetLangFileDir; 345 363 TLanguage(Languages[0]).Available := True; // Automatic 346 364 347 365 for I := 1 to Languages.Count - 1 do 348 366 with TLanguage(Languages[I]) do begin 349 Available := FileExists UTF8(POFilesFolder + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) +367 Available := FileExists(LangDir + DirectorySeparator + ExtractFileNameOnly(Application.ExeName) + 350 368 '.' + Code + ExtensionSeparator + 'po') or (Code = 'en'); 351 369 end; … … 381 399 T: string; 382 400 begin 383 T := '';384 385 401 // Win32 user may decide to override locale with LANG variable. 386 Lang := GetEnvironmentVariable UTF8('LANG');402 Lang := GetEnvironmentVariable('LANG'); 387 403 388 404 // Use user selected language … … 392 408 if Lang = '' then begin 393 409 for i := 1 to Paramcount - 1 do 394 if (ParamStr UTF8(i) = '--LANG') or (ParamStrUTF8(i) = '-l') or395 (ParamStr UTF8(i) = '--lang') then396 Lang := ParamStr UTF8(i + 1);410 if (ParamStr(i) = '--LANG') or (ParamStr(i) = '-l') or 411 (ParamStr(i) = '--lang') then 412 Lang := ParamStr(i + 1); 397 413 end; 398 414 if Lang = '' then 399 L azGetLanguageIDs(Lang, T);415 LCLGetLanguageIDs(Lang, T); 400 416 401 417 if Assigned(Language) and (Language.Code = '') and Assigned(FOnAutomaticLanguage) then begin … … 403 419 end; 404 420 405 if Lang = 'en' then Lang := ''; // English files are without en code406 407 421 Result := Lang; 408 422 end; … … 415 429 function TCoolTranslator.FindLocaleFileName(LCExt: string): string; 416 430 var 431 T: string; 417 432 Lang: string; 418 433 begin … … 424 439 Exit; 425 440 426 Result := ChangeFileExt(ParamStr UTF8(0), LCExt);441 Result := ChangeFileExt(ParamStr(0), LCExt); 427 442 if FileExistsUTF8(Result) then 428 443 Exit; -
trunk/UCore.lfm
r73 r74 19 19 EmailContact = 'robie@centrum.cz' 20 20 AppName = 'LazFuck' 21 ReleaseDate = 4 111621 ReleaseDate = 42721 22 22 RegistryKey = '\Software\Chronosoft\LazFuck' 23 23 RegistryRoot = rrKeyCurrentUser 24 License = 'CC0' 24 25 left = 72 25 26 top = 16
Note:
See TracChangeset
for help on using the changeset viewer.