home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vos2-121.zip / v / test / vtcmdwin.h < prev    next >
C/C++ Source or Header  |  1998-07-21  |  3KB  |  105 lines

  1. //=======================================================================
  2. //  vtcmdwin.h - testCmdWindow class header
  3. //  Copyright (C) 1995,1996  Bruce E. Wampler
  4. //
  5. //  This program is part of the V C++ GUI Framework example programs.
  6. //
  7. //  This program is free software; you can redistribute it and/or modify
  8. //  it under the terms of the GNU General Public License as published by
  9. //  the Free Software Foundation; either version 2 of the License, or
  10. //  (at your option) any later version.
  11. //
  12. //  This program is distributed in the hope that it will be useful,
  13. //  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. //  GNU General Public License for more details.
  16. //
  17. //  You should have received a copy of the GNU General Public License
  18. //  (see COPYING) along with this program; if not, write to the Free
  19. //  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. //=======================================================================
  21.  
  22. #ifndef VTCMDWIN_H
  23. #define VTCMDWIN_H
  24.  
  25. #include <stdio.h>
  26. #include <stdlib.h>
  27. #include <v/vapp.h>
  28. #include <v/vcmdwin.h>
  29. #include <v/vmodald.h>
  30. #include <v/vynreply.h>
  31. #include <v/vdebug.h>
  32. #include <v/vnotice.h>
  33. #include <v/vpane.h>
  34. #include <v/vstatusp.h>
  35. #include <v/vcmdpane.h>
  36. #include <v/vfont.h>
  37. #include <v/vreply.h>
  38. #include <v/vfilesel.h>
  39. #include <v/vtimer.h>
  40. #include <v/vprintdc.h>
  41. #include <v/vmemdc.h>
  42.  
  43. #include "vtcanvas.h"        // The test canvas
  44. #include "vtdialog.h"        // The test dialog
  45. #include "vttogdlg.h"        // The toggle dialog
  46.  
  47.  
  48.     class testCmdWindow;
  49.  
  50.     class myTimer : public vTimer
  51.       {
  52.       public:        //---------------------------------------- public
  53.     myTimer(testCmdWindow* cw) { cmdw = cw; }
  54.     ~myTimer() {}
  55.     virtual void TimerTick();
  56.       private:        //--------------------------------------- private
  57.     testCmdWindow* cmdw;
  58.       };
  59.  
  60.  
  61.     class testCmdWindow : public vCmdWindow
  62.       {
  63.       public:        //---------------------------------------- public
  64.     testCmdWindow(char*, int, int); // Constructor with size
  65.     virtual ~testCmdWindow();        // Destructor
  66.     virtual void WindowCommand(ItemVal id, ItemVal val, CmdType cType);
  67.         void SetShownTop(int shown, int top);
  68.         virtual void CloseWin();
  69.  
  70.     virtual void WorkSlice() { ++_workCounter; }
  71.  
  72.       protected:    //--------------------------------------- protected
  73.  
  74.       private:        //--------------------------------------- private
  75.  
  76.     long _workCounter;
  77.     vMenuPane* myMenu;        // For the menu bar
  78.     testTextCanvasPane* myCanvas;    // For the canvas
  79.     vStatusPane* myStatus;        // For the status bar
  80.     vCommandPane* myCmdPane;    // for the command pane
  81.     vCommandPane* myCmdPane2;    // for the command pane
  82.         vCommandPane* myCmdPane3;    // for the command pane
  83.  
  84.     vMemoryDC* myMemDC;
  85.  
  86.      void PrintTest(int scaled = 0);
  87.     int GetCenter( vPrintDC& pdc, char* str, int scaled);
  88.  
  89. #define MAX_WINDOWS 4
  90.     int nextCmdWin;
  91.  
  92.      testCmdWindow* CmdWins[MAX_WINDOWS];
  93.     
  94.     int nextWin;
  95.      vWindow* Wins[MAX_WINDOWS];
  96.  
  97.     testDialog* curDialog;    // so we construct dialog only once
  98.     toggleDialog* curTogDialog;
  99.     vDialog* curListDialog;
  100.  
  101.     vPen _pen;
  102.     myTimer* _timer;        // a timer
  103.       };
  104. #endif
  105.