how to display filetypes

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Ninja
Quite a regular
Quite a regular
Posts: 86
Joined: Sun Aug 20, 2006 11:42

how to display filetypes

Postby Ninja » Wed Sep 03, 2008 12:58

Hi Guys

how can i display all files in a folder in a combobox they will mainly be mp3 type files then dispaly the file name in a editbox

and what would be better for this a listbox or combobox


TIA

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Wed Sep 03, 2008 13:17

Hi,

Cegui does not provide such browse features, you'd need a local API to browse a directory for files. After that it's mainly storing all found entries in your list, like you had to do earlier when storing Image names into a ListBox :)

The list type mainly depends on your specs. A Combobox already has an Editbox for example, which might make things a bit more straightforward.

HTH.
Check out my released snake game using Cegui!

Ninja
Quite a regular
Quite a regular
Posts: 86
Joined: Sun Aug 20, 2006 11:42

Postby Ninja » Thu Sep 04, 2008 12:28

hi ScriptKid

thanks for your answer could i use the win32 api for this ? and if so do you know of any examples of this.


TIA

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Fri Sep 05, 2008 18:47

Yes, you need a combination of FindFirstFile and FindNextFile, as shown in this sample: http://msdn.microsoft.com/en-us/library/aa365200(VS.85).aspx

It's a bit verbose, but you need the part from:

Code: Select all

// Find the first file in the directory.

   hFind = FindFirstFile(szDir, &ffd);


And the the loop below it.

HTH :)
Check out my released snake game using Cegui!

Ninja
Quite a regular
Quite a regular
Posts: 86
Joined: Sun Aug 20, 2006 11:42

Postby Ninja » Sat Sep 06, 2008 11:45

Hi ScriptKid

Thanks for the help much appreciated


Return to “Help”

Who is online

Users browsing this forum: No registered users and 23 guests