but It's very simple and easy.
sample :
MyGUIManager * MGM=new MyGUIManager;
void main()
{
MGM->Create(guienv->addStaticText(L"Debug Mode",rect<s32>(10,10,2600,200),false));
MGM->Create(guienv->addStaticText(L"Debug Mode",rect<s32>(30,10,2600,200),false));
}
Codes if you don't use it :
void main()
{
IGUIStaticText *lgst;
lgst=new IGUIStaticText;
lgst=guienv->addStaticText(L"Debug Mode",rect<s32>(10,10,2600,200),false);
IGUIStaticText *lgst2;
lgst2=new IGUIStaticText;
lgst2=guienv->addStaticText(L"Debug Mode",rect<s32>(30,10,2600,200),false);
}
difference is very big that don't use it and use it.
code using MyGUIManager is very simple but Codes you don't use it is isn't.
MGM->Create();
this is return control key.
control key is what?
control key can control Objects.
int ck;
ck=MGM->Create(guienv->addStaticText(L"Debug Mode",rect<s32>(30,10,2600,200),false));
// I was used 'StaticText'.
MGM->STB[ck]->setText("WWWHWHWHWH hahahaha...");
Code: Select all
#define MAX_OBJ_NUM 10000
class MyGUIManager
{
public:
MyGUIManager()
{
uEB=0;
uLB=0;
uBTN=0;
uCB=0;
uCOB=0;
uCTM=0;
uST=0;
uWS=0;
uIB=0;
}
~MyGUIManager()
{
//this will use to erase GUI Buffers
IGUIStaticText * O1;
IGUIEditBox * O2;
IGUIListBox * O3;
IGUIButton * O4;
IGUICheckBox * O5;
IGUIComboBox * O6;
IGUIContextMenu * O7;
IGUIWindow * O8;
IGUIImage * O9;
/*
IGUIStaticText * STB[MAX_OBJ_NUM];
IGUIEditBox * EB[MAX_OBJ_NUM];
IGUIListBox * LB[MAX_OBJ_NUM];
IGUIButton * BTN[MAX_OBJ_NUM];
IGUICheckBox * CB[MAX_OBJ_NUM];
IGUIComboBox * COB[MAX_OBJ_NUM];
IGUIContextMenu * CTM[MAX_OBJ_NUM];
IGUIWindow * WinS[MAX_OBJ_NUM];
IGUIImage *ImgB[MAX_OBJ_NUM];
*/
for(int i=0;i > MAX_OBJ_NUM ; i++)
{
STB[i]=O1;
EB[i]=O2;
LB[i]=O3;
BTN[i]=O4;
CB[i]=O5;
COB[i]=O6;
CTM[i]=O7;
WinS[i]=O8;
ImgB[i]=O9;
} // MAX_OBJ_NUM
}
IGUIStaticText * STB[MAX_OBJ_NUM]; // 1
IGUIEditBox * EB[MAX_OBJ_NUM]; // 2
IGUIListBox * LB[MAX_OBJ_NUM];//3
IGUIButton * BTN[MAX_OBJ_NUM];//4
IGUICheckBox * CB[MAX_OBJ_NUM];//5
IGUIComboBox * COB[MAX_OBJ_NUM];//6
IGUIContextMenu * CTM[MAX_OBJ_NUM];//7
IGUIWindow * WinS[MAX_OBJ_NUM];//8
IGUIImage *ImgB[MAX_OBJ_NUM];//9
// 간접 생성
int Create(IGUIImage * ImageControl)
{
if(uIB==MAX_OBJ_NUM)
return -1;
uIB++;
ImgB[uIB]=ImageControl;
return uLB;
}
int Create(IGUIWindow * WindowControl)
{
if(uWS==MAX_OBJ_NUM)
return -1;
uWS++;
WinS[uWS]=WindowControl;
return uLB;
}
int Create(IGUIContextMenu * ContextMenuControl)
{
if(uCTM==MAX_OBJ_NUM)
return -1;
uCTM++;
CTM[uCTM]=ContextMenuControl;
return uLB;
}
int Create(IGUIComboBox * ComboboxControl)
{
if(uCOB==MAX_OBJ_NUM)
return -1;
uCOB++;
COB[uCOB]=ComboboxControl;
return uLB;
}
int Create(IGUICheckBox * CheckboxControl)
{
if(uCB==MAX_OBJ_NUM)
return -1;
uCB++;
CB[uCB]=CheckboxControl;
return uLB;
}
int Create(IGUIButton * BtnControl)
{
if(uBTN==MAX_OBJ_NUM)
return -1;
uBTN++;
BTN[uBTN]=BtnControl;
return uLB;
}
int Create(IGUIListBox * ListBoxControl)
{
if(uLB==MAX_OBJ_NUM)
return -1;
uLB++;
LB[uLB]=ListBoxControl;
return uLB;
}
int Create(IGUIStaticText * StaticTextControl)
{
if(uST==MAX_OBJ_NUM)
return -1;
uST++;
STB[uST]=StaticTextControl;
return uST;
}
int Create(IGUIEditBox * EditBoxControl)
{
if(uEB==MAX_OBJ_NUM)
return -1;
uEB++;
EB[uEB]=EditBoxControl;
return uEB;
}
int Create(IGUIImage * ImageControl,int contkey)
{
ImgB[contkey]=ImageControl;
return contkey;
}
int Create(IGUIWindow * WindowControl,int contkey)
{
WinS[contkey]=WindowControl;
return contkey;
}
int Create(IGUIContextMenu * ContextMenuControl,int contkey)
{
CTM[contkey]=ContextMenuControl;
return contkey;
}
int Create(IGUIComboBox * ComboboxControl,int contkey)
{
COB[contkey]=ComboboxControl;
return contkey;
}
int Create(IGUICheckBox * CheckboxControl,int contkey)
{
CB[contkey]=CheckboxControl;
return contkey;
}
int Create(IGUIButton * BtnControl,int contkey)
{
BTN[contkey]=BtnControl;
return contkey;
}
int Create(IGUIListBox * ListBoxControl,int contkey)
{
LB[contkey]=ListBoxControl;
return contkey;
}
int Create(IGUIStaticText * StaticTextControl,int contkey)
{
STB[contkey]=StaticTextControl;
return contkey;
}
int Create(IGUIEditBox * EditBoxControl,int contkey)
{
EB[contkey]=EditBoxControl;
return contkey;
}
void AllErase()
{
//this will use to erase GUI Buffers
IGUIStaticText * O1;
IGUIEditBox * O2;
IGUIListBox * O3;
IGUIButton * O4;
IGUICheckBox * O5;
IGUIComboBox * O6;
IGUIContextMenu * O7;
IGUIWindow * O8;
IGUIImage * O9;
/*
IGUIStaticText * STB[MAX_OBJ_NUM];
IGUIEditBox * EB[MAX_OBJ_NUM];
IGUIListBox * LB[MAX_OBJ_NUM];
IGUIButton * BTN[MAX_OBJ_NUM];
IGUICheckBox * CB[MAX_OBJ_NUM];
IGUIComboBox * COB[MAX_OBJ_NUM];
IGUIContextMenu * CTM[MAX_OBJ_NUM];
IGUIWindow * WinS[MAX_OBJ_NUM];
IGUIImage *ImgB[MAX_OBJ_NUM];
*/
for(int i=0;i > MAX_OBJ_NUM ; i++)
{
STB[i]=O1;
EB[i]=O2;
LB[i]=O3;
BTN[i]=O4;
CB[i]=O5;
COB[i]=O6;
CTM[i]=O7;
WinS[i]=O8;
ImgB[i]=O9;
} // MAX_OBJ_NUM
}
private:
int uEB,uLB,uBTN,uCB,uCOB,uCTM,uST,uWS,uIB;
};