Just went looney with "MouseEnter" and "MouseLeave"...

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Just went looney with "MouseEnter" and "MouseLeave"...

Postby agamemnus » Sun May 16, 2010 08:34

API:
"EventMouseEnters"

Actual:
"MouseEnter"

:hammer:

User avatar
emarcotte
Quite a regular
Quite a regular
Posts: 55
Joined: Fri Dec 26, 2008 14:30
Contact:

Re: Just went looney with "MouseEnter" and "MouseLeave"...

Postby emarcotte » Mon May 17, 2010 12:19

What exactly is the problem? All of the event objects are called EventBlah and have a value of "Blah." Is there some inconsistency you're seeing? If so could you point it out more obviously, I don't see it here:

http://crayzedsgui.svn.sourceforge.net/ ... iew=markup

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Just went looney with "MouseEnter" and "MouseLeave"...

Postby agamemnus » Mon May 17, 2010 18:19

http://www.cegui.org.uk/docs/current/cl ... indow.html:

It says: "EventMouseEnters" and "EventMouseLeaves".

Nice link, and I see now that it's also inconsistent with DragDropItemEnters / DragDropItemLeaves, too.

I think the string constant should probably be "MouseEnters" and "MouseLeaves" to remain consistent, and if it has been in there long then maybe an alias/define should be added.

User avatar
emarcotte
Quite a regular
Quite a regular
Posts: 55
Joined: Fri Dec 26, 2008 14:30
Contact:

Re: Just went looney with "MouseEnter" and "MouseLeave"...

Postby emarcotte » Tue May 18, 2010 11:16

Oh, are you complaining about the "S" at the end?

I mean, for one, you should not be using the actual value of "MouseEnter" in your code and just using the constant. It may be an issue but it's certainly one that using good practices you wouldn't hit...

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Just went looney with "MouseEnter" and "MouseLeave"...

Postby agamemnus » Tue May 18, 2010 17:56

Yeah, good idea. I'll use the constant inside of Freebasic. :lol:

Or, I'll add a constant list in Freebasic for all the events and update them every time the event list is updated. :lol:

... both of these are not possible/viable solutions. :|

The only solution as I see it is to change them to add an "s".

User avatar
emarcotte
Quite a regular
Quite a regular
Posts: 55
Joined: Fri Dec 26, 2008 14:30
Contact:

Re: Just went looney with "MouseEnter" and "MouseLeave"...

Postby emarcotte » Wed May 19, 2010 18:43

I think you will find that many bindings tend to end up redefining constants in a way they can get to them. For instance, the java opengl bindings redefine every constant from GL.h. Do they manually do it? Hell no. They pull it from GL.h cause humans get stuff wrong all the time. And like you've seen there can be minor typos that don't matter in 99% of cases, but doing this sort of automatic copying propagates the error so it matters less. Then, when its fixed, you still get the fix too and you don't have to change your code.

So, again, having no idea how freebasic works, can you write C headers/functions/things that you can call from Freebasic? If so make a header/function/thing that is something like:

Code: Select all

char* MOUSE_ENTERS = CEGUI::Window::EventMouseEnters.c_str()


or

Code: Select all

char* mouseEnters() { return CEGUI::Window::EventMouseEnters.c_str()}


I'm curious why you are using freebasic in the end... there seems to be a whole lot of integration trouble. If you can't do natural cross-language calls/variable references it seems like you've got an uphill battle to fight. This sort of stuff isn't going to just work itself out magically and manually writing the "string values" of things is just going to lead to a maintenance nightmare, even if they are consistent.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Just went looney with "MouseEnter" and "MouseLeave"...

Postby Jamarr » Thu May 20, 2010 21:20

I have to agree with emarcotte in that you should try to automate bindings; preferably by generating them from the original source. That said, with v0.7 recently released and already including some non-backwards compatible changes it might be a good idea to go ahead and clean up the consistency issues between the variable and string-literal names.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

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

Re: Just went looney with "MouseEnter" and "MouseLeave"...

Postby CrazyEddie » Sat May 22, 2010 07:34

Jamarr wrote:... with v0.7 recently released and already including some non-backwards compatible changes it might be a good idea to go ahead and clean up the consistency issues between the variable and string-literal names.

This is actually a really hard call ;) I don't think it's something we can contemplate in the v0-7 branch as it's supposed to be API stable, so that makes it a trunk 0.8.0 type of a change.

In general we've been reasonably well behaved as far as trying to maintain backwards compatibility with scripts and xml data files, though obviously I'm not going to say that 100% compatibility has been maintained. I mention scripts and data files because in making this change I'd want to change the strings to match the symbols rather than the 'easy' option of doing it the other way around.

There are other places that need to be sorted out too. One that comes to mind is the misspelling of caret as carat.

I think if we could gather all these inconsistencies and errors together somewhere to be collected and discussed, it would then be possible to get those changes in for the 0.8.0 release in one go and we can move to a more consistent and stable API.

CE

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: Just went looney with "MouseEnter" and "MouseLeave"...

Postby Jamarr » Mon May 24, 2010 18:53

It would be very beneficial to gather the inconsistencies and other quirks into a single location. Even if they are not addressed until v0.8.0, having that data in an easily referencable location would help spread awareness. It can be very frustrating to spend hours debugging an issue when it is nothing more than a spelling/grammar issue.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

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

Re: Just went looney with "MouseEnter" and "MouseLeave"...

Postby CrazyEddie » Tue May 25, 2010 10:10

I'll sort out a sticky topic for this purpose over the coming days...

CE

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: Just went looney with "MouseEnter" and "MouseLeave"...

Postby agamemnus » Wed Jun 09, 2010 17:57

emarcotte wrote:So, again, having no idea how freebasic works, can you write C headers/functions/things that you can call from Freebasic? If so make a header/function/thing that is something like:

Code: Select all

char* MOUSE_ENTERS = CEGUI::Window::EventMouseEnters.c_str()



I could do this, but it would be a giant function call instead, since I must use a DLL.


Here is the list I use. The string value has been changed to equal the string name minus "Event". The few extra characters used for typing a longer event name (where it has been previously shortened) is worth it in order to avoid the time spent in looking up the event string.

Code: Select all

const String Window::EventNamespace("Window");
const String Window::EventWindowUpdated ("WindowUpdated");
const String Window::EventParentSized("ParentSized");
const String Window::EventSized("Sized");
const String Window::EventMoved("Moved");
const String Window::EventTextChanged("TextChanged");
const String Window::EventFontChanged("FontChanged");
const String Window::EventAlphaChanged("AlphaChanged");
const String Window::EventIDChanged("IDChanged");
const String Window::EventActivated("Activated");
const String Window::EventDeactivated("Deactivated");
const String Window::EventShown("Shown");
const String Window::EventHidden("Hidden");
const String Window::EventEnabled("Enabled");
const String Window::EventDisabled("Disabled");
const String Window::EventClippedByParentChanged("ClippedByParentChanged");
const String Window::EventDestroyedByParentChanged("DestroyedByParentChanged");
const String Window::EventInheritsAlphaChanged("InheritsAlphaChanged");
const String Window::EventAlwaysOnTopChanged("AlwaysOnTopChanged");
const String Window::EventInputCaptureGained("InputCaptureGained");
const String Window::EventInputCaptureLost("InputCaptureLost");
const String Window::EventRenderingStarted("RenderingStarted");
const String Window::EventRenderingEnded("RenderingEnded");
const String Window::EventChildAdded("ChildAdded");
const String Window::EventChildRemoved("ChildRemoved");
const String Window::EventDestructionStarted("DestructionStarted");
const String Window::EventZOrderChanged("ZOrderChanged");
const String Window::EventDragDropItemEnters("DragDropItemEnters");
const String Window::EventDragDropItemLeaves("DragDropItemLeaves");
const String Window::EventDragDropItemDropped("DragDropItemDropped");
const String Window::EventVerticalAlignmentChanged("VerticalAlignmentChanged");
const String Window::EventHorizontalAlignmentChanged("HorizontalAlignmentChanged");
const String Window::EventWindowRendererAttached("WindowRendererAttached");
const String Window::EventWindowRendererDetached("WindowRendererDetached");
const String Window::EventRotated("Rotated");
const String Window::EventNonClientChanged("NonClientChanged");
const String Window::EventTextParsingChanged("TextParsingChanged");
const String Window::EventMouseEnters("MouseEnters");
const String Window::EventMouseLeaves("MouseLeaves");
const String Window::EventMouseMove("MouseMove");
const String Window::EventMouseWheel("MouseWheel");
const String Window::EventMouseButtonDown("MouseButtonDown");
const String Window::EventMouseButtonUp("MouseButtonUp");
const String Window::EventMouseClick("MouseClick");
const String Window::EventMouseDoubleClick("MouseDoubleClick");
const String Window::EventMouseTripleClick("MouseTripleClick");
const String Window::EventKeyDown("KeyDown");
const String Window::EventKeyUp("KeyUp");
const String Window::EventCharacterKey("CharacterKey");

uelkfr
Not too shy to talk
Not too shy to talk
Posts: 34
Joined: Tue Dec 14, 2010 16:57

Re: Just went looney with "MouseEnter" and "MouseLeave"...

Postby uelkfr » Wed Dec 22, 2010 14:40

I don't know english very well, but I think its similar typo.
datafiles/schemes
datafiles/xml_schemas
helper to newbies

"i help you, dear newbie
but nobody helps me!"


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 13 guests