1   module Params where
    2 
    3 
    4 
    5 
    6 
    7 
    8 
    9 
   10   data Command = Polygon | Union | Intersect | Subtract | Complement | Partition 
   11                   | Render | Classify | Area | Quit | Null deriving (Eq)
   12 
   13 
   14 
   15   --partain: type String = [Char]
   16 
   17 
   18 
   19 
   20 
   21   type Button = (Command,Int,String)
   22 
   23 
   24 
   25 
   26   delimiter :: String
   27   delimiter = "         "
   28 
   29 
   30 
   31 
   32 
   33   blank :: String
   34   blank = "              "
   35 
   36 
   37 
   38 
   39 
   40   buttonHeight :: Int
   41   buttonHeight = 40
   42   buttonWidth :: Int
   43   buttonWidth = 110
   44   buttonIndent :: Int
   45   buttonIndent = 5
   46 
   47 
   48 
   49 
   50   textIn :: Int
   51   textIn = buttonIndent+4
   52   textDown :: Int
   53   textDown =  30
   54 
   55 
   56 
   57   renderRegion :: [Int]
   58   renderRegion = [renderLeft,renderTop,windowWidth,renderHeight]
   59 
   60 
   61 
   62 
   63   renderTop :: Int
   64   renderTop = 0
   65   renderLeft :: Int
   66   renderLeft = 120
   67   renderHeight :: Int
   68   renderHeight = 510
   69   renderWidth :: Int
   70   renderWidth = 780
   71 
   72 
   73 
   74 
   75   windowRegion :: [Int]
   76   windowRegion = [0,0,windowWidth,windowHeight]
   77 
   78 
   79 
   80   textRegion :: [Int]
   81   textRegion = [0,(renderHeight+5),(renderLeft-5),50]
   82 
   83 
   84 
   85   noTextRegion :: [Int]
   86   noTextRegion = treeRegion
   87 
   88 
   89 
   90   treeRegion :: [Int]
   91   treeRegion = [renderLeft,(renderHeight+5),
   92                                   (windowWidth-renderLeft),(windowHeight-renderHeight)]
   93 
   94 
   95 
   96   mouseRegion :: [Int]
   97   mouseRegion = [0,0,windowWidth,windowHeight]
   98 
   99 
  100 
  101 
  102   windowLeft :: Int
  103   windowLeft = 100
  104   windowTop :: Int
  105   windowTop = 50
  106   windowWidth :: Int
  107   windowWidth = 900
  108   windowHeight :: Int
  109   windowHeight = 700
  110 
  111 
  112 
  113   mouseBox :: [Int]
  114   mouseBox = [mouseLeft,mouseTop,mouseWidth,mouseHeight]
  115   mouseLeft :: Int
  116   mouseLeft = buttonIndent
  117   mouseTop :: Int
  118   mouseTop = renderHeight+55
  119   mouseWidth :: Int
  120   mouseWidth = (renderLeft-10)
  121   mouseHeight :: Int
  122   mouseHeight = mbuttonHeight+18
  123 
  124 
  125 
  126   button1Box :: [Int]
  127   button1Box = [(buttonIndent+5),(renderHeight+60),mbuttonWidth,mbuttonHeight]
  128   button2Box :: [Int]
  129   button2Box = [(buttonIndent+40),(renderHeight+60),mbuttonWidth,mbuttonHeight]
  130   button3Box :: [Int]
  131   button3Box = [(buttonIndent+75),(renderHeight+60),mbuttonWidth,mbuttonHeight]
  132 
  133 
  134 
  135   button1TextOrigin,button2TextOrigin,button3TextOrigin :: (Int,Int)
  136   button1TextOrigin = ((buttonIndent+8),(renderHeight+75))
  137   button2TextOrigin = ((buttonIndent+43), (renderHeight+75))
  138   button3TextOrigin = ((buttonIndent+78), (renderHeight+75))
  139 
  140 
  141 
  142   mbuttonWidth :: Int
  143   mbuttonWidth = 30
  144   mbuttonHeight :: Int
  145   mbuttonHeight = 104
  146 
  147 
  148 
  149 
  150   mouseCaptionDown,mouseCaptionAcross :: Int
  151   mouseCaptionDown = (renderHeight+74+mbuttonHeight)
  152   mouseCaptionAcross = buttonIndent+38
  153 
  154 
  155 
  156   buttons :: [Button]
  157   buttons = [primitiveButton,unionButton,intersectButton,subtractButton,
  158                 complementButton, partitionButton, renderButton, 
  159                                 classifyButton, areaButton, quitButton]
  160 
  161 
  162 
  163   primitiveButton :: Button
  164   primitiveButton = (Polygon,10,        "   Polygon    ")
  165   unionButton :: Button
  166   unionButton = (Union,60,              "    Union     ")
  167   intersectButton :: Button
  168   intersectButton = (Intersect,110,     "  Intersect   ")
  169   subtractButton :: Button
  170   subtractButton = (Subtract,160,       "   Subtract   ")
  171   complementButton :: Button
  172   complementButton = (Complement,210,   "  Complement  ")
  173   partitionButton :: Button
  174   partitionButton = (Partition,260,     "Partitionings ")
  175   renderButton :: Button
  176   renderButton = (Render,310,           "    Render    ")
  177   classifyButton :: Button
  178   classifyButton = (Classify,360,       "Classify Point")
  179   areaButton :: Button
  180   areaButton = (Area,410,               "     Area     ")
  181   quitButton :: Button
  182   quitButton = (Quit,460,               "     Quit     ")
  183 
  184 
  185 
  186   button :: Int -> [Int]
  187   button d = [buttonIndent,d,buttonWidth,buttonHeight]  
  188 
  189 
  190 
  191 
  192   mouseDispx, mouseDispy :: Int
  193   mouseDispx = 5
  194   mouseDispy = 4
  195 
  196 
  197 
  198   gap = ' '