Jump to content

Search the Community

Showing results for tags 'tlistview'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 8 results

  1. PawelPepe

    How to free TListView Objects (String)

    Hi, I got a problem with TListView and Data. It seems that I got memory leaks, because Data pointers are not released (if I understand it well). Let me show you what I do: Here is a simple TListView (LV_Data). I add few items to the list (Report Style) into 3 Columns. var i : Integer; ListItem : TListItem; PObject : PChar; for i := 0 to 3 do begin // Caption ListItem := AList.Items.Add; ListItem.Caption := 'My Caption' + '_' + Inttostr(i+1); // Language Name ListItem.SubItems.Add('Language' + '_' + Inttostr(i+1)); // User Name ListItem.SubItems.Add('User Name' + '_' + Inttostr(i+1)); // User Data Path PObject := StrAlloc(250); StrPCopy(PObject, 'PATH_TO_USER_DIRECTORY' + '_' + Inttostr(i+1)); ListItem.Data := PObject; end; As you can see, I also add "hidden" data (in this example a path to directory, as string). I can use it in program, without displaying it to user in listview. I can read it in simple way (for examle, in ListView OnClick event:) var sPath : string; if (LV_Data.Items.Count > 0) AND (LV_Data.ItemIndex <> -1) then begin sPath := StrPas(PChar(LV_Data.Items[LV_Data.ItemIndex].Data)); end; Everything works very nice... but, when I close program, I see there are some memory leaks. --------------------------- Unexpected Memory Leak --------------------------- An unexpected memory leak has occurred. The unexpected small block leaks are: 473 - 520 bytes: Unknown x 3 --------------------------- OK --------------------------- As far as I know, I have to free those List View Data bymyself. How to do this? procedure TMainFrm.LV_DataDeletion(Sender: TObject; Item: TListItem); begin if Item.Data <> nil then begin FreeMem(Item.Data); Item.Data := nil; end; end; Above code not working (why!?), got Invalid Pointer Operation. Could you please tell me how to free this data to avoid memory leak? Thank you in advance, -Pawel
  2. toufik

    Tlistview SQLite pagination

    hello every one ... I'm trying pagination with SQLite database using live binding with a tlistview i did try using this guide: DB Pagination and TListView question - Databases - Delphi-PRAXiS [en] (delphipraxis.net) with some modification so i added the implement of pagination on PullToRefresh of the tlistview and work's fine . the problem that .... i want to keep the items that added to the tlistview every PullToRefresh and so on the code I used, can anyone point me to the right direction. procedure TFormMain.ListView2MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); begin if PullToRefreshCheck then begin if (Y-RefreshPos)>40 then begin if (FDTableTask.RecordCount < lMyMaxRecordsByPage) then exit; // FDTableTask.Disconnect; FDTableTask.FetchOptions.RecsSkip := FDTableTask.FetchOptions.RecsSkip + lMyMaxRecordsByPage; FDTableTask.Open(); Label48.Text := '...تحديث'; Label48.Visible := True; Timer3.Enabled := True; PullToRefreshCheck := False; RefreshPos := 0; end else begin Label48.Text := 'u retched the end '; end; end; bandicam_2023-01-22_20-18-24-671_(1).mp4
  3. sjordi

    TListView swipe in both directions?

    Hi, The TListView component offers just a swipe left to display the Delete button. While it's possible to customize the text with something else, it fires an event only to an Item "swipe left". I'd like to be able to swipe both directions, right and left, in order to check/uncheck (select/unselect) the current item. Any way to easily implement this? Or any available FMX component (even paid) that extends/derives from TListViews? Thanks for any help and suggestion
  4. BennieC

    Listview Programming

    Good day I am trying to build an application which requires me to display multiple images in groups with selectable sizes. The images consist of a bitmap and a text field. My idea is to put the image groups in a TListview (Which I hope can display horizontally) and then add these listview groups into a TFlowlayout to manage the screen layout. However, I simply do not get it right to create a TListview item programmatically to display the image. I have tried to create a TListItemImage as well as simply adding a TListViewItem but neither worked in that I could see anything on the screen. I am including my test code (Note it pulls images from a folder for testing). The commented out sections will probably indicate some of the experiments that I tried. I will probably also struggle to add the TListviews to the TFlowlayout. Some advice will be much appreciated. The idea is that the application will run on both Android mobile as well as desktops. prjFlowLO.dpr prjFlowLO.dproj uFlowLOMain.fmx uFlowLOMain.pas
  5. Hi, in my application I offer to the user the possibility to change style (light/dark) procedure TStartForm.SwitchThemeSwitch(Sender: TObject); begin Datas.StyleBookLight.UseStyleManager:=false; Datas.StyleBookDark.UseStyleManager:=false; if SwitchTheme.IsChecked then MainForm.StyleBook:=Datas.StyleBookDark else MainForm.StyleBook:=Datas.StyleBookLight; datas.parametres.blacktheme:=SwitchTheme.IsChecked; Datas.StyleBookLight.UseStyleManager:=not SwitchTheme.IsChecked; Datas.StyleBookDark.UseStyleManager:=SwitchTheme.IsChecked; {TODO -obug -cGeneral : TListview style don't apply on first lines} end; All is working except on my TListView, as you can see. Here I change from light to dark, font text color is still black on these lines, scrolling down the color is the "normal" white I remember I bang this bug another times, I override this by deactivating and then reactivating the link, but this is time-consuming when there are many records! Is there another way ?
  6. toufik

    TListView Paging

    good morning every one ^^... TListView Paging**** is this look logic to you ? a mobile app + rest . I want to be able to get 10 record every time . so how about putting the last record i get every time and send it back to the server side to get 10 more record starting with it ,,,,and so on ... is this look ok to you thank you
  7. hi, Problem.: 1.- ListView using with DynamiAppearance, using only these kinds of objects.: 2.- I have to create a progress bar in runtime. I want to create/draw a bitmap in runtime. 3.- How to draw a rectangle, and fill it with color. -input data.: 25 -output.: Some bitmap with two rectangle -bitmap Height 10 Width 100 all the time! kind regards kz.
  8. Sherlock

    TListView collapse stuff under a header

    So I built a list of data grouped by devices where this data came from. Each device gets his own header in a TListView followed by its data. Pretty simple and straightforward. Now those lists may get long in total but also per device so I would like to be able to click on a header to collapse its list of data. I'm pretty sure VCL.TListView can do that. FMX.TListView...not so much. At least not that I'm aware of. I'm already having a hard time at getting the click event from a header. All TListViewItems with Purpose set to TListItemPurpose.Header sadly wont fire the OnItemClick event. Did I overlook something or other in the documentation? Anybody have a suggestion as to how this can be accomplished. Thanks in advance.
×