Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 07/30/23 in Posts

  1. 3ddark

    Simple ORM

    Delphi Simple ORM using ZeosDBO https://github.com/3ddark/delphi-orm-test Two different version. v2 supported actions function GetList(AClass: TClass; var AList: TArray<TTable>; AFilter: string; ALock: Boolean; APermissionCheck: Boolean=True): Boolean; function GetListCustom(AClass: TClass; var AList: TArray<TTable>; AFields: TArray<TFieldDB>; AFilter: string; ALock: Boolean; APermissionCheck: Boolean=True): Boolean; function GetOne(ATable: TTable; AFilter: string; ALock: Boolean; APermissionCheck: Boolean=True): Boolean; overload; function GetOneCustom(ATable: TTable; AFields: TArray<TFieldDB>; AFilter: string; ALock: Boolean; APermissionCheck: Boolean=True): Boolean; overload; function GetOne(ATable: TTable; AID: Int64; ALock: Boolean; APermissionCheck: Boolean=True): Boolean; overload; function GetOneCustom(ATable: TTable; AFields: TArray<TFieldDB>; AID: Int64; ALock: Boolean; APermissionCheck: Boolean=True): Boolean; overload; function Insert(ATable: TTable; APermissionCheck: Boolean=True): Boolean; virtual; function Update(ATable: TTable; APermissionCheck: Boolean=True): Boolean; virtual; function CustomUpdate(ATable: TTable; AFields: TArray<TFieldDB>; APermissionCheck: Boolean=True): Boolean; virtual; function DeleteBatch(AClass: TClass; AFilter: string; APermissionCheck: Boolean=True): Boolean; overload; function DeleteBatch(ATables: TArray<TTable>; APermissionCheck: Boolean=True): Boolean; overload; function Delete(ATable: TTable; APermissionCheck: Boolean=True): Boolean; virtual; function LogicalSelect(AClass: TClass; var ATable: TTable; AFilter: string; ALock, AWithBegin, APermissionCheck: Boolean; AProcBusinessSelect: TBusinessSelectEvent): TEntityManager; virtual; function LogicalInsert(ATable: TTable; AWithBegin, AWithCommit, APermissionCheck: Boolean; AProcBusinessInsert: TBusinessOperationEvent): Boolean; virtual; function LogicalUpdate(ATable: TTable; AWithBegin, AWithCommit, APermissionCheck: Boolean; AProcBusinessUpdate: TBusinessOperationEvent): Boolean; virtual; function LogicalDelete(ATable: TTable; AWithBegin, AWithCommit, APermissionCheck: Boolean; AProcBusinessDelete: TBusinessOperationEvent): Boolean; virtual; procedure Listen(ATableName: string); virtual; procedure Unlisten(ATableName: string); virtual; procedure Notify(ATableName: string); virtual; function IsAuthorized(ATableSourceCode: string; APermissionType: TPermissionType; APermissionCheck: Boolean; AShowException: Boolean=True): Boolean; procedure Start(AConnection: TZAbstractConnection = nil); procedure Commit(AConnection: TZAbstractConnection = nil); procedure Rollback(AConnection: TZAbstractConnection = nil); frmMain contain example for using methods
  2. Alexander Sviridenkov

    ANN: HTML Office Library 4.7 released

    The only native Delphi library for reading and displaying documents in 19 formats: Word, Excel, Powerpoint, PDF, EPUB, Outlook and much more. Whats's new 1. Support for MBOX files (Thunderbird and other mail app. mailboxes) 2. Support for CHM (help) file format. 3. Support for CSV (displayed as table). 4. Support for DOC 6-95 format. 5. Support for old XLS format. 6. Encoding detection for text files. 7. Support for PICT format (embedded to some office documents) 8. Support for JPX (JPEG2000) - currently using openjpeg. 9. PDF conversion was completely rewritten: Big improvements in PDF rendering quality. Better text extraction from PDF (space detection, hyphenation handling). Faster PDF conversion - 1000 pages / sec. Less memory consumption for conversion of big PDF files. SIMD optimized image conversion for PDF (color spaces, masks, etc.). 10. Improvements in PPTX, DOCX and XLS. 11. Faster text extraction for all formats. 12. Added document properties Authod, Keyword, Modified, Created. 13. Search engine was completely rewritten: 14. Smaller index and faster than all similar products (dtsearch, docfetcher, copernic, x1, etc.), search for word sequence. 15. Support for highlighting of code files (PAS, C++, JS, etc.) 16. DarkMode property - convert styles to dark theme. 17. ImageConverted now has CanvasClass property (canvas is used in HTML to PNG conversion). 18. ODTTF format support 19. TOTFFont now supports adding ligatures 20. FileBrowser demo no more requires VirtualTrees. 21. New demo - PPT file explorer. Demos: https://delphihtmlcomponents.com/FileBrowser.zip - file viewer. https://delphihtmlcomponents.com/codefinder.html - full text search engine / document viewer. https://delphihtmlcomponents.com/office.html
  3. I added a sample for send/receive strings over a Socket here : https://github.com/DeveloppeurPascal/Delphi-samples/tree/main/Network-Samples/01-TSocket it could inspire you. 😉
  4. Martifan

    [Android] How to put data from a dataset into a listbox?

    The way you're currently doing this is creating a new TListBoxItem for each row of data, and then applying the styles and setting the data for each. This is a relatively expensive operation, particularly if you're doing it hundreds of times in a loop. Instead, consider batching your data updates. One common way to do this is to create a list of objects (each containing the three pieces of data for each row), and then update the ListBox with this list all at once. To do this, you could define a simple class to hold your data: type TListBoxData = class Definition: string; Qty1: string; Qty2: string; end; Then, you could create a list of these objects and fill it with your data: var DataList: TObjectList<TListBoxData>; i: Integer; Data: TListBoxData; begin DataList := TObjectList<TListBoxData>.Create; try for i := 0 to ... do begin Data := TListBoxData.Create; Data.Definition := value1[i]; Data.Qty1 := value2[i]; Data.Qty2 := value3[i]; DataList.Add(Data); end; UpdateListBox(DataList); finally DataList.Free; end; end; Then, in your UpdateListBox procedure, you could loop through this list of data objects and add them to the ListBox: procedure TForm1.UpdateListBox(DataList: TObjectList<TListBoxData>); var i: Integer; ListBoxItem: TListBoxItem; begin ListBox1.BeginUpdate; try for i := 0 to DataList.Count - 1 do begin ListBoxItem := TListBoxItem.Create(ListBox1); ListBoxItem.Parent := ListBox1; ListBoxItem.StylesData['Reference.text'] := DataList[i].Definition; ListBoxItem.StylesData['Qty1.text'] := DataList[i].Qty1; ListBoxItem.StylesData['Qty2.text'] := DataList[i].Qty2; ListBoxItem.ApplyStyleLookup; end; finally ListBox1.EndUpdate; end; end; This will allow you to create and set up all your TListBoxItem instances in one batch, which should significantly improve performance. If you still experience performance issues, you may want to look into using a virtualized list control that only creates and renders items as they're needed. This can significantly improve performance when dealing with large amounts of data. Please note that this code was written in Delphi since you posted Delphi-like code, but you mentioned Android in the beginning. If you're using Kotlin or Java for Android development, the approach would be different
  5. Martifan

    FMX Tabcontrol Tab Hight

    On mobile platforms like iOS and Android, setting the TabHeight property directly on the TabControl doesn't work as expected. The tab height is determined automatically based on the platform and controls used. Instead, to increase the tab height you need to modify the TabControl's style. Here are a couple options to try: Set the TabControl's StyleLookup property to 'tabcontrolstyle' and modify that style in the Styles Designer. Increase the height of the tab elements in the style. Clone the default TabControl style, give it a new name like 'TabControlStyleBig', and modify the tab height there. Then set your TabControl.StyleLookup to that new style name. Set the TabControl's Style property directly in code instead of using StyleLookup. Modify the Tab tabOffset and Tab tabHeight style elements. For example: TabControl1.Style.StyleElements := [seTab, seClient]; TabControl1.Style.SetElementStyle(TabControl1.Style.GetElement(seTab), [], [tsTabHeight, 70]); The key is that the tab height can't just be directly set on mobile - you have to go through the control's style. Check the documentation on TTabControlStyles and styling for more details.
  6. Serge_G

    corrupt primary key?

    I was thinking this way, even if I don't know it could solve your problem
×