Just went looney with "MouseEnter" and "MouseLeave"...
Moderators: CEGUI MVP, CEGUI Team
Just went looney with "MouseEnter" and "MouseLeave"...
API:
"EventMouseEnters"
Actual:
"MouseEnter"
"EventMouseEnters"
Actual:
"MouseEnter"
Re: Just went looney with "MouseEnter" and "MouseLeave"...
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
http://crayzedsgui.svn.sourceforge.net/ ... iew=markup
Re: Just went looney with "MouseEnter" and "MouseLeave"...
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.
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.
Re: Just went looney with "MouseEnter" and "MouseLeave"...
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...
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...
Re: Just went looney with "MouseEnter" and "MouseLeave"...
Yeah, good idea. I'll use the constant inside of Freebasic.
Or, I'll add a constant list in Freebasic for all the events and update them every time the event list is updated.
... both of these are not possible/viable solutions.
The only solution as I see it is to change them to add an "s".
Or, I'll add a constant list in Freebasic for all the events and update them every time the event list is updated.
... both of these are not possible/viable solutions.
The only solution as I see it is to change them to add an "s".
Re: Just went looney with "MouseEnter" and "MouseLeave"...
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:
or
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.
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.
Re: Just went looney with "MouseEnter" and "MouseLeave"...
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!
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Just went looney with "MouseEnter" and "MouseLeave"...
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
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Just went looney with "MouseEnter" and "MouseLeave"...
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!
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Just went looney with "MouseEnter" and "MouseLeave"...
I'll sort out a sticky topic for this purpose over the coming days...
CE
CE
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Just went looney with "MouseEnter" and "MouseLeave"...
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");
Re: Just went looney with "MouseEnter" and "MouseLeave"...
I don't know english very well, but I think its similar typo.
datafiles/schemes
datafiles/xml_schemas
datafiles/schemes
datafiles/xml_schemas
helper to newbies
"i help you, dear newbie
but nobody helps me!"
"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 4 guests