Open file dialog

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

Sairon
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Sun Dec 07, 2008 01:11

Open file dialog

Postby Sairon » Wed Dec 10, 2008 21:59

Hi,

I'm implementing a open file dialog ( doesn't seem to exist one from the get go, correct? ). I'd love to get some feedback since I'm totaly green with CEGUI, to make sure that I'm going about this correctly and that it meshes with the general architecture of CEGUI.

I should probably start out by creating a layout file defining the different basic elements right? This seems pretty straightforward. Now the tricky part after I got the layout going is that I need to integrate it with the code back end. There doesn't seem to be any framework for dialogs, so how would one go about this? Inheritance from FrameWindow would probably grant me all the functionality I would need to contain and manage the sub elements. This doesn't feel correct at all though, I just want to create an object which take cares of the different events and updates the sub elements, and is managed by CEGUI. What is the correct way to implement such a dialog in CEGUI?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Wed Dec 10, 2008 22:09

Hi :)

Yeah there are no "higher-level" elements such as common dialogs in CEGUI at present.

The way I would suggest you go about this is to have a new class that represents the dialog (not subclassed from anything in CEGUI, we're not an application framework in the same manner as MFC or similar). This new class would oversee loading the layout as needed, attaching to the current gui sheet (if you're going that route). The class would subscribe handlers to the various sub-components of the dialog to hear about user interaction and deal with those accordingly. The class would provide member functions to set the title, the initial directory and what have you, and also to fetch the current status of the dialog, and - obviously - get get the selected file and or directory ;)

You might also like to look at the common file dialog that exists on the Ogre Wiki - here

CE.

Sairon
Not too shy to talk
Not too shy to talk
Posts: 22
Joined: Sun Dec 07, 2008 01:11

Postby Sairon » Wed Dec 10, 2008 22:12

Cool, thanks :)

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 » Thu Dec 11, 2008 11:59

Here's another link, showing a folder selector:

http://www.cegui.org.uk/wiki/index.php/Folder_Selector
Check out my released snake game using Cegui!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 4 guests