home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / freedraft.tar.gz / freedraft.tar / FREEdraft-050298 / VIEWPORT / vdcmdwin.h < prev    next >
C/C++ Source or Header  |  1998-04-29  |  4KB  |  139 lines

  1. // vdcmdwin.h
  2.  
  3.  
  4. // Copyright (C) 1997,1998  Cliff Johnson                                  //
  5. //                                                                         //
  6. // This program is free software; you can redistribute it and/or           //
  7. // modify it under the terms of the GNU  General Public                    //
  8. // License as published by the Free Software Foundation; either            //
  9. // version 2 of the License, or (at your option) any later version.        //
  10. //                                                                         //
  11. // This software is distributed in the hope that it will be useful,        //
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of          //
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       //
  14. // General Public License for more details.                                //
  15. //                                                                         //
  16. // You should have received a copy of the GNU General Public License       //
  17. // along with this software (see COPYING); if not, write to the        //
  18. // Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
  19.  
  20. // Derive a window from the vCmdWindow class
  21.  
  22. #ifndef VDCMDWIN_H
  23. #define VDCMDWIN_H
  24.  
  25. #include <v/vcmdwin.h>      // So we can use vCmdWindow
  26. #include <v/vmenu.h>        // For the menu pane
  27. #include <v/vcmdpane.h>     // command pane
  28. #include <v/vstatusp.h>
  29. #include <v/vdialog.h>      // dialogs
  30.  
  31. // vdapp support classes
  32. #include <typemaskbehavior.h>        //HASA
  33. #include <modifierbehavior.h>        //HASA
  34. #include <functionmapbehavior.h>    //HASA
  35. #include <inputstring.h>        //HASA
  36.  
  37. // data managment support classes
  38. #include <geombank.h>            //HASA
  39.  
  40. // debug support
  41. #ifdef vDEBUG
  42. #include <v/vdebug.h>
  43. #endif
  44.  
  45. #include <vdglcanvas.h>            //HASA
  46. #include <selection.h>
  47. #include <vector>
  48. #include <string>
  49. #include <selectstack.h>
  50.  
  51. class MenuHandler;
  52. class TableDrawables;
  53.  
  54. // 
  55.  
  56. class vdCmdWindow : public vCmdWindow
  57. {
  58.  
  59.     // function flags
  60.     enum {
  61.         DEFAULT_SNAP_RESOLUTION = 2
  62.     };
  63.  
  64.         friend int AppMain(int, char**);        // allow AppMain access
  65.  
  66.       public:           //---------------------------------------- public
  67.         vdCmdWindow(char*, int, int);    // Constructor with size
  68.         virtual ~vdCmdWindow();          // Destructor
  69.         virtual void WindowCommand(ItemVal id,ItemVal val,CmdType cType);
  70.         virtual void KeyIn(vKey keysym, unsigned int shift);
  71.  
  72. // process responses from vdglcanvas
  73.     void CanvasPick(const SelectStack& ss);
  74.  
  75. // command sub-handlers
  76.     void FileMenuCommand(ItemVal id, ItemVal val, CmdType cType);
  77.     void AttributeMenuCommand(ItemVal id, ItemVal val, CmdType cType);
  78.     void ViewMenuCommand(ItemVal id, ItemVal val, CmdType cType);
  79.     void ButtonBarCommand(ItemVal id, ItemVal val, CmdType cType);
  80. //    void FunctionMenuCommand(ItemVal id, ItemVal val, CmdType cType);
  81.  
  82.     
  83.       private:          //--------------------------------------- private
  84.  
  85.         vMenuPane* vdMainMenu;             // For the menu bar
  86.     int runningFunction;
  87.     int snapResolution; //  ATTENTION: resolution is actually 10 ^ snapResolution !!!!
  88.  
  89. // declare the canvas
  90.  
  91.     VDGLCanvas* vdglcanvas;           // opengl canvas - 
  92.  
  93.         vCommandPane* typeMaskCmdPane;     // for the entity selection buttons
  94.  
  95.     vCommandPane* functionMenuCmdPane;      // for the functional menu 
  96.  
  97.     vStatusPane* inputStatusPane;             // reflection of text entry
  98.  
  99. // support class for keyboard entry
  100. //    class InputString inputString;
  101.  
  102. // controller classes  for button behavior
  103.     TypeMaskBehavior typeMaskBehavior;
  104.     ModifierBehavior modifierBehavior;
  105.     FunctionMapBehavior functionMapBehavior;
  106.  
  107. // data manager class
  108.     GeomBank* bank;
  109.  
  110.     CanvasRegister* drawregister;
  111.  
  112. // stack of selections and actions
  113.     vector<Selection> cmdwinSelections;
  114.     vector<int> cmdwinActions;
  115. public:
  116. // Geometry creation functions
  117.     void PointByPicking(const SelectStack& ss);
  118.  
  119. // menu manager class
  120.     MenuHandler* menuHandler;
  121.     friend class MenuHandler;
  122.  
  123. // manager interfaces
  124. //    int LoadMenuLabel(int,const char*,int);
  125. //    int LoadMenuButton(int,const char*,int);
  126.  
  127. private: // common data for the various menuHandlers to use
  128.     int currentColor;
  129.     unsigned short currentLineStyle;
  130.     unsigned int currentThick;
  131.     unsigned int currentPointSize;
  132.     unsigned int currentLayer;
  133.     
  134.     string currentFileName;
  135.     
  136.     TableDrawables* tableDrawables;
  137. };
  138. #endif
  139.