1st of all, I'm new here and to all of this, so congratulations on a really cool system. I look forward to contributing where I can.
I looked at a bunch of GUI toolkits; CEGUI is the slickest... and that it's not tied to the OS is excellent. Moreover, I needed (and right away) something along the lines of Windows' CFileDialog. I found that in CEGUICommonFileDialog on http://www.ogre3d.org/wiki/index.php/CEGUICommonFileDialog... but it's been a hassle.
Could this feature ever be "more officially" included into CEGUI? I understand that this is a GUI toolkit with which you can construct such dialogs -- and that it is OS-dependent -- but a File Open/Save Dialog is a very ubiquitously-used thing, so it strikes me as being just as important as other "composite" (but perhaps more low-level) GUI controls. Anyway, that's just a suggestion. Maybe a file-access layer could be abstracted out like the renderer is, so that it can be OS independent. I dunno. Probably too much work.
Okay, onto the bug. I'm using CEGUI Mk-2 Release 0.4.1 for VC7.1. I tried using CEGUICommonFileDialog by itself and even as it's included in martignasse's TestaSkin tool (awesome, by the way!); in both I see the same problem.
CEGUICommonFileDialog.h contains this code:
Code: Select all
// ------------------ Inner class that represents drive, path and filename ------------------
class _Path : public ListboxTextItem
{
private:
protected:
public:
_Path(const String& szRelativePath) :
szAbsolutePath(szAbsolutePath),
szRelativePath(""),
ListboxTextItem(szAbsolutePath) {};
virtual ~_Path(void){};
String szAbsolutePath;
String szRelativePath;
};
which I don't understand. In the constructor, he passes in a string to initialize with, but instead initializes a member and the base class constructor using an uninitialized member.
I don't know how this was working for anyone else. On my machine, the uninitialized szAbsolutePath must have "referred" to a huge string, which sent ListboxTextItem into outer space. Windows' pagefile would shoot up over 1.3 GB and the demo would hang.
I changed the constructor to this:
Code: Select all
_Path(const String& szRelativePath) :
szAbsolutePath(""),
szRelativePath(szRelativePath),
ListboxTextItem(szRelativePath) {};
Don't know if that's what he originally intended, but it fixes the problem.
Also, and maybe this is just me, but I find passing in arguments to a constructor/function having the exact same names as members/locals of that function to be strange, and possibly confusing.
Anyway, I'd appreciate any thoughts... Thanks!