BetaGUI : BetaGUI 2.5 update - Style system added.
-
nebukadnezzar
- Halfling
- Posts: 93
- Joined: Sun Jun 11, 2006 4:40 pm
- Location: Germany
- x 1
-
To1ne
- Halfling
- Posts: 68
- Joined: Thu May 10, 2007 3:24 pm
To go further on the subject: click here
So it's fixed. I finally got BetaGUI running (and it feels good).
So it's fixed. I finally got BetaGUI running (and it feels good).
-
ghiboz
- Goblin
- Posts: 205
- Joined: Wed Apr 25, 2007 9:47 pm
- Location: Centallo (I)
- x 2
-
To1ne
- Halfling
- Posts: 68
- Joined: Thu May 10, 2007 3:24 pm
Same problem here!
In BetaGUI 015 it's like this:
It got it from betajaen short tutorial.
But I don't know how to do it in BetaGUI 020.
I got the some code from GlobalExplorer's example. But I do it like in BetaGUI 015, just one "onButtonPress"-function and check the "*ref" which button is pressed.
Does "BetaGUI::Callback" still exist? Or do I need to use a other method?
GlobalExplorer used a seperate class for his "on_std"-function, but I like to include the function in the "BetaGUIFrameListener"-class. How I do that:
What should be the last argument there?
If I leave it this way I get a read/write error on the "on_std"-function.
In BetaGUI 015 it's like this:
Code: Select all
mGUI_ExitButton = mGUI_ExitWindow->createButton(Vector4(4,28,100,22), "bgui.button", "Quit", BetaGUI::Callback(this));Code: Select all
void onButtonPress(BetaGUI::Button *ref)
{
if (ref == mGUI_ExitButton)
mShutdown = true;
} But I don't know how to do it in BetaGUI 020.
I got the some code from GlobalExplorer's example. But I do it like in BetaGUI 015, just one "onButtonPress"-function and check the "*ref" which button is pressed.
Does "BetaGUI::Callback" still exist? Or do I need to use a other method?
GlobalExplorer used a seperate class for his "on_std"-function, but I like to include the function in the "BetaGUIFrameListener"-class. How I do that:
Code: Select all
mGUI_ExitWindow = mGUI->createWindow(100,100,320,164, "betagui", BetaGUI::WFT_MOVE, "SceneNode Inspector", mBetaGUIListener);If I leave it this way I get a read/write error on the "on_std"-function.
Last edited by To1ne on Mon May 21, 2007 10:37 am, edited 1 time in total.
-
Aladrin
- Orc
- Posts: 465
- Joined: Fri Mar 10, 2006 10:22 pm
-
To1ne
- Halfling
- Posts: 68
- Joined: Thu May 10, 2007 3:24 pm
So who knows how to do it in BetaGUI 2?But I don't know how to do it in BetaGUI 020.
I got the some code from GlobalExplorer's example. But I do it like in BetaGUI 015, just one "onButtonPress"-function and check the "*ref" which button is pressed.
Does "BetaGUI::Callback" still exist? Or do I need to use a other method?
GlobalExplorer used a seperate class for his "on_std"-function, but I like to include the function in the "BetaGUIFrameListener"-class. How I do that:
Code:
mGUI_ExitWindow = mGUI->createWindow(100,100,320,164, "betagui", BetaGUI::WFT_MOVE, "SceneNode Inspector", mBetaGUIListener);
What should be the last argument there?
If I leave it this way I get a read/write error on the "on_std"-function.
The problem with the seperate class is, I can't use variables like "mShutDown" "mGUI_ExitButton"... .
-
ghiboz
- Goblin
- Posts: 205
- Joined: Wed Apr 25, 2007 9:47 pm
- Location: Centallo (I)
- x 2
Ok, after many errors works fine:
now my problem is this:
the window & the menu works fine, but when I add the static text appears this error:
at this line:
thanks! 
now my problem is this:
Code: Select all
mGUI_Menu = mGUI->createWindow(0,0,640,25, "betagui", BetaGUI::WFT_NONE, "MainMenu", this);
mGUI_Bounding = mGUI_Menu->createButton(2,2, "BoundingBox", (BetaGUI::ButtonMethodPtr) &App::Bounding );
mGUI_Menu->createStaticText(300, 2, "test text");
Code: Select all
Run-Time Check Failure #1 - A cast to a smaller data type has caused a loss of data. If this was intentional, you should mask the source of the cast with the appropriate bitmask. For example:
char c = (i & 0xFF);
Changing the code in this way will not affect the quality of the resulting optimized code.
Code: Select all
text->setParameter("char_height", Ogre::StringConverter::toString(mGUI->mStyle[mStyle]->mFontSize));
-
To1ne
- Halfling
- Posts: 68
- Joined: Thu May 10, 2007 3:24 pm
-
betajaen
- OGRE Moderator

- Posts: 3447
- Joined: Mon Jul 18, 2005 4:15 pm
- Location: Wales, UK
- x 58
You guys do realise that the BetaGUI2 code I posted only covers the events with buttons? TextInputs and the other widgets prototyped there don't work.
I admire your effects trying to get it working, but you should consider using the Bullet Version of BetaGUI or even KungFooMasta's QuickGUI, until at least I actually finish the code.
I admire your effects trying to get it working, but you should consider using the Bullet Version of BetaGUI or even KungFooMasta's QuickGUI, until at least I actually finish the code.
-
nebukadnezzar
- Halfling
- Posts: 93
- Joined: Sun Jun 11, 2006 4:40 pm
- Location: Germany
- x 1
-
betajaen
- OGRE Moderator

- Posts: 3447
- Joined: Mon Jul 18, 2005 4:15 pm
- Location: Wales, UK
- x 58
-
To1ne
- Halfling
- Posts: 68
- Joined: Thu May 10, 2007 3:24 pm
Thx for the TIP mate, good point!!!
I need TextInput's too, so I'll take the Bullet (hopefully it's not much editing to my working 15version)
EDIT:
It doesn't work:
"BetaGUIFrameListener" is declared like this:
And it seems to be "BetaGUIListener" is abstract. (I had the same problem with BetaGUI 2).
So this is the "BetaGUIListener"-class:
Why is it abstract?
And how do I fix this problem?
My code is basic the same as betajaen sample code on page 2 of this topic.
I need TextInput's too, so I'll take the Bullet (hopefully it's not much editing to my working 15version)
EDIT:
It doesn't work:
Code: Select all
error C2259: 'BetaGUIFrameListener' : cannot instantiate abstract classCode: Select all
class BetaGUIFrameListener : public ExampleFrameListener, BetaGUI::BetaGUIListenerSo this is the "BetaGUIListener"-class:
Code: Select all
class BetaGUIListener
{
public:
virtual void onButtonPress(Button*, unsigned char) = 0;
};And how do I fix this problem?
My code is basic the same as betajaen sample code on page 2 of this topic.
-
betajaen
- OGRE Moderator

- Posts: 3447
- Joined: Mon Jul 18, 2005 4:15 pm
- Location: Wales, UK
- x 58
-
ghiboz
- Goblin
- Posts: 205
- Joined: Wed Apr 25, 2007 9:47 pm
- Location: Centallo (I)
- x 2
-
To1ne
- Halfling
- Posts: 68
- Joined: Thu May 10, 2007 3:24 pm
@ ghiboz
Don't get how you did it in BetaGUI 2. Because these are the errors I got in BetaGUI2 too. While BetaGUI 15 worked fine.
@ betajaen
On the Wiki-page is a "typo":2 times "public"??
What should be the first argument?
Are there extra resources needed?
Don't get how you did it in BetaGUI 2. Because these are the errors I got in BetaGUI2 too. While BetaGUI 15 worked fine.
@ betajaen
On the Wiki-page is a "typo":
Code: Select all
class myCallbackOrMainClass : public public BetaGUI::BetaGUIListener {Code: Select all
mGUI = new BetaGUI::GUI("??","font",16);Are there extra resources needed?
-
betajaen
- OGRE Moderator

- Posts: 3447
- Joined: Mon Jul 18, 2005 4:15 pm
- Location: Wales, UK
- x 58
-
ghiboz
- Goblin
- Posts: 205
- Joined: Wed Apr 25, 2007 9:47 pm
- Location: Centallo (I)
- x 2
www.ghiboz.com/tmp/bguires.zip
inside a font and all the materials that aren't in the default package:
with this you can do this:
inside a font and all the materials that aren't in the default package:
with this you can do this:
Code: Select all
mGUI = new BetaGUI::GUI("testgui", "MgOpen", 16, mWindow);
mPointer = mGUI->createMousePointer(Vector2(50, 50), "bgui.pointer");
BetaGUI::Window* window = mGUI->createWindow(Vector4(1, 1, 300, 100), "bgui.window" ,BetaGUI::WFT_RESIZE_AND_MOVE, "window caption" );
-
To1ne
- Halfling
- Posts: 68
- Joined: Thu May 10, 2007 3:24 pm
-
ghiboz
- Goblin
- Posts: 205
- Joined: Wed Apr 25, 2007 9:47 pm
- Location: Centallo (I)
- x 2
no, compile, but give this error:To1ne wrote:@ ghiboz
So do you have a solution for our problem?
Code: Select all
BetaGUI::Button* bBoxes = window->createButton(Vector4(20, 10, 50, 20), "bgui.button", "button", BetaGUI::Callback( mListen ) );
Code: Select all
Listen* mListen;
...
class Listen : public BetaGUI::BetaGUIListener
{
Listen(void) {};
~Listen(void) {};
public:
void onButtonPress(BetaGUI::Button *ref)
{
static Ogre::uint boundtype = 0;
boundtype += 1;
}
};
-
ghiboz
- Goblin
- Posts: 205
- Joined: Wed Apr 25, 2007 9:47 pm
- Location: Centallo (I)
- x 2
here is my code:To1ne wrote:@ ghiboz
Don't get how you did it in BetaGUI 2. Because these are the errors I got in BetaGUI2 too. While BetaGUI 15 worked fine.
Code: Select all
//main class:
class gApp : public BaseApplication, public BetaGUI::GUIListener
{
public:
gApp(void);
virtual ~gApp(void);
void Bounding(BetaGUI::Button*, BetaGUI::FocusState)
{
static Ogre::uint boundtype = 0;
boundtype += 1;
if (boundtype > 2)
boundtype = 0;
switch (boundtype)
{
case 1:
mSceneMgr->showBoundingBoxes(true);
break;
default:
mSceneMgr->showBoundingBoxes(false);
break;
}
}
...
//where I use:
mGUI = new BetaGUI::GUI(mWindow);
mPointer = mGUI->createMousePointer("bgui.pointer",50,50);
BetaGUI::Window* mGUI_Menu;
BetaGUI::Button *mGUI_Shadows;
BetaGUI::Button *mGUI_Bounding;
BetaGUI::Style* mBetaGUIStyle = mGUI->createStyle("betagui");
mBetaGUIStyle->mWindow_Background = "bgui.window";
mBetaGUIStyle->mFontFace = "MgOpen";
mBetaGUIStyle->addStyle("button", "background: bgui.button; height: 20; text-align: center; font-size: 14; decal-size: 10;");
mBetaGUIStyle->addStyle("titlebar", "background: bgui.titlebar; height: 20; font-size: 15;");
mBetaGUIStyle->addStyle("textinput", "background: bgui.textinput; height: 20; font-size: 12; decal-size: 5;");
mGUI_Menu = mGUI->createWindow(0,0,640,25, "betagui", BetaGUI::WFT_NONE, "MainMenu", this);
mGUI_Bounding = mGUI_Menu->createButton(2,2, "BoundingBox", (BetaGUI::ButtonMethodPtr) &gApp::Bounding );
bye!
-
To1ne
- Halfling
- Posts: 68
- Joined: Thu May 10, 2007 3:24 pm
Don't get it anymore:
I have a working solution with BetaGUI 1.5 . But I've looked up, and "BetaGUI::BetaGUIListener" seems to be abstract too. But I can compile en run. And BetaGUI 1.6 doesn't compile, because it's an abstract class.
So what should I do to fix it?
@ betajaen
Are there a lot of differences between version 15 en 16?
And what are they?
@ ghiboz
A little tip:Change the "50,50" to "32,32". It should look better.
@ nebukadnezzar
I found a real good online tutorial here about classes, friends, inheritance and polymorphism. I'll look in to it (when I have some time). I admit I'm not a genius in C++-programming.
I have a working solution with BetaGUI 1.5 . But I've looked up, and "BetaGUI::BetaGUIListener" seems to be abstract too. But I can compile en run. And BetaGUI 1.6 doesn't compile, because it's an abstract class.
So what should I do to fix it?
@ betajaen
Are there a lot of differences between version 15 en 16?
And what are they?
@ ghiboz
A little tip:
Code: Select all
mPointer = mGUI->createMousePointer("bgui.pointer",50,50);@ nebukadnezzar
I found a real good online tutorial here about classes, friends, inheritance and polymorphism. I'll look in to it (when I have some time). I admit I'm not a genius in C++-programming.
-
ghiboz
- Goblin
- Posts: 205
- Joined: Wed Apr 25, 2007 9:47 pm
- Location: Centallo (I)
- x 2
-
To1ne
- Halfling
- Posts: 68
- Joined: Thu May 10, 2007 3:24 pm
-
Epimetheus
- Halfling
- Posts: 82
- Joined: Sat Sep 17, 2005 3:28 pm
- Location: Sweden
I'm trying to get BetaGUI 015 working in my SpaceNav experiment program but when i try to compile it (having only added it to my code::blocks project (linux), included it from my app class and created the BetaGUI::GUI object) I get alot of ambiguous definitons of uint :O anyone else with this problem who maybe could tell me how to solve it.
Candidates are unsigned int uint in types.h and Ogre::uint
Candidates are unsigned int uint in types.h and Ogre::uint
-
betajaen
- OGRE Moderator

- Posts: 3447
- Joined: Mon Jul 18, 2005 4:15 pm
- Location: Wales, UK
- x 58