Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 08/23/21 in Posts

  1. Stefan Glienke

    RAD Studio 11 Alexandria is now available

    You're welcome - it is just a slightly improved version of what Aleksandr Sharahov already wrote years ago. Surprisingly they never used his purepascal code which compiles to almost the exact same code as the x86 asm version was doing. There are more than a dozen other improvements in the RTL that I have worked on - I cannot fix their compiler but I can certainly improve some suboptimal RTL code.
  2. Hi everyone, Following fast on my last post, I thought I'd also share another development I've started - a Console Manager for the Delphi IDE. This is a tool that allows you to spin up a cmd.exe or powershell.exe within a dockable form, localised within the Delphi IDE. Features: - It is aware of the active project, so it will open up in the directory in which the dproj is located. It is still very alpha as in it just streams stdout/stdin, and not totally pleasant on the eye, but ok for an alpha POC. - I've got a little slider that allows you to zoom in/out. - (planning) The ability to have lists of commands / saved environments that could be applied to a newly created session. This is a POC, and still have some more work to do as I want to embrace the new pseudo console api which was introduced with the new Windows Terminal drive along with the VT emulation which would support colour, repositioning of the cursor, etc. I have not released this publicly yet, but attached is a short video demonstrating how it works. If you are interested in accessing it, please send me a mail: conrad.vermeulen@gmail.com. Let me know about what IDEs versions you may be interested in. I think I can do XE8 onwards. I'll provide more information when it is officially released. Regards, Conrad
  3. aehimself

    TPopupMenu with group headers

    I ended up combining the code of @chkaufmann and @Lars Fosdal plus added the always-disabled property. The end result fully supports VCL styles and looks awesome! The full code became: Unit uHeaderMenuItem; Interface Uses Vcl.Menus, Vcl.Graphics, WinApi.Windows, System.Classes; Type THeaderMenuItem = Class(TMenuItem) strict private Procedure SetEnabled(Const inEnabled: Boolean); Function GetEnabled: Boolean; protected Procedure AdvancedDrawItem(ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState; TopLevel: Boolean); Override; Procedure DoAdvancedDrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState); Procedure Loaded; Override; Public Constructor Create(AOwner: TComponent); Override; published Property Enabled: Boolean Read GetEnabled Write SetEnabled; End; Implementation Uses Vcl.Themes, System.SysUtils; Procedure THeaderMenuItem.AdvancedDrawItem(ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState; TopLevel: Boolean); Begin Self.DoAdvancedDrawItem(Self, ACanvas, ARect, State); End; Constructor THeaderMenuItem.Create(AOwner: TComponent); Begin inherited; Self.Enabled := False; OnAdvancedDrawItem := DoAdvancedDrawItem; End; Procedure THeaderMenuItem.DoAdvancedDrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState); Begin ACanvas.Brush.Color := TStyleManager.ActiveStyle.GetStyleColor(scPanelDisabled); ACanvas.FillRect(ARect); ACanvas.Font.Color := TStyleManager.ActiveStyle.GetStyleFontColor(sfWindowTextNormal); ACanvas.Font.Style := [fsBold]; ACanvas.TextRect(ARect, ARect.Left + 3, ARect.Top + 3, StripHotkey(Caption)); End; Function THeaderMenuItem.GetEnabled: Boolean; Begin Result := inherited Enabled; End; Procedure THeaderMenuItem.Loaded; Begin inherited; Self.Enabled := False; End; Procedure THeaderMenuItem.SetEnabled(Const inEnabled: Boolean); Begin inherited Enabled := False; End; End.
  4. Alexander Sviridenkov

    HTML Office Library: Font Browser Demo

    New compiled demo showing font management capabilities of HTML Office Library. it can: Open TTF or WOFF font. Extract embedded fonts of any type from PDF file. Save extracted font as TTF or WOFF. Show font glyphs. Show glyph control points. Copy glyph as SVG. 100 lines of Delphi code. Everything is cross platform (Win, Mac, Linux, iOS, Android) https://delphihtmlcomponents.com/FontBrowser.zip
  5. Marco showed a preview of some of what's new in Delphi 11 yesterday - you can read his blog with screenshots, or watch the video replay, here. I'm also giving a talk today on Usability and Design, in general but also referring to the IDE and some decisions we made there. If you've ever wanted to see an internal mockup of things we did not do, this is the one to watch -- but also, I hope the talk in general will be helpful for anyone who wants to have good design in their app. Join this or the other (really good!) talks today and tomorrow here!
  6. Anders Melander

    RAD Studio 11 Alexandria is now available

    Please do. The name helps no one and just adds confusion. I don't know why they thought it would be smart to name versions. I have to google it every time someone refers to a version by name.
  7. There is another way to prevent instance creation - or at least misuse - having public constructor that raises exception. TSingleton = class private class var FInstance: TSingleton; constructor CreateSingleton; class destructor ClassDestroy; public constructor Create; class function Instance: TSingleton; static; end; class destructor TSingleton.ClassDestroy; begin FInstance.Free; end; constructor TSingleton.Create; begin raise Exception.Create('Singleton instance cannot be directly constructed'); end; constructor TSingleton.CreateSingleton; begin // actual constructor end; class function TSingleton.Instance: TSingleton; begin if not Assigned(FInstance) then FInstance := TSingleton.CreateSingleton; Result := FInstance; end;
  8. OK, it is not official, but I will share some internals here. You can change the titles of the Welcome Page items to clickable links with a secret registry setting: Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\22.0\WelcomePage] "ActivateLinkOnTitle"=dword:00000001
  9. Carlo Barazzetta

    Delphi compatibility with Windows 11?

    Typically, any Delphi app runs smoothly on Windows 11 (I've been using W11 since June). Using an application with native Windows Style, the main differences I found are visible in this form: The window and even the menu have rounded corners The menuitem selected has rounded corners and a smaller area of drawing The major problem is visible in the selected cell of a DbGrid: a strange rectangular and a rounded focused box: very bad to see. If an edit has Ctl3D it works like default in W11: only the bottom border is visible (and colored): when the input receive focus the bottom border gets thicker Selected RadioGroup has a colored border instead of a dot inside. Scrollbars are thiny and enlarged when focused. Buttons are rounded Using a Styled app, all of those problem disappear, but it would be useful to have styles that look like Windows 11, just as Windows 10 styles were created (I hope in the next Delphi 11 release).
  10. If you don't want instances, then don't make it a class - this ain't Java.
  11. Joseph MItzen

    RAD Studio 11 Alexandria is now available

    So you're suggesting a better name would have been Delphi 11 Kabul Edition?
  12. Dalija Prasnikar

    RAD Studio 11 Alexandria is now available

    Africa, Egypt. There was the largest library in ancient world.
  13. With Delphi 11 release a few minutes ago, MMX Code Explorer is already supporting it: Change log V15.0.44
  14. dummzeuch

    FinTech anyone?

    I never heard that term either, but I'm not American. I heard of Fintech though, not sure what it means other than just another buzzword about making money with other people's money.
  15. Angus Robertson

    RAD Studio 11.0 Support

    ICS V8.67 has packages for Delphi and C++ 11.0, currently only available from SVN and the overnight zip, with a final release due next week. http://wiki.overbyte.eu/wiki/index.php/ICS_Download There was a major new OpenSSL 3.0 release this week, just finishing testing and integration with V8.67. Currently, many older ICS icons appeared incorrectly with a magenta background in Delphi 11.0 due to transparency being ignored, these will be fixed for the final release. Angus
  16. Joseph MItzen

    Delphi FireDAC .Post on Firebird table

    That's... not normal. This is as strange to me as the Delphi user on the old forum who said he never uses Delphi strings, only Pchars. You're not supposed to have control; the database is supposed to have control. You declare what you want and the RDMS query optimizer decides the best way to retrieve it. I can guarantee you there's no query optimizer designed with your "another way" in mind.
  17. Hi All FinalBuilder 8.0.0.3035 with Rad Studio 11 support is now available from our website - release notes https://www.finalbuilder.com/forums/t/finalbuilder-8-0-0-3035-released/7115 Automating your Build process is simple with FinalBuilder. With FinalBuilder you don't need to edit xml, or write scripts. Visually define and debug your build scripts, then schedule them with windows scheduler, or integrate them with Continua CI, Jenkins or any other CI Server. Thousands of Software Developers rely on FinalBuilder to automate the build, test and release process. If you are not using FinalBuilder to automate your builds, you are missing out 😉
  18. Suggestion: Throw the ENoConstructException from System.SysUtils, not a regular Exception 😉
  19. darnocian

    Console Manager for the Delphi IDE

    I was not sure if the docking thing would be a hard or not, but decided to give it a shot... and result! Thanks for the feedback.
  20. chkaufmann

    TPopupMenu with group headers

    Thanks for all hints. I created a subclass of TMenuItem and did an override of the AdvancedDrawItem method. In addition I set Enabled=False. Themes are not support, but I don't have that anyway in my application. But so far it looks fine: procedure TMenuGroupItem.AdvancedDrawItem(ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState; TopLevel: Boolean); begin ACanvas.Brush.Color := TColors.Silver.Lighten(50); ACanvas.FillRect(ARect); ACanvas.Font.Color := TColors.SysWindowText; ACanvas.TextRect(ARect, ARect.Left + 3, ARect.Top + 3, StripHotkey(Caption)); end; Christian
  21. Kas Ob.

    Maximum static memory

    Well, this is not short story as there is many things to distinguish between, so i will try to point few things and most likely will miss few things too, thankfully there is others here will help. But first lets make sure we are on the same page as your post combined many things. What did you mean with static ?!! This is unclear, did you mean static memory declared as global in the project ? Here you mentioned static structure, this also unclear, because when you allocate array of "something" then size of this "something" is included in the allocation, the simplest "something" is byte which can be translated to size easily, but when you need a array of record or an instances then the size will depends on the direct size including the hidden ones, example even "array of byte" does include a hidden header which is a record for Size and ReferenceCounter, so that hidden header is 8 bytes on 32bit, but wait it is 16 bytes on 64Bit, notice here that the size does accept 64bit value while Reference Counter is still 4 bytes, but a padding introduced with 4 bytes to align the data on 16 bytes, (alas the padding is in wrong place it should be in the middle !, but this is different story) This is also unclear, how did you hit the access violation while the allocation didn't raise an exception ? In theory if an allocation was success then accessing it should not raise AV. There is, but this depends on few factors. No need to answer any of the above, read the following and then formulate your question(s) accordingly. So instead of answering and commenting on each one of the above, i will go with basic to clear things, and you can comment and ask more in precise way. 1) Windows have hard limit for an EXE size that can be allocated, we must differentiate between EXE on disk and EXE at runtime, see you can declare global vars with huge size that require 1gb or close to 2gb (32bit) at runtime while the EXE size on disk will stay something like 30mb or even 50kb !, on other hand you can build an EXE with size 47GB (random number) on disk while at runtime it is few mb, if you want better understanding of the EXE then you can read the specification of the PE format and this part to be exact is clear enough https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#optional-header-image-only In this quote, the first Image word is referring to the segments(sections) sizes allocated in memory while the second used for the EXE (PE32) size on disk. 2) in (1) i was talking about the EXE size and its impact and limits, which mainly depends on compiled resources, code, and global allocated data, of course constants will be reserve space too, but all of that should not be a problem unless you allocating huge arrays as global vars, which is not recommended, for few reason, like what if there no memory on the system, then you application will fail to run silently, so it is not recommended to use global var with very large size, you are better with runtime/dynamic allocations. 3) We need to understand an allocation of an array of "TSomething", this is simple enough the needed size is CountOfElement*SizeOf(TSomething)+ (ArrayHeader), CountOfElement is exactly equal to Length(Something), while ArrayHeader is either 8 or 16byte, now will this work every time ?, it should but will not work, as there is another hidden factor, which is the Memory Manager, see while the language itself required a header, MM will require additional header(s) or extra information to manage it, i am not sure how much but will be completely a MM thing. 4) Now to the allocation it self and how to use it, lets take SetLength as an example as mostly all behave the same, here we need to understand the Compiler behaviour first, see the following var BytesArr: TBytes; ...... // Compiler will fail to calculate the size right ! SetLength(BytesArr, $7FFFFFFF *3); // almost 3 * 2Gbyte , exactly 3*(2GB-1byte) // OK and will compile SetLength(BytesArr, Int64($7FFFFFFF) *3); // almost 3 * 2Gbyte , exactly 3*(2GB-1byte) Same behaviour on 32bit and 64bit, which is really annoying on 64bit as it fail to make the default as Int64, but that is not critical here, the main point is how to access these elements of BytesArr ? ( i do understand that 32bit will fail to allocate at runtime as mentioned above) Will you use "Index : Integer" ? On 32Bit assuming it did allocate, it will be OK, but on 64Bit it will be a problem as here you need bigger indexing mechanism so the index must be Int64, so if you are allocating huge arrays on 64Bit remember to use Int64. Last thing to say i used and i am using huge arrays but not that size as i don't want my application to fail, i am caching many thing on one server, and it is utilizing something around 16GB in pieces less than 2GB on a server with 32GB RAM, nothing else is running on that server except MySQL with dedicated 8GB memory. Always develop your application with IntergerOverflow and BuferOverflow Enabled, this will save you time and headache later, also in many cases will predict AV before they happen. As a rule of thumb, i always use signed integer for indexing, meaning use Integer or Int64, the other cases to use unsigned is very rare and mostly will be coming form OS API or other 3rd-party libraries, but for you own code try to stick to signed Integers. Try to stick to smaller allocation, it is relatively how much small is small, but hitting 2gb is the limit, also in very cases, as it require from the OS to find such allocation in one piece, this will stress the System memory, remember this, the OS will provide you with such virtual memory, but there is a price to pay, in most cases the price is huge, as the OS will start to paging the memory on its swap file and the performance degradation will be huge, not only you application will suffer but the system application wide. Hope that help, now if you have more questions, please ask.
  22. Dany Marmur

    Delphi FireDAC .Post on Firebird table

    This is about the database and the different ways it allows for the DAC (and thus you) to reduce the use of server resources. I'll not go into details. IBObjects has a very good tutorial on FB transactions you can dive into. There's a lot about OAT and more. The database design is another ballpark but related because of the way you can access you data when you have it normalized correctly. IMHO all you database tables should have a primary key. IMHO autogenerate all keys, either using a sequence or a GUID, do not try to build a key out of "real world data", use indexes for that so that the columns and relations can be changed in production; if for example sizes of garment cannot be expressed with 5 characters any more. XXXXXL might popup up in the future. You would need to change the type of that column. Much trickier and costly if it is a primary key. The value will never have to be displayed to a user, but when you build a REST server you will be so happy you can do idempotent apis by just storing that ID and doing a simple DSQL update. HTH, /D
  23. Ralf7

    RAD Studio 11 Alexandria is now available

    As a Turbo Pascal user from the first hour, I am still following the development of Delphi with interest. I got out with Delphi XE and am amazed to find that people are still struggling with the same problems as they were 30+ years ago. Problems that also occur at other companies, but are completely fixed after a few weeks. Nothing gets better at "Borland".
  24. Lars Fosdal

    TPopupMenu with group headers

    Nice idea, @chkaufmann and nglthach. I had to change it around a little to get it to work, as I instantiate the menu items at runtime. Since I don't assign an OnClick handler, I don't need to disable the entry. I mucked around with colors for a while. Currently using Bold White on DarkGrey which works "ok" for both light and dark themes. type TMenuItemGroup = class(TMenuItem) protected procedure DoAdvancedDrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState); public constructor Create(AOwner: TComponent); override; end; constructor TMenuItemGroup.Create(AOwner: TComponent); begin Inherited; OnAdvancedDrawItem := DoAdvancedDrawItem; end; procedure TMenuItemGroup.DoAdvancedDrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState); begin ACanvas.Brush.Color := TColors.Darkgrey; // TColors.SysHighlight; // TColors.Darkblue; ACanvas.FillRect(ARect); ACanvas.Font.Color := TColors.White; // TColors.SysHighlightText; // TColors.White; ACanvas.Font.Style := [fsBold]; ACanvas.TextRect(ARect, ARect.Left + 3, ARect.Top + 3, StripHotkey(Caption)); end;
  25. 1. Sign your files. Windows Defender heuristics are much more forgiving if an executable file has a valid digital signature. 2. Submit false positive detection: https://www.microsoft.com/en-us/wdsi/filesubmission
×