hI THANKS FOR YOUR REPLIES BUT I CAN NOT DO IT TILL .
THIS IS MY CODE. SO CAN YOU SUGGEST SOMETHING TO DO:
WHAT I WANT TO IS THAT "WHEN FIRST CHECKBOX IS CHECKED SHOW THE BUTTON WHICH IS "YES THAT'S RIGHT"
}
Code: Select all
if (event.EventType==irr::EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
IGUIEnvironment* guienv=device->getGUIEnvironment();
switch(event.GUIEvent.EventType)
{
case EGET_BUTTON_CLICKED:
{
IGUICheckBox* chk = (IGUICheckBox*)guienv->getRootGUIElement()->getElementFromId(MYGUI_BOLD,true);// enen deer ochood button press hiigdeh yum baina
bool bold = true;//chk->isChecked();
if(bold)
{
ch = (IGUIButton*)guienv->getRootGUIElement()->getElementFromId(MYGUI_HELPBUTTON,true);
}
IGUICheckBox* chk1 = (IGUICheckBox*)guienv->getRootGUIElement()->getElementFromId(MYGUI_ITALIC,true);
bool italic = chk1->isChecked();
IGUICheckBox* chk2 = (IGUICheckBox*)guienv->getRootGUIElement()->getElementFromId(MYGUI_ALPHA,true);
bool alpha = chk2->isChecked();
IGUICheckBox* chk3 = (IGUICheckBox*)guienv->getRootGUIElement()->getElementFromId(MYGUI_ANTIALIAS,true);
bool aa = chk3->isChecked();
// vector fonts disabled
//chk = (IGUICheckBox*)env->getRootGUIElement()->getElementFromId(MYGUI_VECTOR,true);
//bool vec = false;//chk->isChecked()
}
case EGET_CHECKBOX_CHANGED:
if(id==MYGUI_BOLD)
{
//{
//IGUICheckBox* chk = 0;
IGUICheckBox* ch = (IGUICheckBox*)event.GUIEvent.Caller;
//if(bold)
//{
//
// ch = (IGUIButton*)guienv->getRootGUIElement()->getElementFromId(MYGUI_HELPBUTTON,true);
}
}
...
guienv->addGUIElement("GUIEditor");
IGUIWindow *win =guienv->addWindow(core::rect<s32>(10,10,260,220), true, L"Good Luck for your Test",0, -1);
win->getCloseButton()->setVisible(false);
IGUISkin *skin = guienv->createSkin(EGST_WINDOWS_CLASSIC);
guienv->setSkin(skin);
//if(guienv)
//{
guienv->addButton(core::rect<s32>(35,35,200,50), 0, 0, L"Please choose right word" );
//guienv->addCheckBox(true, rect<s32>(35,35,80,100), 0,0, L"Star");
s32 xs=10,xp=xs, yp=50, h=20;
// bold checkbox
guienv->addCheckBox(false, core::rect<s32>(xp,yp,xp+60,yp+yp),win, MYGUI_BOLD, L"sar");
xp += 45;
// italic checkbox
guienv->addCheckBox(false, core::rect<s32>(xp,yp,xp+80,yp+yp),win, MYGUI_ITALIC, L"nar");
xp += 45;
// AA checkbox
guienv->addCheckBox(false, core::rect<s32>(xp,yp,xp+80,yp+yp),win, MYGUI_ANTIALIAS, L"mangar");
xp +=40;
// Alpha checkbox
guienv->addCheckBox(false, core::rect<s32>(xp,yp,xp+80,yp+yp),win, MYGUI_ALPHA, L"teneg");
xp = xs;
yp += (s32)(h*1.5f);
device->getCursorControl()->setVisible(true);
device->sleep(5, true);
}
if(ch)
{
guienv->addButton(core::rect<s32>
(35,35,200,50), 0, 0, L"Yes That's right" );
}
//win->setVisible(false);
THANKS FOR YOUR KIND REPLY