SEDITDLG.H 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. #ifdef WOLAPI_INTEGRATION
  15. // SEditDlg.h - "SimpleEditDlgClass": An ok/cancel type dialog with a single edit box.
  16. // ajw 07/21/98
  17. #include "function.h"
  18. class SimpleEditDlgClass
  19. {
  20. public:
  21. SimpleEditDlgClass( int iDialogWidth, const char* szTitle, const char* szPrompt, int iEditCharsAccept,
  22. const char* szPrompt2 = NULL, int iEditCharsAccept2 = 0 );
  23. virtual ~SimpleEditDlgClass();
  24. const char* Show(); // Shows dialog, returns text of button pressed.
  25. // Unless SetButtons() is used, value will be TXT_OK or TXT_CANCEL string values.
  26. void SetButtons( const char* szOk, const char* szCancel, const char* szMiddle = NULL );
  27. char szEdit[ 300 ]; // iEditCharsAccept upper limit.
  28. char szEdit2[ 300 ];
  29. protected:
  30. int iDialogWidth; // X pixels width of entire dialog.
  31. char* szTitle; // Title of dialog, or NULL for no title.
  32. char* szPrompt; // Text appearing to the left of edit box.
  33. int iEditCharsAccept; // Max length of string allowed in edit, includes null-terminator.
  34. char* szPrompt2;
  35. int iEditCharsAccept2;
  36. const char* szOkButton; // Text of button that acts like an Ok button. Appears on left.
  37. const char* szCancelButton; // Text of button that acts like an Cancel button. Appears on right.
  38. const char* szMiddleButton; // Optional middle button text. Null = no middle button.
  39. };
  40. #endif