

FabDev
Members-
Content Count
85 -
Joined
-
Last visited
Everything posted by FabDev
-
Hello, At this time does somebody know a library to handle 7zip compression (LZMA) without DLL ? I have tried it : https://github.com/ccy/delphi-zip But file LzmaDec.pas et LzmaEnc.pas are missing. LZMA is in the list : https://docwiki.embarcadero.com/Libraries/Sydney/en/System.Zip.TZipCompression But it's not seems to be handled. Better a cross-plateform library.
-
Thank you it's work, but after some fails : I understand that it's work for zip with LZMA compression but not for 7z with LZMA compression. Someone know a native Delphi library for 7z ? Because it's really better compression than zip !
-
Hello, Anyone success to compile TzipMaster with Delphi 11 because it give : [dcc32 Error] ZMZipEOC.pas(500): E2010 Incompatible types: 'PEOCrecs' and 'Pointer' Same issue than : https://github.com/edwinyzh/ZipMaster/issues/1
-
Do you try to compile it with trace software like the very good MadExcept ?
-
Hello, I try to da a Style tester on Android, IOS, Window and MacOs. It's a form with most of visual components and a style selector. For that I use : FMX.Styles.TStyleManager.SetStyleFromFile(SytleFileName); It's work but I have random access violation Exception 'first chance' at $00F0CD3A. Exception class $C0000005 with a message 'access violation at 0x00f0cd3a: read of address 0x0907728b'. Processus StyleTest.exe (10884) in FMX.Objects in all platform : function TText.GetColor: TAlphaColor; begin Result := FTextSettings.FontColor; end; I have tried something like : try BeginUpdate; FMX.Styles.TStyleManager.SetStyleFromFile(SytleFileName); finally EndUpdate; end; Or using Thread : TThread.Synchronize( nil, procedure begin try try BeginUpdate; ok:=FMX.Styles.TStyleManager.SetStyleFromFile(StyleFilename); finally endupdate; end; except ok:=false; end; end ); But it's doesn't fix the problem. Or does it a bad idea to change style at runtime ?
-
I confirm that SetStyleFromFile can (must ?) be used in Application.Initialize) or in the initialization section of one of the form unit : https://docwiki.embarcadero.com/Libraries/Alexandria/en/FMX.Styles.TStyleManager.SetStyleFromFile But I have found another solution which doesn't seems to give AV on IOS/Win32/Android : StyleBook:=nil; StyleBook1.Clear; StyleBook1.LoadFromFile(StyleFileName); StyleBook:= StyleBook1; Or the unique way, I have tested, it's to only use it in Application.Initialize (or Initalization section) ?
-
Hello, I have the same kind of problem, but only when I try to debug on IOS, Delphi 11 freeze. I have no problem if I run without debug. I use a Mac mini 2014. I have no problem using XCode debug... Delphi 11.1 (and 10.4) Xcode: 13.4.1 macOS: 12.2 (Mac mini 2014) PAServer: 13.1.11.0 sdk: iOS 15.5 Different Iphone 6s and 7 on IOS 15.X and 14.X
-
Hello, I'am looking since a few time, without any success, a function which return me a gradient (Tcolor) from an array of double (or integer) value. For example : Const REVENUE_ARRAY: array [1 .. 5] of integer= (10,15,30,45,60); Result with a gradient from Yellow to red : 10 => Yellow ... 30 => Orange ... 60 => Red My purpose is to fill a MAP ShapeFile items (Devexpress MAP) with a gradient which correspond to a Revenue array ( REVENUE_ARRAY)
-
Yes it's not so complicated. But find an already done (and tested) function is often less time lost. Some component has this kind of function but not always easy to find/extract. Finally a colleague, which has code a lot on assembler on Atari 68000/68030 (Doom version) , took a nasty pleasure to code this function with a lot of SHR and boolean operator 😉. So it will not take a lot of time to execute even on CPU with 8 Mhz clock speed 😉
-
Hello, In my software I use TMS Scripter which is a very efficient, stable and powerful component. But I need more and more to handle Webservice (SOAP). And TMS Scripter can't dynamically handle Webservice : It's need Delphi/import WSDL and import library (translate) for TMS Scripter and recompile my software. Other way is to manually handle http/xml etc... Python (With Zeep) seems to be able to handle (more easily ?) webservice WDSL ? So my idea is to use TMS Scripter (which know my business object classes) + Python4Delphi (for SOAP handling). Does it a good or a bad idea ?
-
Hello SoulFlesh, Thank you for answer. We don't need parallelisation and high performance. We need, for example, get a value from another software/database. And in most of these cases the user has to wait the response. Another alternative was to use CEF (Chromium Zmbeded Framework + javascript) but it's take a lot of memory : Like all webbrowser => "Hello world" at 500 mb of memory ! Best regards,
-
Hello, I have miss something but in new version I have lost "Code Template" ( Ctrl+J Invoke code templates also called code snippets in Delphi). Something very useful ! In old version this worked fine : https://github.com/pyscripter/SynEdit-2/blob/master/Source/SynEditAutoComplete.pas I have updated old code source "SynEditAutoComplete.pas" but I need to manually invoke in a my Synedit.OnKeydown : { with fAutoComplete: SynEditAutoComplete.TSynAutoComplete2; TSynAutoComplete renamed to TSynAutoComplete2 because it's exist in synedit code source } fAutoComplete.Execute(Snedit1); In attachment old sample "AutoCompleteDemo.dpr" AutoCompleteDemo.zip
-
Hello, Free eBook : Delphi High Performance By Primož Gabrijelčič Publication date: Feb 2018 Pages: 336 Build fast, scalable, and high performing applications with Delphi Here only today : https://www.packtpub.com/free-learning
-
Hello, I try to compile this version : https://github.com/TurboPack/SynEdit On my Delphi RIO 10.3.3, I try to compile "SynEditDR260.BPL" and I get this error : [dcc32 Erreur] SynDWrite.pas(786): E2003 Identificator not declared : 'DWRITE_WORD_WRAPPING_EMERGENCY_BREAK' Of course I have deleted : {$IF CompilerVersion <= 32} and it's work. But when I open demos like "PrintDemo" I get some error about properties that doesn't exists for exampe : - SynPasSyn.options.AutoDetectLineLimit - SynPasSyn.options.Visible So does I use the correct version ?
-
Hello, I use old version : Synedit version 1.04 (2020-04-14) with TMS Scripter I will migrate to Pyscripter version because of some new very interesting feature like Gutter.ShowModification. Thanks PyScripter for your job ! But I need time to implement these (must have 😉) shortcuts before : https://github.com/Kryuski/Editor-Shortcuts
-
Hello, Like described here : How to set tab stops in a TMemo In a TMemo in VCL it's possible to set the tab width using such a code : Memo1.Perform( EM_SETTABSTOPS, 1, LongInt(@lTabWidth)); or SendMessage(Memo1.handled, EM_SETTABSTOPS, 1, Longint(@lTabWidth)); But does it exist a way to do the same on FMX ? Because if have tried this : {$IFDEF MSWINDOWS} SendMessage(TWinWindowHandle(Memo1).Wnd, EM_SETTABSTOPS, 1, Longint(@lTabWidth)); {$ENDIF} Off course only on Windows but it's doesn't work ! I find nothing in Memo1.model. So does it exists a way to do it on all platforms (IOS, Android, MAcos etc..) ?
-
Report Builder + HTML Library + Office Library.
FabDev replied to Alexander Sviridenkov's topic in Delphi Third-Party
Hello Alexander, The same is possible on Fast Report ? -
Parsing Text search expression
FabDev replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
I confirm that HTMLLibrary is an awesome HTML library. Congratulation Alexander 😉 But for the SQL parser of HTML library I don't find how to transform this : Peter or "Bibi Paulo" and John to a where clause to search on a field : select xxx where Name containing 'Peter' or Name containing 'Bibi Paulo' and Name containing 'John' -
Hello, Following this sample : https://blog.marcocantu.com/blog/2014_may_background_delphi_android_threads.html I try to insert items in a TlistView using a Thread (see in attachment). procedure TForm1.Button2Click(Sender: TObject); begin AniIndicator1.Visible := True; AniIndicator1.Enabled := True; ListView1.enabled:=false; ListView1.beginupdate; FMyThreadTerminated:=false; FMyThread:=TThread.CreateAnonymousThread(procedure () var I: Integer; Total: Integer; begin Total := 0; for I := 1 to MaxValue do begin // if (I * 10 mod MaxValue) = 0 then TThread.Synchronize (TThread.CurrentThread, procedure () begin ListView1.Items.Add.Text := 'Th: ' + I.ToString; Button2.text:= i.tostring; // On windows this is needed to update AniIndicator {$IFDEF MSWINDOWS} if GetQueueStatus(QS_ALLINPUT) <> 0 then Application.ProcessMessages; {$ENDIF} end); if application.Terminated then begin break; end; end; TThread.Synchronize (TThread.CurrentThread, procedure () begin ListView1.Items.Add.Text := 'Thread: ' + Total.ToString; NotifyComplete; end); end); // FMyThread.FreeOnTerminate:=false; // FMyThread.OnTerminate:=ThreadTerminated; FMyThread.FreeOnTerminate:=false; FMyThread.Start; end; It's work fine on Windows and IOS except if you quit the application while thread (To insert item) is running : Application freeze ! I use : procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); begin STopThread; end; procedure TForm1.StopThread; begin if Assigned(FMyThread) then begin FMyThread.Terminate; WaitForSingleObject(FMyThread.handle,0); // FMyThread.WaitFor; //TerminateThread(FMyThread.Handle,0); access violation end; FMyThread.Free; end; What is wrong in my code ? I use Delphi 10.4.2. TListView-Thread.zip
-
Thank you very much Dalija, your version work fine (tested on Windows and Android) . Thank you to all other for interesting answer !
-
You means that : procedure TForm1.Button2Click(Sender: TObject); begin AniIndicator1.Visible := True; AniIndicator1.Enabled := True; ListView1.enabled:=false; ListView1.beginupdate; FMyThreadTerminated:=false; FMyThread:=TThread.CreateAnonymousThread(procedure () //TThread.queue(TThread.Current, procedure () // Total: Integer; var I: Integer; begin for I := 1 to MaxValue do begin TThread.queue (TThread.Current, procedure () begin ListView1.Items.Add.Text := 'Th: ' + I.ToString; Button2.text:= i.tostring; // On windows this is needed to update AniIndicator {$IFDEF MSWINDOWS} if (GetQueueStatus(QS_ALLINPUT) <> 0) then {$ENDIF} begin // Application.ProcessMessages; end; end ); if application.Terminated then begin break; end; end; TThread.queue (nil, procedure () begin NotifyComplete; end); end); FMyThread.FreeOnTerminate:=false; FMyThread.Start; end; But it's doesn't work ! But this work fine excepted my TAniIndicator on Windows which work only with a Application.processMessage, but it's work fine on IOS : procedure TForm1.Button2Click(Sender: TObject); begin AniIndicator1.Visible := True; AniIndicator1.Enabled := True; ListView1.enabled:=false; ListView1.beginupdate; FMyThreadTerminated:=false; FMyThread:=TThread.CreateAnonymousThread(procedure () //TThread.queue(TThread.Current, procedure () // Total: Integer; var I: Integer; begin for I := 1 to MaxValue do begin TThread.Synchronize(TThread.Current, procedure () begin ListView1.Items.Add.Text := 'Th: ' + I.ToString; Button2.text:= i.tostring; // On windows this is needed to update AniIndicator {$IFDEF MSWINDOWS} if (GetQueueStatus(QS_ALLINPUT) <> 0) then {$ENDIF} begin // Application.ProcessMessages; end; end ); if application.Terminated then begin break; end; end; TThread.queue (nil, procedure () begin NotifyComplete; end); end); FMyThread.FreeOnTerminate:=false; FMyThread.Start; end;
-
It's work but now to have my TAniIndicator and button2.text changing I have had to call Application.ProcessMessages on each platform (Windows, IOS, MacOs...) : procedure TForm1.Button2Click(Sender: TObject); begin AniIndicator1.Visible := True; AniIndicator1.Enabled := True; ListView1.enabled:=false; ListView1.beginupdate; FMyThreadTerminated:=false; FMyThread:=TThread.CreateAnonymousThread(procedure () begin TThread.queue (TThread.Current, procedure () var I: Integer; begin for I := 1 to MaxValue do begin ListView1.Items.Add.Text := 'Th: ' + I.ToString; Button2.text:= i.tostring; // On windows this is needed to update AniIndicator {$IFDEF MSWINDOWS} if GetQueueStatus(QS_ALLINPUT) <> 0 then {$ENDIF} begin Application.ProcessMessages; end; if application.Terminated then begin break; end; end; end ); TThread.queue (TThread.CurrentThread, procedure () begin NotifyComplete; end); end); FMyThread.FreeOnTerminate:=false; FMyThread.Start; end;
-
Thank you Dalija, now it's (seems ?) work fine like this : procedure TForm1.Button2Click(Sender: TObject); begin AniIndicator1.Visible := True; AniIndicator1.Enabled := True; ListView1.enabled:=false; ListView1.beginupdate; FMyThreadTerminated:=false; TThread.queue(TThread.Current, procedure () var I: Integer; Total: Integer; begin Total := 0; for I := 1 to MaxValue do begin TThread.Synchronize (TThread.CurrentThread, procedure () begin ListView1.Items.Add.Text := 'Th: ' + I.ToString; Button2.text:= i.tostring; // On windows this is needed to update AniIndicator {$IFDEF MSWINDOWS} if GetQueueStatus(QS_ALLINPUT) <> 0 then Application.ProcessMessages; {$ENDIF} end); if application.Terminated then begin break; end; end; TThread.Synchronize (TThread.CurrentThread, procedure () begin ListView1.Items.Add.Text := 'Thread: ' + Total.ToString; NotifyComplete; end); end); end;
-
To not freeze application while inserting some records. Imagine record extracted from a query or a webservice. What is more while it's working it's display a TAniIndicator...
-
Hello, Does someone know how to get first and last item index visible in a TListView ? Purpose : I use TlistView.OnUpdateObjects event to custom draw items and it's work fine. But it is very slow (with a certain number of items) because it is called for each items !