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

Function PrintToDlgItem

editor/editor.cpp:1051–1068  ·  view source on GitHub ↗

Function to print to an edit box Parameters: dlg - the dialog that the edit box is in id - the ID of the edit box fmt - printf-style text & arguments

Source from the content-addressed store, hash-verified

1049// id - the ID of the edit box
1050// fmt - printf-style text & arguments
1051void PrintToDlgItem(CDialog *dlg, int id, char *fmt, ...) {
1052 std::va_list arglist;
1053 char str[3000];
1054 int len;
1055 CEdit *ebox;
1056
1057 va_start(arglist, fmt);
1058 len = std::vsnprintf(str, 3000, fmt, arglist);
1059 va_end(arglist);
1060 ASSERT(len < 3000);
1061
1062 ebox = (CEdit *)dlg->GetDlgItem(id);
1063 if (ebox == NULL) {
1064 Int3();
1065 return;
1066 }
1067 ebox->SetWindowText(str);
1068}
1069
1070// A quick way to use an openfiledialog/savefiledialog.
1071// wnd = parent window

Callers 7

UpdateDialogMethod · 0.85
UpdateDialogMethod · 0.85
UpdateDialogMethod · 0.85
UpdateDialogMethod · 0.85
OnItemSelectedMethod · 0.85
EnableFieldsMethod · 0.85
UpdateDialogMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected