home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vos2-121.zip / v / iconed / viedcmdw.h < prev    next >
C/C++ Source or Header  |  1998-07-03  |  6KB  |  154 lines

  1. //========================= viedcmdw.h ==================================
  2. // This is the header file for the command window class.
  3. //
  4. // Copyright (C) 1996 Philip Eckenroth, Mike Tipping, Marilee Padilla,
  5. //                    John Fredric Jr. Masciantoni, and Bruce E. Wampler.
  6. //
  7. // This file is part of the V Icon Editor, and is covered
  8. // under the terms of the GNU General Public License,
  9. // Version 2. This program has NO WARRANTY. See the source file
  10. // viedapp.cpp for more complete information about license terms.
  11. //=======================================================================
  12.  
  13. #ifndef VIEDCMDW_H
  14. #define VIEDCMDW_H
  15.  
  16. #include <v/vcmdwin.h>  // So we can use vCmdWindow
  17. #include <v/vmenu.h>    // For the menu pane
  18. #include <v/vcmdpane.h> // command pane
  19. #include <v/vpen.h>     // for a pen
  20. #include <v/vbrush.h>   // for a brush
  21. #include <v/vstatusp.h> // status pane
  22.  
  23. // Start defines for the main window with 100
  24.  
  25.     const int setPen = 0;
  26.     const int setBrush = 1;
  27.     const int setBG = 2;
  28.  
  29. // Declare Item values for window objects
  30.     const ItemVal m_Clear = 100;
  31.     const ItemVal m_CloseFile = 107;
  32.     const ItemVal m_Undo = 108;
  33.     const ItemVal m_Resize = 109;
  34.  
  35.     const ItemVal m_Zoom0 = 700;    // These values must correspond
  36.     const ItemVal m_Zoom2 = 702;
  37.     const ItemVal m_Zoom4 = 704;
  38.     const ItemVal m_Zoom8 = 708;
  39.     const ItemVal m_Zoom16 = 716;
  40.     const ItemVal m_Zoom32 = 732;
  41.  
  42.     const ItemVal m_fgbgFrame = 2100;
  43.     const ItemVal m_fgColor = 2101;
  44.     const ItemVal m_bgColor = 2102;
  45.     const ItemVal m_brushFrame = 2120;
  46.  
  47.     const ItemVal m_DrawCombo = 2151;
  48.     const ItemVal m_QuickPick = 2152;
  49.     const ItemVal m_ColorPalette = 2153;
  50.     const ItemVal m_Snap = 2154;
  51.     const ItemVal m_ToolBox = 2155;
  52.     const ItemVal m_BrshBox = 2156;
  53.     
  54.     const ItemVal m_DrawPoint = 200;
  55.     const ItemVal m_DrawLine = 201;
  56.     const ItemVal m_DrawRect = 202;
  57.     const ItemVal m_DrawRdRect = 204;
  58.     const ItemVal m_DrawEllipse = 206;
  59.     const ItemVal m_DrawZoom = 208;
  60.     const ItemVal m_DrawFill = 209;
  61.     const ItemVal m_DrawClear = 210;
  62.     const ItemVal m_DrawUndo = 211;
  63.     const ItemVal m_DrawText = 212;
  64.     const ItemVal m_DrawDropper = 213;
  65.     const ItemVal m_DrawSelect = 214;
  66.     const ItemVal m_DrawPixel = 215;
  67.     const ItemVal m_DrawGrid = 216;
  68.     const ItemVal m_DrawRefresh = 217;
  69.  
  70.     const ItemVal m_PenSolid = 301;
  71.     const ItemVal m_PenTransparent = 302;
  72.     const ItemVal m_PenDash = 303;
  73.     const ItemVal m_PenDot = 304;
  74.     const ItemVal m_PenDashDot = 305;
  75.  
  76.     const ItemVal m_BrushSolid = 310;
  77.     const ItemVal m_BrushTransparent = 311;
  78.     const ItemVal m_BrushHoriz = 312;
  79.     const ItemVal m_BrushVert = 313;
  80.     const ItemVal m_BrushLeft = 314;
  81.     const ItemVal m_BrushRight = 315;
  82.     const ItemVal m_BrushCross = 316;
  83.     const ItemVal m_BrushDiagCross = 317;
  84.  
  85.     const ItemVal m_MousePosLbl = 402;
  86.     const ItemVal m_MousePosX = 403;
  87.     const ItemVal m_MousePosY = 404;
  88.  
  89.     const ItemVal m_DrawAllDialog = 900;
  90.     const ItemVal m_ColorAllDialog = 901;
  91.     const ItemVal m_ToolAllDialog = 902;
  92.     const ItemVal m_BrshAllDialog = 903;
  93.     const ItemVal m_FillAllDialog = 904;
  94.  
  95.     class vColorDialog;
  96.     class vToolDialog;
  97.     class vBrshDialog;
  98.     class myCanvasPane;
  99.     class Picture;
  100.     class myColor_Pal;
  101.  
  102.     class myCmdWindow : public vCmdWindow
  103.       {
  104.         friend int AppMain(int, char**);   // allow AppMain access
  105.  
  106.       public:           //--------------------------------- public
  107.         myCmdWindow(char*, int, int);       // Constructor with size
  108.         virtual ~myCmdWindow();             // Destructor
  109.         virtual void WindowCommand(ItemVal id, ItemVal val,
  110.                 CmdType cType);            // executes commands from window
  111.         int CheckClose();    // Checks is changes have been made to file before closing
  112.         void OpenFile(char* fname);        // Opens a given file to the canvas
  113.         void MouseXYStatus(int x, int y);    // Get the current X, Y status of the mouse
  114.         int GetText(void);        // Allows user to enter text into a dialog box
  115.         int write_text(char letter, int location); // writes text input on the canvas
  116.  
  117.     void SetFGBtn(vColor& color);
  118.     void SetBGBtn(vColor& color);
  119.  
  120.         vColorDialog* myColDlg;        // pointer to our color dialog window
  121.         
  122.       protected:        //------------------------------ protected
  123.  
  124.       private:          //-------------------------------- private
  125.  
  126.         // Pointers to panes this window contains
  127.         vMenuPane* myMenu;              // For the menu bar
  128.         myCanvasPane* myCanvas;         // For the canvas
  129.         vCommandPane* myCmdPane;        // for the command pane
  130.         vCommandPane* myToolPane;       // for the command pane
  131.  
  132.         int GetDigit(char * digitstring);     // Get a digit from the string 
  133.     int GetWH(int& width, int& height);
  134.  
  135.         Picture *_myPicture;
  136.         myColor_Pal *myColPal;
  137.         vStatusPane* myStatus;          // for status pane
  138.  
  139.         vBrshDialog* myBrshDlg;        // pointer to brush box dialog
  140.         
  141.         int curWidth;            // current brush width        
  142.         int curShape;            // current brush shape
  143.  
  144.         int _mx, _my;                   // Mouse coordinates
  145.         vPen _pen;                      // track pen color
  146.         vBrush _fgbrush;        // brush with foreground color
  147.         vBrush _bgbrush;        // brush with background color
  148.         vColor _bg;                     // background color
  149.         ItemVal brushMenuId;
  150.         ItemVal penMenuId;
  151.         char _fname[100];               // file name
  152.       };
  153. #endif
  154.