cmCursesForm.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef __cmCursesForm_h
  14. #define __cmCursesForm_h
  15. #include "../cmStandardIncludes.h"
  16. #include "cmCursesStandardIncludes.h"
  17. class cmCursesForm
  18. {
  19. public:
  20. cmCursesForm();
  21. virtual ~cmCursesForm();
  22. // Description:
  23. // Handle user input.
  24. virtual void HandleInput() = 0;
  25. // Description:
  26. // Display form.
  27. virtual void Render(int left, int top, int width, int height) = 0;
  28. // Description:
  29. // This method should normally called only by the form.
  30. // The only exception is during a resize.
  31. virtual void UpdateStatusBar() = 0;
  32. // Description:
  33. // During a CMake run, an error handle should add errors
  34. // to be displayed afterwards.
  35. virtual void AddError(const char* message, const char* title) {};
  36. // Description:
  37. // Turn debugging on. This will create ccmakelog.txt.
  38. static void DebugStart();
  39. // Description:
  40. // Turn debugging off. This will close ccmakelog.txt.
  41. static void DebugEnd();
  42. // Description:
  43. // Write a debugging message.
  44. static void LogMessage(const char* msg);
  45. // Description:
  46. // Return the FORM. Should be only used by low-level methods.
  47. FORM* GetForm()
  48. {
  49. return m_Form;
  50. }
  51. static cmCursesForm* CurrentForm;
  52. protected:
  53. static std::ofstream DebugFile;
  54. static bool Debug;
  55. cmCursesForm(const cmCursesForm& from);
  56. void operator=(const cmCursesForm&);
  57. FORM* m_Form;
  58. };
  59. #endif // __cmCursesForm_h