Category : Word Processors
Archive   : BOXIT010.ZIP
Filename : BOXIT.S

 
Output of file : BOXIT.S contained in archive : BOXIT010.ZIP
/*
ÚÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÒ¿
³º Macro Title: BoxIt! º³
³º Version....: 0.10 for TSE 1.0 Pre-Release º³
³º Author.....: George J. De Bruin º³
³º Address....: 1414 Shiloh Rd. Apt/Box 511 º³
³º Plano, TX 75074 º³
³º Phone......: (214) 422-0266 º³
³º BBS Contact: Qedit support conferences on the following Mail Nets: º³
³º RIME, Ilink, Intelec, Metrolink, FidoNet, EchoNet. º³
³º Also available via the Ilink Editor's Conference, and º³
³º directly on SemWare's Support BBS. º³
³ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ³
³º This macro is hereby released as freeware. Anyone may use º³
³º or modify it in any way they see fit. Future versions may carry º³
³º more notices on distributing modified versions of BoxIt! º³
³ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ³
³º R E L E A S E N O T I C E º³
³º º³
³º This macro is officially released to SemWare for possible º³
³º distribution in conjunction with The SemWare Editor, or an ancillaryº³
³º macro collection. º³
³ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ³
³º Purpose: º³
³º º³
³º This is a simple macro that will draw a box around column blocked º³
³º area using TSE's internal line drawing mode. *ONLY* column blocks º³
³º are supported at this time. º³
ÀÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÐÙ
*/

constant MaxColumn = 1008 // Current Maximum in TSE

integer GlobalGap = 0, // Gap between block and box
TopGap = 0,
BottomGap = 0,
LeftGap = 0,
RightGap = 0,
BoxGlobal = TRUE,
BoxTop = TRUE, // Draw Top Line? (True or false)
BoxRight = TRUE, // Draw Right Side? (T/f)
BoxLeft = TRUE, // Draw Left Side? (T/f)
BoxBottom = TRUE // Draw Bottom Line? (T/f)

/* ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ */
proc OptToggle( VAR integer opt)
opt = iif( opt, FALSE, TRUE )
return()
end OptToggle

/* ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ */
proc NumRead( VAR integer n)
string s[5] = str(n)

n = iif(Read(s), val(s), n)
return()
end NumRead

/* ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ */
string proc StrOnOff(integer i)
return (iif(i, "On", "Off"))
end StrOnOff

/* ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ */
string proc StrBoxGlobal(integer i)
string ret[3]
if i < 3
ret = StrOnOff(i)
else
ret = "Inv"
endif
return( ret )
end StrBoxGlobal

/* ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ */
proc GotoRC(integer row, integer col)
GotoLine( row )
GotoColumn( col )
end GotoRC

/* ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ */
proc VLine(integer row1, integer col1, integer row2)

integer direct = iif( row1 > row2, _UP_, _DOWN_ ) // Set Line Drawing
// Direction
GotoRC( row1, col1 ) // Goto Starting Row & Column
while row2 <> CurrLine() // Draw the line
LineDraw(direct)
endwhile
LineDraw( iif( direct == _UP_, _DOWN_, _UP_ ) ) // Make sure there is
LineDraw( iif( direct == _UP_, _DOWN_, _UP_ ) ) // a character in the
end Vline

/* ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ */
proc Hline(integer row1, integer col1, integer col2)

integer direct = iif( col1 > col2, _LEFT_, _RIGHT_ ) // Set Line Drawing
// Direction
GotoRC( row1, col1 ) // Goto Starting Row & Column
while col2 <> CurrCol() // Draw the Line
LineDraw(direct)
endwhile
LineDraw( iif( direct == _LEFT_, _RIGHT_, _LEFT_ ) ) // Make sure there is
LineDraw( iif( direct == _LEFT_, _RIGHT_, _LEFT_ ) ) // a character in the
end Hline

/* ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ */
proc SetAllGaps()
NumRead(GlobalGap) // Get Global Gap Setting
TopGap = GlobalGap // Assign Global Gap to each side
BottomGap = GlobalGap
RightGap = GlobalGap
LeftGap = GlobalGap
pushkey() // Update the menu
end SetAllGaps

/* ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ */
menu SideOnOff()
history
"&On",,CloseBefore
"O&ff",,CloseBefore
"&Invert",,CloseBefore
end SideOnOff

/* ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ */
proc SetAllSides()
SideOnOff() // Get Global Sides On / Off
BoxGlobal = MenuOption() // Which Option was selected?
If BoxGlobal <> 3 // If invert, don't do this
BoxGlobal = iif(BoxGlobal - 2, TRUE, FALSE) // On or Off?
BoxTop = BoxGlobal // Assign value for each side
BoxBottom = BoxGlobal
BoxRight = BoxGlobal
BoxLeft = BoxGlobal
else
BoxTop = not BoxTop // Invert current values
BoxBottom = not BoxBottom
BoxRight = not BoxRight
BoxLeft = not BoxLeft
endif
pushkey() // Update the menu
end SetAllSides

/* ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ */
proc BoxIt()
integer ULC = 0, // Upper left column of block
ULR = 0, // Upper left row of block
LRC = 0, // Lower right column of block
LRR = 0, // Lower right row of block
InsLines = 0,
Insrt = Set(Insert, On) // Turn Insert Mode on and Save
// Previous setting

set(MsgLevel, _WARNINGS_ONLY_) // Turn off display updates

if isBlockInCurrFile() <> _COLUMN_ // Is there a column block in current
message("No Column Block In File.") // buffer? If not, then return.
return()
endif

if isCursorInBlock() <> _COLUMN_ // Is the cursor in the block?
message("Cursor Not In Block.") // If not, then return.
return()
endif

PushPosition() // Store Starting Location
GotoBlockBegin()

ULC = CurrCol()
if (ULC - LeftGap <= 1) and (LeftGap >= 1) // If in first column, or left side
// is past the first column, return.
PopPosition() // Restore Starting position
message("Cannot Insert Box At or Before Beginning of Line.")
return()
endif

ULR = CurrLine()
if (ULR == 1) // If first line of file,
PushPosition() // insert enough lines to permit
Begline() // drawing the box
while InsLines < TopGap + 1
SplitLine()
InsLines = InsLines + 1
endwhile
PopPosition()
ULR = CurrLine()
endif

GotoBlockEnd()

LRC = CurrCol()
if LRC == MaxColumn // If last column of buffer, return
PopPosition() // Restore Starting position
return()
endif

LRR = CurrLine()

if BoxTop // If BoxTop == TRUE, Draw Line
Hline( (ULR - (TopGap)), (ULC - (LeftGap)), (LRC + (RightGap)))
endif

if BoxRight // If BoxRight == TRUE, Draw Line
VLine( (ULR - (TopGap)), (LRC + (RightGap)), (LRR + (BottomGap)))
endif

if BoxBottom // If BoxBottom == TRUE, Draw Line
HLine( (LRR + (BottomGap)), (LRC + (RightGap)), (ULC - (LeftGap)))
endif

if BoxLeft // If BoxLeft == TRUE, Draw Line
VLine( (LRR + (BottomGap)), (ULC - (LeftGap)), (ULR - (TopGap)))
endif

PopPosition() // Restore Starting position
UnmarkBlock() // Get rid of block
Set(Insert, Insrt) // Restore Initial Insert Value
ScrollToRow(Query(WindowRows)/2)
Return() // Exit -- ALL DONE!
end BoxIt

#include ["BoxIt.Hlp"] // Help Menus
#include ["BoxIt.Mnu"] // BoxIt Menus
#include ["BoxIt.Key"] // BoxIt Key Bindings


  3 Responses to “Category : Word Processors
Archive   : BOXIT010.ZIP
Filename : BOXIT.S

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/