MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / InputString

Function InputString

editor/EditLineDialog.cpp:109–118  ·  view source on GitHub ↗

Gets a string from the user Parameters: buf - buffer the string is written to. should be initialized to default value maxsize - the length of buf title - the title for the input window prompt - the prompt for the input box Returns: false if cancel was pressed on the dialog, else true If false returned, buf is unchanged

Source from the content-addressed store, hash-verified

107// Returns: false if cancel was pressed on the dialog, else true
108// If false returned, buf is unchanged
109bool InputString(char *buf, int maxsize, char *title, char *prompt, CWnd *wnd) {
110 CEditLineDialog dlg(title, prompt, buf, 0, wnd);
111
112 if (dlg.DoModal() == IDOK) {
113 strncpy(buf, (char *)dlg.GetText(), maxsize);
114 buf[maxsize - 1] = 0; // strncpy doesn't terminate if string is too long
115 return 1;
116 } else
117 return 0;
118}
119
120// Gets a number from the user
121// Parameters: n - filled in the with return value

Callers 15

InputSoundNameFunction · 0.85
OnCommandMethod · 0.85
InputTextureNameFunction · 0.85
OnTrigAddToCurfaceMethod · 0.85
OnTrigAddToCurportalMethod · 0.85
OnTrigAddFloatingMethod · 0.85
OnTrigEditNameMethod · 0.85
RenameRoomFunction · 0.85
InputWeaponNameFunction · 0.85
InputDoorNameFunction · 0.85

Calls 2

DoModalMethod · 0.45
GetTextMethod · 0.45

Tested by

no test coverage detected