Menu

ListBox Tutorials

nvellios
2007-10-30
2012-09-26
  • nvellios

    nvellios - 2007-10-30

    Does anybody know of some good listbox/listview tutorials and examples in C (Not C++, not C#) that will compile fairly easily on Dev C++?

    I am looking to do some things like drag/drop, and data storage.

    I want a listbox (or listview, but I am using a listbox at the moment) that will hold some items, for example:

    item 1
    item 2
    item 3
    item 4
    item 5

    But I also want to be able to store other data about those items. I am creating an gif animation program and I want to store info like filepath, frame delay, transparency, frame #, filename, x position, y position etc....

    I tried using a typedef struct, but when I delete items, it messes everything above that up. So I tried writing some code to where I had a 2nd struct, and the contents were copied into the 2nd struct, then copied back in sequence without the deleted item but I couldn't get the damn thing working.

    So I was hoping there were some examples that you guys are aware of that showed to how do this type of data storage.

     
    • Anonymous

      Anonymous - 2007-10-31

      Of course I have not a crystal ball, and less in this changing matter, but things seem in that direction.

      Old newbie

       
    • Anonymous

      Anonymous - 2007-10-30

      > ... showed to how do this type of data storage.

      I'm unsure of what exactly you try to do, and can't give you the address of some tutorial, and yes, from a time a go, all search in Google tend to be related with tutorials in C#, MS VC++ MFC and .NET, so I believe that even googling may be hard to find what you want
      The pure C/C++ Windows API tend to be thing of the neanderthal people :-(

      In despite the above, I can give you some light in the matter. Really nor ListBox nor LisView are components appropriate to keep data (but to show data), but there can be some tricks. For example, in a Listbox, besides the information contained in each line (text) there can be a value that you can use to reference any data. Just now I'm using that to store the index of a record in a SQL table. Also may be a pointer to an multidimensional array, a binary tree or some like that.

      The same with the ListViews, although in this case, sometimes I've used a hidden column (wide = 0) to store auxiliary data. In this last case, at the cost to use printf/atol to convert numeric to literal data.

      In despite of my proverbial bad english HTH.

      Old newbie.

       
    • nvellios

      nvellios - 2007-10-31

      So is Microsoft trying to phase out C/C++ in favor of C#?

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.