home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / starview / examples / dialog / poppad.cxx < prev   
Encoding:
C/C++ Source or Header  |  1992-08-01  |  1.6 KB  |  73 lines

  1. /*******************************************************************
  2. *  POPPAD.CXX
  3. *  (c) 1992 STAR DIVISION
  4. *******************************************************************/
  5.  
  6. #include <sv.hxx>
  7.  
  8. // --- class MyApp -------------------------------------------------
  9.  
  10. class MyApp : public Application
  11. {
  12. public:
  13.     virtual void Main( int, char*[] );
  14. };
  15.  
  16. // --- class EditWindow --------------------------------------------
  17.  
  18. class EditWindow : public WorkWindow
  19. {
  20. protected:
  21.     MultiLineEdit   aEditor;
  22.  
  23. public:
  24.                     EditWindow();
  25.  
  26.     virtual void    Resize();
  27.     virtual void    GetFocus();
  28. };
  29.  
  30. // --- EditWindow::EditWindow() ------------------------------------
  31.  
  32. EditWindow::EditWindow() :
  33.                 WorkWindow( NULL, WB_APP | WB_STDWORK ),
  34.                 aEditor( this, WB_HSCROLL | WB_VSCROLL | WB_LEFT )
  35. {
  36.     aEditor.ChangePosPixel( Point( 0, 0 ) );
  37.     aEditor.ChangeSizePixel( GetOutputSizePixel() );
  38.     aEditor.Show();
  39.  
  40.     SetText( "PopPad" );
  41.     Show();
  42. }
  43.  
  44. // --- EditWindow::GetFocus() --------------------------------------
  45.  
  46. void EditWindow::GetFocus()
  47. {
  48.     aEditor.GrabFocus();
  49. }
  50.  
  51. // --- EditWindow::Resize() ----------------------------------------
  52.  
  53. void EditWindow::Resize()
  54. {
  55.     aEditor.ChangeSizePixel( GetOutputSizePixel() );
  56. }
  57.  
  58. // --- MyApp::Main() -----------------------------------------------
  59.  
  60. void MyApp::Main( int, char*[] )
  61. {
  62.     EditWindow aWindow;
  63.     Execute();
  64. }
  65.  
  66. // --- aMyApp ------------------------------------------------------
  67.  
  68. MyApp aMyApp;
  69.  
  70. #ifdef MAC
  71.     Application* pApp = &aMyApp;
  72. #endif
  73.