home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Science / Science.zip / goat006.zip / SRC.ZIP / goatsrc / SubProcs / resizemain < prev    next >
Text File  |  2002-08-07  |  3KB  |  95 lines

  1.  
  2. mainsizexmainsizey=VpWindow(window,'GETSIZE')
  3. PARSE VAR mainsizexmainsizey mainsizex mainsizey
  4.  
  5. /* Get item size text1002 Push Button */
  6. buttonxbuttony=VpItem(window,1002,'ITEMSIZE')
  7. PARSE VAR buttonxbuttony buttonx buttony
  8.  
  9. /* Get item position text1002 Push Button */
  10. buttonposxbuttonposy=VpItem(window,1002,'ITEMPOS')
  11. PARSE VAR buttonposxbuttonposy buttonposx buttonposy
  12.  
  13. topcorner=buttonposy+buttony
  14.  
  15. buttonposy=topcorner-40
  16. buttonsize=40
  17.  
  18. do i=1002 to 1016
  19.     /* Set item position/size text1002 Push Button */
  20.     CALL VpItem window,i,'SETITEMPOS',buttonposx,buttonposy,buttonsize,buttonsize
  21.     if i=1008 then
  22.       do
  23.         /* Set item position/size 1017 Spin Button */
  24.         CALL VpItem window,1017,'SETITEMPOS',(buttonposx+buttonsize),buttonposy,80,buttonsize
  25.         buttonposx=0
  26.         buttonposy=buttonposy-buttonsize
  27.       end
  28.     else
  29.       buttonposx=buttonposx+buttonsize
  30.     if i=1016 then
  31.       do
  32.         /* Set item position/size Spin 1018 Text */
  33.         CALL VpItem window,1018,'SETITEMPOS',buttonposx,buttonposy,80,buttonsize
  34.       end
  35. end
  36. drop i
  37.  
  38. /* Get item size 1000 Image Editor */
  39. imagesizeximagesizey=VpItem(window,1000,'ITEMSIZE')
  40. PARSE VAR imagesizeximagesizey imagesizex imagesizey
  41.  
  42. /* Get item position 1001 Multi-Line Entry Field */
  43. textposxtextposy=VpItem(window,1001,'ITEMPOS')
  44. PARSE VAR textposxtextposy textposx textposy
  45. /* Get item size 1001 Multi-Line Entry Field */
  46. textsizextextsizey=VpItem(window,1001,'ITEMSIZE')
  47. PARSE VAR textsizextextsizey textsizex textsizey
  48.  
  49. select
  50.   when view='STANDARD' then
  51.     do
  52.       /* Show item 1000 Image Editor */
  53.       CALL VpItem window,1000,'SHOW'
  54.       imagesizey=buttonposy-2
  55.       imagesizex=(mainsizex/2)-7
  56.       /* Set item position/size 1000 Image Editor */
  57.       CALL VpItem window,1000,'SETITEMPOS',0,0,imagesizex,imagesizey
  58.  
  59.       /* Show item 1001 Multi-Line Entry Field */
  60.       CALL VpItem window,1001,'SHOW'   
  61.       textsizey=buttonposy-2
  62.       textsizex=(mainsizex/2)
  63.       textposx=(mainsizex/2)-7
  64.       /* Set item position/size 1001 Multi-Line Entry Field */
  65.       CALL VpItem window,1001,'SETITEMPOS',textposx,textposy,textsizex,textsizey
  66.     end
  67.   when view='IMAGE' then
  68.     do
  69.       /* Show item 1000 Image Editor */
  70.       CALL VpItem window,1000,'SHOW'  
  71.       imagesizey=buttonposy-2
  72.       imagesizex=mainsizex-8
  73.       /* Set item position/size 1000 Image Editor */
  74.       CALL VpItem window,1000,'SETITEMPOS',0,0,imagesizex,imagesizey
  75.       
  76.       /* Hide item 1001 Multi-Line Entry Field */
  77.       CALL VpItem window,1001,'HIDE'    
  78.     end
  79.   when view='TEXT' then
  80.     do
  81.       /* Hide item 1000 Image Editor */
  82.       CALL VpItem window,1000,'HIDE'
  83.       
  84.       /* Show item 1001 Multi-Line Entry Field */
  85.       CALL VpItem window,1001,'SHOW'      
  86.       textsizey=buttonposy-2
  87.       textsizex=mainsizex-7
  88.       textposx=0
  89.       /* Set item position/size 1001 Multi-Line Entry Field */
  90.       CALL VpItem window,1001,'SETITEMPOS',textposx,textposy,textsizex,textsizey
  91.     end
  92.   otherwise
  93.     NOP
  94. end    
  95.