home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Bonus / WSTAR2 / DISK4 / WIDOWCTL.WM_ / WIDOWCTL.bin
Text File  |  1994-02-28  |  12KB  |  153 lines

  1. REM Description:  Widow control on/off
  2. REM Filename: widowctl.wmc
  3. REM Created by: Steve Wylie - 11/08/93
  4.  
  5. REM Can't run if no document open
  6. IF GetDocName$() = "" THEN
  7.     MESSAGE "Please create a new document or open an existing document first."
  8.     STOP
  9. ENDIF
  10.  
  11. REM Can't run in a graphic or table frame
  12. frameType% = GetFrameType()
  13. IF frameType% <> 0 THEN
  14.     Message "The current frame must be a text frame."
  15.     STOP
  16. ENDIF
  17.  
  18. REM Can't run in frame mode
  19. ret% = ViewEditMode(1)
  20. IF ret% = 2 THEN
  21.     ret% = ViewEditMode(2)
  22.     BEEP
  23.     STOP
  24. ENDIF
  25.  
  26. REM Change this value to 0 to make the change globally
  27. local% = 1
  28.  
  29. REM Save the beginning and end of the selection
  30. yes% = GetTextOffset(strt%, end%)
  31. IF strt% = 0 THEN strt% = 4
  32.  
  33. REM Freeze the screen so that the activity isn't visible
  34. freeze% = ViewFreezeScreen(1)
  35.  
  36. EditGotoOffset strt%, 
  37. DO
  38.     ret% = GetTextOffset(savestart%, saveend%)
  39.     ParaDown 1, 
  40.     ret% = GetTextOffset(start2%, end2%)
  41.     numParagraphs% = numParagraphs% + 1
  42. LOOP UNTIL end2% >= end% OR end2% = saveend%
  43.  
  44. REM Go to the beginning of the selection
  45. EditGotoOffset strt%, 0
  46.  
  47. REM Use the first paragraph to figure out whether Widow control should be turned on or off.  Then perform
  48. REM the same operation on the entire selection.
  49. GetStyleParagraph first%, left%, right%, above%, below%, align%, location%, span%, hyphen%, numHyph%, keep%, allowBreak%, widow%
  50.  
  51. REM Toggle the setting of the first paragraph.
  52. if widow% = 1 then
  53.     widow% = 0
  54. else
  55.     widow% = 1
  56. endif
  57.  
  58. FOR i% = 1 TO numParagraphs%
  59.     REM Get the style information
  60.     currStyle$ = GetStyle$()
  61.     
  62.     REM Redefine the style with the new widow setting
  63.     DefineStyle currStyle$, local%
  64.     DefineStyleParagraph , , , , , , , , , , , , widow%
  65.     EndDefineStyle 1
  66.  
  67.     REM Go to the next paragraph.
  68.     ParaDown 1,0
  69.     IF GetNextChar$(1) <> "<Cr>" THEN CharRight 1,0,
  70. NEXT i%
  71.  
  72. REM Restore the selection
  73. EditGotoOffset strt%, 0
  74. if yes%=1 then EditGotoOffset end%, 1
  75.  
  76. REM Restore the screen
  77. freeze% = ViewFreezeScreen(freeze%)
  78.  
  79. 
  80. *****  WARNING *****
  81. This is a WSWin macro file.
  82. Subsequent data is binary information and should not be modified.
  83. # MF # 1.0None762570844>▓p#
  84. 8àêë
  85. âêçèâ
  86. 8ìî
  87. ïìÄÅ
  88. 8    
  89. 8    æÉÆ
  90. 8 âÉöâ
  91. 8ûò
  92. ïûùÿ
  93. 8
  94. 8¢Ç
  95. ܢ֣
  96. 8
  97. âÖ₧ƒâ
  98. 8á₧
  99. ÜáÖí
  100. 8
  101. 8
  102. 8óÇ
  103. 8 ñѪúº
  104. 8
  105. âÑ⌐â
  106. 8 Ѭ
  107. 8 #¡Ç
  108. ¼¡½«
  109. 8#%
  110. »Ñ▒
  111. 8%' ñ┤╡Ö╢
  112. 8'(╕Ç
  113. ╖╕╣
  114. 8() ñ║╗Ö╝
  115. 8)*╜╜Ç
  116. 8*+
  117. ╛╗╡┐ª╛â╗┐▓â
  118. 8+.└
  119. »Ñ└┴
  120. 8.2 ┬├─┼╞╟╚╔╩╦╠═╬╧╨
  121. 824
  122. â╧Ç╥â
  123. 846╧╤
  124. 868π
  125. 88;╘╜╙Ç╒╙╙Çâ╙╘╪â
  126. 8;=
  127. ┌█▄    ┘█
  128. 8=@
  129. ▌┘ó▐
  130. 8@A ▀╧α
  131. 8ABΓÇßΓπ
  132. 8BEΣÇσ
  133. ╖Σσµ
  134. 8EE$ΩÇ
  135. τΩδ∞ âδΘφâ
  136. 8E$F∩Ç≡ ε∩≡±
  137. 8FG╫
  138. 8GJ≥
  139. »Ñ≥≤
  140. 8JJ
  141. âúÇ⌡â
  142. 8JKւ
  143. »ª÷≈
  144. 8KN
  145. ¼½½°√~╛ñ····················.r.r.r .r-.r5.r;.rA.rN.r^.r    l.r
  146. z.r ê.r û.rñ.r▓.r╢.r╣.r╜.r└.r┬.r─.r╞.r╔.r╠.r╧.r╥.r╘.r╓.r┌.r▄.r▐.rα.r Γ.r!Σ.r"Θ.r#∞.r$≡.r%⌡.r&ⁿ.r'/r(
  147. /r)/r*/r+/r,"/r-(/r.-/r/3/r06/r1;/r2@/r3B/r4E/r5J/r6N/r7T/r8Y/r9`/r:g/r;l/r<o/r=w/r>y/r?{/r@/rAê/rBî/rCÅ/rDù/rE₧/rFú/rG¡/rH┤/rI╣/rJ╜/rK┬/rL╟/rM═/rN╤/rO╒/rP▄/rQπ/rRΩ/rS≡/rT≈/rU0rV0rW0rX$0rY10rZ:0r[G0r\P0r]X0r^`0r_h0r`q0rav0rb{0rcÇ0rdç0reÄ0rfö0rg¢0rh¥0rió0rj¿0rk«0rl╡0rm╛0rn╟0ro╦0rp╙0rq╫0rr▄0rsΓ0rtΦ0ruε0rv⌠0rw∙0rx■0ry1rz1r{1r|1r}WÇ  WÇ+WÇ+    WÇWÇWÇ  WÇ WÇ
  148. ë,WÇ  H1WÇ+      4WÇ      9WÇ     >WÇ  HCWÇçKWÇ+      ÄWÇ      ôWÇ  ÿWÇ     ¥WÇ          ¿WÇç╡WÇ     ║WÇ  ÿ┐WÇ  ÿ─WÇ+      εWÇ      ≤WÇ  °WÇ     ■WÇ          WÇçWÇ  WÇ     WÇ  ⁿ!WÇ+  #WÇ  ⁿ(WÇ  .WÇ     4WÇ          ;WÇ          @WÇçNWÇ          TWÇ          YWÇ     _WÇ  JdWÇ  JiWÇ+  kWÇ          sWÇçPäWÇ  èWÇ     ÉWÇAMƒWÇ  ÑWÇ     ½WÇ  x░WÇ  °╢WÇ          ┴WÇ          ╩WÇ     ╨WÇAA┘WÇ  ▀WÇ     σWÇ          φWÇ          ≤WÇ     ∙WÇ          WÇ  WÇ  WÇ  WÇ      WÇA2WÇ          9WÇ          ?WÇ          FWÇ          MWÇ          TWÇ          [WÇ          eWÇ          kWÇ          sWÇ          |WÇ          éWÇ          ÄWÇ          òWÇ      ¢WÇ  xíWÇ  hºWÇ          ¬WÇ  »WÇ  Ü╡WÇ  ¿╗WÇ  Æ┴WÇ  É╟WÇ
  149.           ╥WÇ
  150. ë,▄WÇ      ΓWÇ     ΦWÇA.⌠WÇ     ·WÇA1WÇ     WÇA?$WÇ  *WÇ     0WÇ  6WÇ  <WÇ     BWÇ
  151. ëDOWÇ  éUWÇ+      \WÇ  bWÇ      hWÇ     nWÇ  étWÇAF~WÇ  äWÇ  èWÇ     ÉWÇ  ûWÇ     £WÇ  ▄óWÇ  ▄¿WÇ  «WÇ     ┤WÇ     ║WÇ╝WÇ????01CANCELERRORNUM[T1]
  152. GETDOCNAME$[L1]""[T2][T3][L2]MESSAGE"Please create a new document or open an existing document first."[T4][T5][T6]FRAMETYPE%GETFRAMETYPE[T7][L3][L4]"The current frame must be a text frame."[T8][T9][T10]RET%VIEWEDITMODE[T11][T12][L5]2[L6][T13][T14]LOCAL%YES%GETTEXTOFFSETSTRT%END%[T15][L7][L8]4FREEZE%VIEWFREEZESCREEN[T16][T17]EDITGOTOOFFSET[T18][T19][L9][L10]SAVESTART%SAVEEND%[T20]PARADOWN[T21][T22]START2%END2%[T23]NUMPARAGRAPHS%[T24][T25][T26][T27]GETSTYLEPARAGRAPHFIRST%LEFT%RIGHT%ABOVE%BELOW%ALIGN%LOCATION%SPAN%HYPHEN%NUMHYPH%KEEP%ALLOWBREAK%WIDOW%[T28][L11][L12]I%[F1][L13][L14][L15][L16]CURRSTYLE$GETSTYLE$[T29][T30]DEFINESTYLE[T31]DEFINESTYLEPARAGRAPH[T32]ENDDEFINESTYLE[T33][T34][T35][T36][T37]GETNEXTCHAR$[L17]"<Cr>"[T38][T39][T40][L18]CHARRIGHT[T41][T42][T43][T44][T45][L19][L20][T46][T47][T48]
  153.