| 1018 | |
| 1019 | |
| 1020 | ResultType GuiType::ControlSetName(GuiControlType &aControl, LPTSTR aName) |
| 1021 | { |
| 1022 | if (aName && !*aName) |
| 1023 | { |
| 1024 | aName = NULL; |
| 1025 | } |
| 1026 | else if (aName) |
| 1027 | { |
| 1028 | // Make sure the name isn't already taken. |
| 1029 | for (GuiIndexType u = 0; u < mControlCount; ++u) |
| 1030 | if (mControl[u]->name && !_tcsicmp(mControl[u]->name, aName)) |
| 1031 | { |
| 1032 | if (mControl[u] == &aControl) // aControl already has this name, but upper- vs lower-case may differ. |
| 1033 | break; |
| 1034 | return g_script.RuntimeError(_T("A control with this name already exists."), aName); |
| 1035 | } |
| 1036 | |
| 1037 | aName = _tcsdup(aName); |
| 1038 | if (!aName) |
| 1039 | return MemoryError(); |
| 1040 | } |
| 1041 | if (aControl.name) |
| 1042 | free(aControl.name); |
| 1043 | aControl.name = aName; |
| 1044 | return OK; |
| 1045 | } |
| 1046 | |
| 1047 | |
| 1048 | ResultType GuiType::MethodGetPos(ResultToken &aResultToken, ExprTokenType *aParam[], int aParamCount, RECT &aPos) |
no test coverage detected