home *** CD-ROM | disk | FTP | other *** search
- Option Public
- Public ConvertCase As MenuItem
- Sub Main
- .UpdateUI
- Dim MenuBar As MenuItem
- Dim FileMenu As MenuItem
- Dim TextMenu As MenuItem
- Dim ViewMenu As MenuItem
- Dim TableMenu As MenuItem
- Dim EditMenu As MenuItem
- Dim InsertMenu As MenuItem
- Dim FormatMenu As MenuItem
- Dim ToolsMenu As MenuItem
- Set MenuBar = .ApplicationWindow.LwpMenuBar
- Set FileMenu = MenuBar.items("&File")
- FileMenu.Action = "uiwatch.lss!File_Menu"
- Set TextMenu = MenuBar.items("&Text")
- TextMenu.Action = "uiwatch.lss!Text_Menu"
- Set ViewMenu = MenuBar.items("&View")
- ViewMenu.Action = "uiwatch.lss!View_Menu"
- Set TableMenu = MenuBar.items("T&able")
- TableMenu.Action = "uiwatch.lss!Table_Menu"
- Set EditMenu = MenuBar.items("&Edit")
- EditMenu.Action = "uiwatch.lss!Edit_Menu"
- Set InsertMenu = MenuBar.items("&Insert")
- InsertMenu.Action = "uiwatch.lss!Insert_Menu"
- Set FormatMenu = MenuBar.items("F&ormat")
- FormatMenu.Action = "uiwatch.lss!Format_Menu"
- Set ToolsMenu = MenuBar.items("&Tools")
- ToolsMenu.Action = "uiwatch.lss!Tools_Menu"
- End Sub
- Sub File_Menu
- Dim MenuBar As MenuItem
- Dim FileMenu As MenuItem
- Dim Revert As MenuItem
- Dim DocName As String
- Dim DocPath As String
- Set MenuBar = .ApplicationWindow.LwpMenuBar
- Set Filemenu = MenuBar.items("&File")
- Set Revert = FileMenu.items("&Revert to Saved")
- Revert.OverrideCheckAndEnable = True
- If .ActiveDocument Is Nothing Then
- Revert.Enabled = False
- Else
- DocPath = .ActiveDocument.Path
- If DocPath = "" Then
- Revert.Enabled = False
- Else
- Revert.Enabled = True
- End If
- End If
- End Sub
- Sub Text_Menu
- Dim MenuBar As MenuItem
- Dim TextMenu As MenuItem
- Dim Caps As MenuItem
- Dim Upper As MenuItem
- Dim Lower As MenuItem
- Dim Small As MenuItem
- Set MenuBar = .ApplicationWindow.LwpMenuBar
- Set Textmenu = MenuBar.items("&Text")
- Set Caps = TextMenu.items("&Caps")
- Set Upper = Caps.items("&Upper Case")
- Upper.OverrideCheckAndEnable = True
- If .Text.Font.UpperCase = True Then
- Upper.Checked = True
- Else
- Upper.Checked = False
- End If
- Set Lower = Caps.items("&Lower Case")
- Lower.OverrideCheckAndEnable = True
- If .Text.Font.LowerCase = True Then
- Lower.Checked = True
- Else
- Lower.Checked = False
- End If
- Set Small = Caps.items("&Small Caps")
- Small.OverrideCheckAndEnable = True
- If .Text.Font.SmallCaps = True Then
- Small.Checked = True
- Else
- Small.Checked = False
- End If
- End Sub
- Sub View_Menu
- Dim MenuBar As MenuItem
- Dim ViewMenu As MenuItem
- Dim Tools As MenuItem
- Dim ScriptBar As MenuItem
- Dim Text_Bar As MenuItem
- Dim UnivBar As MenuItem
- Dim Normal As MenuItem
- Dim Layout As MenuItem
- Dim Outline As MenuItem
- Dim FullScreen As MenuItem
- Dim Footnotes As MenuItem
- Dim Graphics As MenuItem
- Dim Table_Grid As MenuItem
- Dim Hidden_Text As MenuItem
- Dim Returns As MenuItem
- Dim BarShowing As Integer
- Dim ScriptPal As IconBar
- Dim TextPal As Iconbar
- Dim UnivPal As Iconbar
- Set MenuBar = .ApplicationWindow.LwpMenuBar
- Set ViewMenu = MenuBar.items("&View")
- Set Tools = ViewMenu.items("&Toolbars")
-
- Set ScriptBar = Tools.items("&Script Tools")
- ScriptBar.OverrideCheckAndEnable = True
- Set ScriptPal = .ApplicationWindow.IconBarManager.IconBars("Script Tools")
- BarShowing = ScriptPal.IsShowing
-
- If BarShowing = True Then
- ScriptBar.Checked = True
- Else
- ScriptBar.Checked = False
- End If
-
- Set Text_Bar = Tools.items("&Text")
- Text_Bar.OverrideCheckAndEnable = True
- Set TextPal = .ApplicationWindow.IconBarManager.IconBars("Text")
- BarShowing = TextPal.IsShowing
-
- If BarShowing = True Then
- Text_Bar.Checked = True
- Else
- Text_Bar.Checked = False
- End If
-
- Set UnivBar = Tools.items("&Universal")
- UnivBar.OverrideCheckAndEnable = True
- Set UnivPal = .ApplicationWindow.IconBarManager.IconBars("Universal")
- BarShowing = UnivPal.IsShowing
-
- If BarShowing = True Then
- UnivBar.Checked = True
- Else
- UnivBar.Checked = False
- End If
-
- Set FullScreen = ViewMenu.items("F&ull Screen")
- FullScreen.OverrideCheckAndEnable = True
- Set Normal = ViewMenu.items("&Normal")
- Normal.OverrideCheckAndEnable = True
- Set Layout = ViewMenu.items("&Page Layout")
- Layout.OverrideCheckAndEnable = True
- Set Outline = ViewMenu.items("&Outline")
- Outline.OverrideCheckAndEnable = True
- Set Footnotes = ViewMenu.items("&Footnotes")
- Set Graphics = ViewMenu.items("&Graphics")
- Graphics.OverrideCheckAndEnable = True
- Set Table_Grid = ViewMenu.items("Table Grid&lines")
- Table_Grid.OverrideCheckAndEnable = True
- Set Hidden_Text = ViewMenu.items("Hidden Te&xt")
- Hidden_Text.OverrideCheckAndEnable = True
- Set Returns = ViewMenu.items("&Show Paragraph Symbols")
- Returns.OverrideCheckAndEnable = True
- If .ActiveDocument Is Nothing Then
- FullScreen.Enabled = False
- Normal.Enabled = False
- Outline.Enabled = False
- Layout.Enabled = False
- Normal.Checked = False
- Layout.Checked = False
- Outline.Checked = False
- Graphics.Enabled = False
- Table_Grid.Enabled = False
- Hidden_Text.Enabled = False
- Returns.Enabled = False
- Graphics.Checked = False
- Table_Grid.Checked = False
- Hidden_Text.Checked = False
- Returns.Checked = False
- Else
- FullScreen.Enabled = True
- Normal.Enabled = True
- Outline.Enabled = True
- Layout.Enabled = True
- Graphics.Enabled = True
- Table_Grid.Enabled = True
- Hidden_Text.Enabled = True
- Returns.Enabled = True
-
- If .ActiveDocWindow.WinViewPrefs.IsViewPictures = True Then
- Graphics.Checked = True
- Else
- Graphics.Checked = False
- End If
-
- If .ActiveDocWindow.WinViewPrefs.IsViewTableGridLines = True Then
- Table_Grid.Checked = True
- Else
- Table_Grid.Checked = False
- End If
-
- If CurrentDocument.DivisionOptions.ShowHiddenText = True Then
- Hidden_Text.Checked = True
- Else
- Hidden_Text.Checked = False
- End If
-
- If .ActiveDocWindow.WinViewPrefs.IsViewReturns = True Then
- Returns.Checked = True
- Else
- Returns.Checked = False
- End If
-
- If .Division.Foundry.Footnotes.Count = 0 Then
- Footnotes.OverrideCheckAndEnable = True
- Footnotes.Enabled = False
- Else
- Footnotes.OverrideCheckAndEnable = False
- End If
-
- If .ActiveDocWindow.WinViewPrefs.IsInOutline = False Then
- If .ActiveDocWindow.WinViewPrefs.IsInDraft = True Then
- Normal.Checked = True
- Layout.Checked = False
- Outline.Checked = False
- End If
- End If
-
- If .ActiveDocWindow.WinViewPrefs.IsInOutline = False Then
- If .ActiveDocWindow.WinViewPrefs.IsInDraft = False Then
- Normal.Checked = False
- Layout.Checked = True
- Outline.Checked = False
- End If
- End If
-
- If .ActiveDocWindow.WinViewPrefs.IsInOutline = True Then
- Normal.Checked = False
- Layout.Checked = False
- Outline.Checked = True
- End If
-
- End If
- End Sub
- Sub Table_Menu
- Dim MenuBar As MenuItem
- Dim TableMenu As MenuItem
- Dim Table_From_Text As MenuItem
- Dim GridLines As MenuItem
- Dim Row_Col As MenuItem
- Dim GrdLines As Integer
- Set MenuBar = .ApplicationWindow.LwpMenuBar
- Set TableMenu = MenuBar.items("T&able")
- Set Table_From_Text = TableMenu.items("Convert Text to Table...")
- Set GridLines = TableMenu.items("&Gridlines")
- Set Row_Col = TableMenu.items("Ro&w/Col Indicators")
- Table_From_Text.OverrideCheckAndEnable = True
- GridLines.OverrideCheckAndEnable = True
- Row_Col.OverrideCheckAndEnable = True
- If .ActiveDocument Is Nothing Then
- GridLines.Enabled = False
- Table_From_Text.Enabled = False
- Row_Col.Enabled = False
- Else
- If Not(.Text.SelectionType = $LwpSelectionTypeText) Then
- Table_From_Text.Enabled = False
- Else
- Table_From_Text.Enabled = True
- End If
- If Not (.Table Is Nothing) Then
- If .Table.IsValid = True Then
- GridLines.Enabled = True
- Row_Col.Enabled = True
- If .ActiveDocWindow.WinViewPrefs.IsViewTableHeadings = True Then
- Row_Col.Checked = True
- Else
- Row_Col.Checked = False
- End If
- GrdLines = .ActiveDocWindow.WinViewPrefs.IsViewTableGridLines
- If GrdLines = False Then
- GridLines.Checked = False
- Else
- GridLines.Checked = True
- End If
- End If
- Else
- GridLines.Enabled = False
- GridLines.Checked = False
- Row_Col.Enabled = False
- Row_Col.Checked = False
- End If
- End If
- End Sub
- Sub Edit_Menu
- Dim MenuBar As MenuItem
- Dim EditMenu As MenuItem
- Dim Clear As MenuItem
- Dim L_Case As MenuItem
- Dim U_Case As MenuItem
- Dim I_Cap As MenuItem
- Set MenuBar = .ApplicationWindow.LwpMenuBar
- Set EditMenu = MenuBar.items("&Edit")
- Set Clear = EditMenu.items("Cle&ar")
- Set ConvertCase = EditMenu.items("Con&vert Case")
- Set L_Case = ConvertCase.items("&Lowercase")
- Set U_Case = ConvertCase.items("&Uppercase")
- Set I_Cap = ConvertCase.items("&Initial Capitals")
- Clear.OverrideCheckAndEnable = True
- ConvertCase.OverrideCheckAndEnable = True
- L_Case.OverrideCheckAndEnable = True
- U_Case.OverrideCheckAndEnable = True
- I_Cap.OverrideCheckAndEnable = True
- If .ActiveDocument Is Nothing Then
- ' ConvertCase.Enabled = False
- L_Case.Enabled = False
- U_Case.Enabled = False
- I_Cap.Enabled = False
- Clear.Enabled = False
- Else
- ' ConvertCase.Enabled = True
- L_Case.Enabled = True
- U_Case.Enabled = True
- I_Cap.Enabled = True
- Clear.Enabled = True
- End If
- End Sub
- Sub Insert_Menu
- Dim MenuBar As MenuItem
- Dim InsertMenu As MenuItem
- Dim Hyperlink As MenuItem
- Dim FootNote As MenuItem
- Dim EndNote As MenuItem
- Dim Foot_Opt As MenuItem
- Dim End_Opt As MenuItem
- Set MenuBar = .ApplicationWindow.LwpMenuBar
- Set InsertMenu = MenuBar.items("&Insert")
- Set FootNote = InsertMenu.items("&Footnote")
- Set EndNote = InsertMenu.items("&Endnote")
- Set Hyperlink = InsertMenu.items("Hyperl&ink...")
- Set Foot_Opt = FootNote.items("&Options...")
- Set End_Opt = EndNote.items("&Options...")
- Hyperlink.OverrideCheckAndEnable = True
- If .ActiveDocument Is Nothing Then
- Hyperlink.Enabled = False
- Foot_Opt.OverrideCheckAndEnable = True
- End_Opt.OverrideCheckAndEnable = True
- Foot_Opt.Enabled = False
- End_Opt.Enabled = False
- Else
- Foot_Opt.OverrideCheckAndEnable = False
- End_Opt.OverrideCheckAndEnable = False
- Hyperlink.Enabled = True
- End If
- End Sub
- Sub Format_Menu
- Dim MenuBar As MenuItem
- Dim FormatMenu As MenuItem
- Dim Tabset As MenuItem
- Dim Borders As MenuItem
- Dim Frameitem As MenuItem
- Set MenuBar = .ApplicationWindow.LwpMenuBar
- Set FormatMenu = MenuBar.items("F&ormat")
- Set Tabset = FormatMenu.items("&Tabs...")
- Tabset.OverrideCheckAndEnable = True
- If .ActiveDocument Is Nothing Then
- Tabset.Enabled = False
- Else
- Tabset.Enabled = True
- End If
- Set Borders = FormatMenu.items("&Borders and Shading")
- Set Frameitem = Borders.items("&Frame...")
- If .ActiveDocument Is Nothing Then
- Frameitem.OverrideCheckAndEnable = False
- Else
- If Typename(.Layout) = "NOTELAYOUT" Then
- Frameitem.OverrideCheckAndEnable = True
- Frameitem.Enabled = False
- Else
- Frameitem.OverrideCheckAndEnable = False
- End If
- End If
- End Sub
- Sub Tools_Menu
- Dim MenuBar As MenuItem
- Dim ToolsMenu As MenuItem
- Dim Hyperlink As MenuItem
- Dim Highlight As MenuItem
- Set MenuBar = .ApplicationWindow.LwpMenuBar
- Set ToolsMenu = MenuBar.items("&Tools")
- Set Hyperlink = ToolsMenu.items("H&ypertext/Web Links")
- Set Highlight = ToolsMenu.items("&Highlight")
- Hyperlink.OverrideCheckAndEnable = True
- Highlight.OverrideCheckAndEnable = True
- If .ActiveDocument Is Nothing Then
- Hyperlink.Enabled = False
- Highlight.Enabled = False
- Else
- Hyperlink.Enabled = True
- Highlight.Enabled = True
- End If
- End Sub
-