home *** CD-ROM | disk | FTP | other *** search
- REM Description: Use outline numbering
- REM Filename: outline.wmc
- REM Created by: Steve Wylie - 11/08/93
-
- REM Can't run if no document open
- IF GetDocName$() = "" THEN
- MESSAGE "Please create a new document or open an existing document first."
- STOP
- ENDIF
-
- REM Can't run in a graphic or table frame
- frameType% = GetFrameType()
- IF frameType% <> 0 AND frameType% <> 2 THEN
- Message "The current frame must be a text or table frame."
- STOP
- ENDIF
-
- REM Can't run in frame mode
- ret% = ViewEditMode(1)
- IF ret% = 2 THEN
- ret% = ViewEditMode(2)
- BEEP
- STOP
- ENDIF
-
- CONST Outline$ = "Outline"
- GetCurrentStyle currStyle$, local%
-
- IF INSTR(currStyle$, Outline$) > 0 THEN
- level% = VAL(Right$(currStyle$,1))
- ELSE
- level% = 0
- ENDIF
-
- REM Use this dialog if we are using any outline style except for Outline 8
- BEGIN DIALOG Dialog1 250, 34, "Outline Numbering"
- TEXT 4, 4, 140, 8, "Choose the desired outline level:"
- PUSHBUTTON 70, 14, 60, 14, currStyle$, 4
- PUSHBUTTON 136, 14, 60, 14, nextStyle$, 5
- CANCELBUTTON 202, 14, 40, 14
- PUSHBUTTON 4, 14, 60, 14, prevStyle$, 3
- END DIALOG
-
- REM Use this dialog if we are not using an outline style
- BEGIN DIALOG Dialog2 250, 34, "Outline Numbering"
- TEXT 4, 4, 140, 8, "Choose the desired outline level:"
- PUSHBUTTON 70, 14, 60, 14, currStyle$, 4
- PUSHBUTTON 136, 14, 60, 14, nextStyle$, 5
- CANCELBUTTON 202, 14, 40, 14
- END DIALOG
-
- SELECT CASE level%
-
- REM Not using any outline style
- CASE 0
- nextStyle$ = Outline$ + " 1"
- ret% = Dialog(Dialog2)
-
- CASE 1
- prevStyle$ = "BodyText"
- nextStyle$ = Outline$ + " 2"
- ret% = Dialog(Dialog1)
-
- CASE 2 TO 7
- prevStyle$ = Outline$ + " " + str$(level% - 1)
- nextStyle$ = Outline$ + " " + str$(level% + 1)
- ret% = Dialog(Dialog1)
-
- CASE 8
- prevStyle$ = Outline$ + " 7"
- nextStyle$ = "BodyText"
- ret% = Dialog(Dialog1)
-
- CASE ELSE
- REM If we got here, something went wrong.
- STOP
-
- END SELECT
-
- SELECT CASE ret%
-
- CASE 2
- STOP
-
- REM Use previous style.
- CASE 3
- StyleApplyStyle prevStyle$, 0
-
- CASE 4
- StyleApplyStyle currStyle$, 0
-
- CASE 5
- IF ExistStyle(nextStyle$) = 1 THEN
- StyleApplyStyle nextStyle$, 0
- ELSE
- StyleCreateStyle nextStyle$, currStyle$, 1
- StyleApplyStyle nextStyle$, 0
- GetStyleParagraph first%, left%, right%, above%, below%, align%, location%, span%, hyphen%, numHyph%, keep%, allowBreak%, widow%
- adjust% = TO_DP("0.50", 0)
- first% = first% + adjust%
- left% = left% + adjust%
- DefineStyle nextStyle$, 0
- DefineStyleNextStyle nextStyle$
- DefineStyleParagraph first%, left%, , , , , , , , , , ,
- DefineStyleNumbering Outline$, level%+1, first% - adjust%,
- EndDefineStyle 1
- ENDIF
-
- END SELECT
-
-
-
- ***** WARNING *****
- This is a WSWin macro file.
- Subsequent data is binary information and should not be modified.