MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / InitCustomEdit

Method InitCustomEdit

ogsr_engine/xrGame/ui/UIXmlInit.cpp:952–1006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

950}
951
952bool CUIXmlInit::InitCustomEdit(CUIXml& xml_doc, const char* path, int index, CUICustomEdit* pWnd)
953{
954 InitWindow(xml_doc, path, index, pWnd);
955
956 string256 foo;
957 u32 color;
958 InitText(xml_doc, strconcat(sizeof(foo), foo, path, ":text"), index, (IUITextControl*)pWnd);
959
960 strconcat(sizeof(foo), foo, path, ":text_color:e");
961 if (xml_doc.NavigateToNode(foo, index))
962 {
963 color = GetColor(xml_doc, foo, index, 0x00);
964 pWnd->SetTextColor(color);
965 }
966
967 strconcat(sizeof(foo), foo, path, ":text_color:d");
968 if (xml_doc.NavigateToNode(foo, index))
969 {
970 color = GetColor(xml_doc, foo, index, 0x00);
971 pWnd->SetTextColorD(color);
972 }
973
974 strconcat(sizeof(foo), foo, path, ":text_color:cursor");
975 if (xml_doc.NavigateToNode(foo, index))
976 {
977 color = GetColor(xml_doc, foo, index, 0x00);
978 pWnd->SetCursorColor(color);
979 }
980
981 if (xml_doc.ReadAttribInt(path, index, "db_click", 0))
982 pWnd->SetDbClickMode();
983
984 if (xml_doc.ReadAttribInt(path, index, "numonly", 0))
985 {
986 pWnd->SetNumbersOnly(true);
987 if (xml_doc.ReadAttribInt(path, index, "float", 0))
988 pWnd->SetFloatNumbers(true);
989 }
990 if (xml_doc.ReadAttribInt(path, index, "password", 0))
991 pWnd->SetPasswordMode();
992
993 float text_x = xml_doc.ReadAttribFlt(foo, index, "x", 0);
994 float text_y = xml_doc.ReadAttribFlt(foo, index, "y", 0);
995
996 if (text_x)
997 pWnd->SetTextPosX(text_x);
998 if (text_y)
999 pWnd->SetTextPosY(text_y);
1000
1001 int cnt = xml_doc.ReadAttribInt(path, index, "max_symb_count", 0);
1002 if (cnt != 0)
1003 pWnd->SetMaxCharCount(cnt);
1004
1005 return true;
1006}
1007bool CUIXmlInit::InitEditBoxEx(CUIXml& xml_doc, const char* path, int index, CUIEditBoxEx* pWnd)
1008{
1009 InitCustomEdit(xml_doc, path, index, pWnd);

Callers

nothing calls this directly

Calls 14

GetColorFunction · 0.85
NavigateToNodeMethod · 0.80
ReadAttribIntMethod · 0.80
SetDbClickModeMethod · 0.80
SetNumbersOnlyMethod · 0.80
SetFloatNumbersMethod · 0.80
ReadAttribFltMethod · 0.80
SetMaxCharCountMethod · 0.80
SetTextColorMethod · 0.45
SetTextColorDMethod · 0.45
SetCursorColorMethod · 0.45
SetPasswordModeMethod · 0.45

Tested by

no test coverage detected