GraphicsContext.st
changeset 4902 d1511e0c9adb
parent 4901 b96f1e51b7ec
child 4903 9bed66cb8c21
equal deleted inserted replaced
4901:b96f1e51b7ec 4902:d1511e0c9adb
  1730 
  1730 
  1731     "left line"
  1731     "left line"
  1732     self displayLineFromX:left y:(top + hHalf - 1) toX:left y:(bottom - hHalf).
  1732     self displayLineFromX:left y:(top + hHalf - 1) toX:left y:(bottom - hHalf).
  1733 
  1733 
  1734     "top right arc"
  1734     "top right arc"
  1735     self displayArcX:(right - wC + 1) y:top width:wC height:hC from:0 angle:90.
  1735     self displayArcX:(right - wC) y:top width:wC height:hC from:0 angle:90.
  1736 
  1736 
  1737     "bottom line"
  1737     "bottom line"
  1738     self displayLineFromX:(left + wHalf -1) y:bottom+1
  1738     self displayLineFromX:(left + wHalf -1) y:bottom
  1739                       toX:(right - wHalf + 1 ) y:bottom+1.
  1739                       toX:(right - wHalf ) y:bottom.
  1740 
  1740 
  1741     "bottom right arc"
  1741     "bottom right arc"
  1742     self displayArcX:(right - wC + 1) y:(bottom - hC + 1) width:wC height:hC from:270 angle:90.
  1742     self displayArcX:(right - wC) y:(bottom - hC) width:wC height:hC from:270 angle:90.
  1743 
  1743 
  1744     "right line"
  1744     "right line"
  1745     self displayLineFromX:right+1 y:(top + hHalf) toX:right+1 y:(bottom - hHalf).
  1745     self displayLineFromX:right y:(top + hHalf) toX:right y:(bottom - hHalf).
  1746 
  1746 
  1747     "bottom left arc"
  1747     "bottom left arc"
  1748     self displayArcX:left y:(bottom - hC + 1) width:wC height:hC from:180 angle:90
  1748     self displayArcX:left y:(bottom - hC) width:wC height:hC from:180 angle:90
  1749 
  1749 
  1750     "
  1750     "
  1751      |v|
  1751      |v|
  1752 
  1752 
  1753      (v := View new) extent:200@200; openAndWait.
  1753      (v := View new) extent:200@200; openAndWait.
  2338     device platformName = 'WIN32' ifTrue:[
  2338     device platformName = 'WIN32' ifTrue:[
  2339         "/ bug workaround
  2339         "/ bug workaround
  2340         "top left arc"
  2340         "top left arc"
  2341         self fillArcX:left y:top width:wC height:hC from:90 angle:90.
  2341         self fillArcX:left y:top width:wC height:hC from:90 angle:90.
  2342         "top right arc"
  2342         "top right arc"
  2343         self fillArcX:(right - wC) y:top width:wC height:hC from:0 angle:90.
  2343         self fillArcX:(right - wC - 1) y:top width:wC height:hC from:0 angle:90.
  2344         "bottom right arc"
  2344         "bottom right arc"
  2345         self fillArcX:(right - wC) y:(bottom - hC) width:wC height:hC from:270 angle:90.
  2345         self fillArcX:(right - wC - 1) y:(bottom - hC - 1) width:wC height:hC from:270 angle:90.
  2346         "bottom left arc"
  2346         "bottom left arc"
  2347         self fillArcX:left y:(bottom - hC) width:wC height:hC from:180 angle:90.
  2347         self fillArcX:left y:(bottom - hC) width:wC height:hC-1 from:180 angle:90.
       
  2348 
       
  2349         "center rectangle"
       
  2350         self fillRectangleX:(left + wHalf) y:top width:(width - wHalf - wHalf) height:height-1.
       
  2351         "left partial rectangle"
       
  2352         self fillRectangleX:left y:top+hHalf width:wHalf height:(height-hHalf-hHalf).
       
  2353         "right partial rectangle"
       
  2354         self fillRectangleX:right-wHalf y:top+hHalf width:wHalf-1 height:(height-hHalf-hHalf).
  2348     ] ifFalse:[
  2355     ] ifFalse:[
  2349         "top left arc"
  2356         "top left arc"
  2350         self fillArcX:left y:top width:wC height:hC from:90 angle:90.
  2357         self fillArcX:left y:top width:wC height:hC from:90 angle:90.
  2351         "top right arc"
  2358         "top right arc"
  2352         self fillArcX:(right - wC) y:top width:wC height:hC from:0 angle:90.
  2359         self fillArcX:(right - wC) y:top width:wC height:hC from:0 angle:90.
  2353         "bottom right arc"
  2360         "bottom right arc"
  2354         self fillArcX:(right - wC - 1) y:(bottom - hC) width:wC height:hC from:270 angle:90.
  2361         self fillArcX:(right - wC - 1) y:(bottom - hC) width:wC height:hC from:270 angle:90.
  2355         "bottom left arc"
  2362         "bottom left arc"
  2356         self fillArcX:left y:(bottom - hC + 1) width:wC height:hC from:180 angle:90.
  2363         self fillArcX:left y:(bottom - hC + 1) width:wC height:hC from:180 angle:90.
  2357 
  2364 
  2358     ].
  2365         "center rectangle"
  2359 
  2366         self fillRectangleX:(left + wHalf) y:top width:(width - wHalf - wHalf+1) height:height.
  2360     "center rectangle"
  2367         "left partial rectangle"
  2361     self fillRectangleX:(left + wHalf) y:top width:(width - wHalf - wHalf+1) height:height.
  2368         self fillRectangleX:left y:top+hHalf width:wHalf height:(height-hHalf-hHalf).
  2362     "left partial rectangle"
  2369         "right partial rectangle"
  2363     self fillRectangleX:left y:top+hHalf width:wHalf height:(height-hHalf-hHalf).
  2370         self fillRectangleX:right-wHalf y:top+hHalf width:wHalf height:(height-hHalf-hHalf).
  2364     "right partial rectangle"
  2371     ].
  2365     self fillRectangleX:right-wHalf y:top+hHalf width:wHalf height:(height-hHalf-hHalf).
  2372 
  2366 
  2373 
  2367     "
  2374     "
  2368      |v|
  2375      |v|
  2369 
  2376 
  2370      (v := View new) extent:200@200; openAndWait.
  2377      (v := View new) extent:200@200; openAndWait.
  2411 ! !
  2418 ! !
  2412 
  2419 
  2413 !GraphicsContext class methodsFor:'documentation'!
  2420 !GraphicsContext class methodsFor:'documentation'!
  2414 
  2421 
  2415 version
  2422 version
  2416     ^ '$Header: /cvs/stx/stx/libview/GraphicsContext.st,v 1.114 2008-02-05 19:26:13 cg Exp $'
  2423     ^ '$Header: /cvs/stx/stx/libview/GraphicsContext.st,v 1.115 2008-02-05 19:58:43 cg Exp $'
  2417 ! !
  2424 ! !
  2418 
  2425 
  2419 GraphicsContext initialize!
  2426 GraphicsContext initialize!