Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 09/10/19 in all areas

  1. David Heffernan

    Rules for changing cursor to HourGlass and back

    This approach is what you take when you hate your users. They can't tell whether or not your program is stuck in a non terminating loop, and the OS asks if you want to terminate the program. So only do this if you want to make your users suffer.
  2. Dave Nottage

    Rules for changing cursor to HourGlass and back

    These days, I avoid changing the cursor at all, but provide feedback in other ways. If it's a long running process, it'll be performed in a background thread. If you really must change the cursor, be sure to save its current value, and wrap it all in a try..finally, e.g. SaveTheCurrentCursorAndChangeToHourGlass; try DoSomeLongProcess; finally RestoreCursorToWhatItWas; end;
  3. dummzeuch

    Working Find Unit...

    https://blog.dummzeuch.de/2018/08/04/improved-uses-clause-manager-in-gexperts/
  4. Alexander Elagin

    Rules for changing cursor to HourGlass and back

    I usually use a simple class with a counter and two methods, like BeginWait and EndWait. The first one increments the counter and sets the cursor to crHourglass if the counter was 0, the second one decrements the counter if it is positive and reverts the cursor back to crDefault when the counter is 0. Of course, with the obligatory try..finally to make sure that each BeginWait has a matching EndWait and with critical sections if multithreaded.
  5. ConstantGardener

    Rules for changing cursor to HourGlass and back

    unit uTempCursor; interface uses Vcl.Controls; type ITempCursor = interface(IInterface) ['{495ADE0F-EFBE-4A0E-BF37-F1ACCACCE03D}'] end; TTempCursor = class(TInterfacedObject, ITempCursor) strict private FCursor: TCursor; public constructor Create(const ACursor: TCursor); destructor Destroy; override; class function SetTempCursor(const ACursor: TCursor = crHourGlass): ITempCursor; end; implementation uses Vcl.Forms; { TTempCursor } constructor TTempCursor.Create(const ACursor: TCursor); begin inherited Create(); FCursor := Screen.Cursor; Screen.Cursor := ACursor; end; destructor TTempCursor.Destroy; begin if Assigned(Screen) then Screen.Cursor := FCursor; inherited Destroy(); end; class function TTempCursor.SetTempCursor(const ACursor: TCursor = crHourGlass): ITempCursor; begin Result := TTempCursor.Create(ACursor); end; end. ...using somthing like this for years (the original idea is from Jeroen Pluimer's i think). Use the SetTempCursor-Function in your code, and when the interface get out of scope, the corsur changes back to the old cursor. uses uTempCursor; procedure LongRun; begin SetTempCursor; // the default is crHourGlass // do the long running stuff end;
  6. Thank you all for your answers. I decided to stick with delphi. I cant just force myself to learn something I dont like. I think delphi will be more fun than anything else. So until there is a very good reason to learn something else I will use delphi.
  7. Yaron

    My open-source portfolio

    I released quite a bit of interesting code to github over the years: YouTube DATA API v3 parsing: https://github.com/bLightZP/Delphi-YouTube-Channel-parsing-plugin-for-Zoom-Player Basic RSS feed parsing code: https://github.com/bLightZP/Delphi-RSS-feed-parsing-plugin-for-Zoom-Player TheAudioDB MetaData/Image scraping code: https://github.com/bLightZP/Delphi-theaudiodb.com-Zoom-Player-media-scraping-plug-in TheMovieDB MetaData/Image scraping code: https://github.com/bLightZP/Delphi-themoviedb.org-Zoom-Player-media-scraping-plug-in OpenSubtitles.org subtitle search & scrape code: https://github.com/bLightZP/Delphi-OpenSubtitles.org-API-support-for-Zoom-Player A basic cross-platform calculator https://github.com/bLightZP/ElegantCalculator https://play.google.com/store/apps/details?id=com.inmatrix.ElegantCalculator Adapted old code to work as cross-platform pure-pascal image scaling with filters (bicubic, bilinear, etc): https://github.com/bLightZP/ImageInterpolation Adapted old code to work as a cross-platform drawing of an anti-aliased circle (can be modified to draw rount-rect as well): https://github.com/bLightZP/AntiAliasedCircle I forked a QRCode generating source code and greatly optimized it (~ x50 faster): https://github.com/bLightZP/DelphiZXingQRCode The original Delphi scanline color-conversion implementation was very slow, so I optimized it: https://github.com/bLightZP/OptimizedDelphiFMXScanline
  8. David Heffernan

    Which rise no problems ?

    Don't change libraries and hope. The library you use is known to work well. There's a defect in your code. Work out what it is. Trial and error never works out. Provide a minimal yet complete program ideally a console app. Then you can hope for some help.
  9. Jacek Laskowski

    Working Find Unit...

    RFindUnit is for me the second, after MMX, the most important IDE extension! It is irreplaceable and "almost" perfect.
  10. Der schöne Günther

    Step-by-step debugging exceptions

    Are you sure F8 is the right hotkey? I think in your case, it should be Shift+F8 (run until return). Also, TStringList is from Delphis default RTL. Be sure to have "With Debug DCU files" checked in your project or you cannot have breakpoints in there.
  11. David Heffernan

    Rules for changing cursor to HourGlass and back

    Why would that be odd? That's pretty much a canonical use of try finally.
  12. Dave Nottage

    Issue with a new and a (rather old) App for iOS with Rio

    Sounds like your .deployproj may have problems and/or your IDE. Make a backup of the .deployproj file, delete the existing one, do a Clean, Build, and try again.
  13. Hi all, Just wanted to let you know I made available an online training course about web development with Delphi: "Introduction to TMS Web Core". Its got a theoretical introduction about web applications, then goes into TMS Web Core and Pas2JS compiler, explaining the idiosyncrasies of both web applications and TMS Web Core specifically. Course link: https://courses.landgraf.dev/p/web-applications-with-delphi-tms-web-core --- Wagner Landgraf
  14. Uwe Raabe

    MMX 15 (Beta) Available

    OK, I found why I thought the problem to be fixed: It happens only under some complex conditions which were not always satisfied in my test configuration.
  15. Ugochukwu Mmaduekwe

    Recommended Cryptographic Library

    Hi Ivana and welcome to the forum. To answer your question, CryptoLib4Pascal is the complete package and more. The hashes you requested and more can be found here sample for generating Key Pairs with Elliptic curves, signing and verifying can be found here and here AES and Chacha20 sample here Perks of CryptoLib4Pascal Constantly developed and improved Cross Platform and Cross Compiler support used in the real world on various products uses the friendly MIT License Best of all, it's free.
  16. Arnaud Bouchez

    Recommended Cryptographic Library

    Our Open-Source https://github.com/synopse/mORMot/blob/master/SynCrypto.pas has almost all that you require. About performance, it is the only one in the Delphi area using AES-NI and optimized SSE3/SSE4.2 assembly - as far as I know. So it should blow alternatives. It is cross-compiler (Delphi and FPC) and cross-platform (Windows, Linux, BSD... thanks to FPC). For elliptical curves, see its sibbling https://github.com/synopse/mORMot/blob/master/SynEcc.pas It supports only secp256r1 but it is feature complete (e.g. simple CA management) and fast (1 ms to create a key pair, 0.4 ms to sign or verify on x86-64) - also cross-platform and cross-compiler. See the documentation at https://synopse.info/files/html/Synopse mORMot Framework SAD 1.18.html#TITL_187 Both are highly maintained, and used on production since years. They don't require any external dll (like OpenSSL) which tends to be a maintenance nightmare on Windows.
×