CEGUI Layout Editor (Update 1)
Progress has been good over the past few days of working on the editor. I've been implementing more logic for handling the designing of GUIs as well as adding some features that are vital for efficient GUI designing. I still have a bit of work to do and code to cleanup, but things are looking very good right now.
Here are some updated development screenshots.
I added the ability to easily resize the application to commonly used screen resolutions. I took this idea from the original CELayoutEditor because it allows designers to get an idea of proportions across different sized screens. I'll add the ability to hide the property inspection as well later.
I added a "locking" feature to controls to prevent them from being modified. I felt that was a necessary feature to help keep from messing up your GUI accidentally as you work with more controls. In this image, I show the logic of not being able to delete a group of controls if one is locked. This is the only operation implemented this way. If you were to instead move or resize those controls, the action would only process for unlocked controls.
I load the available types of controls from a CEGUI scheme file, but have added in hard coded logic to only show the controls implemented. Each control type has additional fields for default X, Y, Width, and Height that you can set by expanding the menu on the right. This was done so you don't always have to have controls placed in inconvenient locations or sizes each time.
My current "todo" list for this project:
- Code project save/load system
- Code the export to CEGUI system
- Implement more base controls
- Implement custom controls that are themed to CEGUI graphics
- Implement custom objects that hold special properties for different types of CEGUI components (right now all controls share the same base class)
- Tie in the Undo/Redo and Cut/Copy/Paste systems (part of the base code I am using)
- Implement control formatting (align, size, space)
- Implement "Select All"
- Implement keyboard accelerators (ctrl + keys)
- Implement user settings save/load for application
- Code cleanup and optimization
I've had to come up with some "workarounds" due to the design of some C# controls and how the internals work. The "Locking" system was tricky because components are subclassed for resizing and if you try to cancel events for the resize via grips, your application crashes with an exception. Likewise, resizing controls in a certain fashion will result them moving, so I had to come up with a way to avoid all of that. I just saved the last value on each change and if it's locked, restore those values.
The mouse position required a bit of extra work because of how events are sent to the controls themselves. As a result, I could be at 400, 300 in the GUI but it'd be 0, 0 if it were on the top left corner of a control. For this issue I just get the location of the control and add offsets of the mouse move message to get the cursor position when it is inside the DesignSurface object.
Maintaining the correct View required a bit of thought as well for a polished system. When the user maximizes the application and then restores it, I had to come up with a simple way to restore the selection. This turned out to be a simple storing the last control selected and detecting the maximize event from a Resize and setting it accordingly.
That's about it for now. I'll probably slow down development this weekend on it to work on a few other things and then get back to full steam once the week starts.
0 Comments
Recommended Comments
There are no comments to display.