Jump to content

limelect

Members
  • Content Count

    913
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by limelect

  1. limelect

    Listview data problem

    I hope I explained my problem with the listview I have 2 pictures and 2 text Adding text ,the text items is OK, but Adding 2 pictures is the problem PListItemData = ^TListItemData; TListItemData = record theString: string; ThePicture: TBitmap; end; b: Tbitmap; <<<< is created at oncreat. var ClipItem: TListItem; ListItemData: PListItemData; while not FDQuery2.Eof do begin ------ process Query ClipItem := lvClip.Items.Insert(0); New(ListItemData); try ListItemData.theString := s.Text; <<< OK if ContainsText(s.Text, 'Picture') then begin b.Assign(nil); BlobField := FDQuery2.FieldByName('Image') as TBlobField; Stream := FDQuery2.CreateBlobStream(BlobField, bmRead);<<< read the picture b.LoadFromStream(Stream); ListItemData.ThePicture := TBitmap(b); <<<< get also the picture FreeAndNil(Stream); end; ClipItem.Data := ListItemData; except Dispose(ListItemData); end; FDQuery2.Next; end; No problem, no leak BUT !!!! Now to the problem of looping twice PListItemData(lvClip.Items[0].data).ThePicture <<<< first picture PListItemData(lvClip.Items[0].data).TheString <<< first text OK Second time in the loop PListItemData(lvClip.Items[1].data).ThePicture <<< got second picture PListItemData(lvClip.Items[1].data).TheString <<< second text OK But now PListItemData(lvClip.Items[0].data).ThePicture got the second picture SO, more explanation. The first item got the second picture!!! But the text is OK it has 2 texts no problem On the breakpoint, I see the watch list as PListItemData(lvClip.Items[0].data).ThePicture PListItemData(lvClip.Items[0].data).TheString PListItemData(lvClip.Items[1].data).ThePicture PListItemData(lvClip.Items[1].data).TheString
  2. limelect

    Listview data problem

    @Remy Lebeau To begin, thank you for helping a lot I cannot put here what I did, as it has too many places fixed. those 2 lines PListItemData(lvClip.Selected.Data).ThePicture.Free; Dispose(PListItemData(lvClip.Selected.Data)); were added in many places, and more my software closes nicely without any leaks So thanks again
  3. limelect

    Listview data problem

    Ok, I did a very simple test One line of text and delete then if ListItemData.ThePicture.empty then exit ;<<<<<<<<<<<< error cannot check ListItemData.ThePicture.Free; If I check with nil ListItemData.ThePicture is NOT nil I will keep checking to find what's going on.
  4. limelect

    Listview data problem

    Surely I followed your suggestion, which works OnDeletion is not done only if I want to delete Only if I delete a line in the list, unless I do not understand you This is why I have a form onclose. From the source New(ListItemData); try ListItemData.theString := s.Text; if ContainsText(s.Text, 'Picture') then begin ListItemData.ThePicture := nil; BlobField := FDQuery2.FieldByName('Image') as TBlobField; Stream := FDQuery2.CreateBlobStream(BlobField, bmRead); ListItemData.ThePicture := TBitmap.Create; ListItemData.ThePicture.LoadFromStream(Stream); FreeAndNil(Stream); end; ClipItem.Data := ListItemData; except ListItemData.ThePicture.Free; Dispose(ListItemData); end; lvClip.Items.EndUpdate; FDQuery2.Next; end; s.Free; That's it, nothing else Ok, let me explain the application. Sometimes you have text only, and at times text and Bitmap on the same line So I check for bitmap nill, but something fishy is that beside the above
  5. limelect

    Listview data problem

    @Remy Lebeau Obviously, it works, but using this, free gives an error D10,2,3 procedure TMyForm.lvClipDeletion(Sender: TObject; Item: TListItem); var ListItemData: PListItemData; begin ListItemData := PListItemData(Item.Data); if ListItemData <> nill then begin ListItemData.ThePicture.Free; <<<<<<<<<<<<<<<< error Dispose(ListItemData); end; end; On vcl.control procedure TWinControl.MainWndProc(var Message: TMessage); begin try try WindowProc(Message); finally FreeDeviceContexts; FreeMemoryContexts; end; except Application.HandleException(Self); <<<<<<<<<<<< error end; end; I wanted to add this to the program close procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction); var i: Integer; ListItemData: PListItemData; begin for i := 0 to lvClip.Items.Count - 1 do // if lvClip.Items.Data <> nil then begin ListItemData := PListItemData(lvClip.Items.Data); if ListItemData <> nil then begin // PListItemData(lvClip.Items.Data).ThePicture.Free; ListItemData.ThePicture.Free; <<<<<<<<<< Error and // Dispose(ListItemData); <<<<<<<<<<< I cannot use this as it gives many more errors end; end; end; Any Idea ?
  6. limelect

    Listview data problem

    Thanks I will try it
  7. limelect

    ToolBar just knoledg

    I copied a toolbar from the Gexpert procedure list form Now, someone can explain The toolbar is on a NEW FORM. As one can see from the DFM, it has 2 sections object ToolBar: TToolBar Left = 0 Top = 27 Width = 552 Height = 22 AutoSize = True DisabledImages = dmSharedImages.DisabledImages <<<<<<< Images = dmSharedImages.Images<<<<<<<<<<<<< And the buttons show the icons On the form, there are no uses !!!! for it Can anyone explain why I see pictures on the buttons? Is it because GEXPERT is in my IDE? This means I can use all Delphi resources, even if they are hidden. P.S. Running this form, the icons disappear !!!
  8. limelect

    ToolBar just knoledg

    @Uwe Raabe I thought so as long as the Gexpert DLL is installed. @Lajos Juhász Is wrong. I suggest you try it, it's so simple to do. The toolbar pictures will not disappear
  9. limelect

    [Open Source] Delphi Youtube Downloader

    Yes, it took a while to cook
  10. limelect

    [Open Source] Delphi Youtube Downloader

    This is a guy not worth considering why https://github.com/mesutde/Delphi-Youtube-Downloader/issues/1 does not respect the knowledge of others "I'm currently downloading a video that you can't download. First, improve yourself." Sorry, usually I do not respond, but in this case, he made me angry
  11. limelect

    ToolBar just knoledg

    @Die Holländer My problem is understanding why I see the bmp on the keys, even though I have no link to any bitmaps Just try it and see if you can explain the phenomenon Get Gexpert procedure list from the source and copy the toolbar to a new form That's it.
  12. limelect

    ToolBar just knoledg

    Inside the Gexpert DLL
  13. limelect

    ToolBar just knoledg

    The only way it knows is from the Gexpert DLL, which means that it has hidden resources. Try it yourself and see if you have the Gexpert source P.S. I just copied the toolbar from the FORM ( procedure list), nothing else!!!!!!!!!!!
  14. limelect

    D12.3 Error when closing

    It does not matter. Things can fail on restart and then go back to OK. It happens to me hundred of times.
  15. limelect

    D12.3 Error when closing

    Read carefully this is my experience similar to yours
  16. In order to test your idea, is it possible to put it here a full source as there are a lot of unknown
  17. limelect

    Creating an app to play Youtube videos

    This is my free application https://limelect.com/downloads/youtube_downloader_shell/ That is a shell for youtube-dl proven application
  18. That's not important as the application you give can be done with TMS-rich with one line of code!!! So good luck
  19. And the source? TMS-rich does that So what's so special?
  20. limelect

    Richedit

    I am trying to understand my problem with reverse HEBREW TEXT. I have 3 rich edit components and a memo for testing. RichEdit1, jvRichEdit, and AdvRichEditor jvRichEdit and AdvRichEditor reverse my string(my Hebrew name) The source is a Richedit file. procedure TForm1.BitBtn2Click(Sender: TObject); var s: TStringList; begin s := TStringList.Create; OpenDialog1.Filter := 'RTF files (*.rtf)|*.rtf|Any files (*.*)|*.*'; if OpenDialog1.Execute then begin AdvRichEditor1.Clear; RichEdit1.Clear; jvRichEdit1.Clear; RichEdit1.Lines.LoadFromFile(OpenDialog1.FileName); jvRichEdit1.Lines.LoadFromFile(OpenDialog1.FileName); s.LoadFromFile(OpenDialog1.FileName); Memo1.Clear; memo1.Text := RtfToText(s.Text, true); <<<< procedure from the Internet AdvRichEditor1.InsertText(0, memo1.Text); <<<<< Inserting memo text to ADVrich is OK AdvRichEditor1.Repaint; AdvRichEditorRTFIO1.Load(OpenDialog1.FileName); <<<<< reverse Hebrew string s.Free; end; end; My main rich is AdvRichEditor. P.S My final file contains pictures too Unless I have to go into the sources any solution? Untitled_1.bmp
  21. https://www.habarisoft.com/scroogexhtml/9.2.1/ScroogeXHTMLDemo.zip does not work wants resources
  22. limelect

    Has the toolbar problem been fixed?

    @Uwe Raabe Since I have been with Delphi since #1, History proved that there are a few stable versions. In my D10.2.3, GetIt does not work, but that does not impair work, for example And I am not alone on this matter
  23. limelect

    Has the toolbar problem been fixed?

    Sorry, I do not want to move to the newer Delphi after seeing all those problems I know Embaecadero hase to make money, but my stable Delphi is more important to me.
  24. limelect

    Realy ?

    https://readwrite.com/the-nsa-list-of-memory-safe-programming-languages-has-been-updated/ The US government says it would be better for them if you ceased using C or C++ when programming tools In no particular order, the NSA suggests these memory-safe programming languages Go Rust C# Swift Java Ruby Python Delphi/Object Pascal <<<<<<<<<<< waaaa Ada
  25. limelect

    Realy ?

    Are we in the wrong business? https://www.tiobe.com/tiobe-index/ https://www.tiobe.com/tiobe-index/python/ https://www.tiobe.com/tiobe-index/delphi-object-pascal/
×