PyCegui

dermont

28-09-2005 19:40:38

This is a follow on from my previous post in the main forum regarding dynamic casting and pycegui. I know that this is not a priority given your current workload, fair enough. Will you be still be accepting patches etc for pycegui?

I've been experimenting with pycegui bindings under mingw and made 3 or 4 (probably uneeded / wrong) changes, though still not enough to make it completely useable.

Anyway here's a shot of the cegui meshviewer using pyogre / pycegui. Some really ugly hacks (particularly the list box), and no event handling (mouse in window)

http://img175.imageshack.us/my.php?image=pyceguimeshviewer7ql.jpg

fog

28-09-2005 19:49:03

First of all, great work!, really.

I will surely accept CEGUI related patched (well, in fact I'll gladly accept any kind of patches) and apply them ASAP (usually that means a couple of hours for small patches.)

Just send them to me or upload them to berlios patch tracker.

BerndWill

28-09-2005 21:12:27

Superb work, dermont !!

Greetings
Bernd

dermont

29-09-2005 17:37:46

Fog wrote:
First of all, great work!, really.


Actually all I did was convert the existing ogreaddons cegui meshveiwer demo to python (or something that resembles python).

All the great work has been done by you and Clay (and the author of the original viewer).

I'll try sending you the source and any changes I've made tomorrow.

dermont

10-10-2005 20:25:19

I'm using cegui 0.30 / mingw. What is the correct way to create a ListboxItem / ListboxTextItem and add it to a Listbox via Listbox.additem(*args).

For the simple ceguimeshviewer demo above I'm using a method which involves some really nasty (and wrong) hacks to Listbox.i.

Clay

14-10-2005 03:27:58

Does anyone know the current state of PyCEGUI? I haven't gotten around to dermont's patch yet because we don't really have a good CEGUI demo I can use as a testbed. Our little demo in sandbox works, but the subscribeEvent methods aren't working (so we can't have the quit button actually quit).

Has anyone worked around this? Does anyone have working python code that shows it working, or can we say that it doesn't work right now? If it doesn't I'll get started on seeing if I can do something about it.

Thanks

dermont

14-10-2005 08:06:00

Edit: 16:30, to better illustrate problem (4).

I think we can we say that it semi-works. As far as I can see the current status of pyCEGUI is as follows:

Version
- Runs in current state Cegui 0.30 and Cegui 0.4

Not Wrapped / No interface Files

#Combo
CEGUICombobox
CEGUIComboDropList
#Drag Drop
CEGUIDragContainer
#Menu
CEGUIItemEntry
CEGUIItemListBase
CEGUIMenubar
CEGUIMenuBase
CEGUIMenuItem
CEGUITextItem
CEGUIPopupMenu
#ToolTip
CEGUIToolTip


Problems


1) No Event Handling
- subscribeEvent doesn't work not wrapped, in CEGUIEventSet.i
%ignore CEGUI::EventSet::subscribeEvent;

- subscribeScripted Event doesn't work (not too sure if only applies to Lua)

2) There appears no way to add a list box item Listbox.additem(*args) using ListboxItem or ListboxTextItem.

Run Error TypeError: argument number 2: a 'ListboxItem *' is expected,
(a) 'PySwigObject(_p_CEGUI__ListboxItem)' is received
(b) 'PySwigObject(_p_CEGUI__ListboxTextItem)' is received

I'm sure similiar problems occur for MultiColumnList etc. This is a show stopper in terms of testing.

3) ImageSet not working, error not supported think this is because the Image stuff not wrapped in ogre

[Edit Begin ------]
4) Problem creating a cegui.window and accessing it's base properties, eg:

# cegui, add a multicolumnlist
multi = cegui.WindowManager.getSingleton().createWindow("TaharezLook/MultiColumnList", "a MultiColumn List")
sheet.addChildWindow(multi)
multi.position = cegui.Point(0.0,0.0)
multi.size = cegui.Size(0.5,0.35)
multi.addColumn('Column1',1,0.5)

Crashes on addColumn(....)
[Edit End ------]




Workarounds

1. Get the window currently clicked from cegui.System.getSingleton().windowContainingMouse eg:


def mousePressed(self, mouseEvent):
button = self._convertOgreButtonToCegui(mouseEvent)
cegui.System.getSingleton().injectMouseButtonDown(button)

# ------------------------------------------------------
# Real Hack Test Compare the windows name against
# the window containing the mouse
# ------------------------------------------------------
win_mouse = cegui.System.getSingleton().windowContainingMouse

if (win_mouse.name=='QuitButton'):
self.stopMainLoop = 1
if (win_mouse.name=='PrintButton'):
..whatever


You could also use generic control handling:

..
if (win_mouse.type=="TaharezLook/RadioButton"):
print win_mouse.selected
..


2. Update listbox to additem eg listbox.addItemText(id,text). Plainly wrong
3. Unknown
4. Patch 633

There appears to be a problem with dynamic casting , consider:
class ButtonBase(Window):
class Checkbox(ButtonBase):

The patch casts a Window to a Buttonbase, but I cant get/set properties for the Checkbox. To work around this I've updated CEGUIButtonBase.i to cast ButtonBase to Checkbox/ PushButton etc.


%apply SWIGTYPE *DYNAMIC {CEGUI::ButtonBase *};

// DYNAMIC CAST of CEGUI:ButtonBase

%{
static swig_type_info *
_cast_CEGUI__ButtonBase(void **ptr) {
CEGUI::Checkbox *a1 = dynamic_cast<CEGUI::Checkbox*>((CEGUI::ButtonBase*)*ptr);
if (a1) {
*ptr = (void*)a1;
return SWIGTYPE_p_CEGUI__Checkbox;
}

CEGUI::RadioButton *a2 = dynamic_cast<CEGUI::RadioButton*>((CEGUI::ButtonBase*)*ptr);
if (a2) {
*ptr = (void*)a2;
return SWIGTYPE_p_CEGUI__RadioButton;
}

CEGUI::PushButton *a3 = dynamic_cast<CEGUI::PushButton*>((CEGUI::ButtonBase*)*ptr);
if (a3) {
*ptr = (void*)a3;
return SWIGTYPE_p_CEGUI__PushButton;
}

CEGUI::TabButton *a4 = dynamic_cast<CEGUI::TabButton*>((CEGUI::ButtonBase*)*ptr);
if (a4) {
*ptr = (void*)a4;
return SWIGTYPE_p_CEGUI__TabButton;
}

return 0;
}
%}

DYNAMIC_CAST(SWIGTYPE_p_CEGUI__ButtonBase, _cast_CEGUI__ButtonBase);


PLEASE PLEASE any comments on this would be appreciated. The same problem apply to StaticText.

I've started on the missing Menu interface files, encountering same problems as (4) and addPopuMenu(2).

I've sent you may sample py files used for my own testing, it is based on Patch 633 and updates to ButtonBase.i. If you want me to put create a sample based on your own testcegui.py I will.

Clay

16-10-2005 00:28:03

This is very nice work. I've applied this patch and your change to ButtonBase as well, though I have wrapped all of the ButtonBase changes into CEGUIWindow.i. We don't actually need to convert to ButtonBase since it contains a pure virtual function. We can just use all of the subclasses.

I'm going to get to work on wrapping some of the other classes that are needed. After that I need to figure out why the program is crashing when I hit exit. There is a specific order of destruction for CEGUI/Ogre/Renderers that I need to ensure gets done properly.

The event handling is a huge problem. I know how to do it, but I'm not sure how to do it without leaking memory. =)

dermont

16-10-2005 04:21:11

@Clay, I've done much the same for the Static Text(Static) and Static Image(Static) and wrote a demo to show it working nicely - changing colours etc.

I'll take a look at how you wrapped the ButtonBase changes into CEGUIWindow.i and do similiar before submitting a patch.

There still appears to be the problem of creating and adding items - for example the list box Listbox.additem() and similiar problems for the MultiColumnList.

If we could resolve the listbox/MCList problems we could create a MultiColumn list that when clicking on a control shows it's properties and allows said properties to be changed interactively.

This would really speed up testing etc.

Point (3) isn't clear and refers to CEGUI texture for the RTT. This looks like it may be due to the code, I'll take another look at that.

Thanks for the feedback, greatly appreciated.

Clay

16-10-2005 04:44:12

I've finished wrapping all of the unwrapped classes you listed earlier. I'm finnishing work on TabPane right now, and I'll add dynamic cast for StaticImage and StaticText while I'm at it.

I've changed the pattern for dynamic casts from this:
CEGUI::MultiLineEditbox *a1 = dynamic_cast<CEGUI::MultiLineEditbox*>((CEGUI::Window*)*ptr);
if (a1) {
*ptr = (void*)a1;
return SWIGTYPE_p_CEGUI__MultiLineEditbox;
}


To this:
if (dynamic_cast<CEGUI::MultiLineEditbox*>((CEGUI::Window*)*ptr))
return SWIGTYPE_p_CEGUI__MultiLineEditbox;


Assigning the ptr to be the casted value has no affect in this case. You are assigning a memory value back to itself. It's just a needless copy. The second code (which only tests to see if the dynamic_cast is successful) works just the same, only faster.

Problems:
1) No progress.
2) This is a very strange problem. I've never seen this happen, and it's obvious that SWIG should have figured this out. I'll have to investigate further.
3) The image set in your example code doesn't work because you are misusing Texture::createTexture. See the API to double check you are doing this correctly.
4) I was going to play with that code, but I'm not sure where to use it. Would you mind opening up sandbox/testcegui.py and showing me where this should go? (The current sandbox/testcegui.py is a modification of the code you sent me in an email.)

Edit: Be sure to update SVN, I commit very often.
Edit2:
Importaint Note: I may have broken backwards compatibility with those last few commits, so if anyone runs into problems, be sure to upgrade to CEGUI 0.4.0.

dermont

16-10-2005 07:08:43

Point 4 I believe is resolved using the dynamic casts you have applied. The demo only prints the "selected" property in showWindowTypeInfo() when clicking buttonbased controls.

To check the ButtonBase properties you could add:

def main():
..
printButton= guiHelper.CreateControl("TaharezLook/Button" , "PrintButton" ,sheet ,[0.75 ,0.95],[0.1,0.036],[0.01,0.01],[1.0,1.0],"Print")
red = cegui.colour(1.0, 0.0, 0.0, 1.0);
quitButton.hoverTextColour=red
..


I have more detailed individual demos particular to BaseButton and StaticText/Image. However I can't add them to the demo without encountering the Windows Notepad memory limitation.

PS, there appears to be some indentaion problems with the demo in SVN. Probably my fault.

dermont

16-10-2005 09:34:05

Ok I've updated to Revision 218. I see the changes youv'e made to CEGUIWindow.i. Why CEGUI::Window and not CEGUI::Static as per the buttonbase controls?.


if (dynamic_cast<CEGUI::StaticImage*>((CEGUI::Window*)*ptr))
return SWIGTYPE_p_CEGUI__StaticImage;
...


Here's a sample of code I'm using:

def createStaticText(sheet):
# cegui, Test a Static TextWindow
#
staticText = cegui.WindowManager.getSingleton().createWindow("TaharezLook/StaticText", "TestLabel")
sheet.addChildWindow(staticText)
blue = cegui.colour(0.0, 0.0, 1.0, 0.5);
red = cegui.colour(1.0, 0.0, 0.0, 0.5);
green = cegui.colour(0.0, 1.0, 0.0, 1.0);
blue_back = cegui.colour(0.0, 0.0, 1.0, 1.0);
red_back = cegui.colour(1.0, 0.0, 0.0, 1.0);
#Window Props
staticText.position = cegui.Point(0.7,0.7)
staticText.size = cegui.Size(0.20,0.15)
staticText.text = 'Test Horizontal Bar on Static Text'
#Static Props
staticText.setFrameColours(green) # OK
#staticText.backgroundEnabled = False # OK
staticText.frameEnabled = True # OK
img = cegui.ImagesetManager.getSingleton().getImageset("TaharezLook").getImage("ListboxSelectionBrush")
staticText.setBackgroundImage(img)
staticText.setBackgroundColours(blue_back) #OK
staticText.setBackgroundColours(cegui.ColourRect(blue,red,blue,red)) # OK
#Static Text Props
staticText.setHorizontalScrollbarEnabled(True) # OK Bars Shown
staticText.setTextColours(cegui.colour(1.0,0.0,0.0)) # OK red Text
staticText.requestRedraw

def createStaticImage(sheet):

# cegui, Test a Static Image Window
#
staticImage = cegui.WindowManager.getSingleton().createWindow("TaharezLook/StaticImage", "TestImage")
sheet.addChildWindow(staticImage)
blue = cegui.colour(0.0, 0.0, 1.0, 0.5);
red = cegui.colour(1.0, 0.0, 0.0, 0.5);
green = cegui.colour(0.0, 1.0, 0.0, 1.0);
blue_back = cegui.colour(0.0, 0.0, 1.0, 1.0);
red_back = cegui.colour(1.0, 0.0, 0.0, 1.0);
#Window Props
staticImage.position = cegui.Point(0.5,0.7)
staticImage.size = cegui.Size(0.20,0.15)
staticImage.text = 'Test Horizontal Bar on Static Text'
#Static Props
staticImage.setFrameColours(green) # OK
#staticText.backgroundEnabled = False # OK
staticImage.frameEnabled = True # OK
img = cegui.ImagesetManager.getSingleton().getImageset("TaharezLook").getImage("ListboxSelectionBrush")
print img.getName()
#img.size = cegui.Size(0.10,0.075)
#img.offsetX=0.05
staticImage.setImage(img)
staticImage.setImageColours(blue_back) #OK
#Static Image Props
staticImage.horizontalFormatting=cegui.LeftAligned #OK
staticImage.horizontalFormatting=cegui.RightAligned #OK
staticImage.horizontalFormatting=cegui.Centred #OK
staticImage.horizontalFormatting=cegui.Justified #OK
staticImage.requestRedraw


And in main:

createStaticText(sheet)
createStaticImage(sheet)

The above crashes with error:

AttributeError: 'Static' object has no attribute ssetHorizontalScrollbarEnabled'


To check if the above works I add the following to CEGUIStatic.i, (and remove the cast stuff for StaticText/StaticImage from CEGUIWindow.i) it works fine:


%apply SWIGTYPE *DYNAMIC {CEGUI::Static *};

// DYNAMIC CAST of CEGUI:Static
%{
static swig_type_info *_cast_CEGUI__Static(void **ptr)
{
if (dynamic_cast<CEGUI::StaticImage*>((CEGUI::Static*)*ptr))
return SWIGTYPE_p_CEGUI__StaticImage;
if (dynamic_cast<CEGUI::StaticText*>((CEGUI::Static*)*ptr))
return SWIGTYPE_p_CEGUI__StaticText;
if (dynamic_cast<CEGUI::TabPane*>((CEGUI::Static*)*ptr))
return SWIGTYPE_p_CEGUI__TabPane;
return 0;
}
%}

DYNAMIC_CAST(SWIGTYPE_p_CEGUI__Static, _cast_CEGUI__Static);

Clay

16-10-2005 20:05:37

Ok I've updated to Revision 218. I see the changes youv'e made to CEGUIWindow.i. Why CEGUI::Window and not CEGUI::Static as per the buttonbase controls?.
I've changed ButtonBase too. ButtonBase, Static, StaticImage, etc are all subclasses of Window, so to simplify the code I have put all dynamic checks in Window. This creates an order problem though. We always have to check subclasses first, then parents. The problem you mentioned below was because I had a check for Static above the checks for StaticImage and StaticText. This code now works:
if (dynamic_cast<CEGUI::StaticImage*>((CEGUI::Window*)*ptr))
return SWIGTYPE_p_CEGUI__StaticImage;

if (dynamic_cast<CEGUI::StaticText*>((CEGUI::Window*)*ptr))
return SWIGTYPE_p_CEGUI__StaticText;

if (dynamic_cast<CEGUI::TabPane*>((CEGUI::Window*)*ptr))
return SWIGTYPE_p_CEGUI__TabPane;

if (dynamic_cast<CEGUI::Static*>((CEGUI::Window*)*ptr))
return SWIGTYPE_p_CEGUI__Static;

The problem you outlined below is because I had a second (duplicate) dynamic_cast for Static farther above this section of code. Now that its removed it works again.

Also I updated some of the attributes, this line should be changed:

#staticText.setHorizontalScrollbarEnabled(True) # OK Bars Shown
staticText.horizontalScrollbarEnabled = True # OK Bars Shown


To check if the above works I add the following to CEGUIStatic.i, (and remove the cast stuff for StaticText/StaticImage from CEGUIWindow.i) it works fine:


%apply SWIGTYPE *DYNAMIC {CEGUI::Static *};

// DYNAMIC CAST of CEGUI:Static
%{
static swig_type_info *_cast_CEGUI__Static(void **ptr)
{
if (dynamic_cast<CEGUI::StaticImage*>((CEGUI::Static*)*ptr))
return SWIGTYPE_p_CEGUI__StaticImage;
if (dynamic_cast<CEGUI::StaticText*>((CEGUI::Static*)*ptr))
return SWIGTYPE_p_CEGUI__StaticText;
if (dynamic_cast<CEGUI::TabPane*>((CEGUI::Static*)*ptr))
return SWIGTYPE_p_CEGUI__TabPane;
return 0;
}
%}

DYNAMIC_CAST(SWIGTYPE_p_CEGUI__Static, _cast_CEGUI__Static);

This works, but I'd like to keep all dynamic_cast methods for the Window base class in the CEGUIWindow.i file. I just made a mistake with the dynamic cast code by leaving a stale check at the top of the list.

dermont

16-10-2005 21:09:16

Clay Wrote:

This code now works

Nice work, yep works fine for StaticImage/Text. TabPane doesn't work either way for some strange reason. Have to check my code.

Resolved point 3, render to texture will submit as as testcegui_rtt.py if thats OK with you.

Clay

16-10-2005 21:14:12

Check your email.

Clay

18-10-2005 21:50:58

Point #2 is now resolved. If anyone runs into this in the future, the problem was that ListboxItem and ListboxText item was %included after Listbox. By rearranging this, the problem went away, but it created a new problem.

CEGUI wants to autodelete the listboxitems and it's causing bad things to happen with memory. I have an idea that might fix this that I'm trying to make work now.

Outside of #2, if there are any other major CEGUI issues we need to open up bugs for them on the tracker or list them below. I'm starting to lose track of what needs to be done.

Clay

18-10-2005 22:04:08

Well my idea didn't work out as planned. I'm going to commit what I have and revisit the memory ownership problem later.

dermont

19-10-2005 07:58:05

Thanks for the feedback on point #2. Yep, rearranging at least allows listboxitems to be created. I should have noticed that. Sorry.

Clay

21-10-2005 23:07:36

Ok the last of the Listbox issues are resolved.

You now must hold onto a reference for any ListboxTextItem you create and populate a Listbox (or other container) with. I've removed the auto deletion feature that was causing crashes.

As far as I know, all of the CEGUI issues brought up in this thread are now resolved. If there's something I missed, follow up to it here, or open up a bug on the bug tracker.

dermont

24-10-2005 17:42:24

Edit ---- 6.30 Ignore this -- End Edit

I have hit a real snag conerning the pyogre CEGUI stuff, this relates to Windows and Linux.

1. Widget Sets and Creation

If you look at the directory structure of CEGUI it has a widget sets directory as follows:

- Falgard
- TaharezLook
- WindowsLook

AFAIK these widget sets subclass and extend the appropriate CEGUI widget and create a factory object for each widget.

Button class for the TaharezLook Look GUI scheme
*/
class TAHAREZLOOK_API TLButton : public PushButton
class WINDOWSLOOK_API WLButton : public PushButton

Button class for the WindowsLook GUI scheme
class TAHAREZLOOK_API TLButtonFactory : public WindowFactory
Window* createWindow(const String& name);

class WINDOWSLOOK_API WLButtonFactory : public WindowFactory
Window* createWindow(const String& name);


2. When running a pycegui demo

24/10/2005 14:20:41 (InfL1) Attempting to create an Imageset from the information specified in file '../datafiles/imagesets/TaharezLook.imageset'.
24/10/2005 14:20:41 (InfL2) Started creation of Imageset 'TaharezLook' via XML file.
24/10/2005 14:20:41 (InfL2) Finished creation of Imageset 'TaharezLook' via XML file.

Python Only --------------------------------
24/10/2005 14:20:41 (InfL1) No window factories specified for module 'CEGUITaharezLook' - adding all available factories...
End Python Only --------------------------------


24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/AlternateProgressBar' windows added.
24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/Button' windows added.
24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/Checkbox' windows added.
24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/CloseButton' windows added.
24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/Combobox' windows added.
24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/ComboDropList' windows added.
24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/ComboEditbox' windows added.
24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/Editbox' windows added.
24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/FrameWindow' windows added.
24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/LargeVerticalScrollbar' windows added.
24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/LargeVerticalScrollbarThumb' windows added.
24/10/2005 12:47:00 (InfL1) WindowFactory for 'TaharezLook/Listbox' windows added.
..

24/10/2005 14:20:41 (InfL1) WindowFactory for 'TaharezLook/MultiLineEditbox' windows added.
24/10/2005 14:20:41 (InfL1) WindowFactory for 'TaharezLook/ProgressBar' windows added.
24/10/2005 14:20:41 (InfL1) WindowFactory for 'TaharezLook/RadioButton' windows added.
24/10/2005 14:20:41 (InfL1) WindowFactory for TaharezLook/ScrollablePane' windows added.
24/10/2005 14:20:41 (InfL1) WindowFactory for 'TaharezLook/Slider' windows added.


The avilable factories for the "TaharezLook.scheme" don't appear to include menus/popupmenus though there specified in the datafiles/Imageset/TaharezLook.imageset.

3. The TaharezLookSkin allows creation of menus eg.
cegui.SchemeManager.getSingleton().loadScheme("TaharezLookSkin.scheme")

The TaharezLookSkin.scheme does mapping as follows:

<FalagardMapping WindowType="TaharezLook/MenuBar" TargetType="Falagard/MenuBar"

On windows the scheme loads, menus are created but there are problems with positioning, sizing etc which suggests mappings aren't done properly due to (1).

On linux the problem was highlighted, when compiling I had to to add -lCEGUITaharezLook, when trying to extend this to -lCEGUIWindowsLook.so -lCEGUIFalgardBase.so I recieved errors
TaharezLook/widget etc already exists.

Bottom Line, is that it appears that only TaharezLook may work without menus, without wrapping (1), considerable effort. Any comments appreciated.

dermont

24-10-2005 19:20:01

Doh, the snag turned out be self created, looking through all these sheme/image files has zapped my brain:

1/2/3 These Widget Sets are extensions. I should be using WindowsLook instead of TaharezLookSkin.

On linux the problem was resolved by linking seprately against -lCEGUITaharezLook to run a TaharezLook demo and -lCEGUIWindowsLook.so to run a WindowsLook demo.
Sorry.

dermont

27-10-2005 16:02:19

Just a note about the MultiLineEdit control. If you are using the ME control within a resizable frame you should ensure that the ME control has a reasonable minimum size.


edit.minimumSize = cegui.Size(0.05,0.05)
OR
# get the character spacing / width res in 0.0 to 1.0 coords
# ----------------------------------------------------------
pwidth = font.getLineSpacing()/font.nativeResolution[0]
pheight = font.getFontHeight()/font.nativeResolution[1]
delta = 0.01 # allow for border spacing

# Set the edit boxes minimum size to match above
# ----------------------------------------------
edit.minimumSize = cegui.Size(pwidth + delta,pheight+delta)


CEGUI's CELayoutEditor version that I'm using doesn't appear to output this value. So if you try to resize the frame, so that the edit box is less than one character in width, the program will hang. This is not confined to pyogre it happens in C++ too.

Here is the code I've used to simulate the above for the _createGUI method in ManualCreation.py:

def _createGUI(self):

# Initiaslise CEGUI Renderer
self.guiRenderer = cegui.OgreCEGUIRenderer(self.renderWindow)
self.system = cegui.System(self.guiRenderer)
cegui.Logger.getSingleton().loggingLevel = cegui.Insane

# Load Cegui Scheme
cegui.SchemeManager.getSingleton().loadScheme("TaharezLook.scheme")
self.system.setDefaultMouseCursor("TaharezLook", "MouseArrow")
cegui.FontManager.getSingleton().createFont("Iconified-12.font")

# Load Layout
# Load Default CEGUI Window
sheet = cegui.WindowManager.getSingleton().createWindow("DefaultWindow", "root_wnd")
self.system.guiSheet = sheet

#Frame
frame = cegui.WindowManager.getSingleton().createWindow("TaharezLook/FrameWindow", "MFrame")
sheet.addChildWindow(frame)
frame.position = cegui.Point(0.1,0.1)
frame.size = cegui.Size(0.4,0.4)
frame.maximumSize = cegui.Size(1.0,1.0)

#Edit Box & Add to Frame
edit = cegui.WindowManager.getSingleton().createWindow("TaharezLook/MultiLineEditbox", "MEdit")
edit.position = cegui.Point(0.1,0.1)
edit.size = cegui.Size(0.4,0.4)
edit.maximumSize = cegui.Size(1.0,1.0)
edit.text = ""
#edit.minimumSize = cegui.Size(0.05,0.05)
}

Clay

28-10-2005 02:00:03

Ok, outside of my review of all attributes....is there anything outstanding that needs to be fixed with CEGUI that's not already on the bug tracker? I'm getting close to a PyCEGUI release, but I'm not sure if I've missed anything.

dermont

28-10-2005 05:23:22

I still had problems on retrieving the attributes of the EventArgs /WindowsEventArg arguments associated with an Event.

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=101

Edit:
Also just noticed that in Events no error is flagged for incorrect code. For example in LayoutCreation.py if you add the following to the end of onAdd() in LayoutCreation.py

print editBox2.name
try:
print editBox2.name
except:
print "Event Error"


Nothing happens.

Clay

28-10-2005 17:38:06

I still had problems on retrieving the attributes of the EventArgs /WindowsEventArg arguments associated with an Event.

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=101

Oops, I missed this one. I put it on the tracker.

Edit:
Also just noticed that in Events no error is flagged for incorrect code. For example in LayoutCreation.py if you add the following to the end of onAdd() in LayoutCreation.py

print editBox2.name
try:
print editBox2.name
except:
print "Event Error"


Nothing happens.

This is really strange. You would think that this problem would occur in pyogre as well, but its directors still properly throw exceptions. I've put it on the bug tracker as well.

dermont

03-12-2005 19:21:34

Clay, I've just updated to CEGUI 4.1, no real problems so far except for minor things with some layouts.

1) Came across a strange error with events on a new demo with MultiColumnListBox. I made a typo, as follows, this caused one of those annoying invalid page fault dialogs that meant I had to reboot:


def onSelectAddedItem(self,args):
print "Text is",args.window.text
if (args.win.getFirstSelectedItem()):
print "here"



2) Offtopic, the define const problem with the OpenGLGUIRenderer seems to have been resolved. I've got a pretty simple demo running under pyOpenGL/Glut. I know this is Ogre but are you interested?.

If so I'll submit (1) & "(2)"

Clay

03-12-2005 20:54:56

1) Would you put a patch on the tracker so I can play with it?

2) Yeah, I want a Python wrapping for CEGUI that will function without Ogre. Any demo for GL/CEGUI is more than welcome.

dermont

04-12-2005 07:45:49

Ok, both submiited as patch 000737.

Clay

04-12-2005 07:54:52

Ok thanks