home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-07-08 | 386.0 KB | 12,981 lines
Begin Code ModuleManager.PublishObjectDLL("evdev.dll") End Code Type SampleMasterFormHelpMenu From PopupMenu End Type Type Envelop From Application Type Help From HelpFile ' METHODS for object: Envelop.Help Sub ShowMethodHelp(method As String, obj As Object) If Not ShowTopicHelp(method & "_Method_" & FieldDefiner(obj, method)) Then ' Try to look for help for an Event by this name dim eventName as string dim i as integer Dim s as String dim o as Object eventName = method ' If there is an "_" if name (e.g. Button1_Click), take last part as event name i = Instr(method, "_") If i Then ' Since we are looking for an event with the "host-defined" syntax (i.e. Button1_Click) ' we need to find the name of the object referred to by the first component of the name ' (i.e. "Button1") eventName = Mid(method, i + 1) obj = FindEmbed(obj, Left(method, i - 1)) End If ' Since we don't know where Event may be defined look on each Object up parent chain. s = obj While (s <> "") If ShowTopicHelp(eventName & "_Event_" & s) Then Exit Sub o = FindObject(s) s = RootName(o) Wend InfoBox.Message("Missing Help", "No help available for Method: " & method) End If End Sub Sub ShowObjectHelp(obj As Object) Dim s as String dim o as Object s = obj While (s <> "") If ShowTopicHelp(s & "_Object") Then Exit Sub ' Show Help for parent object if not available for self. o = FindObject(s) s = RootName(o) Wend InfoBox.Message("Missing Help", "No help available for Object: " & obj) End Sub Sub ShowPropertyHelp(prop As String, obj As Object) ShowTopicHelp(prop & "_Property_" & FieldDefiner(obj, prop)) End Sub Function ShowTopicHelp(topicName As String) As Integer dim helpIndex as long If EnvelopHelpTable.FindValue(topicName, helpIndex) Then GotoContext(helpIndex) ShowTopicHelp = True Else ShowTopicHelp = False End If End Function End Type Type EBOOpen From OpenDialog ' METHODS for object: Envelop.EBOOpen Function BrowseForModule As ObjectModule static lastFilterIndex As Integer FileMustExist = True FileName = "" DefaultExtension = "" InitialDir = Envelop.FileDialogDir NoChangeDir = True If (lastFilterIndex = 0) Then lastFilterIndex = 1 ' Default initialization FilterIndex = lastFilterIndex If Execute = 1 Then ' Make busy cursor show immediately If App Then App.ShowBusySignal ' Note: "FileName" may refer to a Text-based Module (.eto) If True Then ' Allow trapping of exceptions from code run as a result of loading Dim suspend As New SuspendIgnoreExceptions BrowseForModule = ModuleManager.LoadModule(FileName, False) End If ' Remember what last type of file was user loaded. lastFilterIndex = FilterIndex Envelop.FileDialogDir = FileName Else BrowseForModule = Nothing End If End Function End Type Type ETOOpen From OpenDialog ' METHODS for object: Envelop.ETOOpen Sub MergeEto() FileMustExist = True FileName = "" DefaultExtension = "" InitialDir = Envelop.FileDialogDir NoChangeDir = True FilterIndex = 1 If Execute = 1 Then ' Make busy cursor show immediately If App Then App.ShowBusySignal If True Then ' Allow trapping of exceptions from code run as a result of loading Dim suspend As New SuspendIgnoreExceptions ObjectTools.LoadTextObject(FileName) End If ObjectViewer.Reset Envelop.FileDialogDir = FileName End If End Sub End Type Type SADlg From SaveAsDialog ' METHODS for object: Envelop.SADlg Function DisplayDialog(m as ObjectModule) As Boolean ' Return FALSE only if user cancels DisplayDialog = True InitialDir = Envelop.FileDialogDir NoChangeDir = True ' Display the dialog and react If Execute = IDOK Then Dim AsText As Boolean AsText = TypeFileName(m.IsText) ' Make busy cursor show immediately If App Then App.ShowBusySignal ' Save Module and Reset object viewer m.SaveAs(FileName, AsText) ObjectViewer.ResetModuleString(m) Envelop.FileDialogDir = FileName Else DisplayDialog = False End If End Function Function SaveAs(m As ObjectModule) As Boolean ' Return FALSE only if user cancels Dim f as new File f.FileName = m.FileName If m.IsUntitled Then FileName = "mod" & m.UntitledSerialNum Title = "Save Module " & m.DisplayName & " As" Else FileName = f.Name Title = "Save Module As" End If ' Setup the filter based on current save mode. Filter = "Envelop binary (*.ebo)|*.ebo|Envelop text (*.eto)|*.eto|" If (m.IsText) Then FilterIndex = 2 Else FilterIndex = 1 End If DefaultExtension = "" ' Display the dialog and react SaveAs = DisplayDialog(m) End Function Function SaveModule(m as ObjectModule) As Boolean ' Return FALSE only if user cancels an untitled save SaveModule = True ' Leave if there's nothing to save If m.ReadOnly || Not m.IsModified Then Exit Function ' Prompt for a file, if necessary If m.IsUntitled Then FileName = "mod" & m.UntitledSerialNum Title = "Select file for module " & m.DisplayName Filter = "Envelop binary (*.ebo)|*.ebo|Envelop text (*.eto)|*.eto|" FilterIndex = 1 DefaultExtension = "" ' Display the dialog and react SaveModule = DisplayDialog(m) Else ' Make busy cursor show immediately If App Then App.ShowBusySignal m.Save End If End Function Function TypeFileName(ByVal AsText as Boolean) As Boolean ' Type file based on extension and filter selection Dim f as New File f.FileName = FileName If (f.Extension = "") Then If FilterIndex = 1 Then AsText = False FileName = f.FileName & ".ebo" Else AsText = True FileName = f.FileName & ".eto" End If Else ' Recognize a couple of suffixes and force save mode If (StrComp(Right(FileName, 3), "ebo") = 0) Then AsText = False If (StrComp(Right(FileName, 3), "eto") = 0) Then AsText = True End If TypeFileName = AsText End Function Sub WriteObjectAsText(obj as Object) If HostObject(obj) Then Dim mb As New MessageBox mb.SetIconExclamation mb.Message("Invalid object", "Embedded objects cannot be saved as standalone text objects.") Exit Sub End If FileName = "" Title = "Save object: " & obj & " to text as" ' Setup the filter to specify .eto files Filter = "Envelop text (*.eto)|*.eto|" FilterIndex = 1 DefaultExtension = "" NoChangeDir = True InitialDir = Envelop.FileDialogDir If Execute = 1 Then ' Type file based on extension and filter selection Dim f as New File f.FileName = FileName If (f.Extension = "") Then FileName = f.FileName & ".eto" ' Make busy cursor show immediately App.ShowBusySignal ObjectTools.SaveTextObject(FileName, False, obj) Envelop.FileDialogDir = FileName End If End Sub End Type Dim FileDialogDir_ As String Property FileDialogDir Get getFileDialogDir Set setFileDialogDir As String Dim SamplesPath As String ' METHODS for object: Envelop Function CanClose() As Integer Dim m As ObjectModule Dim p As Project Dim i, n, r As Integer Dim ync As New YesNoCancelBox Dim CANCEL_EXIT, OK_TO_EXIT, REVERT_ON_EXIT As Integer CANCEL_EXIT = 0 OK_TO_EXIT = 1 REVERT_ON_EXIT = 2 ync.title = "Quit" CanClose = OK_TO_EXIT ' Check to see if there are any changes at all. If Not ObjectViewer.SaveAll_Enable Then CanClose = OK_TO_EXIT Exit Function End If ' Ask user if he wants to save any changes r = ync.Msg("Do you want to save changes? (No = revert to last save)") If r = IDCANCEL Then CanClose = CANCEL_EXIT Exit Function ElseIf r = IDNO Then CanClose = REVERT_ON_EXIT Exit Function End If ' Save any projects that user wants. If user cancels anything, then ' CheckAndSaveProject returns FALSE and we abort the exit. n = ProjectManager.ProjectCount - 1 For i = 0 To n If Not ObjectViewer.CheckAndSaveProject(ProjectManager.Project(i)) Then CanClose = CANCEL_EXIT Exit Function End If Next i ' The 0th module is always the intrinsic module, so skip it. n = ModuleManager.ModuleCount - 1 For i = 1 To n m = ModuleManager.Module(i) If m.ReadOnly = False && m.IsModified Then r = ync.Msg("Save changes to module " & m.DisplayName & "?") If r = IDCANCEL Then CanClose = CANCEL_EXIT Exit Function ElseIf r = IDYES Then If Not Envelop.SADlg.SaveModule(m) Then CanClose = CANCEL_EXIT Exit Function End If End If End If Next i End Function Function getFileDialogDir() As String Dim Dir as New Directory Dir.Path = FileDialogDir_ If Dir.Exists Then getFileDialogDir = FileDialogDir_ Else getFileDialogDir = "" End If End Function Sub setFileDialogDir(newValue As String) ' FileDialogDir is configured to accept either a directory or a file. ' If it gets a file, it will extract the path from it. If Instr(newValue, ".") > 0 Then Dim f as New File f.FileName = newValue FileDialogDir_ = f.Path Else FileDialogDir_ = newValue End If ProjectStartupOptions.FileDialogDir = FileDialogDir_ ModuleManager.ModuleContaining(ProjectStartupOptions).Save End Sub Sub Shutdown Help.Quit End Sub Sub Startup ' Secure this object to prevent deletion. ' TODO: Need to specify can't delete or rename security, can't use general, because ' then methods and properties can't be changed either. ' SecureObject(Me, ACL) ' Initialize paths to help and samples Help.FileName = App.Path & "..\help\envelop.hlp" SamplesPath = "..\Examples" ' Define Application Main Form MainForm = EnvelopForm ' Show startup dialog according to options ProjectStartupDialog.Execute End Sub Function TextUnload(ByVal indent As String, cmds As String) As Integer ' Write our parent's properties, but none of ours. TextUnload = False End Function End Type Type ProjectStartupOptionsDialog From Form Type BtnOK From Button ' METHODS for object: ProjectStartupOptionsDialog.BtnOK Sub Click() Parent.ModalResult IDOK Parent.Hide End Sub End Type Type BtnCancel From Button ' METHODS for object: ProjectStartupOptionsDialog.BtnCancel Sub Click() Parent.ModalResult IDCANCEL Parent.Hide End Sub End Type Dim OptDefaultProj As New OptionButton Dim OptShowDialog As New OptionButton Dim OptNewProj As New OptionButton Dim OptOpenProj As New OptionButton Dim OptNoProj As New OptionButton ' METHODS for object: ProjectStartupOptionsDialog Sub Execute LoadForm Center SyncOptions If ShowModal = IDOK Then With ProjectStartupOptions If OptShowDialog.Value Then .AskOnStartup = True Else .AskOnStartup = False If OptNoProj.Value Then .StartupAction = .ACTION_NO_PROJECT ElseIf OptOpenProj.Value Then .StartupAction = .ACTION_OPEN_PROJECT ElseIf OptNewProj.Value Then .StartupAction = .ACTION_NEW_PROJECT Else .StartupAction = .ACTION_DEFAULT_PROJECT End If End If End With ModuleManager.ModuleContaining(ProjectStartupOptions).Save End If End Sub Sub Resize() Dim m, mm, l, t, w, h, effWidth As Single m = BtnOK.Top mm = m * 2 effWidth = IIf(ScaleWidth < 4000, 4000, ScaleWidth) w = BtnOK.Width l = effWidth - m - w t = m h = BtnOK.Height BtnOK.Move(l, t, w, h) t = t + h + m BtnCancel.Move(l, t, w, h) w = l - OptNoProj.Left - m OptDefaultProj.Width = w OptShowDialog.Width = w OptNewProj.Width = w OptOpenProj.Width = w OptNoProj.Width = w End Sub Sub SyncOptions OptDefaultProj.Value = False OptShowDialog.Value = False OptNewProj.Value = False OptOpenProj.Value = False OptNoProj.Value = False With ProjectStartupOptions If .AskOnStartup Then OptShowDialog.Value = True Else Select Case .StartupAction Case .ACTION_NO_PROJECT OptNoProj.Value = True Case .ACTION_OPEN_PROJECT OptOpenProj.Value = True Case .ACTION_NEW_PROJECT OptNewProj.Value = True Case Else ' Includes .ACTION_DEFAULT_PROJECT OptDefaultProj.Value = True End Select End If End With End Sub End Type Type GadgetConfigWizard From WizardMaster.Wizard Type ToolName From WizardMaster.FrmStep Dim TBName As New TextBox End Type Type ToolHintText From WizardMaster.FrmStep Dim TBHintText As New TextBox End Type Type ToolBitmap From WizardMaster.FrmStep Dim LblBitmap As New Label Dim TBBitmap As New TextBox Type BTNBrowse From Button ' METHODS for object: GadgetConfigWizard.ToolBitmap.BTNBrowse Sub BtnBrowse_Click() Dim open as New OpenDialog ' Set the title of the open dialog just before we display it. open.Title = "Configure Tool Gadget" ' Set the filter to look for bitmaps open.Filter = "Bitmap files|*.bmp|" ' If a filename was picked, then remember it ' Let the picture on this wizard preview it If open.Execute <> IDCANCEL Then TBBitmap.Text = open.FileName End If End Sub End Type Type SampleBox From ObjectBox Dim PreviewTool As New ToolGadget ' METHODS for object: GadgetConfigWizard.ToolBitmap.SampleBox Sub Reposition dim l,t,w,h as long PreviewTool.bitmap.SetPicture Parent.wizard.TempGadget.bitmap.GetPicture PreviewTool.HintText = Parent.wizard.TempGadget.HintText w = (PreviewTool.bitmap.Width + 4) * 15 If w > 4125 Then w = 4125 If w < 150 Then w = 150 h = (PreviewTool.bitmap.Height + 4) * 15 If h > 1575 Then h = 1575 If h < 150 Then h = 150 l = 2850 + ((4125 - w) / 2) t = 2175 + ((1575 - h) / 2) Move(l, t, w, h) PreviewTool.Refresh ForceLayout(True) End Sub End Type Dim BTNPreview As New Button ' METHODS for object: GadgetConfigWizard.ToolBitmap Sub BTNBrowse_Click() Dim length As Integer Dim open as New OpenDialog ' Set the title of the open dialog just before we display it. open.Title = "Configure Tool Gadget" ' Set the filter to look for bitmaps open.Filter = "Bitmap files|*.bmp|" ' Let this selection cause a directory change open.NoChangeDir = False ' If a filename was picked, then remember it ' Let the picture on this wizard preview it If open.Execute <> IDCANCEL Then TBBitmap.Text = open.FileName BTNPreview_Click End If End Sub Sub BTNPreview_Click() wizard.TempGadget.bitmap.LoadType = "FileBased" wizard.TempGadget.bitmap.FileName = TBBitmap.Text wizard.TempGadget.bitmap.LoadType = "MemoryBased" SampleBox.Reposition End Sub End Type Dim OriginalGadget As ButtonGadget Type TempGadget From ToolGadget Dim PsuedoName As String End Type Dim BlankBitmap As New Bitmap ' METHODS for object: GadgetConfigWizard Sub FinishTool Try OriginalGadget.HintText = TempGadget.HintText Catch AccessDenied End Try If TempGadget.bitmap.ImageSize <= 0 Then OriginalGadget.bitmap.SetPicture BlankBitmap.GetPicture Else OriginalGadget.bitmap.SetPicture TempGadget.bitmap.GetPicture End If OriginalGadget.Name = TempGadget.PsuedoName OriginalGadget.Refresh OriginalGadget.Parent.ForceLayout(True) End Sub Sub InitTempGadget TempGadget.bitmap.SetPicture OriginalGadget.bitmap.GetPicture TempGadget.HintText = OriginalGadget.HintText TempGadget.PsuedoName = OriginalGadget.Name TempGadget.Refresh End Sub Function TextUnload(ByVal indent As String, cmds As String) As Integer ' Write our parent's properties, but none of ours. TextUnload = False End Function Sub ToolBitmap_ValidateDisplay(ok As Boolean) ToolBitmap.TBBitmap.Text = TempGadget.bitmap.FileName ToolBitmap.SampleBox.Reposition ToolBitmap.SampleBox.ForceLayout(True) End Sub Sub ToolBitmap_ValidateFinish(ok As Boolean) dim OKToFinish as boolean ToolBitmap_ValidateNext(OKToFinish) If OKToFinish Then FinishTool End Sub Sub ToolBitmap_ValidateNext(ok As Boolean) TempGadget.bitmap.LoadType = "FileBased" TempGadget.bitmap.FileName = ToolBitmap.TBBitmap.Text TempGadget.bitmap.LoadType = "MemoryBased" ok = True End Sub Sub ToolHintText_ValidateDisplay(ok As Boolean) ToolHintText.TBHintText.Text = TempGadget.HintText End Sub Sub ToolHintText_ValidateFinish(ok As Boolean) dim OKToFinish as Boolean ToolHintText_ValidateNext(OKToFinish) If OKToFinish Then FinishTool End Sub Sub ToolHintText_ValidateNext(ok As Boolean) TempGadget.HintText = ToolHintText.TBHintText.Text ok = True End Sub Sub ToolName_ValidateDisplay(ok As Boolean) If OriginalGadget = Nothing Then MessageBox.Msg("Error in GadgetConfigWizard, OriginalGadget is not connected") ok = False Else ' If not initialized yet, set the TempGadget to match the original If Not ToolName.initialized Then InitTempGadget ToolName.initialized = True End If ToolName.TBName.Text = TempGadget.PsuedoName ToolName.TBName.SelStart = 0 ToolName.TBName.SelLength = 1000 End If End Sub Sub ToolName_ValidateFinish(ok As Boolean) Dim OKToFinish as Boolean ToolName_ValidateNext(OKToFinish) If OKToFinish Then FinishTool End Sub Sub ToolName_ValidateNext(ok As Boolean) If ToolName.TBName.Text = "" Then MessageBox.Msg("You must supply a name before continuing") ok = False Else TempGadget.PsuedoName = ToolName.TBName.Text ok = True End If End Sub End Type Type ObjectEditor From ObjectEditor End Type Type MethodEditor From MethodEditor ' METHODS for object: MethodEditor Sub Help() Envelop.Help.ShowMethodHelp(MethodName, CurObject) End Sub End Type Type ObjectEditorMgr From ObjectEditorMgr End Type Type SamplesBrowser From Form Dim ChkBasicTraining As New CheckBox Dim ChkAdvancedTraining As New CheckBox Dim ChkConceptsTraining As New CheckBox Dim ChkComponents As New CheckBox Dim ChkApplications As New CheckBox Dim ChkTools As New CheckBox Dim ChkKeywordSearch As New CheckBox Dim Label1 As New Label Dim TxtKeySearch As New TextBox Dim BtnShowTopics As New Button Dim LstKeywords As New ListBox Dim Label2 As New Label Dim BtnLoadSample As New Button Dim BtnHelp As New Button Dim LstTopics As New ListBox Dim CurrentSampleModule As ObjectModule Dim CurrentSecondModule As ObjectModule Dim LstSearchMaster As New ListBox Dim DirBasicTraining As String Dim DirAdvancedTraining As String Dim DirConceptsTraining As String Dim DirComponents As String Dim DirApplications As String Dim DirTools As String Dim ScanCategory As String Dim LstSampleNameIndex As New ListBox Dim LblTopics As New Label Dim helpfile As New HelpFile Dim initializing As Long Dim PopulateMasterListPunchOut As Long Dim BtnUpdate As New Button ' METHODS for object: SamplesBrowser Sub BtnHelp_Click() ' If we have a topic selected, load it If (LstTopics.ListIndex <> -1) Then Dim samplename As String samplename = Mid(LstTopics.Text, Instr(LstTopics.Text, ":") + 1) LoadHelp(samplename) End If End Sub Sub BtnLoadSample_Click() ' If we have a topic selected, load it If (LstTopics.ListIndex <> -1) Then Dim samplename As String samplename = Mid(LstTopics.Text, Instr(LstTopics.Text, ":") + 1) LoadSample(samplename) End If End Sub Sub BtnShowTopics_Click() PopulateTopicsList(LstKeywords.Text) End Sub Sub BtnUpdate_Click() PopulateMasterList End Sub Sub ChkAdvancedTraining_Click() BtnUpdate.Enabled = True End Sub Sub ChkApplications_Click() BtnUpdate.Enabled = True End Sub Sub ChkBasicTraining_Click() BtnUpdate.Enabled = True End Sub Sub ChkComponents_Click() BtnUpdate.Enabled = True End Sub Sub ChkConceptsTraining_Click() BtnUpdate.Enabled = True End Sub Sub ChkKeywordSearch_Click() If ChkKeywordSearch.Value Then LblTopics.Caption = "<topic>:<sample>" TxtKeySearch.Enabled = True BtnShowTopics.Enabled = True LstKeywords.Enabled = True TxtKeySearch.SetFocus Else LblTopics.Caption = "<category>:<sample>" TxtKeySearch.Enabled = False BtnShowTopics.Enabled = False LstKeywords.Enabled = False End If ' Need to enable the Update button BtnUpdate.Enabled = True End Sub Sub ChkTools_Click() BtnUpdate.Enabled = True End Sub Sub DoHelpEnabling() Dim item, comma1, comma2 As Integer Dim itemstr, filename, path, samplename, sample As String Dim file As New File ' If we have a topic selected, load it If (LstTopics.ListIndex <> -1) Then sample = Mid(LstTopics.Text, Instr(LstTopics.Text, ":") + 1) Else Exit Sub End If ' Locate the corresponding sample For item = 0 To LstSampleNameIndex.ListCount - 1 itemstr = LstSampleNameIndex.List(item) comma1 = Instr(itemstr, ",") samplename = Trim(Left(itemstr, comma1 - 1)) If (samplename = sample) Then comma2 = Instr(comma1 + 1, itemstr, ",") filename = Trim(Mid(itemstr, comma1 + 1, comma2 - comma1 - 1)) path = Trim(Mid(itemstr, comma2 + 1)) Exit For End If Next item ' Determine which is the most current file ' between the ebo and eto sample files file.FileName = path & "\" & filename & ".hlp" ' If the help file exists, enable the button BtnHelp.Enabled = file.Exists End Sub Function getDateTime(filename as File) As String getDateTime = Right(filename.Date, 4) & Left(filename.Date, 6) & filename.Time End Function Sub InitSampleSpy initializing = True ' Set the search directories and strip off leading (..) DirBasicTraining = Envelop.Path & "..\bootcamp\basic" DirAdvancedTraining = Envelop.Path & "..\bootcamp\advanced" DirConceptsTraining = Envelop.Path & "..\bootcamp\concepts" DirComponents = Envelop.Path & "..\arsenal\parts" DirApplications = Envelop.Path & "..\arsenal\apps" DirTools = Envelop.Path & "..\arsenal\tools" ' Set all the category checkboxes to false ChkBasicTraining.Value = 0 ChkAdvancedTraining.Value = 0 ChkConceptsTraining.Value = 0 ChkComponents.Value = 0 ChkTools.Value = 0 ChkApplications.Value = 0 ChkKeywordSearch.Value = 0 ' Clear the master and keyword lists LstSearchMaster.Clear() LstSampleNameIndex.Clear() LstKeywords.Clear() LstTopics.Clear() TxtKeySearch.Text = "" initializing = False End Sub Sub Load ' set the initial directories for various types of samples InitSampleSpy CurrentSampleModule = Nothing PopulateMasterList End Sub Sub LoadHelp(sample As String) Dim item, comma1, comma2 As Integer Dim itemstr, filename, path, samplename As String Dim file As New File ' Locate the corresponding sample For item = 0 To LstSampleNameIndex.ListCount - 1 itemstr = LstSampleNameIndex.List(item) comma1 = Instr(itemstr, ",") samplename = Trim(Left(itemstr, comma1 - 1)) If (samplename = sample) Then comma2 = Instr(comma1 + 1, itemstr, ",") filename = Trim(Mid(itemstr, comma1 + 1, comma2 - comma1 - 1)) path = Trim(Mid(itemstr, comma2 + 1)) Exit For End If Next item ' Determine which is the most current file ' between the ebo and eto sample files path = IIf((Right(path, 1) = "\"), path, path & "\") file.FileName = path & filename & ".hlp" ' Load the file if it exists, otherwise disable the button If Not file.Exists Then BtnHelp.Enabled = False Else helpfile.FileName = file.FileName helpfile.Contents End If End Sub Function LoadNewer(ByVal path as string, ByVal filename as string) As Object ' Determine which is the most current file ' between the ebo and eto sample files dim file As New File dim ebodatetime As String path = IIf((Right(path, 1) = "\"), path, path & "\") file.FileName = path & filename & ".ebo" If file.Exists Then ebodatetime = getDateTime(file) file.FileName = path & filename & ".eto" If file.Exists && (getDateTime(file) < ebodatetime) Then file.FileName = path & filename & ".ebo" End If Else file.FileName = path & filename & ".eto" End If LoadNewer = ModuleManager.LoadModule(file.FileName, True) End Function Sub LoadSample (sample As String) Dim item, comma1, comma2 As Integer Dim itemstr, filename, path, samplename As String Dim ebodatetime As String Dim file As New File ' Locate the corresponding sample For item = 0 To LstSampleNameIndex.ListCount - 1 itemstr = LstSampleNameIndex.List(item) comma1 = Instr(itemstr, ",") samplename = Trim(Left(itemstr, comma1 - 1)) If (samplename = sample) Then comma2 = Instr(comma1 + 1, itemstr, ",") filename = Trim(Mid(itemstr, comma1 + 1, comma2 - comma1 - 1)) path = Trim(Mid(itemstr, comma2 + 1)) Exit For End If Next item ' Make sure we find a sample If path = "" Or filename = "" Then InfoBox.Message("Not Found", "Sample " & sample & " not found in index.") Exit Sub End If file.FileName = path & filename & ".eto" ' Unload Previous Sample(s) If CurrentSecondModule Then CurrentSecondModule.Unload CurrentSecondModule = Nothing End If If CurrentSampleModule Then CurrentSampleModule.Unload CurrentSampleModule = Nothing End If If file.Exists Then Dim curMod as ObjectModule curMod = ModuleManager.CurrentModule CurrentSampleModule = LoadNewer(file.Path, file.Name) file.FileName = file.Path & "s" & Left$(file.Name, 7) & file.Extension If file.Exists Then CurrentSecondModule = LoadNewer(file.Path, file.Name) Else CurrentSecondModule = Nothing End If ModuleManager.CurrentModule = curMod ObjectViewer.Reset Else InfoBox.Message("File not found", "Unable to load sample " & sample) End If End Sub Sub LstKeywords_DblClick() BtnShowTopics_Click End Sub Sub LstTopics_Click() DoHelpEnabling End Sub Sub LstTopics_DblClick() BtnLoadSample_Click End Sub Sub PopulateMasterList() ' Clear the master and keyword lists LstSearchMaster.Clear() LstSampleNameIndex.Clear() LstKeywords.Clear() LstTopics.Clear() TxtKeySearch.Text = "" ' Depending on which option is selected, populate the master list with ' corresponding sample information ScanCategory = "" If ChkBasicTraining.Value Then ScanCategory = "Basic Training" ScanSamples DirBasicTraining End If If ChkAdvancedTraining.Value Then ScanCategory = "Advanced Training" ScanSamples DirAdvancedTraining End If If ChkConceptsTraining.Value Then ScanCategory = "Concepts Training" ScanSamples DirConceptsTraining End If If ChkComponents.Value Then ScanCategory = "Components" ScanSamples DirComponents End If If ChkApplications.Value Then ScanCategory = "Applications" ScanSamples DirApplications End If If ChkTools.Value Then ScanCategory = "Tools" ScanSamples DirTools End If If ChkKeywordSearch.Value && LstKeywords.ListCount = 0 && ScanCategory <> "" Then PostNotFoundMessage ScanCategory End If ' Disable the Update button to signify that no update is needed BtnUpdate.Enabled = False End Sub Sub PopulateTopicsList (key as string) Dim item, comma1, comma2, comma3 As Integer Dim itemstr, keypart, topicname, samplename As String ' clear the current topics list LstTopics.Clear() For item = 0 To LstSearchMaster.ListCount - 1 itemstr = LstSearchMaster.List(item) comma1 = Instr(itemstr, ",") keypart = Trim(Left(itemstr, comma1 - 1)) If (keypart = key) Then comma2 = Instr(comma1 + 1, itemstr, ",") comma3 = Instr(comma2 + 1, itemstr, ",") topicname = Trim(Mid(itemstr, comma1 + 1, comma2 - comma1 - 1)) samplename = Trim(Mid(itemstr, comma2 + 1, comma3 - comma2 - 1)) LstTopics.AddItem(topicname & ":" & samplename) End If If (LCase(keypart) > LCase(key)) Then Exit Sub End If Next item End Sub Sub PostNotFoundMessage (message As String) ' Display a message if no samples were found InfoBox.Message("Not Found", "No samples were found in the " & message & " category.") End Sub Sub ScanKwdFile(ByVal filename As String, attr As Long) Dim file As New TextFile Dim contents, samplename, key, part1, part2 As String Dim i, pos As Integer ' Use a TextFile object to parse path name into parts, as well ' as to read the contents and manipulate them into the index lists. file.FileName = filename contents = file.ContentsAsString samplename = "" Do pos = Instr(contents, "^M") If pos = 0 Then pos = Len(contents) + 1 key = Trim$(Left$(contents, pos - 1)) contents = Mid$(contents, pos + 2) If (Len(key) > 0) Then ' look for colon separators in each line entry pos = Instr(key, ":") part1 = Trim(Left(key, pos - 1)) part2 = Trim(Mid(key, pos + 1)) If part1 = "SampleName" Then LstSampleNameIndex.AddItem(part2 & "," & file.Name & "," & file.Path) If ChkKeywordSearch.Value Then samplename = part2 Else LstTopics.AddItem(ScanCategory & ":" & part2) Exit Do End If Else If samplename = "" Then InfoBox.Message("Not Found", "Could not identify SampleName entry in keyword file: " & filename) Exit Sub End If If ChkKeywordSearch.Value Then LstSearchMaster.AddItem(part2 & "," & part1 & "," & samplename & "," & file.Path) If (LstKeywords.ItemIndex(part2) = -1) Then LstKeywords.AddItem(part2) End If End If End If Loop While Len(contents) > 0 End Sub Sub ScanSamples (path As String) Dim dir As New Directory dir.Path = path dir.EnumContents(Me, "ScanKwdFile", "*.kwd", True) End Sub Sub TxtKeySearch_Change() Dim newselection as Integer If TxtKeySearch.Text = "" Then LstKeywords.ListIndex = -1 Else ' Search for the keyword in the keyword list and select it newselection = LstKeywords.FindString(TxtKeySearch.Text, -1) If (newselection <> -1) Then ' Suppress keystroke that generated new selection LstKeywords.ListIndex = newselection End If End If End Sub End Type Type MenuSelector From Form Dim Label1 As New Label Dim btnOK As New Button Dim btnCancel As New Button Dim Label2 As New Label Dim optMbar As New OptionButton Dim optPopup As New OptionButton Dim cboMenus As New ObjectCombo ' METHODS for object: MenuSelector Sub btnCancel_Click() ModalResult(IDCANCEL) Hide End Sub Sub btnOK_Click() ModalResult(IDOK) Hide End Sub Sub optMbar_Click() Populate End Sub Sub optPopup_Click() Populate End Sub Sub Populate Dim name As String Dim i As Integer cboMenus.Clear If optMbar.Value = True Then cboMenus.RootObject = FindObject("MenuBar") Else cboMenus.RootObject = FindObject("PopupMenu") End If ' Filter out 'MenuBar' , 'PopupMenu', 'MenuTester.*' ' work our way up from the bottom of the list so that ' the indices won't be disturbed by any removals For i = cboMenus.ListCount - 1 To 0 Step -1 name = cboMenus.List(i) If name = "MenuBar" || name = "PopupMenu" || Left$(name, 11) = "MenuTester." Then cboMenus.RemoveItem(i) Next i End Sub Sub Preload() LoadForm End Sub Sub Resize() Dim l As Integer cboMenus.Width = ScaleWidth - 2 * cboMenus.Left l = ScaleWidth - 60 - btnOK.Width btnCancel.Left = l btnOK.Left = l End Sub End Type Type EnvelopFont From Font End Type Type ProjectAndModuleView From IndentedList Dim dirty As Boolean Dim bitmap As New Bitmap Dim kIconProject As Integer Dim kIconModule As Integer Dim kIconObject As Integer Dim kLevelProject As Integer Dim kLevelModule As Integer Dim kLevelObject As Integer Property SelModule Get getSelModule Set setSelModule As ObjectModule Property SelObject Get getSelObject Set setSelObject As Object ' METHODS for object: ProjectAndModuleView Sub Click() If SelObject Then ObjectEditorMgr.Selection SelObject End Sub Sub Collapsed(ByVal itemIndex as Integer, ByVal itemData as Long, itemObj as Object) Dim level As Integer level = ItemLevel(itemIndex) If level = kLevelProject Then ' Project SetItemIcon(itemIndex, IIf(itemObj.IsCurrent, kIconProject + 1, kIconProject)) ElseIf level = kLevelModule Then ' Module SetItemIcon(itemIndex, IIf(itemObj.IsCurrent, kIconModule + 1, kIconModule)) End If End Sub Sub DblClick() ObjectViewer.DblClickObject getSelObject End Sub Sub DestroySelectedObject() DestroyObject(SelObject) ResetObjectDestroyed(ListIndex) End Sub Sub DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect) Parent.DragAndDrop(source, x, y, state, effect) End Sub Sub DragStart(o as XferData, x,y as single) o.ObjectRef = SelObject o.Drag(1) ' Drag and drop ends up eating the mouse up event. Since we ' are doing left mouse dnd, this leaves the list in a state where it ' is expecting a mouse up. ' We will explicitly send a lbutton up message to the list's hwnd ' to fix the problem. SendMessage(hWnd, User32.WM_LBUTTONUP, 0, 0) End Sub Sub Expand(ByVal itemIndex as Integer, ByVal itemData as Long, itemObj as Object) Dim level, oldCount As Integer level = ItemLevel(itemIndex) oldCount = ListCount If level = kLevelProject Then ' Project ExpandProject(itemIndex, itemObj) If oldCount < ListCount Then SetItemIcon(itemIndex, IIf(itemObj.IsCurrent, kIconProject + 3, kIconProject + 2)) End If ElseIf level = kLevelModule Then ' Module ExpandModule(itemIndex, itemObj) If oldCount < ListCount Then SetItemIcon(itemIndex, IIf(itemObj.IsCurrent, kIconModule + 3, kIconModule + 2)) End If End If End Sub Sub ExpandModule(ByVal index as Integer, m as ObjectModule) Dim i, i1, n as integer dim o as Object dim idx as Integer dim icon as Integer dim pstr as String ' Add in all the module's objects i1 = index + 1 n = m.StaticCount - 1 Sorted = True For i = 0 To n o = m.StaticObject(i) pstr = o icon = IIf(IsPrototype(o), kIconObject + 1, kIconObject) idx = InsertItem(pstr, icon, kLevelObject, i1) SetItemObject(idx, o) Next i Sorted = False End Sub Function firstEntryInSet(ByVal idx as Integer) As Integer Dim i, level, targetLevel as Integer targetLevel = ItemLevel(idx) For i = idx - 1 To 0 Step -1 level = ItemLevel(i) If level <> targetLevel Then firstEntryInSet = i + 1 Exit Function End If Next i firstEntryInSet = 0 End Function Function getSelModule As ObjectModule Dim m as ObjectModule Dim i, l as long Dim o as Object i = ListIndex If (i >= 0) Then l = ItemLevel(i) o = ItemObject(i) If l = kLevelModule Then m = o ElseIf l = kLevelObject Then m = ModuleManager.ModuleContaining(o) Else ' Project m = o.CurrentModule End If Else m = ModuleManager.CurrentModule End If getSelModule = m End Function Function getSelObject As Object Dim i as long i = ListIndex If (i >= 0) && (ItemLevel(i) = kLevelObject) Then getSelObject = ItemObject(i) Else getSelObject = Nothing End If End Function Sub KeyDown(keyCode As Integer, ByVal shift As Integer) Dim idx, i, letter, stopidx As Integer If (keyCode = VK_F1) Then ObjectViewer.Help ElseIf (keyCode = VK_DELETE) Then Dim level As Integer idx = ListIndex If idx = -1 Then Exit Sub ' bail if nothing selected in my list. level = ItemLevel(idx) If level = kLevelProject Then ' Close Project ObjectViewer.CloseProject_Click ElseIf level = kLevelModule Then ' Unload Module ObjectViewer.UnloadModule_Click Else ' assume delete of object EnvelopForm.DeleteObject_Click End If End If ' If not on object, bail If ListIndex = -1 Or ItemLevel(ListIndex) <> kLevelObject Then Exit Sub End If ' If the next guy is not also an object, go to first object in ' this module. If ItemLevel(ListIndex + 1) <> kLevelObject Then idx = firstEntryInSet(ListIndex) Else idx = ListIndex + 1 End If ' If the next guy in the list starts with our target, we're ' done. If he starts with a letter less than our target, look ' down in the list. If he starts with a letter greater than ' our target, look up. letter = Asc(UCase(Left(ItemString(idx), 1))) If letter = keyCode Then ListIndex = idx Exit Sub ElseIf letter < keyCode Then idx = idx + 1 ElseIf letter > keyCode Then idx = firstEntryInSet(ListIndex) End If ' Look through the list stopidx = ListCount - 1 For i = idx To stopidx letter = Asc(UCase(Left(ItemString(i), 1))) If letter = keyCode Then ListIndex = i Exit Sub ElseIf letter > keyCode Then Exit Sub End If Next i End Sub Sub MoveSelectedObject() Dim o as Object o = SelObject If o Then AttachObject(o) RemoveItem(ListIndex) SelectObject(o, True) End If End Sub Sub RenameSelectedObject(nm as String) Dim o as Object o = SelObject If o Then If TypeOf o Is Form Then ' This will keep the Caption in sync. o.Name = nm Else RenameObject(o, nm) End If SetItemObject(ListIndex, o) SetItemString(ListIndex, o) End If End Sub Sub ResetItemIcons Dim i, n, l as long Dim icon as integer Dim o as Object n = ListCount - 1 For i = 0 To n l = ItemLevel(i) o = ItemObject(i) If l = kLevelObject Then icon = IIf(IsPrototype(o), kIconObject + 1, kIconObject) SetItemIcon(i, icon) Else icon = IIf(ItemIsExpanded(i), 2, 0) + IIf(o.IsCurrent, 1, 0) If l = kLevelProject Then SetItemIcon(i, icon + kIconProject) ElseIf l = kLevelModule Then SetItemIcon(i, icon + kIconModule) End If End If Next i End Sub Sub ResetModuleString(m as ObjectModule) Dim i, n as Integer Dim o As Object ' Find the module entry in question (all if m = Nothing) n = ListCount - 1 For i = 0 To n o = ItemObject(i) If ItemLevel(i) = kLevelModule && (Not m || o = m) Then ' Set the item to show the correct module name SetItemString(i, o.DisplayName) If m Then Exit Sub End If Next i End Sub Sub ResetNewObject(newObj As Object) SelectObject(newObj, True) End Sub Sub ResetObjectDestroyed(ByVal selIndex As Integer) ' Cull items whose object has been destroyed, while trying to keep the ' selected item "near" where it was. Dim i, oldCount As Integer ' Remove items whose object no longer exists i = 0 While i < ListCount ' Can't cache list count for this loop If ItemObject(i) = Nothing Then oldCount = ListCount If ItemIsExpanded(i) Then CollapseItem(i) RemoveItem(i) ' Adjust selIndex if removed items were above here. If i < selIndex Then selIndex = selIndex - (oldCount - ListCount) Else ' Only increment i when we don't remove any items i = i + 1 End If Wend ' Ok, fix up the selection now. If selIndex is past the end of the list, ' just make it the last item. Otherwise leave it. If selIndex >= ListCount Then selIndex = ListCount - 1 ListIndex = selIndex End Sub Sub SelectObject(o As Object, ByVal collapse As Boolean) Dim i, n as Integer Dim m as ObjectModule If hWnd = 0 Then Exit Sub If Not o Then ListIndex = -1 Exit Sub End If m = ModuleManager.ModuleContaining(o) ' Find list entry for the module header, bail if not found. i = FindModuleIndex(m, False) If i = -1 Then ListIndex = -1 Exit Sub End If ' If given the hint, collapse before expanding. If collapse Then CollapseItem(i) ' Expand the module -- may change ListCount, so update cached 'n' ExpandItem(i) : n = ListCount ' Paw through them to find the object in question i = i + 1 ' advance off of module header While ItemObject(i) <> o And i < n i = i + 1 Wend ListIndex = IIf(i < n, i, -1) End Sub Sub setSelModule(m As ObjectModule) ListIndex = FindModuleIndex(m, True) End Sub Sub setSelObject(o As Object) SelectObject(o, False) End Sub Sub setSelProject(p As Project) ListIndex = FindProjectIndex(p) End Sub Function TextUnload(ByVal indent As String, cmds As String) As Integer cmds = cmds & TextFieldUnload(Me, indent, "kIconProject") cmds = cmds & TextFieldUnload(Me, indent, "kIconModule") cmds = cmds & TextFieldUnload(Me, indent, "kIconObject") cmds = cmds & TextFieldUnload(Me, indent, "kLevelProject") cmds = cmds & TextFieldUnload(Me, indent, "kLevelModule") cmds = cmds & TextFieldUnload(Me, indent, "kLevelObject") TextUnload = False End Function End Type Type Debug From Debug ' METHODS for object: Debug Sub Help() Envelop.Help.ShowTopicHelp("Debug_Window") End Sub End Type Type SourceIterator From SourceIterator End Type Type ApplicationEditor From ObjectEditor Property Visible Get getVisible Set setVisible As Boolean Type form From Form Dim LblApp As New Label Dim CBApps As New ObjectCombo Dim BtnNewApp As New Button Dim LblMainForm As New Label Dim CBForms As New ObjectCombo Dim LblEXE As New Label Dim TEEXE As New TextBox Dim BtnBrowseEXE As New Button Dim LblSplash As New Label Dim TESplash As New TextBox Dim BtnBrowseSplash As New Button Dim LblModules As New Label Dim LstModules As New ListBox Dim BtnWriteEXE As New Button Dim ChkNoMainForm As New CheckBox Dim BtnAddModule As New Button Dim BtnDelModule As New Button ' METHODS for object: ApplicationEditor.form Sub BtnAddModule_Click() Dim r as long r = InputDialog.Execute("Add Module", "Enter name of module to load:", "") If r = IDOK Then Dim i as integer i = LstModules.InsertItem(InputDialog.Text, LstModules.ListIndex + 1) LstModules.SetFocus LstModules.ListIndex = i End If End Sub Sub BtnBrowseEXE_Click() Dim a as Application a = CBApps.SelObject If a Then Dim openDlg as new OpenDialog openDlg.DefaultExtension = "exe" openDlg.FileMustExist = False openDlg.FileName = a.EXEName openDlg.Filter = "EXE files (*.exe)|*.exe|All files (*.*)|*.*|" openDlg.InitialDir = a.Path openDlg.NoChangeDir = True openDlg.Title = "Choose application EXE file" If openDlg.Execute = IDOK Then TEEXE.Text = openDlg.FileName End If End If End Sub Sub BtnBrowseSplash_Click() Dim a as Application a = CBApps.SelObject If a Then Dim openDlg as new OpenDialog openDlg.DefaultExtension = "bmp" openDlg.FileMustExist = True openDlg.FileName = "" openDlg.Filter = "Bitmap files (*.bmp)|*.bmp|All files (*.*)|*.*|" openDlg.InitialDir = a.Path openDlg.NoChangeDir = True openDlg.Title = "Choose splash-screen bitmap file" If openDlg.Execute = IDOK Then TESplash.Text = openDlg.FileName End If End If End Sub Sub BtnDelModule_Click() Dim i, n as integer i = LstModules.ListIndex If i >= 0 Then n = LstModules.RemoveItem(i) If i = n Then i = i - 1 LstModules.ListIndex = i End If End Sub Sub BtnNewApp_Click() Dim a as Application Dim r as long r = InputDialog.Execute("New Application", "Enter name for new application:", UniqueObjectNameFromString("Application")) If r = IDOK Then a = CopyObject(Application, InputDialog.Text) CBApps.Reset CBApps.SelObject = a CBForms.SetFocus End If End Sub Sub BtnWriteEXE_Click() Dim a as Application a = CBApps.SelObject If a Then a.MainForm = CBForms.SelObject a.EXEFileName = TEEXE.Text a.SplashFileName = TESplash.Text a.ModulePath = FormatModulePath() a.WriteEXE End If End Sub Sub CBApps_Click() Dim a as Application Dim appName as String a = CBApps.SelObject appName = a If Len(appName) = 0 || a = Application Then Caption = "Application" Else Caption = "Application: " & appName End If If a Then CBForms.Reset CBForms.SelObject = a.MainForm TEEXE.Text = a.EXEFileName TESplash.Text = a.SplashFileName InitModulePath(a) Else CBForms.SelObject = Nothing TEEXE.Text = "" TESplash.Text = "" LstModules.Clear End If If CBForms.SelObject = Nothing Then ChkNoMainForm.Value = 1 Else ChkNoMainForm.Value = 0 End If End Sub Sub CBApps_DropDown() Dim a As Object a = CBApps.SelObject CBApps.Reset CBApps.SelObject = a End Sub Sub CBForms_Click() If CBForms.SelObject Then ChkNoMainForm.Value = 0 Else ChkNoMainForm.Value = 1 End If End Sub Sub CBForms_DropDown() Dim f As Object f = CBForms.SelObject CBForms.Reset CBForms.SelObject = f End Sub Sub ChkNoMainForm_Click() If ChkNoMainForm.Value && CBForms.SelObject Then CBForms.SelObject = Nothing ElseIf ChkNoMainForm.Value = False && CBForms.SelObject = Nothing Then CBForms.ListIndex = 0 End If End Sub Function DetailedEdit(a As Object) As Long If a Then LoadForm CBApps.Reset CBForms.Reset CBApps.SelObject = a BringToTop End If DetailedEdit = 0 End Function Function FormatModulePath() As String Dim i, n as integer Dim ml as string ml = "" n = LstModules.ListCount - 1 For i = 0 To n If i Then ml = ml & ";" ml = ml & LstModules.List(i) Next i FormatModulePath = ml End Function Sub InitModulePath(a as Application) Dim i, pos as integer Dim m, ml as string LstModules.Clear ml = a.ModulePath Do pos = Instr(ml, ";") If pos > 0 Then m = Left(ml, pos - 1) ml = Mid(ml, pos + 1) Else m = ml End If If Len(m) > 0 Then LstModules.AddItem m Loop While pos > 0 End Sub Sub KeyDown(keyCode As Integer, ByVal shift As Integer) If (keyCode = VK_F1) Then Envelop.Help.ShowTopicHelp("Application_Editor") End Sub Sub Load CBApps.Height = 1500 CBApps.ListIndex = 0 CBForms.Height = 1500 CBApps.Reset CBForms.Reset End Sub Sub LstModules_KeyDown(keyCode As Integer, ByVal shift As Integer) If keyCode = VK_BACK Then BtnDelModule_Click ElseIf keyCode = VK_INSERT Then BtnAddModule_Click End If End Sub Sub Resize dim swidth, sheight as single dim m, mm, w, lh, x1, x2, y as single swidth = LblApp.Width + (2 * BtnNewApp.Width) + 300 ' m5 = 300 If swidth < ScaleWidth Then swidth = ScaleWidth m = 60 : mm = 120 x1 = LblApp.Width + mm x2 = swidth - BtnNewApp.Width - m w = x2 - x1 - mm CBApps.Width = w BtnNewApp.Left = x2 CBForms.Width = w ChkNoMainForm.Left = x2 TEEXE.Width = w BtnBrowseEXE.Left = x2 TESplash.Width = w BtnBrowseSplash.Left = x2 y = TESplash.Top + TESplash.Height + mm sheight = y + 1200 If sheight < ScaleHeight Then sheight = ScaleHeight lh = sheight - y - m LstModules.Move(x1, y, w, lh) BtnAddModule.Left = x2 BtnDelModule.Left = x2 y = sheight - BtnWriteEXE.Height - m BtnWriteEXE.Move(x2, y, BtnWriteEXE.Width, BtnWriteEXE.Height) Refresh End Sub End Type ' METHODS for object: ApplicationEditor Sub BringToTop form.BringToTop End Sub Function DetailedEdit(a As Object) As Long If Not a || (TypeOf a Is Application) Then DetailedEdit = form.DetailedEdit(a) End If End Function Function getVisible As Boolean getVisible = form.Visible End Function Sub Hide form.Hide End Sub Sub setVisible(vis As Boolean) form.Visible = vis End Sub Sub Show form.Show End Sub End Type Type EnvelopScreenLayout From ScreenLayout ' METHODS for object: EnvelopScreenLayout Sub SaveExplicitWindows() ' This method is overridden to get certain windows saved explicitly. SaveExplicitWindow("Form") SaveExplicitWindow("EnvelopForm") SaveExplicitWindow("MethodEditor") SaveExplicitWindow("PropertyEditor") SaveExplicitWindow("Debug") SaveExplicitWindow("ObjectViewer") SaveExplicitWindow("SourceSearcher") SaveExplicitWindow("MenuEdit") SaveExplicitWindow("ApplicationEditor.form") SaveExplicitWindow("WorkSet.WorkSetForm") SaveExplicitWindow("GroupEditor.EditorForm") SaveExplicitWindow("ToolPalette") SaveExplicitWindow("ControlTools.Palette") SaveExplicitWindow("ObjectBoxEditor.ObjBoxForm") SaveExplicitWindow("SamplesBrowser") End Sub End Type Type WinDebug From WinDebug End Type Type ObjectViewer From Form Type ProjectView From ProjectAndModuleView Property CurrProjIndex Get getCurrProjIndex As Long Property SelProject Get getSelProject Set setSelProject As Project ' METHODS for object: ObjectViewer.ProjectView Sub ExpandProject(ByVal index as Integer, p as Project) Dim i, n as integer dim m, cm as ObjectModule dim idx as Integer dim icon as Integer dim pstr as String ' Add in all the project's modules idx = index n = p.ModuleCount - 1 cm = ModuleManager.CurrentModule For i = 0 To n m = p.Module(i) If m = cm Then icon = kIconModule + 1 Else icon = kIconModule End If pstr = m.DisplayName idx = InsertItem(pstr, icon, kLevelModule, idx + 1) SetItemCanExpand(idx, 1) SetItemObject(idx, m) Next i End Sub Function FindModuleIndex(m As ObjectModule, ByVal collapse As Boolean) As Long Dim p As Project Dim m_i, p_i, n, l As Long ' First, try to find the module in the current project. p = ProjectManager.CurrentProject If Not p Then p = ProjectManager.FirstProjectContainingModule(m) If p Then m_i = p.ModuleIndex(m) If m_i >= 0 Then p_i = FindProjectIndex(p) If collapse Then CollapseItem(p_i) If Not ItemIsExpanded(p_i) Then ExpandItem(p_i) m_i = p_i + m_i + 1 ' m_i is now a lower-bound for where we might find the module. ' If not collapsing/expanding the project, we have to search. If collapse Then FindModuleIndex = m_i Exit Function End If n = ListCount While (m_i < n) l = ItemLevel(m_i) If l = kLevelProject Then ' left the project we were searching FindModuleIndex = -1 Exit Function ElseIf l = kLevelModule && ItemObject(m_i) = m Then ' found it FindModuleIndex = m_i Exit Function End If m_i = m_i + 1 Wend End If End If FindModuleIndex = -1 End Function Function FindProjectIndex(p As Project) As Long If p Then Dim i, n as long n = ListCount - 1 For i = 0 To n If ItemLevel(i) = kLevelProject && ItemObject(i) = p Then FindProjectIndex = i Exit Function End If Next i End If FindProjectIndex = -1 End Function Function getCurrProjIndex As Long Dim i, n as long Dim cp as Project cp = ProjectManager.CurrentProject n = ListCount - 1 For i = 0 To n If ItemLevel(i) = kLevelProject && ItemObject(i) = cp Then getCurrProjIndex = i Exit Function End If Next i End Function Function getSelProject As Project Dim p as Project Dim i as long i = ListIndex If (i >= 0) Then While (ItemLevel(i) > kLevelProject) : i = i - 1 : Wend p = ItemObject(i) End If getSelProject = p End Function Sub MakeSelItemCurrent() Dim p as Project p = SelProject If p Then Dim m as ObjectModule ProjectManager.CurrentProject = p m = SelModule If m Then p.CurrentModule = m ResetItemIcons End If End Sub Sub Reset() Dim i as Integer Dim inherited Strictly As IndentedList inherited = Me ' Clear out the list Clear ' Add in all the open projects For i = 0 To ProjectManager.ProjectCount - 1 dim p as Project dim index as Integer dim icon as Integer dim pstr as String p = ProjectManager.Project(i) If p = ProjectManager.CurrentProject Then icon = kIconProject + 1 Else icon = kIconProject End If pstr = p & IIf(p.ProjectFileName <> "", " (" & p.ProjectFileName & ")", "") index = InsertItem(pstr, icon, 0, i) SetItemCanExpand(index, 1) SetItemObject(index, p) Next i ' Select the current project and expand it SelProject = ProjectManager.CurrentProject ExpandItem(ListIndex) ' Invoke my inherited reset method. inherited.Reset ObjectViewer.ViewProject_Enable = ListCount > 0 dirty = False End Sub Sub ResetProject(p As Project, expandCurrMod As Boolean) Reset SelProject = p CollapseItem(ListIndex) ExpandItem(ListIndex) If expandCurrMod Then SelModule = p.CurrentModule ExpandItem(ListIndex) End If End Sub Sub ResetProjectString(p as Project) Dim i, n as Integer Dim o As Object ' Find the project entry in question (all if p = Nothing) n = ListCount - 1 For i = 0 To n o = ItemObject(i) If ItemLevel(i) = kLevelProject && (Not p || o = p) Then ' Set the item to show the correct project information SetItemString(i, o & IIf(o.ProjectFileName <> "", " (" & o.ProjectFileName & ")", "")) If p Then Exit Sub End If Next i End Sub Sub setSelProject(p As Project) ListIndex = FindProjectIndex(p) End Sub Function TextUnload(ByVal indent As String, cmds As String) As Integer ' Write our parent's properties, but none of ours. TextUnload = False End Function End Type Type HierView From ObjectHierarchy Dim dirty As Boolean ' METHODS for object: ObjectViewer.HierView Sub Click() If SelObject Then ObjectEditorMgr.Selection SelObject End Sub Sub DblClick() ObjectViewer.DblClickObject SelObject End Sub Sub DragAndDrop(source As XferData, x,y As Single, state As OleDropState, effect As OleDropEffect) Parent.DragAndDrop(source, x, y, state, effect) End Sub Sub DragStart(o as XferData, x,y as single) o.ObjectRef = SelObject o.Drag(1) ' Drag and drop ends up eating the mouse up event. Since we ' are doing left mouse dnd, this leaves the list in a state where it ' is expecting a mouse up. ' We will explicitly send a lbutton up message to the list's hwnd ' to fix the problem. SendMessage(hWnd, User32.WM_LBUTTONUP, 0, 0) End Sub Sub KeyDown(keyCode As Integer, ByVal shift As Integer) If (keyCode = VK_F1) Then ObjectViewer.Help ElseIf (keyCode = VK_DELETE) Then EnvelopForm.DeleteObject_Click End If End Sub Sub MakeSelItemCurrent() If SelObject Then ModuleManager.CurrentModule = ModuleManager.ModuleContaining(SelObject) End If End Sub Sub MoveSelectedObject() Dim o as Object o = SelObject If o Then AttachObject(o) End Sub Sub RenameSelectedObject(nm as String) Dim o as Object o = SelObject If TypeOf o Is Form Then ' This will keep the Caption in sync. o.Name = nm Else RenameObject(o, nm) End If Refresh End Sub Sub Reset() Dim P Strictly As ObjectHierarchy P = Me P.Reset dirty = False End Sub Sub ResetNewObject(newObj As Object) Reset SelObject = newObj End Sub End Type Property SelObject Get getSelObject Set setSelObject As Object Property SelModule Get getSelModule As ObjectModule Dim viewer As Object Type ModuleView From ProjectAndModuleView ' METHODS for object: ObjectViewer.ModuleView Function FindModuleIndex(m As ObjectModule, ByVal collapse As Boolean) As Long Dim i, n As Integer n = ListCount - 1 For i = 0 To n If ItemLevel(i) = kLevelModule && ItemObject(i) = m Then FindModuleIndex = i Exit Function End If Next i End Function Sub MakeSelItemCurrent() ModuleManager.CurrentModule = SelModule ResetCurrentModuleIcon End Sub Sub Reset() Dim i, n, icon as Integer Dim m, currModule as ObjectModule Dim inherited Strictly As IndentedList Dim idx as Integer inherited = Me ' Clear out the list Clear ' Add in all the modules n = ModuleManager.ModuleCount - 1 currModule = ModuleManager.CurrentModule For i = 0 To n m = ModuleManager.Module(i) icon = IIf(m = currModule, kIconModule + 1, kIconModule) idx = InsertItem(m.DisplayName, icon, 0, i) SetItemCanExpand(idx, 1) SetItemObject(idx, m) Next i ' Forward reset to parent and clear dirty flag inherited.Reset dirty = False End Sub Sub ResetCurrentModuleIcon() Dim i, n, currIcon as Integer n = ListCount - 1 currIcon = kIconModule + 1 For i = 0 To n If ItemLevel(i) = 0 Then SetItemIcon(i, IIf(ItemObject(i).IsCurrent, currIcon, kIconModule)) End If Next i End Sub End Type Property ActiveView Get getActiveView Set setActiveView As Object Type AlphaView From ObjectList Dim dirty As Boolean ' METHODS for object: ObjectViewer.AlphaView Sub Click() If SelObject Then ObjectEditorMgr.Selection SelObject End Sub Sub DblClick() ObjectViewer.DblClickObject SelObject End Sub Sub DestroySelectedObject DestroyObject(SelObject) Reset End Sub Sub DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect) Parent.DragAndDrop(source, x, y, state, effect) End Sub Sub DragStart(o as XferData, x,y as single) o.ObjectRef = SelObject o.Drag(1) ' Drag and drop ends up eating the mouse up event. Since we ' are doing left mouse dnd, this leaves the list in a state where it ' is expecting a mouse up. ' We will explicitly send a lbutton up message to the list's hwnd ' to fix the problem. SendMessage(hWnd, User32.WM_LBUTTONUP, 0, 0) End Sub Sub KeyDown(keyCode As Integer, ByVal shift As Integer) If (keyCode = VK_F1) Then ObjectViewer.Help ElseIf (keyCode = VK_DELETE) Then EnvelopForm.DeleteObject_Click End If End Sub Sub MakeSelItemCurrent() If SelObject Then ModuleManager.CurrentModule = ModuleManager.ModuleContaining(SelObject) End If End Sub Sub MoveSelectedObject() Dim o as Object o = SelObject If o Then AttachObject(o) End Sub Sub RenameSelectedObject(nm as String) Dim o as Object o = SelObject If TypeOf o Is Form Then ' This will keep the Caption in sync. o.Name = nm Else RenameObject(o, nm) End If Reset SelObject = o End Sub Sub Reset() Dim P Strictly As ObjectList dim oldIndex As Integer P = Me oldIndex = ListIndex ' Forward reset to our parent P.Reset ' If oldIndex is now too big, select last item in list If oldIndex >= ListCount Then oldIndex = ListCount - 1 ListIndex = oldIndex ' Reset dirty flag dirty = False End Sub Sub ResetNewObject(newObj As Object) Reset SelObject = newObj End Sub Function TextUnload(ByVal indent As String, cmds As String) As Integer ' Write our parent's properties, but none of ours. TextUnload = False End Function End Type Type toolbar From ObjectBox Dim ViewProject As New ToolGadget Dim ViewModule As New ToolGadget Dim ViewAlphabetical As New ToolGadget Dim ViewHierarchical As New ToolGadget Dim MakeCurrent As New ToolGadget Dim AddModule As New ToolGadget Dim NewModule As New ToolGadget Dim LoadModule As New ToolGadget Dim SaveModule As New ToolGadget Dim UnloadModule As New ToolGadget ' METHODS for object: ObjectViewer.toolbar Sub DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect) effect = 0 End Sub End Type Type ObjectEditorHook From ObjectEditor ' METHODS for object: ObjectViewer.ObjectEditorHook Sub Refresh(ByVal reason As RefreshReason) If reason = "ModuleLoaded" || reason = "ModuleUnloaded" Then ObjectViewer.Reset End If End Sub End Type Dim ViewProject_Enable As Integer Dim ObjectPopup As New PopupMenu Dim ModulePopup As New PopupMenu Dim ProjectPopup As New PopupMenu ' METHODS for object: ObjectViewer Sub AddModule_Click() Dim p as Project p = ProjectManager.CurrentProject If p Then Dim i, n as integer Dim m as ObjectModule Dim exclude as New Group ' Make a group of the modules already in the project, to be excluded. ' Always exclude the intrinsic module (never a project member). exclude.Append(ObjectModule) n = p.ModuleCount - 1 For i = 0 To n exclude.Append(p.Module(i)) Next i m = SelectModuleForm.ExecuteExcluding(exclude, "Select module to add") If m Then Dim i as integer i = IIf(p.CurrentIndex >= 0, p.CurrentIndex + 1, -1) p.InsertModule(m, i) p.CurrentModule = m ResetProject(p, False) End If End If ' ProjectManager.CurrentProject End Sub Function AddModule_Enable As Integer Dim p As Project p = ProjectManager.CurrentProject If p Then toolbar.AddModule.HintText = "Add module to project: " & p AddModule_Enable = True Else toolbar.AddModule.HintText = "Add module to current project" AddModule_Enable = False End If End Function Sub AlphaView_MouseDown(button As Integer, shift As Integer, x As Single, y As Single) If button = 2 Then With AlphaView dim i as integer i = .FindIndexUnderPoint(x, y) If i >= 0 Then .ListIndex = i PopupMenu = ObjectPopup EnvelopForm.CBSelectedObject.Text = .List(.ListIndex) Else PopupMenu = FindObject("PopupMenu") End If End With End If End Sub Sub AlphaView_MouseUp(button As Integer, shift As Integer, x As Single, y As Single) PopupMenu = FindObject("PopupMenu") End Sub Function CheckAndSaveProject(p As Project) As Boolean ' Return FALSE only if user cancels something CheckAndSaveProject = True If ProjectIsModified(p) Then Dim ync as New YesNoCancelBox Dim answer as Integer ync.title = "Close modified project" ync.message = "The project " & p & " is modified.^M^M" ync.message = ync.message & "Save project before closing?" answer = ync.Execute If answer = IDCANCEL Then CheckAndSaveProject = False ElseIf answer = IDYES Then CheckAndSaveProject = SaveProject(p) End If End If End Function Sub CloseProject_Click() Dim p as Project p = ProjectManager.CurrentProject If CheckAndSaveProject(p) Then ' user did not cancel anything ProjectManager.CloseCurrentProject ProjectView.Reset If ProjectManager.ProjectCount > 0 Then ActiveView = ProjectView Else ' no more projects ActiveView = ModuleView End If DamageInactiveViews End If End Sub Function CloseProject_Enable() As Integer CloseProject_Enable = ProjectManager.CurrentProject <> Nothing End Function Function CopyObjectQuick(o As Object, ByVal quick As Boolean) As Boolean Dim o As Object o = ObjectEditorMgr.SelectedObject SelObject = o If SelObject = o Then Dim uniqName As String uniqName = UniqueObjectName(o) If quick Then DoCopyObject(o, uniqName) Else If InputDialog.Execute("Copy Object", "Enter name for new copy of " & o & ":", uniqName) = IDOK Then DoCopyObject(o, InputDialog.Text) End If End If CopyObjectQuick = True Else CopyObjectQuick = False End If End Function Sub DamageInactiveViews If ActiveView <> ProjectView Then ProjectView.dirty = True If ActiveView <> ModuleView Then ModuleView.dirty = True If ActiveView <> AlphaView Then AlphaView.dirty = True If ActiveView <> HierView Then HierView.dirty = True End Sub Sub DblClickObject(o As Object) If o Then ' Special case the EnvelopForm to turn Form-Editing off (avoids confusing state) If (o = EnvelopForm) Then FormEditor.Editing = False ObjectEditorMgr.Edit(o) ' If object is a form then bring it to top If TypeOf o Is Form Then o.Show : o.BringToTop End If End Sub Function DestroySelectedObject(o As Object) As Boolean SelObject = o If SelObject = o Then ActiveView.DestroySelectedObject DamageInactiveViews ObjectEditorMgr.Selection SelObject DestroySelectedObject = True Else DestroySelectedObject = False End If End Function Sub DoCopyObject(o As Object, ByVal newName As String) Dim sameNameObj, newObj As Object If IsIdentifierValid(newName) = 0 Then Dim mb As New MessageBox mb.SetIconExclamation mb.Message("Invalid identifier", """" & newName & """ is not a valid object name") Exit Sub End If sameNameObj = FindObject(newName) If sameNameObj Then If ModuleManager.ModuleContaining(sameNameObj) = ModuleManager.CurrentModule Then MessageBox.Message("Object exists", """" & newName & """ already exists in the current module.") Exit Sub Else If YesNoCancelBox.Message("Object exists", """" & newName & """ already exists in a different module, ^J^M^J^MOk to continue?") <> IDYES Then Exit Sub End If End If End If newObj = CopyObject(o, newName) If (o && TypeOf o Is Form && StrComp(o, o.Caption) = 0) Then ' Try to keep title and object name in sync, if src object was. newObj.Caption = newObj End If ActiveView.ResetNewObject(newObj) DamageInactiveViews ObjectEditorMgr.Edit newObj End Sub Function DoProjectSave(p As Project, ByVal saveAs As Boolean) As Boolean Dim resetString As Boolean Dim projModule As ObjectModule ' Return FALSE only if user cancels a dialog DoProjectSave = True ' Fix up the module list of the project, since user may have ' just renamed (saved-as) some module(s) p.SyncModulePath projModule = ModuleManager.ModuleContaining(p) projModule.Save resetString = False ' Write the project file and EXE, as necessary. If p.ProjectFileName = "" || saveAs Then If SaveProjectFileAs(p) = IDCANCEL Then DoProjectSave = False Exit Function End If resetString = True End If If Not p.ProjectFileMatchesMe Then p.WriteProjectFile ' If we did a save-as on the project file, ' then update the project view. If resetString Then ProjectView.ResetProjectString(p) If TypeOf p Is Application Then If p.EXEFileName = "" || saveAs Then If SaveProjectEXEAs(p) = IDCANCEL Then DoProjectSave = False Exit Function End If resetString = True End If If Not p.EXEMatchesMe Then p.WriteEXE End If ' If we did a save-as on the project file or EXE file, ' then re-save the project module. If resetString Then projModule.Save End Function Sub DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect) dim s,s2 as string dim p as integer If state = 4 Then ' TODO: re-visit this code for ebo/eto names. Also, maybe it shouldn't be driven by ' name for binary modules (we could implement a test for a valid binary module). ' (Dez 3/12/95) s = source.File p = Instr(1, s, "ebo", 1) If Instr(1, s, ".ebo", 1) Then ModuleManager.LoadModule(s, False) DamageInactiveViews ActiveView.Reset ElseIf p > 0 Then s2 = Mid(s, p) If Instr(1, s2, ".tmp", 1) Then ModuleManager.LoadModule(s, False) DamageInactiveViews ActiveView.Reset End If ElseIf Instr(1, s, ".eto", 1) Then ObjectTools.LoadTextObject(s) DamageInactiveViews ActiveView.Reset End If End If End Sub Function getActiveView() As Object If Not viewer Then ActiveView = ProjectView getActiveView = viewer End Function Function getSelModule() As ObjectModule Dim m As ObjectModule Try dim r as long If PropertyExists(ActiveView, "SelModule", r) Then m = ActiveView.SelModule Catch End Try If Not m Then ' OK, either we don't have an active view, or active view doesn't ' have a selected module, so take the current module as selected. m = ModuleManager.CurrentModule End If getSelModule = m End Function Function getSelObject() As Object getSelObject = ActiveView.SelObject End Function Sub Help If SelObject Then Envelop.Help.ShowObjectHelp(SelObject) End Sub Sub HierView_MouseDown(button As Integer, shift As Integer, x As Single, y As Single) If button = 2 Then With HierView dim i as integer i = .FindIndexUnderPoint(x, y) If i >= 0 Then .ListIndex = i PopupMenu = ObjectPopup EnvelopForm.CBSelectedObject.Text = .List(.ListIndex) Else PopupMenu = FindObject("PopupMenu") End If End With End If End Sub Sub HierView_MouseUp(button As Integer, shift As Integer, x As Single, y As Single) PopupMenu = FindObject("PopupMenu") End Sub Sub LoadModule(m As ObjectModule) If m Then Dim p as Project p = ProjectManager.CurrentProject If p Then Dim i as integer i = IIf(p.CurrentIndex >= 0, p.CurrentIndex + 1, -1) p.InsertModule(m, i) p.CurrentModule = m ResetProject(p, False) Else ResetModule(m) End If End If End Sub Sub LoadModule_Click() LoadModule(Envelop.EBOOpen.BrowseForModule) End Sub Sub MakeCurrent_Click() ActiveView.MakeSelItemCurrent DamageInactiveViews End Sub Sub ModAddToProj_Click() Dim p as Project p = ProjectManager.CurrentProject p.InsertModule(SelModule, p.ModuleCount) ProjectView.Reset End Sub Function ModAddToProj_Enable() As Integer Dim i as Boolean If ProjectManager.CurrentProject Then i = (ProjectManager.CurrentProject.ModuleIndex(SelModule) = -1) ModAddToProj_Enable = i ModulePopup.SetCaption(ModulePopup.ItemPosition("ModAddToProj"), "Add to " & IIf(i, "&Project: " & ProjectManager.CurrentProject.ProjectFileProjectName, "Current &Project")) Else ModAddToProj_Enable = False End If End Function Sub ModRemoveFromProj_Click() Dim i as Boolean Dim M as ObjectModule M = SelModule i = M.CanUnload M.CanUnload = False Try ProjectManager.CurrentProject.RemoveModule(M) Catch ModuleUnloadFailed ' We expect this catch, since we just set M's Unload to False. We don't ' want to unload the module, just remove it from the project. TODO: ' fix the code for RemoveModule so that it doesn't always try to Unload ' the module --DEG End Try ProjectView.Reset M.CanUnload = i End Sub Function ModRemoveFromProj_Enable() As Integer Dim i as Boolean If ProjectManager.CurrentProject Then i = Not ModAddToProj_Enable If i then ' We also want to make sure that the project's application object ' is not in the Selected Module If ModuleManager.ModuleContaining(FindObject(ProjectManager.CurrentProject.ProjectFileProjectName)) = SelModule Then ModRemoveFromProj_Enable = False Else ' ModAddToProj_Enable is False (It's in the project) and the Project's ' application is not in the selected Module...We're cool ModRemoveFromProj_Enable = True End If Else ' We can add the module to the project, so the module isn't in the ' project...therefore we can't remove it ModRemoveFromProj_Enable = False End If Else ' We don't have a current project, so we can't remove anything from it ModRemoveFromProj_Enable = False End If End Function Sub ModSaveAs_Click() SaveModuleAs_Click End Sub Function ModSaveAs_Enable() As Integer ModSaveAs_Enable = EnvelopForm.SaveModuleAs_Enable End Function Sub ModSave_Click() SaveModule_Click End Sub Function ModSave_Enable() As Integer ModSave_Enable = EnvelopForm.SaveModule_Enable End Function Sub ModuleView_MouseDown(button As Integer, shift As Integer, x As Single, y As Single) If button = 2 Then With ModuleView dim i as integer i = .FindIndexUnderPoint(x, y) If i >= 0 Then .ListIndex = i Select Case .ItemLevel(.ListIndex) Case 0 ' Module PopupMenu = ModulePopup Case 1 ' Object PopupMenu = ObjectPopup EnvelopForm.CBSelectedObject.Text = .ItemString(.ListIndex) Case Else Throw MenuError End Select Else PopupMenu = FindObject("PopupMenu") End If End With End If End Sub Sub ModuleView_MouseUp(button As Integer, shift As Integer, x As Single, y As Single) PopupMenu = FindObject("PopupMenu") End Sub Sub ModUnload_Click() UnloadModule_Click End Sub Function ModUnload_Enable() As Integer ModUnload_Enable = EnvelopForm.UnloadModule_Enable End Function Sub MoveObject_Click() Dim o As Object o = ObjectEditorMgr.SelectedObject SelObject = o If (SelObject <> o) Then InfoBox.Message("Move Failed", "Unable to move object: " & o) Exit Sub End If ActiveView.MoveSelectedObject DamageInactiveViews End Sub Function MoveObject_Enable() As Integer Dim o As Object o = ObjectEditorMgr.SelectedObject MoveObject_Enable = (o && ModuleManager.ModuleContaining(o) <> ModuleManager.CurrentModule) End Function Sub NewModule_Click() LoadModule(ModuleManager.LoadModule("", False)) End Sub Sub NewObject_Click() If InputDialog.Execute("New Object", "Enter name for new object:", "") = IDOK Then DoCopyObject(Nothing, InputDialog.Text) End If End Sub Sub NewProject_Click() Dim p As Project p = NewProjectForm.Execute If p Then ResetProject(p, True) End Sub Sub ObjAbstract_Click() EnvelopForm.AbstractObject_Click End Sub Function ObjAbstract_Enable() As Integer ObjAbstract_Enable = EnvelopForm.AbstractObject_Enable End Function Sub ObjCopy_Click() EnvelopForm.CopyObject_Click End Sub Function ObjCopy_Enable() As Integer ObjCopy_Enable = EnvelopForm.CopyObject_Enable ObjectPopup.SetCaption(ObjectPopup.ItemPosition("ObjCopy"), "&Copy Object: " & SelObject & "...") End Function Sub ObjDestroy_Click() EnvelopForm.DeleteObject_Click End Sub Function ObjDestroy_Enable() As Integer ObjDestroy_Enable = EnvelopForm.DeleteObject_Enable End Function Sub ObjMoveToModule_Click() MoveObject_Click End Sub Function ObjMoveToModule_Enable() As Integer Dim j as boolean j = EnvelopForm.MoveObject_Enable ObjMoveToModule_Enable = j ObjectPopup.SetCaption(ObjectPopup.ItemPosition("ObjMoveToModule"), "&Move to " & IIf(j, ModuleManager.CurrentModule.DisplayName, "Current Module")) End Function Sub ObjRename_Click() EnvelopForm.RenameObject_Click End Sub Sub OpenProject_Click() Dim dlg As New OpenDialog dlg.FileName = "*.epj" dlg.InitialDir = Envelop.FileDialogDir dlg.Title = "Open Project" dlg.Filter = "Envelop projects (*.epj)|*.epj|All files (*.*)|*.*|" dlg.DefaultExtension = "epj" dlg.FilterIndex = 1 dlg.FileMustExist = True dlg.PathMustExist = True dlg.NoChangeDir = True If dlg.Execute = IDOK Then Dim p as Project Envelop.FileDialogDir = dlg.FileName p = ProjectManager.OpenProject(dlg.FileName) ProjectView.Reset ActiveView = ProjectView DamageInactiveViews ProjectView.SelProject = p ProjectView.ExpandItem(ProjectView.ListIndex) If p && TypeOf p Is Application && p.MainForm Then p.MainForm.Show End If End If End Sub Sub ProjAddModules_Click() AddModule_Click End Sub Function ProjAddModules_Enable() As Integer ProjAddModules_Enable = toolbar.AddModule.Enabled End Function Sub ProjClose_Click() CloseProject_Click End Sub Function ProjClose_Enable() As Integer ProjClose_Enable = EnvelopForm.CloseProject_Enable End Function Function ProjectIsModified(p As Project) As Boolean If Not p Then ProjectIsModified = False Else Dim i, n as integer Dim m as ObjectModule ' Check each module in the project; any modified and we can return. n = p.ModuleCount - 1 For i = 0 To n m = p.Module(i) If m && (Not m.ReadOnly) && m.IsModified Then ProjectIsModified = True Exit Function End If Next i ' Check the project file and EXE, as necessary. If Not p.ProjectFileMatchesMe Then ProjectIsModified = True Exit Function End If If TypeOf p Is Application Then If Not p.EXEMatchesMe Then ProjectIsModified = True Exit Function End If End If End If ' Not p End Function Function ProjectNeedsSaved(p As Project) As Boolean ' Check the project file and EXE, as necessary. If p.ProjectFileName = "" || Not p.ProjectFileMatchesMe Then ProjectNeedsSaved = True Exit Function End If If TypeOf p Is Application Then If p.EXEFileName = "" || Not p.EXEMatchesMe Then ProjectNeedsSaved = True Exit Function End If End If End Function Sub ProjectView_MouseDown(button As Integer, shift As Integer, x As Single, y As Single) If button = 2 Then dim i as integer With ProjectView i = .FindIndexUnderPoint(x, y) If i >= 0 Then .ListIndex = i Select Case .ItemLevel(.ListIndex) Case 0 ' Project PopupMenu = ProjectPopup Case 1 ' Module PopupMenu = ModulePopup Case 2 ' Object PopupMenu = ObjectPopup EnvelopForm.CBSelectedObject.Text = .ItemString(.ListIndex) Case Else Throw MenuError End Select Else PopupMenu = FindObject("PopupMenu") End If End With End If End Sub Sub ProjectView_MouseUp(button As Integer, shift As Integer, x As Single, y As Single) PopupMenu = FindObject("PopupMenu") End Sub Function ProjFileMatchesEXE(p As Project) As Boolean If TypeOf p Is Application Then Dim pf, xf As New File pf.FileName = p.ProjectFileName xf.FileName = p.EXEFileName ProjFileMatchesEXE = (pf.Name <> "") && (pf.Name = xf.Name) Else ProjFileMatchesEXE = False End If End Function Sub ProjSaveAs_Click() SaveProjectAs_Click End Sub Function ProjSaveAs_Enable() As Integer ProjSaveAs_Enable = EnvelopForm.SaveProjectAs_Enable End Function Sub ProjSave_Click() SaveProject_Click End Sub Function ProjSave_Enable() As Integer ProjSave_Enable = EnvelopForm.SaveProject_Enable End Function Sub ProjWriteEXE_Click() Dim p as Project p = ProjectManager.CurrentProject If p Then Dim i, n As Integer Dim m As ObjectModule ' Save each module in the project n = p.ModuleCount - 1 For i = 0 To n m = p.Module(i) If m && (Not m.ReadOnly) && m.IsModified Then If Envelop.SADlg.SaveModule(m) = False Then Exit Sub End If Next i ' Save the project files p.WriteEXE End If End Sub Function ProjWriteEXE_Enable() As Boolean Dim p as Project p = ProjectManager.CurrentProject If TypeOf p Is Application AND NOT p.EXEMatchesMe Then ProjWriteEXE_Enable = True Else ProjWriteEXE_Enable = False End If End Function Function RenameSelectedObject(o As Object, newName As String) SelObject = o If SelObject = o Then Dim resetACL As Long resetACL = 0 ' If object is a project object, then try to change permissions ' to allow rename to go through. If TypeOf o Is Project Then Try resetACL = o.AccessControl.ObjectAccess o.AccessControl.ObjectAccess = "126 - R,W,C,D,M,P" Catch End Try End If Try ActiveView.RenameSelectedObject(newName) DamageInactiveViews Catch If resetACL Then o.AccessControl.ObjectAccess = resetACL Throw End Try If resetACL Then o.AccessControl.ObjectAccess = resetACL RenameSelectedObject = True Else RenameSelectedObject = False End If End Function Sub Reset() ProjectView.dirty = True ModuleView.dirty = True AlphaView.dirty = True HierView.dirty = True ActiveView.Reset End Sub Sub ResetAbstract(abso As Object) ActiveView.Reset SelObject = abso If ActiveView = HierView Then HierView.ExpandItem(HierView.ListIndex) End Sub Sub ResetModule(m As ObjectModule) ModuleView.Reset ActiveView = ModuleView DamageInactiveViews ModuleView.SelModule = m End Sub Sub ResetModuleString(m as ObjectModule) ProjectView.ResetModuleString(m) ModuleView.ResetModuleString(m) End Sub Sub ResetNewObject(newObj As Object) ActiveView.ResetNewObject(newObj) DamageInactiveViews End Sub Sub ResetProject(p As Project, expandCurrMod As Boolean) ProjectView.ResetProject(p, expandCurrMod) ActiveView = ProjectView DamageInactiveViews End Sub Sub Resize() Dim l, t, w, h as Single l = -30 w = ScaleWidth - l toolbar.Move(l, l, w, toolbar.Height) t = toolbar.Top + toolbar.Height h = ScaleHeight - toolbar.Height + 45 ProjectView.Move(l, t, w, h) AlphaView.Move(l, t, w, h) HierView.Move(l, t, w, h) ModuleView.Move(l, t, w, h) End Sub Sub SaveAll_Click() Dim m as ObjectModule Dim p as Project Dim i, n as integer ' Display busy-signal immediately. App.ShowBusySignal ' First, save all modules. ' The 0th module is always the intrinsic module, so skip it. n = ModuleManager.ModuleCount - 1 For i = 1 To n m = ModuleManager.Module(i) If Not m.ReadOnly && m.IsModified Then If Not Envelop.SADlg.SaveModule(m) Then ' user canceled Exit Sub End If End If Next i ' Now, for each open project, make sure it is properly saved, too. n = ProjectManager.ProjectCount - 1 For i = 0 To n If Not DoProjectSave(ProjectManager.Project(i), False) Then ' user canceled Exit Sub End If Next i End Sub Function SaveAll_Enable() As Integer Dim m as ObjectModule Dim i, n as integer n = ModuleManager.ModuleCount - 1 For i = 1 To n m = ModuleManager.Module(i) If m.ReadOnly = False && m.IsModified Then SaveAll_Enable = True Exit Function End If Next i n = ProjectManager.ProjectCount - 1 For i = 0 To n If ProjectNeedsSaved(ProjectManager.Project(i)) Then SaveAll_Enable = True Exit Function End If Next i SaveAll_Enable = False End Function Sub SaveModuleAs_Click Dim m As ObjectModule m = SelModule If m <> ObjectModule && Envelop.SADlg.SaveAs(m) Then ModuleView.ResetModuleString m ProjectView.ResetModuleString m End If End Sub Function SaveModuleAs_Enable() As Integer SaveModuleAs_Enable = SelModule <> ObjectModule End Function Sub SaveModule_Click() Dim m As ObjectModule m = SelModule If Envelop.SADlg.SaveModule(m) Then ModuleView.ResetModuleString m ProjectView.ResetModuleString m End If End Sub Function SaveModule_Enable() As Integer Dim m as ObjectModule Dim enable as Integer m = SelModule enable = (Not m.ReadOnly && m.IsModified) If enable Then toolbar.SaveModule.HintText = "Save module: " & m.DisplayName Else toolbar.SaveModule.HintText = "Save module" End If SaveModule_Enable = enable End Function Function SaveProject(p As Project) As Boolean ' Return FALSE only if user cancels any dialog SaveProject = True If p Then Dim i, n As Integer Dim m As ObjectModule ' Save each module in the project n = p.ModuleCount - 1 For i = 0 To n m = p.Module(i) If m && (Not m.ReadOnly) && m.IsModified Then If Envelop.SADlg.SaveModule(m) = False Then SaveProject = False Exit Function End If End If Next i ' Save the project files SaveProject = DoProjectSave(p, False) End If End Function Sub SaveProjectAs_Click() Dim p as Project p = ProjectManager.CurrentProject If p Then Dim i, n As Integer Dim m As ObjectModule ' Ensure each module in the project is titled n = p.ModuleCount - 1 For i = 0 To n m = p.Module(i) If m && m.IsUntitled Then If Envelop.SADlg.SaveModule(m) = False Then ' user canceled Exit Sub End If End If Next i DoProjectSave(p, True) End If ' ProjectManager.CurrentProject End Sub Function SaveProjectAs_Enable() As Integer SaveProjectAs_Enable = ProjectManager.CurrentProject <> Nothing End Function Function SaveProjectEXEAs(p as Project) As Integer Dim dlg As New SaveAsDialog Dim file As New File Dim name As String name = p.ProjectFileName If p.EXEFileName = "" && name <> "" Then ' Sync the project file name and EXE file name. file.FileName = name name = file.Path & file.Name & ".exe" Else name = p.EXEFileName End If If name <> "" Then file.FileName = name dlg.FileName = file.Name & file.Extension dlg.InitialDir = file.Path Else dlg.FileName = "*.exe" dlg.InitialDir = Envelop.FileDialogDir End If dlg.Title = "Save application EXE file as" dlg.Filter = "Executable files (*.exe)|*.exe|All files (*.*)|*.*|" dlg.DefaultExtension = "exe" dlg.FilterIndex = 1 dlg.PathMustExist = True dlg.NoChangeDir = True SaveProjectEXEAs = IDCANCEL If dlg.Execute = IDOK Then p.EXEFileName = dlg.FileName p.WriteEXE SaveProjectEXEAs = IDOK Envelop.FileDialogDir = dlg.FileName End If End Function Function SaveProjectFileAs(p as Project) As Integer Dim dlg As New SaveAsDialog Dim name As String name = p.ProjectFileName If name <> "" Then Dim file As New File file.FileName = name dlg.FileName = file.Name & file.Extension dlg.InitialDir = IIf(Instr(name, ".") > 0, file.Path, Envelop.FlieDialogDir) Else dlg.FileName = "*.epj" dlg.InitialDir = Envelop.FileDialogDir End If dlg.Title = "Save project file as" dlg.Filter = "Envelop projects (*.epj)|*.epj|All files (*.*)|*.*|" dlg.DefaultExtension = "epj" dlg.FilterIndex = 1 dlg.PathMustExist = True dlg.NoChangeDir = True SaveProjectFileAs = IDCANCEL If dlg.Execute = IDOK Then ' If project is an application, and the EXE name matches the project ' file name, then keep the EXE name in sync here. Dim syncEXE as Boolean syncEXE = ProjFileMatchesEXE(p) p.ProjectFileName = dlg.FileName p.WriteProjectFile If syncEXE Then Dim pf, xf As New File pf.FileName = p.ProjectFileName xf.FileName = p.EXEFileName p.EXEFileName = IIf(xf.Path = "", pf.Path, xf.Path) & pf.Name & ".exe" End If Envelop.FileDialogDir = dlg.FileName SaveProjectFileAs = IDOK End If End Function Sub SaveProject_Click() SaveProject ProjectManager.CurrentProject End Sub Function SaveProject_Enable Dim p as Project p = ProjectManager.CurrentProject If p Then Dim i, n as integer Dim m as ObjectModule ' Check each module in the project, bail if any modified n = p.ModuleCount - 1 For i = 0 To n m = p.Module(i) If m && (Not m.ReadOnly) && m.IsModified Then SaveProject_Enable = True Exit Function End If Next i SaveProject_Enable = ProjectNeedsSaved(p) End If ' ProjectManager.CurrentProject SaveProject_Enable = False End Function Sub setActiveView(o as Object) Dim selobj as Object If o = viewer Or Not o Then Exit Sub If viewer Then selobj = viewer.SelObject viewer.Visible = False End If viewer = o If viewer.dirty Then viewer.Reset If o <> ProjectView Then viewer.SelObject = selobj viewer.Visible = True viewer.SetFocus SyncViewerGadget End Sub Sub setSelObject(o as Object) ActiveView.SelObject = o End Sub Sub Startup Dim p as Project With ProjectStartupOptions Select Case .StartupAction Case .ACTION_NO_PROJECT toolbar.ViewModule.State = 1 ActiveView = ModuleView Case .ACTION_OPEN_PROJECT OpenProject_Click ActiveView = ProjectView Case .ACTION_NEW_PROJECT NewProject_Click ActiveView = ProjectView Case Else ' Includes .ACTION_DEFAULT_PROJECT p = NewProjectForm.MakeDefaultProject ActiveView = ProjectView ResetProject(p, True) ViewProject_Enable = -1 End Select Show ActiveView.Reset End With End Sub Sub SyncViewerGadget Select Case viewer Case ProjectView toolbar.ViewProject.State = "Down" Case ModuleView toolbar.ViewModule.State = "Down" Case AlphaView toolbar.ViewAlphabetical.State = "Down" Case HierView toolbar.ViewHierarchical.State = "Down" End Select End Sub Function TextUnload(ByVal indent As String, cmds As String) As Integer ' Set to ProjectView before saving text ViewProject_Click ' Write our parent's properties, but none of ours. TextUnload = False End Function Sub UnloadModule_Click() Dim p As Project Dim m As ObjectModule Dim ync As New YesNoCancelBox Dim r As Integer ' Try first to remove the selected module from current project ' or first project that contains it. ' If no projects have the selected module, just unload it. m = SelModule p = ProjectManager.CurrentProject If p = Nothing || p.ModuleIndex(m) = -1 Then p = ProjectManager.FirstProjectContainingModule(m) End If If p Then ' Can't remove the module containing the project object If m = ModuleManager.ModuleContaining(p) Then Dim mb As New MessageBox mb.title = "Unload module error" mb.message = "Module: " & m.DisplayName & " contains project: " & p & "^M^M" mb.message = mb.message & "Can't unload module that contains the project object" mb.Execute Exit Sub End If If (Not m.ReadOnly) && m.IsModified Then ync.title = "Unload modified module" ync.message = "Module: " & m.DisplayName & " is modified.^M^MSave before unloading from project: " & p & "?" r = ync.Execute If r = IDCANCEL Then Exit Sub If r = IDYES Then If Not Envelop.SADlg.SaveModule(m) Then ' user canceled the save Exit Sub End If End If Else Dim yn As New YesNoBox yn.title = "Unload module" yn.message = "Unload module: " & m.DisplayName & " from project: " & p & "?" If yn.Execute = IDNO Then Exit Sub End If ' Ignore unload failed exceptions. Try p.RemoveModule(m) Catch ModuleUnloadFailed End Try ResetProject(p, False) ElseIf m.CanUnload Then ' no project w/ module, just unload. If (Not m.ReadOnly) && m.IsModified Then ync.title = "Unload modified module" ync.message = "Module: " & m.DisplayName & " is modified.^M^MSave before unloading?" r = ync.Execute If r = IDCANCEL Then Exit Sub If r = IDYES Then If Not Envelop.SADlg.SaveModule(m) Then ' user canceled the save Exit Sub End If End If End If m.Unload End If End Sub Function UnloadModule_Enable As Integer Dim p As Project Dim m As ObjectModule m = SelModule p = ProjectManager.CurrentProject If p = Nothing || p.ModuleIndex(m) = -1 Then p = ProjectManager.FirstProjectContainingModule(m) End If ' Can't remove the module containing the project object If p Then If m = ModuleManager.ModuleContaining(p) Then toolbar.UnloadModule.HintText = "Unload module" UnloadModule_Enable = False Else toolbar.UnloadModule.HintText = "Unload module: " & m.DisplayName & " from project: " & p UnloadModule_Enable = True End If Else If m.CanUnload Then toolbar.UnloadModule.HintText = "Unload module: " & m.DisplayName UnloadModule_Enable = True Else toolbar.UnloadModule.HintText = "Unload module" UnloadModule_Enable = False End If End If End Function Sub ViewAlphabetical_Click If ActiveView = AlphaView Then AlphaView.Reset Else ActiveView = AlphaView End If End Sub Sub ViewHierarchical_Click If ActiveView = HierView Then HierView.Reset Else ActiveView = HierView End If End Sub Sub ViewModule_Click If ActiveView = ModuleView Then ModuleView.Reset Else ActiveView = ModuleView End If End Sub Sub ViewProject_Click If ActiveView = ProjectView Then ProjectView.Reset Else ActiveView = ProjectView End If End Sub End Type Type SourceSearcher From Form Dim Search As New Button Dim ModuleCombo As New ComboBox Dim Label3 As New Label Dim SearchCombo As New ComboBox Dim MaxEntries As Integer Dim HitResults As New IndentedList Dim bitmap As New Bitmap Dim SearchModule As ObjectModule Dim ObjectsBtn As New Button Dim HitFilter As New CheckBox Dim AutoExpand As New CheckBox Dim Help As New Button Dim searchGroup As New Group Type ListObject Dim obj As Object ' METHODS for object: SourceSearcher.ListObject Function Create(o As Object) As SourceSearcher.ListObject dim newobj as New SourceSearcher.ListObject newobj.obj = o Create = newobj End Function Sub Expand(list As IndentedList, itemIndex As Integer) dim resetCurObject As New SourceSearcher.ResetCurObject ' Item is an object SourceIterator.CurObject = obj SourceIterator.CurMethod = "" While SourceIterator.NextMethod() ' Only add methods for which there is a hit. If (SourceIterator.NextHit()) Then dim curIndex as integer curIndex = list.InsertItem(SourceIterator.CurMethod, 1, 1, itemIndex + 1) list.SetItemCanExpand(curIndex, 1) list.SetItemObject(curIndex, SourceSearcher.ListMethod.Create(obj, SourceIterator.CurMethod)) End If Wend End Sub End Type Type ListMethod From SourceSearcher.ListObject Dim meth As String ' METHODS for object: SourceSearcher.ListMethod Function Create(o As Object, m As String) As SourceSearcher.ListMethod dim newobj as New SourceSearcher.ListMethod newobj.obj = o newobj.meth = m Create = newobj End Function Sub Expand(list As IndentedList, itemIndex As Integer) dim curIndex as integer dim resetCurObject As New SourceSearcher.ResetCurObject curIndex = itemIndex SourceIterator.CurObject = obj SourceIterator.CurMethod = meth While SourceIterator.NextHit() curIndex = list.InsertItem(SourceIterator.HitLine & ": " & SourceIterator.HitLineText, 2, 2, curIndex + 1) list.SetItemObject(curIndex, SourceSearcher.ListHit.Create(obj, meth, SourceIterator.HitStart, SourceIterator.HitLength)) SourceIterator.HitStart = SourceIterator.HitStart + 1 Wend End Sub End Type Type ListHit From SourceSearcher.ListMethod Dim hitStart As Integer Dim hitLength As Integer ' METHODS for object: SourceSearcher.ListHit Function Create(o As Object, m As String, ByVal hs, ByVal hl as integer) As SourceSearcher.ListHit dim newobj as New SourceSearcher.ListHit newobj.obj = o newobj.meth = m newobj.hitStart = hs newobj.hitLength = hl Create = newobj End Function Sub Expand(list As IndentedList, itemIndex As Integer) Throw InvalidExpand() End Sub End Type Type ResetCurObject ' METHODS for object: SourceSearcher.ResetCurObject Sub Destruct() SourceIterator.CurObject = Nothing End Sub End Type ' METHODS for object: SourceSearcher Sub addObjects() dim o as object dim i as integer For i = 0 To searchGroup.Count - 1 dim curIndex as integer o = searchGroup(i) curIndex = HitResults.AddItem(o, 0) HitResults.SetItemCanExpand(curIndex, 1) HitResults.SetItemObject(curIndex, SourceSearcher.ListObject.Create(o)) Next i End Sub Sub Help_Click() dim oldtrap as integer oldtrap = Debugger.TrapSystemExceptions Debugger.TrapSystemExceptions = 0 Try dim helptext as string helptext = "^J1. Select a module (or all modules) to pick objects to search.^J" helptext = helptext & "2. Type a search string (regular expression).^J" helptext = helptext & "3. Click SEARCH button.^J" helptext = helptext & "^JUsing list:^J . Expand an object to show methods where search pattern is found.^J" helptext = helptext & " . Expand a method to show lines of source that match pattern.^J" helptext = helptext & " . Select a hit to view method source." helptext = helptext & "^J^JOptions:^J[ ] Only show hits - use this option to make search results only show hit strings.^J" helptext = helptext & "[ ] Auto expand - Use this option to force full expansion of search results.^J" helptext = helptext & "^JOBJECTS button - Seed list with objects from current module selection." InfoBox.Message("Using the Source Searcher", helptext) catch NotFound() End Try Debugger.TrapSystemExceptions = oldtrap End Sub Sub HitFilter_Click() If HitFilter.Value Then AutoExpand.Value = 1 AutoExpand.Enabled = False Else AutoExpand.Enabled = True End If End Sub Sub HitResults_Click() dim o as Object o = HitResults.ItemObject(HitResults.ListIndex) ' If the object referred to by this item is now gone, remove the item If (Not o.obj) Then HitResults.RemoveItem(HitResults.ListIndex) If (TypeOf o Is SourceSearcher.ListHit) Then If (MethodExists(o.obj, o.meth)) Then MethodEditor.ChangeState(o.obj, o.meth) MethodEditor.SelStart = o.hitStart MethodEditor.SelLength = o.hitLength MethodEditor.SetFocus End If End If End Sub Sub HitResults_DblClick() dim o as Object o = HitResults.ItemObject(HitResults.ListIndex) ' If the object referred to by this item is now gone, remove the item If (Not o.obj) Then HitResults.RemoveItem(HitResults.ListIndex) If (TypeOf o Is SourceSearcher.ListObject) Then ObjectEditorMgr.Edit o.obj End If End Sub Sub HitResults_Expand(ByVal itemIndex as Integer, ByVal itemData as Long, itemObj As Object) SourceIterator.SearchPattern = SearchCombo.Text itemObj.Expand(HitResults, itemIndex) End Sub Sub KeyDown(keyCode As Integer, ByVal shift As Integer) If (keyCode = VK_F1) Then Envelop.Help.ShowTopicHelp("Source_Searcher") End Sub Sub Load() HitResults.IconBitmap = bitmap AutoExpand.Enabled = True AutoExpand.Value = "Checked" MakeModuleList() ModuleCombo.ListIndex = 1 End Sub Sub MakeModuleList() dim i as integer ModuleCombo.Clear ModuleCombo.AddItem("All") ModuleCombo.AddItem("Open Module") For i = 0 To ModuleManager.ModuleCount - 1 dim om as ObjectModule dim modname as string om = ModuleManager.Module(i) modname = "#" & i & " : " & IIf(om.FileName <> "", om.FileName, "<Detached>") & " (" & om.StaticCount & ")" ModuleCombo.AddItem(modname) Next i End Sub Sub ModuleCombo_Click() If (ModuleCombo.ListIndex = 0) Then SearchModule = Nothing ElseIf (ModuleCombo.ListIndex = 1) Then SearchModule = ModuleManager.CurrentModule Else dim modnum as integer dim itemname as string itemname = ModuleCombo.List(ModuleCombo.ListIndex) modnum = Mid(itemname, 2, Instr(itemname, " ") - 2) SearchModule = ModuleManager.Module(modnum) End If HitResults.Clear() End Sub Sub ModuleCombo_DropDown() dim listIndex As Integer ' Remember the original selection before remaking list. listIndex = ModuleCombo.ListIndex MakeModuleList ' After list is remade, reset selection if it is no longer valid. If (listIndex >= ModuleCombo.ListCount) Then listIndex = 1 ' Pick a module, tries to maintain original selection ModuleCombo.ListIndex = listIndex End Sub Sub ObjectsBtn_Click() ' Show the busy cursor, to indicate we are working. If App Then App.ShowBusySignal searchGroup.Clear() HitResults.Clear() If (SearchModule) Then SearchModule.GetPrototypeObjects(searchGroup) Else dim i as integer For i = 0 To ModuleManager.ModuleCount - 1 dim om as ObjectModule om = ModuleManager.Module(i) om.GetPrototypeObjects(searchGroup) Next i End If addObjects() End Sub Sub Resize() HitResults.Width = ScaleWidth - (HitResults.Left * 2) HitResults.Height = ScaleHeight - (HitResults.Top + 45) End Sub Sub SearchCombo_KeyDown(keyCode As Integer, ByVal shift As Integer) If keyCode = VK_RETURN Then SendEvent Search.Click() End If End Sub Sub Search_Click() dim og as new Group dim i,j, hitLevel as integer dim resetCurObject As New SourceSearcher.ResetCurObject ' Show the busy cursor, to indicate we are searching. If App Then App.ShowBusySignal ' Before doing a search, ensure the current module is still valid ' by doing what DropDown does, this may change the search module ModuleCombo_DropDown() searchGroup.Clear() ' Configure the group of objects to search If (SearchModule) Then SearchModule.GetPrototypeObjects(searchGroup) Else For i = 0 To ModuleManager.ModuleCount - 1 dim om as ObjectModule om = ModuleManager.Module(i) om.GetPrototypeObjects(searchGroup) Next i End If SourceIterator.SearchPattern = SearchCombo.Text If (Not SourceIterator.RegExpValid) Then Throw RegularExpressionInvalid() End If updateSearch(SearchCombo.Text) HitResults.Clear If (HitFilter.Value) Then hitLevel = 0 Else hitLevel = 2 For i = 0 To searchGroup.Count - 1 dim hitString as String dim done, curIndex, objIndex, firstObj, firstMethod as integer dim numhits as long curIndex = 0 SourceIterator.CurObject = searchGroup(i) SourceIterator.CurMethod = "" firstObj = -1 done = 0 While SourceIterator.NextMethod() && (Not done) firstMethod = -1 While SourceIterator.NextHit() && (Not done) ' Try to keep iterator from running out of memory, by restricting matches. numhits = numhits + 1 If (numhits > 200) Then InfoBox.Message("Too many matches", "The search criteria was too general, and too many matches were found.") Exit Sub End If If (firstObj && (Not (HitFilter.Value = 1))) Then ' Always insert Objects at index=0, so they sort properly. curIndex = HitResults.InsertItem(SourceIterator.CurObject, 0, 0, 0) HitResults.SetItemCanExpand(curIndex, 1) HitResults.SetItemObject(curIndex, SourceSearcher.ListObject.Create(SourceIterator.CurObject)) objIndex = curIndex firstObj = 0 If (AutoExpand.Value = 0) Then done = -1 : Exit Do End If If (firstMethod && (Not (HitFilter.Value = 1))) Then curIndex = HitResults.InsertItem(SourceIterator.CurMethod, 1, 1, objIndex + 1) HitResults.SetItemCanExpand(curIndex, 1) HitResults.SetItemObject(curIndex, SourceSearcher.ListMethod.Create(SourceIterator.CurObject, SourceIterator.CurMethod)) firstMethod = 0 End If If HitFilter.Value Then hitString = SourceIterator.CurObject & "::" & SourceIterator.CurMethod & " " Else hitString = "" End If curIndex = HitResults.InsertItem(hitString & SourceIterator.HitLine & ": " & SourceIterator.HitLineText, 2, hitLevel, curIndex + 1) HitResults.SetItemObject(curIndex, SourceSearcher.ListHit.Create(SourceIterator.CurObject, SourceIterator.CurMethod, SourceIterator.HitStart, SourceIterator.HitLength)) SourceIterator.HitStart = SourceIterator.HitStart + 1 Wend Wend Next i End Sub Sub updateSearch(s As String) ' Try to find existing item "s", if found don't add again. If SearchCombo.ItemIndex(s) >= 0 Then Exit Sub ' If we have max # of item already, remove oldest item in list. If SearchCombo.ListCount = MaxEntries Then SearchCombo.RemoveItem(SearchCombo.ListCount - 1) End If ' Add an item at the top of the list SearchCombo.InsertItem(s, 0) End Sub End Type Type ObjectBoxEditor From ObjectEditor Type ObjBoxForm From Form Type Toolbox From ObjectBox Dim MovePrevious As New ToolGadget Dim MoveNext As New ToolGadget Dim NewGadget As New ToolGadget Type DelGadget From ToolGadget Property HintText Get getHintText As String ' METHODS for object: ObjectBoxEditor.ObjBoxForm.Toolbox.DelGadget Function getHintText As String If Enabled Then getHintText = "Delete " & Parent.CurrentGadget.Name Else getHintText = "Delete Selected Gadget" End If End Function End Type Type Configure From ToolGadget Property HintText Get getHintText As String ' METHODS for object: ObjectBoxEditor.ObjBoxForm.Toolbox.Configure Function getHintText As String If Enabled Then dim EditObj as string EditObj = ObjectBoxEditor.ObjBoxForm.Caption EditObj = Right$(EditObj, Len(EditObj) - Instr(EditObj, ": ") - 1) getHintText = "Configure " & EditObj Else getHintText = "Configure ObjectBox" End If End Function End Type Type ConfigureTool From ToolGadget Property HintText Get getHintText As String ' METHODS for object: ObjectBoxEditor.ObjBoxForm.Toolbox.ConfigureTool Function getHintText As String If Enabled Then getHintText = "Configure " & Parent.CurrentGadget.Name Else getHintText = "Configure Selected Gadget" End If End Function End Type Dim SlidePrevious As New ToolGadget Dim SlideNext As New ToolGadget Dim SeparatorInc As New ToolGadget Dim SeparatorDec As New ToolGadget Dim CurrentGadget As ButtonGadget Dim GadgetPrototype As ButtonGadget Dim ObjBox As ObjectBox Dim EditOnAdd As Boolean ' METHODS for object: ObjectBoxEditor.ObjBoxForm.Toolbox Sub ConfigureTool_Click() CurrentGadget.DetailedEdit End Sub Function ConfigureTool_Enable() as integer If ObjectBoxEditor.Enabled Then If ObjBox <> Nothing Then If CurrentGadget <> Nothing Then ConfigureTool_Enable = True Else ConfigureTool_Enable = False End If Else ConfigureTool_Enable = False End If Else ConfigureTool_Enable = False End If End Function Sub Configure_Click() ObjectBoxConfigWizard.OriginalBox = ObjBox ObjectBoxConfigWizard.Show End Sub Function Configure_Enable() as integer If ObjectBoxEditor.Enabled Then If ObjBox <> Nothing Then Configure_Enable = True Else Configure_Enable = False End If Else Configure_Enable = False End If End Function Sub DelGadget_Click() Dim YES as integer Dim YN as New YesNoBox YES = 6 YN.title = "Verify Delete" YN.message = "Are you sure you want to delete " & CurrentGadget.Name YN.Execute If YN.result = YES Then dim i as integer i = CurrentGadget.Position DestroyObject(CurrentGadget) If ObjBox.NumItems = 0 Then CurrentGadget = Nothing Else If i > ObjBox.NumItems Then CurrentGadget = ObjBox.At(ObjBox.NumItems) Else ObjBox.ForceLayout(False) CurrentGadget = ObjBox.At(i) End If End If With Parent.CBGadget If CurrentGadget Then .Text = CurrentGadget.Name Else .Text = "" End If End With ObjBox.ForceLayout(True) End If End Sub Function DelGadget_Enable() as integer If ObjectBoxEditor.Enabled Then If ObjBox <> Nothing Then If CurrentGadget <> Nothing Then DelGadget_Enable = True Else DelGadget_Enable = False End If Else DelGadget_Enable = False End If Else DelGadget_Enable = False End If End Function Sub MoveNext_Click() CurrentGadget = ObjBox.At(CurrentGadget.Position + 1) Parent.CBGadget.ListIndex = Parent.CBGadget.ItemIndex(CurrentGadget.Name) End Sub Function MoveNext_Enable() as integer If ObjectBoxEditor.Enabled Then If ObjBox <> Nothing Then If ObjBox.NumItems > 1 && CurrentGadget <> Nothing && CurrentGadget.Position < ObjBox.NumItems Then MoveNext_Enable = True Else MoveNext_Enable = False End If Else MoveNext_Enable = False End If Else MoveNext_Enable = False End If End Function Sub MovePrevious_Click() CurrentGadget = ObjBox.At(CurrentGadget.Position - 1) Parent.CBGadget.ListIndex = Parent.CBGadget.ItemIndex(CurrentGadget.Name) End Sub Function MovePrevious_Enable() as integer If ObjectBoxEditor.Enabled Then If ObjBox <> Nothing Then If ObjBox.NumItems > 1 && CurrentGadget <> Nothing && CurrentGadget.Position > 1 Then MovePrevious_Enable = True Else MovePrevious_Enable = False End If Else MovePrevious_Enable = False End If Else MovePrevious_Enable = False End If End Function Sub NewGadget_Click() CurrentGadget = EmbedObject(ObjBox, GadgetPrototype, UniqueEmbedName(ObjBox, "ToolGadget")) CurrentGadget.bitmap.SetPicture GadgetConfigWizard.BlankBitmap.GetPicture If EditOnAdd Then dim o as long o = CurrentGadget.DetailedEdit If Not o Then Dim YN as New YesNoBox YN.title = "Delete Cancelled Add Configuration" YN.message = "Would you like to Delete '" & CurrentGadget.Name & "'?" YN.Execute If YN.result = IDYES Then DestroyObject(CurrentGadget) If ObjBox.NumItems > 0 Then CurrentGadget = ObjBox.At(1) Else CurrentGadget = Nothing End If End If End If End If ObjBox.ForceLayout(True) End Sub Function NewGadget_Enable() as integer If ObjectBoxEditor.Enabled Then If ObjBox <> Nothing Then NewGadget_Enable = True Else NewGadget_Enable = False End If Else NewGadget_Enable = False End If End Function Sub SeparatorDec_Click() If CurrentGadget.Separator > 1 Then CurrentGadget.Separator = CurrentGadget.Separator - 1 Else CurrentGadget.Separator = 0 End If End Sub Sub SeparatorDec_DblClick() If CurrentGadget.Separator > 10 Then CurrentGadget.Separator = CurrentGadget.Separator - 10 Else CurrentGadget.Separator = 0 End If End Sub Function SeparatorDec_Enable() as integer If ObjectBoxEditor.Enabled Then If ObjBox <> Nothing && ObjBox.LayoutStyle = "ToolBar" && CurrentGadget <> Nothing && CurrentGadget.Separator > 0 Then SeparatorDec_Enable = True Else SeparatorDec_Enable = False End If Else SeparatorDec_Enable = False End If End Function Sub SeparatorInc_Click() CurrentGadget.Separator = CurrentGadget.Separator + 1 End Sub Sub SeparatorInc_DblClick() CurrentGadget.Separator = CurrentGadget.Separator + 10 End Sub Function SeparatorInc_Enable() as integer If ObjectBoxEditor.Enabled Then If ObjBox <> Nothing && ObjBox.LayoutStyle = "ToolBar" && CurrentGadget <> Nothing Then SeparatorInc_Enable = True Else SeparatorInc_Enable = False End If Else SeparatorInc_Enable = False End If End Function Sub SlideNext_Click() CurrentGadget.Position = CurrentGadget.Position + 1 End Sub Function SlideNext_Enable() as integer If ObjectBoxEditor.Enabled Then If ObjBox <> Nothing Then If ObjBox.NumItems > 1 && CurrentGadget <> Nothing && CurrentGadget.Position < ObjBox.NumItems Then SlideNext_Enable = True Else SlideNext_Enable = False End If Else SlideNext_Enable = False End If Else SlideNext_Enable = False End If End Function Sub SlidePrevious_Click() CurrentGadget.Position = CurrentGadget.Position - 1 End Sub Function SlidePrevious_Enable() as integer If ObjectBoxEditor.Enabled Then If ObjBox <> Nothing Then If ObjBox.NumItems > 1 && CurrentGadget <> Nothing && CurrentGadget.Position > 1 Then SlidePrevious_Enable = True Else SlidePrevious_Enable = False End If Else SlidePrevious_Enable = False End If Else SlidePrevious_Enable = False End If End Function Function TextUnload(ByVal indent as string, cmds as string) As Integer cmds = cmds & indent & ".EditOnAdd = " & EditOnAdd & "^J" If GadgetPrototype = Nothing Then cmds = cmds & indent & ".GadgetPrototype = Nothing^J" Else cmds = cmds & indent & ".GadgetPrototype = " & GadgetPrototype & "^J" End If ' Request inherited properites to unload also TextUnload = False End Function End Type Type CBGadget From ComboBox Dim SuppressClick As Boolean ' METHODS for object: ObjectBoxEditor.ObjBoxForm.CBGadget Sub Change() dim o as Object o = FindEmbed(Parent.Toolbox.ObjBox, Text) If o && TypeOf o Is ButtonGadget Then ObjectBoxEditor.Edit(o) End Sub Sub Click() If SuppressClick Then SuppressClick = False Exit Sub End If ObjectBoxEditor.Edit(FindEmbed(Parent.Toolbox.ObjBox, List(ListIndex))) End Sub Sub KeyDown(keyCode As Integer, ByVal shift As Integer) If keyCode = VK_RETURN Then dim o as Object keyCode = 0 o = FindEmbed(Parent.Toolbox.ObjBox, Text) If o && TypeOf o Is ButtonGadget Then ObjectBoxEditor.Edit(o) End If End Sub End Type ' METHODS for object: ObjectBoxEditor.ObjBoxForm Sub CBGadget_DropDown() If Toolbox.ObjBox Then Dim i as integer CBGadget.Clear For i = 1 To Toolbox.ObjBox.NumItems CBGadget.AddItem(Toolbox.ObjBox.At(i).Name) Next i If Toolbox.CurrentGadget && Toolbox.CurrentGadget.Name <> CBGadget.Text Then CBGadget.SuppressClick = True CBGadget.ListIndex = CBGadget.ItemIndex(Toolbox.CurrentGadget.Name) End If Else CBGadget.Clear End If End Sub Function getActive As Long If ToolPalette.ToggleObjectBoxEdit.State = "Up" Then getActive = False Else getActive = True End If End Function Sub KeyDown(keyCode As Integer, ByVal shift As Integer) CBGadget.KeyDown(keyCode, shift) End Sub Sub Resize() CBGadget.Width = ScaleWidth - 4500 Height = 840 CBGadget.Refresh End Sub Sub SetCaption() Caption = "Editing: " If Toolbox.ObjBox Then If Toolbox.ObjBox.Name <> "" Then Caption = Caption & Toolbox.ObjBox.Name Else Caption = Caption & Toolbox.ObjBox End If Else Caption = Caption & "NOTHING" End If End Sub Sub SetPrototype If Toolbox.ObjBox = ControlTools.Palette Then Toolbox.GadgetPrototype = ControlTools.Gadget Else Toolbox.GadgetPrototype = ToolGadget End If End Sub End Type Property Active Get getActive As Long ' METHODS for object: ObjectBoxEditor Sub Edit(o As Object) If (o && TypeOf o Is ObjectBox) && o <> ObjBoxForm.Toolbox Then ObjBoxForm.Toolbox.ObjBox = o If o.NumItems > 0 Then ObjBoxForm.Toolbox.CurrentGadget = o.At(1) Else ObjBoxForm.Toolbox.CurrentGadget = Nothing End If If Active Then ObjBoxForm.Visible = True SetPrototype ObjBoxForm.SetCaption ObjBoxForm.CBGadget_DropDown ElseIf (o && TypeOf o Is ButtonGadget) && o.Parent Then If o = ObjBoxForm.Toolbox.CurrentGadget Then Else ObjBoxForm.Toolbox.ObjBox = o.Parent ObjBoxForm.Toolbox.CurrentGadget = o If Active Then ObjBoxForm.Visible = True ObjBoxForm.SetPrototype ObjBoxForm.SetCaption ObjBoxForm.CBGadget_DropDown End If ' Make the Editor standout. If Active Then ObjBoxForm.BringToTop End If End Sub Function getActive As Long If ToolPalette.ToggleObjectBoxEdit.State = "Up" Then getActive = False Else getActive = True End If End Function Sub SetPrototype If ObjBoxForm.Toolbox.ObjBox = ControlTools.Palette Then ObjBoxForm.Toolbox.GadgetPrototype = ControlTools.Gadget Else ObjBoxForm.Toolbox.GadgetPrototype = ToolGadget End If End Sub End Type Type MenuEditHook From ObjectEditor ' METHODS for object: MenuEditHook Sub BringToTop() MenuEdit.BringToTop() End Sub Sub Edit(obj As Object) If obj && (TypeOf obj Is PopupMenu || TypeOf obj Is MenuBar) Then MenuEdit.ProcessMenu(obj) MenuEdit.Show MenuEdit.BringToTop End If End Sub Sub Hide() MenuEdit.Hide() End Sub Sub Show() MenuEdit.Show() End Sub End Type Type EnvelopForm From Form Type EnvelopMenus From MenuBar Dim EnvelopFileMenu As New PopupMenu Dim EnvelopObjectMenu As New PopupMenu Dim EnvelopOptionsMenu As New PopupMenu Dim EnvelopHelpMenu As New PopupMenu Dim EnvelopToolsMenu As New PopupMenu End Type Dim LblEditObj As New Label Type toolbar From ObjectBox Dim NewProject As New ToolGadget Dim OpenProject As New ToolGadget Dim SaveProject As New ToolGadget Dim CloseProject As New ToolGadget Type WorksetLeft From ToolGadget ' METHODS for object: EnvelopForm.toolbar.WorksetLeft Sub Click() WorkSet.PrevObj End Sub Function Enable() As Integer Enable = WorkSet.Active End Function End Type Type Finger From ToolGadget Dim oldCaption As String Dim fingerStarted As Boolean Dim oldAutoBusy As Boolean Dim fingerPointer As Integer ' METHODS for object: EnvelopForm.toolbar.Finger Function FindObjectUnderPoint(x, y as Single) As Object dim p as New Point p.x = x : p.y = y getScreenCoords(p) FindObjectUnderPoint = ObjectTools.FindObjectUnderPoint(p.x, p.y) End Function Sub getScreenCoords(p as Point) p.x = p.x / Screen.TwipsPerPixelX + Left p.y = p.y / Screen.TwipsPerPixelY + Top ClientToScreen(Parent.hWnd, p) End Sub Sub MouseDown(button As Integer, shift As Integer, x As Single, y As Single) If button And 1 && Not fingerStarted Then fingerStarted = True oldAutoBusy = App.AutoBusySignal App.AutoBusySignal = False Parent.MousePointer = fingerPointer oldCaption = EnvelopForm.Caption End If End Sub Sub MouseMove(button As Integer, shift As Integer, x As Single, y As Single) If button And 1 Then Dim obj As Object obj = FindObjectUnderPoint(x, y) EnvelopForm.Caption = "Found Object: " & IIf(obj, obj, "Nothing") End If End Sub Sub MouseUp(button As Integer, shift As Integer, x As Single, y As Single) If fingerStarted Then dim obj as Object fingerStarted = False EnvelopForm.Caption = oldCaption obj = FindObjectUnderPoint(x, y) If obj Then ' Special case the EnvelopForm to turn Form-Editing off (avoids confusing state) If (obj = EnvelopForm) Then FormEditor.Editing = False ObjectEditorMgr.Edit(obj) End If Parent.MousePointer = "Default" App.AutoBusySignal = oldAutoBusy End If End Sub End Type Type WorksetRight From ToolGadget ' METHODS for object: EnvelopForm.toolbar.WorksetRight Sub Click() WorkSet.NextObj End Sub Function Enable() As Integer Enable = WorkSet.Active End Function End Type Dim NewForm As New ToolGadget Dim CopyObject As New ToolGadget Dim AbstractObject As New ToolGadget Dim DeleteObject As New ToolGadget Type ToggleEdit From ToolGadget Property HintText Get getHintText As String ' METHODS for object: EnvelopForm.toolbar.ToggleEdit Function getHintText As String If FormEditor.Editing Then getHintText = "Deactivate Form Editor" Else getHintText = "Activate Form Editor" End If End Function End Type Type RestoreLayout From ToolGadget ' METHODS for object: EnvelopForm.toolbar.RestoreLayout Sub Click() EnvelopLayoutSet.AutoRestoreLayout End Sub Sub DblClick() ScreenLayoutConfigForm.Execute(EnvelopLayoutSet) End Sub End Type Type Help From EnvelopForm.toolbar.Finger ' METHODS for object: EnvelopForm.toolbar.Help Sub Click() EnvelopForm.HelpTopics_Click End Sub Sub MouseUp(button As Integer, shift As Integer, x As Single, y As Single) If fingerStarted Then dim obj as Object fingerStarted = False EnvelopForm.Caption = oldCaption obj = FindObjectUnderPoint(x, y) If obj Then If TypeOf obj Is MethodEditor Then Envelop.Help.ShowTopicHelp("Methods_Browser") ElseIf TypeOf obj Is PropertyEditor Then Envelop.Help.ShowTopicHelp("Property_Editor") ElseIf obj = ObjectViewer Then Envelop.Help.ShowTopicHelp("Object_Viewer") ElseIf obj = EnvelopForm Then Envelop.Help.ShowTopicHelp("Main_Envelop_Menu_and_Toolbar") ElseIf FormEditor.CurForm = obj Then Envelop.Help.ShowTopicHelp("Form_environment") ElseIf obj = Me Then ' Do nothing in particular, wait for Click event. Else Envelop.Help.ShowObjectHelp(obj) End If End If Parent.MousePointer = "Default" App.AutoBusySignal = oldAutoBusy End If End Sub End Type Dim NewObject As New ToolGadget ' METHODS for object: EnvelopForm.toolbar Sub DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect) effect = 0 End Sub End Type Type CBSelectedObject From ComboBox ' METHODS for object: EnvelopForm.CBSelectedObject Sub Click() Dim editObj as Object editObj = FindObject(List(ListIndex)) If Not editObj Then Exit Sub ObjectEditorMgr.ResetOthers(WorkSet, editObj) End Sub Sub Edit(obj as Object) dim name as String dim grpObj as Object dim idx as Long If Not obj Then Exit Sub End If name = obj idx = ItemIndex(name) If (idx <> -1) Then RemoveItem(idx) End If If (ListCount >= 10) Then RemoveItem(ListCount - 1) InsertItem(name, 0) ' Make the combo select the just entered item, by setting Text property. ' this avoids the "Click" event which would result from setting ListIndex. Text = name End Sub Sub EditByName(nm as String) Dim obj as Object obj = FindObject(nm) ' Special case the EnvelopForm to turn Form-Editing off (avoids confusing state) If (obj = EnvelopForm) Then FormEditor.Editing = False If obj Then ObjectEditorMgr.Edit obj End Sub Sub KeyDown(keyCode As Integer, ByVal shift As Integer) If keyCode = VK_RETURN Then keyCode = 0 EditByName(Text) End If End Sub Sub KeyUp(keyCode As Integer, ByVal shift As Integer) ' Special case having a "." for last typed char, so that ' composite names like "A.B" can be type if "A" is already in list. If (Right(Text, 1) <> ".") Then SelectNamed(Text) End Sub Sub Selection(obj as Object) If obj Then Dim name as String name = obj If Text <> name Then Text = obj End If End If End Sub Sub SelectNamed(nm As String) Dim obj as Object obj = FindObject(nm) If ObjectViewer.SelObject <> obj Then ObjectViewer.SelObject = Nothing ObjectEditorMgr.Selection obj End Sub End Type ' METHODS for object: EnvelopForm Sub About_Click() AboutEnvelopForm.Execute() End Sub Sub AbstractObject_Click() Dim nm, rootNm, newNm as String Dim old, abso as Object Dim r as Long old = ObjectEditorMgr.SelectedObject r = InputDialog.Execute("Abstract Object", "Enter name to give new prototype of " & old & ":", UniqueObjectName(old)) If r <> IDOK Then Exit Sub newNm = InputDialog.Text If IsIdentifierValid(newNm) = 0 Then Dim mb As New MessageBox mb.SetIconExclamation mb.Message("Invalid identifier", """" & newNm & """ is not a valid object name") Exit Sub End If rootNm = ObjectTools.RootName(old) ' Abstract object and reset viewers and editors abso = ObjectTools.AbstractObject(old, newNm) ObjectViewer.ResetAbstract(abso) ObjectEditorMgr.Edit abso ' If original was an embedded control with prefixed name, ' change original's prefixed name to reflect new type If TypeOf old Is Window && old.Parent Then If Instr(old.Name, rootNm) = 1 && Val(Mid(old.Name, Len(rootNm) + 1)) Then rootNm = ObjectTools.RootName(old) old.Name = UniqueEmbedName(old.Parent, rootNm) End If End If If TypeOf old Is HyperControl && old.Parent Then abso.Caption = abso abso.Move(abso.Left, abso.Top, old.Width + (abso.Width - abso.ScaleWidth), old.Height + (abso.Height - abso.ScaleHeight)) End If End Sub Function AbstractObject_Enable() As Integer AbstractObject_Enable = (ObjectEditorMgr.SelectedObject <> Nothing) End Function Sub AppEditor_Click() ApplicationEditor.Visible = Not ApplicationEditor.Visible End Sub Function AppEditor_Enable() As Integer AppEditor_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("AppEditor", ApplicationEditor.Visible) End Function Sub CBSelectedObject_DropDown() WorkSet.CleanList End Sub Sub CloseAll_Click() PropertyEditor.Hide MethodEditor.Hide ObjectViewer.Hide SourceSearcher.Hide ToolPalette.Hide ControlTools.Palette.Hide Debug.Hide MenuEdit.Hide MenuTester.Hide GroupEditor.Hide ApplicationEditor.Hide WorkSet.Hide End Sub Sub CloseProject_Click ObjectViewer.CloseProject_Click End Sub Function CloseProject_Enable() As Integer Dim enable As Integer enable = ObjectViewer.CloseProject_Enable If enable Then toolbar.CloseProject.HintText = "Close project: " & ProjectManager.CurrentProject Else toolbar.CloseProject.HintText = "Close project" End If CloseProject_Enable = enable End Function Sub ConfigureLayout_Click() ScreenLayoutConfigForm.Execute EnvelopLayoutSet End Sub Sub ControlPalette_Click() ControlTools.Palette.Visible = Not ControlTools.Palette.Visible End Sub Function ControlPalette_Enable() As Integer ControlPalette_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("ControlPalette", ControlTools.Palette.Visible) End Function Sub CopyObject_Click() Dim o as Object ' Try to get the FormEditor or the ObjectViewer to do the copy. o = ObjectEditorMgr.SelectedObject If (Not FormEditorCopy(o)) && (Not ObjectViewer.CopyObjectQuick(o, False)) Then ' Just do it ourselves Dim r as Long r = InputDialog.Execute("Copy Object", "Enter name for new object:", UniqueObjectName(o)) If r = IDOK && Len(InputDialog.Text) > 0 Then CopyObject(o, InputDialog.Text) End If End Sub Function CopyObject_Enable() As Integer CopyObject_Enable = (ObjectEditorMgr.SelectedObject <> Nothing) End Function Sub DebugWindow_Click() Debug.Visible = Not Debug.Visible End Sub Function DebugWindow_Enable() As Integer DebugWindow_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("DebugWindow", Debug.Visible) End Function Sub DeleteObject_Click() Dim o as Object Dim msg as String o = ObjectEditorMgr.SelectedObject ' Try to get the FormEditor to do the delete. Try If TypeOf o Is Window && o.Parent = FormEditor.CurForm Then Dim i, n as Integer ObjectViewer.SelObject = o.Parent n = FormEditor.NumSelected - 1 For i = 0 To n If FormEditor.GetSelected(i) = o Then msg = "Destroy selected control" & IIf(FormEditor.NumSelected > 1, "s?", "?") If OKCancelBox.Message("Destroy Object", msg) <> IDOK Then Exit Sub ' If the FormEditor can delete this object, let it. Otherwise ' let the ObjectViewer try. ' The FormEditor will delete all selected controls FormEditor.DeleteControl(Nothing) Exit Sub End If Next i End If Catch End Try msg = "Destroy object '" & o & "' ?" If OKCancelBox.Message("Destroy Object", msg) <> IDOK Then Exit Sub ' Alert the user if we are deleting an object that has copies of itself in existence If ObjectHasCopies(o) Then msg = "The object '" & o & "' has copies of itself that will also be deleted.^M^J OK to continue?" If OKCancelBox.Message("Destroy Object", msg) <> IDOK Then Exit Sub End If ' Try to get the ObjectViewer to do the delete ' ' If the ObjectViewer can delete this object, let it. Otherwise ' delete it ourselves. If Not ObjectViewer.DestroySelectedObject(o) Then ' Just do it ourselves DestroyObject(o) ObjectEditorMgr.Selection ObjectViewer.SelObject End If End Sub Function DeleteObject_Enable() As Integer DeleteObject_Enable = ObjectEditorMgr.SelectedObject && CanDeleteObject(ObjectEditorMgr.SelectedObject) End Function Sub DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect) If state = 4 Then ModuleManager.LoadModule(source.FileName, False) ObjectViewer.Reset Else effect = 0 End If End Sub Function FormEditorCopy(o As Object) As Boolean ' Try to get the FormEditor to do the copy. Try Dim p as Form Dim i, n as Integer p = o.Parent If p <> FormEditor.CurForm Then Throw No n = FormEditor.NumSelected - 1 For i = 0 To n If FormEditor.GetSelected(i) = o Then Exit For Next i If i > n Then Throw No FormEditor.CopyControls FormEditorCopy = True Exit Function Catch End Try FormEditorCopy = False End Function Sub GroupEditor_Click() GroupEditor.Visible = Not GroupEditor.Visible End Sub Function GroupEditor_Enable() As Integer GroupEditor_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("GroupEditor", GroupEditor.Visible) End Function Sub HelpSamples_Click() SamplesBrowser.Show SamplesBrowser.BringToTop End Sub Sub HelpTopics_Click() Envelop.Help.HelpTopics End Sub Sub KeyDown(keyCode As Integer, ByVal shift As Integer) CBSelectedObject.KeyDown(keyCode, shift) If (keyCode = VK_F1) Then Envelop.Help.ShowTopicHelp("Main_Envelop_Menu_and_Toolbar") End Sub Sub Load() ' Secure this object to prevent deletion. ' TODO: Need to specify can't delete or rename security, can't use general, because ' then methods and properties can't be changed either. ' SecureObject(Me, ACL) ' TODO: Patch to prevent selected combo being hidden by toolbar EnvelopForm.CBSelectedObject.ZOrder = 1 ' Hide the project startup dialog, doesn't matter if it didn't show ProjectStartupDialog.Hide ' Display the object viewer; take care of project startup etc. ObjectViewer.Startup ' Restore default layout or best layout for current screen resolution. EnvelopLayoutSet.AutoRestoreLayout() ' Overcome a timing problem with making the default object "Form1" and restoring ' the layout position of the object it copies from "Form". ' Ummm, but only do this if we just made a new or default project! Otherwise we ' might move someone's Form1 in a project they just opened. With ProjectStartupOptions If .StartupAction = .ACTION_NEW_PROJECT || .StartupAction = .ACTION_DEFAULT_PROJECT Then If FindObject("Form1") Then Form1.Move(Form.Left, Form.Top, Form.Width, Form.Height) End If End With ' Set the module index of the Envelop objects, to keep Debugger from ' trapping exceptions that occur in code run from these objects. Debugger.IgnoreExceptionsModule = ModuleManager.ModuleContaining(Me).Selector End Sub Sub LoadModule_Click() ObjectViewer.LoadModule_Click End Sub Sub MenuEditor_Click() MenuEdit.Visible = Not MenuEdit.Visible End Sub Function MenuEditor_Enable() As Integer MenuEditor_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("MenuEditor", MenuEdit.Visible) End Function Sub MergeModule_Click() Envelop.ETOOpen.MergeEto End Sub Sub MethodBrowser_Click() MethodEditor.Visible = Not MethodEditor.Visible End Sub Function MethodBrowser_Enable() As Integer MethodBrowser_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("MethodBrowser", MethodEditor.Visible) End Function Sub MoveObject_Click() ObjectViewer.MoveObject_Click End Sub Function MoveObject_Enable() As Integer ' Set menu item to show an informative string... Dim enable As Boolean Dim pos As Integer Dim itemStr As String enable = ObjectViewer.MoveObject_Enable pos = EnvelopMenus.EnvelopObjectMenu.ItemPosition("MoveObject") itemStr = "Move to " & IIf(enable, ModuleManager.CurrentModule.DisplayName, "Current Module") EnvelopMenus.EnvelopObjectMenu.SetCaption(pos, itemStr) MoveObject_Enable = enable End Function Sub NewForm_Click() Dim f as Form Dim nm as String nm = UniqueObjectNameFromString("Form") f = CopyObject(Form, nm) f.Caption = nm FormEditor.Editing = True ObjectEditorMgr.Edit f ObjectViewer.ResetNewObject(f) End Sub Sub NewModule_Click() ObjectViewer.NewModule_Click End Sub Sub NewObject_Click() ObjectViewer.NewObject_Click End Sub Sub NewProject_Click ObjectViewer.NewProject_Click End Sub Sub ObjectBrowser_Click() ObjectViewer.Visible = Not ObjectViewer.Visible End Sub Function ObjectBrowser_Enable() As Integer ObjectBrowser_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("ObjectBrowser", ObjectViewer.Visible) End Function Sub OcxTool_Click() OcxTool.Visible = Not OcxTool.Visible End Sub Function OcxTool_Enable() As Integer OcxTool_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("OcxTool", OcxTool.Visible) End Function Sub OpenProject_Click ObjectViewer.OpenProject_Click End Sub Sub PropertyEditor_Click() PropertyEditor.Visible = Not PropertyEditor.Visible End Sub Function PropertyEditor_Enable() As Integer PropertyEditor_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("PropertyEditor", PropertyEditor.Visible) End Function Sub QuickCopy_Click() Dim o as Object ' Try to get the FormEditor or the ObjectViewer to do the copy. o = ObjectEditorMgr.SelectedObject If (Not FormEditorCopy(o)) && (Not ObjectViewer.CopyObjectQuick(o, True)) Then ' Just do it ourselves CopyObject(o, UniqueObjectName(o)) End If End Sub Function QuickCopy_Enable() As Integer QuickCopy_Enable = (ObjectEditorMgr.SelectedObject <> Nothing) End Function Sub QuitApp_Click() App.Quit End Sub Sub RenameObject_Click() Dim o as Object Dim nm as String o = ObjectEditorMgr.SelectedObject nm = o If Instr(nm, ".") Then nm = stripEmbedName(nm) If InputDialog.Execute("Rename Object", "Enter new name for object:", nm) = IDOK Then Dim newName As String newName = InputDialog.Text If IsIdentifierValid(newName) = 0 Then Dim mb As New MessageBox mb.SetIconExclamation mb.Message("Invalid identifier", """" & newName & """ is not a valid object name") Exit Sub End If Try If HostObject(o) Then ' The object to rename is an Embedded object, so unless the ObjectViewer is showing ' embeds we can just do the rename like this. If TypeOf o Is Control Then ' Use Name property for these guys, Name doesn't always work on Forms o.Name = newName Else RenameObject(o, newName) End If ElseIf Not ObjectViewer.RenameSelectedObject(o, newName) Then ' If the ObjectViewer can't be shown for example... RenameObject(o, newName) End If Catch InfoBox.Message("Rename failed", "The name " & newName & " is already in use.") End Try ObjectEditorMgr.Selection(o) End If End Sub Function RenameObject_Enable() As Integer Dim obj As Object obj = ObjectEditorMgr.SelectedObject RenameObject_Enable = obj && (Not IsDynamic(obj)) && ((TypeOf obj Is Project) || CanDeleteObject(obj)) End Function Sub Resize() dim lastGad As ButtonGadget dim minLeft, newLeft As Single dim overhang as single dim comboWidth, minCombo, maxCombo, availWidth, desiredWidth As Single ' Define the min/max widths of the Selected Object Combo (CBSelectedObject) minCombo = 2200 maxCombo = 3315 ' Set the inside-height of the Form to be just shy of the toolbar height ' (hides border pixel). Height = (Height - ScaleHeight) + toolbar.Height - 30 ' Reposition the Toolbar to cover entire client area. toolbar.Move(-30, -30, ScaleWidth + 30, toolbar.Height) ' Figure out width of "used" portion of Toolbar (i.e. right edge of last gadget) lastGad = EnvelopForm.toolbar.At(EnvelopForm.toolbar.NumItems) minLeft = EnvelopForm.toolbar.Left + (lastGad.Left + lastGad.bitmap.Width) * Screen.TwipsPerPixelX + 150 ' Compute some stuff comboWidth = maxCombo availWidth = ScaleWidth - minLeft desiredWidth = LblEditObj.Width + 75 + comboWidth + 75 If (availWidth < desiredWidth) Then ' Ok, something has to give, reduce the size of the ComboBox as much as possible/needed comboWidth = comboWidth - (desiredWidth - availWidth) If (comboWidth < minCombo) Then comboWidth = minCombo End If CBSelectedObject.Width = comboWidth ' Figure out where CBSelectedObject combo should go. newLeft = ScaleWidth - CBSelectedObject.Width - 75 If (newLeft < minLeft) Then newLeft = minLeft CBSelectedObject.Left = newLeft ' Compute where Label "Selected:" should go, try to place just to the left of the ' ComboBox, but not past the absolute minimum Left position "minLeft" newLeft = CBSelectedObject.Left - LblEditObj.Width - 75 If (newLeft < minLeft) Then newLeft = minLeft End If ' Because the ZOrder of the Label is lower than the SelectedCombo, it will appear under ' the combo, giving priority to the SelectedCombo, if they overlap. LblEditObj.Left = newLeft End Sub Sub RestoreBestLayout() dim layoutName As String dim layout As ScreenLayout ' Using the dimensions reported by the Screen object, figure out which ' pre-recorded layout would best fit the screen resolution. layoutName = "EnvelopForm.ScreenLayout" & Screen.pixelWidth & "x" & Screen.pixelHeight layout = FindObject(layoutName) If layout Then layout.RestoreLayout End Sub Sub SaveAll_Click() ObjectViewer.SaveAll_Click End Sub Function SaveAll_Enable() As Integer SaveAll_Enable = ObjectViewer.SaveAll_Enable End Function Sub SaveModuleAs_Click() ObjectViewer.SaveModuleAs_Click End Sub Function SaveModuleAs_Enable() As Integer SaveModuleAs_Enable = ObjectViewer.SaveModuleAs_Enable End Function Sub SaveModule_Click() ObjectViewer.SaveModule_Click End Sub Function SaveModule_Enable() As Integer Dim om as ObjectModule om = ObjectViewer.SelModule SaveModule_Enable = Not om.ReadOnly && om.IsModified End Function Sub SaveProjectAs_Click ObjectViewer.SaveProjectAs_Click End Sub Function SaveProjectAs_Enable As Integer SaveProjectAs_Enable = ObjectViewer.SaveProjectAs_Enable End Function Sub SaveProject_Click ObjectViewer.SaveProject_Click End Sub Function SaveProject_Enable As Integer Dim enable As Integer enable = ObjectViewer.SaveProject_Enable If enable Then toolbar.SaveProject.HintText = "Save project: " & ProjectManager.CurrentProject Else toolbar.SaveProject.HintText = "Save project" End If SaveProject_Enable = enable End Function Sub SourceBrowser_Click() SourceSearcher.Visible = Not SourceSearcher.Visible End Sub Function SourceBrowser_Enable() As Integer SourceBrowser_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("SourceBrowser", SourceSearcher.Visible) End Function Sub StartupOptions_Click() ProjectStartupOptionsDialog.Execute End Sub Function stripEmbedName(nm As String) As String Dim pos, lastdot As Integer ' Find last "." in name pos = Instr(nm, ".") lastdot = pos While (pos) pos = Instr(pos + 1, nm, ".") If (pos) Then lastdot = pos Wend stripEmbedName = Mid(nm, lastdot + 1) End Function Sub ToggleEdit_Click() FormEditor.Editing = Not FormEditor.Editing toolbar.ToggleEdit.State = IIf(FormEditor.Editing, "Down", "Up") End Sub Function ToggleEdit_Enable() As Integer ToggleEdit_Enable = True toolbar.ToggleEdit.State = IIf(FormEditor.Editing, "Down", "Up") EnvelopMenus.EnvelopOptionsMenu.CheckItem("ToggleEdit", FormEditor.Editing) End Function Sub ToolPalette_Click() ToolPalette.Visible = Not ToolPalette.Visible End Sub Function ToolPalette_Enable() As Integer ToolPalette_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("ToolPalette", ToolPalette.Visible) End Function Sub TrapInterp_Click() If (EnvelopMenus.EnvelopOptionsMenu.ItemIsChecked("TrapInterp")) Then Debugger.TrapInterpretiveExceptions = False Else Debugger.TrapInterpretiveExceptions = True End If EnvelopMenus.EnvelopOptionsMenu.CheckItem("TrapInterp", Debugger.TrapInterpretiveExceptions) End Sub Function TrapInterp_Enable() As Integer TrapInterp_Enable = True EnvelopMenus.EnvelopOptionsMenu.CheckItem("TrapInterp", Debugger.TrapInterpretiveExceptions) TrapInterp_Enable = Debugger.Available End Function Sub TrapSys_Click() If (EnvelopMenus.EnvelopOptionsMenu.ItemIsChecked("TrapSys")) Then Debugger.TrapSystemExceptions = False Else Debugger.TrapSystemExceptions = True End If EnvelopMenus.EnvelopOptionsMenu.CheckItem("TrapSys", Debugger.TrapSystemExceptions) End Sub Function TrapSys_Enable() As Integer EnvelopMenus.EnvelopOptionsMenu.CheckItem("TrapSys", Debugger.TrapSystemExceptions) TrapSys_Enable = Debugger.Available End Function Sub UnloadModule_Click() ObjectViewer.UnloadModule_Click End Sub Function UnloadModule_Enable() As Integer UnloadModule_Enable = ObjectViewer.UnloadModule_Enable End Function Sub WorkSet_Click() WorkSet.Visible = Not WorkSet.Visible End Sub Function WorkSet_Enable() As Integer WorkSet_Enable = True EnvelopMenus.EnvelopToolsMenu.CheckItem("WorkSet", WorkSet.Visible) End Function Sub WriteText_Click() Envelop.SADlg.WriteObjectAsText(ObjectEditorMgr.SelectedObject) End Sub Function WriteText_Enable() As Integer WriteText_Enable = (ObjectEditorMgr.SelectedObject <> Nothing) End Function End Type Type ObjDebug From ObjDebug End Type Type ProjectStartupDialog From Form Dim BTNOpenProject As New Button Type BTNNewProject From Button Dim font1 As New Font End Type Dim BTNNoProject As New Button Dim LblNewProject As New Label Dim LblNoProject As New Label Dim LblOpenProject As New Label Type LblHeader From Label Dim font As New Font End Type Dim font1 As New Font ' METHODS for object: ProjectStartupDialog Sub Activate LblHeader.BackColor = GetSysColor(COLOR_ACTIVECAPTION) LblHeader.ForeColor = GetSysColor(COLOR_CAPTIONTEXT) End Sub Sub BTNNewProject_Click() ModalResult(ProjectStartupOptions.ACTION_NEW_PROJECT) End Sub Sub BTNNoProject_Click() ModalResult(ProjectStartupOptions.ACTION_NO_PROJECT) End Sub Sub BTNOpenProject_Click() ModalResult(ProjectStartupOptions.ACTION_OPEN_PROJECT) End Sub Sub Deactivate LblHeader.BackColor = GetSysColor(COLOR_INACTIVECAPTION) LblHeader.ForeColor = GetSysColor(COLOR_INACTIVECAPTIONTEXT) End Sub Sub Execute If ProjectStartupOptions.AskOnStartup Then Center ProjectStartupOptions.StartupAction = ShowModal End If End Sub End Type Type AboutEnvelopForm From Form Dim bitmap As New Bitmap Dim imgAbout As New Image Type lstDLLs From ListBox ' METHODS for object: AboutEnvelopForm.lstDLLs Sub Reset dim v, s as string dim pos as integer dim done as Boolean Clear v = ObjectModule.Version done = False While Not done pos = Instr(v, ";") If pos > 0 Then s = Left(v, pos - 1) v = Mid(v, pos + 1) Else s = v done = True End If pos = Instr(s, ":") AddItem Left(s, pos - 1) & " " & Mid(s, pos + 1) Wend End Sub End Type Dim MLReadMe As New MarkupLayer Dim MLRelNotes As New MarkupLayer Dim MLLicense As New MarkupLayer Dim MLStory As New MarkupLayer Dim MLOK As New MarkupLayer Dim MLVersion As New MarkupLayer ' METHODS for object: AboutEnvelopForm Sub Execute() LoadForm LayoutControls Center ShowModal End Sub Sub imgAbout_Click() Hide End Sub Sub KeyUp(keyCode As Integer, ByVal shift As Integer) Hide End Sub Sub LayoutControls Dim x, y, w, h, gap As Single ' Size the form so that it just fits the bitmap/image. ' Ensure that the image is not stretched. imgAbout.ResizeMode = "1 - Clip" imgAbout.ScaleX = 1.0 imgAbout.ScaleY = 1.0 imgAbout.ScrollBars = "0 - Never" ' Move image to upper-left and appropriate size for the bitmap ' while my ScaleMode is pixels. ScaleMode = "3 - Pixel" imgAbout.Move(0, 0, bitmap.Width, bitmap.Height) ' Markup layer positions are currently hard-coded in pixels. ' Change the lines below to =1 and uncomment to help lay them out manually. ' MLReadMe.BevelOuter = 0 ' MLRelNotes.BevelOuter = 0 ' MLLicense.BevelOuter = 0 ' MLStory.BevelOuter = 0 ' MLOK.BevelOuter = 0 ' MLVersion.BevelOuter = 0 x = 332 : y = 48 : w = 128 : h = 16 : gap = 5 MLReadMe.Move(x, y, w, h) : y = y + h : MLReadMe.ZOrder = 1 MLRelNotes.Move(x, y, w, h) : y = y + h : MLRelNotes.ZOrder = 2 y = y + gap MLStory.Move(x, y, w, h) : y = y + h : MLStory.ZOrder = 3 MLLicense.Move(x, y, w, h) : y = y + h : MLLicense.ZOrder = 4 y = y + gap MLOK.Move(x, y, w, h) : y = y + h : MLOK.ZOrder = 5 y = y + gap MLVersion.Move(x, y, w, h) : y = y + h : MLVersion.ZOrder = 6 ' Position and hide the list of DLLs in pixel mode. x = 332 : y = 48 : w = 128 : h = 170 lstDLLs.Move(x, y, w, h) lstDLLs.Visible = False ' Go to twips mode to size the form to the image. ScaleMode = "1 - Twip" BorderStyle = "0 - None" Width = imgAbout.Width Height = imgAbout.Height KeyPreview = True ' ensure I get keys to make hiding easy. End Sub Sub lstDLLs_DblClick() lstDLLs.Visible = False End Sub Sub MLLicense_Click() ShowFile("LICENSE.TXT") End Sub Sub MLOK_Click() Hide End Sub Sub MLReadMe_Click() ShowFile("README.TXT") End Sub Sub MLRelNotes_Click() ShowFile("NOTES.TXT") End Sub Sub MLStory_Click() ShowFile("STORY.TXT") End Sub Sub MLVersion_Click() lstDLLs.Visible = True lstDLLs.ZOrder = 1 lstDLLs.Reset End Sub Sub ShowFile(filename As String) Dim simple As New SimpleMultiLineDialog Dim F As New File F.FileName = Envelop.Path & filename simple.Width = Screen.Width * 0.75 If simple.Width < 8000 Then simple.Width = Screen.Width simple.Height = Screen.Height * 0.75 simple.Center simple.ExecuteFile(Envelop.Path & filename, True, True) End Sub End Type Type WorkSet From ObjectEditor Type WorkSetForm From Form Dim List As New ListBox Dim ListMaxItems As Integer Dim IgnoreClick As Integer ' METHODS for object: WorkSet.WorkSetForm Sub CleanList() Dim i as integer i = 0 While i < List.ListCount - 1 If (Not FindObject(List.List(i))) Then List.RemoveItem(i) EnvelopForm.CBSelectedObject.RemoveItem(i) Else i = i + 1 End If Wend End Sub Sub Edit(obj as Object) dim name as String dim grpObj as Object dim idx as Long LoadForm If Not obj Then Exit Sub End If ' Remove item if already in list name = obj idx = FindPosition(name) If (idx <> -1) Then List.RemoveItem(idx) End If ' Shorten list if it is too long. If (ListMaxItems = List.ListCount) Then List.RemoveItem(List.ListCount - 1) End If ' Add item in and suppress click method List.InsertItem(name, 0) If List.ListIndex Then IgnoreClick = True List.ListIndex = 0 End If ' Propagate selection to CBSelectedObject EnvelopForm.CBSelectedObject.Edit obj End Sub Function FindPosition(ObjName as String) As Integer FindPosition = List.ItemIndex(ObjName) End Function Sub List_Click() If IgnoreClick Then IgnoreClick = False Else Dim obj as Object obj = FindObject(List.Text) CleanList If obj Then ' Special case the EnvelopForm to turn Form-Editing off (avoids confusing state) If (obj = EnvelopForm) Then FormEditor.Editing = False ObjectEditorMgr.ResetOthers(WorkSet, obj) ObjectEditorMgr.Selection obj End If End If End Sub Sub List_DblClick() Dim obj as Object obj = FindObject(List.Text) CleanList If obj Then ' Special case the EnvelopForm to turn Form-Editing off (avoids confusing state) If (obj = EnvelopForm) Then FormEditor.Editing = False ObjectEditorMgr.Edit(obj) EnvelopForm.CBSelectedObject.Edit obj End If End Sub Sub List_DragStart(data as XferData, x As Single, y As Single) dim o as Object o = FindObject(List.Text) If o Then data.ObjectRef = o data.Drag(1) End If End Sub Sub List_KeyDown(keyCode As Integer, ByVal shift As Integer) If (keyCode = VK_F1) Then Envelop.Help.ShowTopicHelp("WorkSet") End Sub Sub NextObj() If List.ListIndex = 0 Then List.ListIndex = List.ListCount - 1 Else List.ListIndex = List.ListIndex - 1 End If End Sub Sub PrevObj() If List.ListIndex = List.ListCount - 1 Then List.ListIndex = 0 Else List.ListIndex = List.ListIndex + 1 End If End Sub Sub Resize() List.Move(0, 0, ScaleWidth, ScaleHeight) Height = Height - ScaleHeight + List.Height End Sub End Type Property Visible Get getVisible Set setVisible As Boolean ' METHODS for object: WorkSet Function Active() as Integer Active = WorkSetForm.List.ListCount > 1 End Function Sub BringToTop() WorkSetForm.BringToTop() End Sub Sub CleanList WorkSetForm.CleanList End Sub Sub Edit(obj As Object) WorkSetForm.Edit(obj) End Sub Function getVisible() as Boolean getVisible = WorkSetForm.Visible End Function Sub Hide() WorkSetForm.Hide() End Sub Sub NextObj() WorkSetForm.NextObj() End Sub Sub PrevObj() WorkSetForm.PrevObj() End Sub Sub Selection(obj as Object) ' Propagate selection to CBSelectedObject EnvelopForm.CBSelectedObject.Selection obj End Sub Sub setVisible(vis as Boolean) WorkSetForm.Visible = vis End Sub Sub Show() WorkSetForm.Show() End Sub Function TextUnload(ByVal indent As String, cmds As String) As Integer ' Save Nothing TextUnload = True End Function End Type Type ObjectBoxConfigWizard From WizardMaster.Wizard Type ObjBoxMargin From WizardMaster.FrmStep Dim TBTop As New TextBox Dim TBLeft As New TextBox Dim TBRight As New TextBox Dim TBBottom As New TextBox Dim LBLTop As New Label Dim LBLLeft As New Label Dim LBLRight As New Label Dim LBLBottom As New Label End Type Type ObjBoxLayout From WizardMaster.FrmStep Dim OBToolBar As New OptionButton Dim OBToolBox As New OptionButton ' METHODS for object: ObjectBoxConfigWizard.ObjBoxLayout Sub ObjBoxLayout_ValidateDisplay(ok As Boolean) If TempBox.LayoutStyle = "ToolBox" Then ObjBoxLayout.OBToolBar.Value = False ObjBoxLayout.OBToolBox.Value = True Else ObjBoxLayout.OBToolBox.Value = False ObjBoxLayout.OBToolBar.Value = True End If End Sub End Type Type ObjBoxTileDir From WizardMaster.FrmStep Dim OBHoriz As New OptionButton Dim OBVertical As New OptionButton ' METHODS for object: ObjectBoxConfigWizard.ObjBoxTileDir Sub OBHoriz_Click() wizard.TempBox.TileDirection = "Horizontal" End Sub Sub OBVertical_Click() wizard.TempBox.TileDirection = "Vertical" End Sub End Type Type ObjBoxColumns From WizardMaster.FrmStep Dim SBColumns As New ScrollBar Dim LblColumns As New Label ' METHODS for object: ObjectBoxConfigWizard.ObjBoxColumns Sub SBColumns_Change() LblColumns.Caption = "Columns: " & SBColumns.Value wizard.TempBox.NumColumns = SBColumns.Value End Sub Sub SBColumns_Scroll() LblColumns.Caption = "Columns: " & SBColumns.Value End Sub Sub TBColumns_KeyDown(keyCode As Integer, ByVal shift As Integer) Try If TBColumns.Text > SBColumns.Max Then SBColumns.Max = TBColumns.Text Else SBColumns.Max = 20 End If SBColumns.Value = TBColumns.Text Catch End Try End Sub End Type Dim OriginalBox As ObjectBox Dim TempBox As New ObjectBox ' METHODS for object: ObjectBoxConfigWizard Sub FinishBox OriginalBox.MarginBottom = TempBox.MarginBottom OriginalBox.MarginLeft = TempBox.MarginLeft OriginalBox.MarginRight = TempBox.MarginRight OriginalBox.MarginTop = TempBox.MarginTop OriginalBox.LayoutStyle = TempBox.LayoutStyle OriginalBox.NumColumns = TempBox.NumColumns OriginalBox.TileDirection = TempBox.TileDirection OriginalBox.ForceLayout(True) End Sub Sub ObjBoxColumns_ValidateDisplay(ok As Boolean) ObjBoxColumns.SBColumns.Value = TempBox.NumColumns End Sub Sub ObjBoxColumns_ValidateFinish(ok As Boolean) FinishBox End Sub Sub ObjBoxLayout_ValidateDisplay(ok As Boolean) If TempBox.LayoutStyle = "ToolBox" Then ObjBoxLayout.OBToolBar.Value = False ObjBoxLayout.OBToolBox.Value = True Else ObjBoxLayout.OBToolBox.Value = False ObjBoxLayout.OBToolBar.Value = True End If End Sub Sub ObjBoxLayout_ValidateFinish(ok As Boolean) dim OKToFinish as Boolean ObjBoxLayout_ValidateNext(OKToFinish) If OKToFinish Then FinishBox End Sub Sub ObjBoxLayout_ValidateNext(ok As Boolean) If ObjBoxLayout.OBToolBar.Value Then ObjBoxLayout.NextStep = ObjBoxTileDir TempBox.LayoutStyle = "ToolBar" Else ObjBoxLayout.NextStep = ObjBoxColumns TempBox.LayoutStyle = "ToolBox" End If ok = True End Sub Sub ObjBoxMargin_ValidateDisplay(ok As Boolean) If OriginalBox = Nothing Then MessageBox.Msg("Error in ObjectBoxConfigWizard, OriginalBox not connected") ok = False Else If Not ObjBoxMargin.initialized Then TempBox.MarginBottom = OriginalBox.MarginBottom TempBox.MarginLeft = OriginalBox.MarginLeft TempBox.MarginRight = OriginalBox.MarginRight TempBox.MarginTop = OriginalBox.MarginTop TempBox.LayoutStyle = OriginalBox.LayoutStyle TempBox.NumColumns = OriginalBox.NumColumns TempBox.TileDirection = OriginalBox.TileDirection ObjBoxMargin.initialized = True End If ObjBoxMargin.TBLeft.Text = TempBox.MarginLeft ObjBoxMargin.TBTop.Text = TempBox.MarginTop ObjBoxMargin.TBRight.Text = TempBox.MarginRight ObjBoxMargin.TBBottom.Text = TempBox.MarginBottom End If End Sub Sub ObjBoxMargin_ValidateFinish(ok As Boolean) dim OKToFinish as boolean ObjBoxMargin_ValidateNext(OKToFinish) If OKToFinish Then FinishBox End Sub Sub ObjBoxMargin_ValidateNext(ok As Boolean) Try TempBox.MarginLeft = ObjBoxMargin.TBLeft.Text TempBox.MarginTop = ObjBoxMargin.TBTop.Text TempBox.MarginRight = ObjBoxMargin.TBRight.Text TempBox.MarginBottom = ObjBoxMargin.TBBottom.Text ok = True Catch ConvertFailed MessageBox.Msg("Margins must be of type integer, please remove any non-numeric chars.") ok = False Catch MessageBox.Msg("Unexpected Behavior") ok = False End Try End Sub Sub ObjBoxTileDir_ValidateDisplay(ok As Boolean) If TempBox.TileDirection = "Horizontal" Then ObjBoxTileDir.OBVertical.Value = False ObjBoxTileDir.OBHoriz.Value = True Else ObjBoxTileDir.OBHoriz.Value = False ObjBoxTileDir.OBVertical.Value = True End If End Sub Sub ObjBoxTileDir_ValidateFinish(ok As Boolean) FinishBox End Sub Function TextUnload(ByVal indent As String, cmds As String) As Integer ' Write our parent's properties, but none of ours. TextUnload = False End Function End Type Type SampleMasterFormMenuBar From MenuBar End Type Type SampleMasterForm From Form Dim SampleDir As String Dim helpfile As New HelpFile Dim SampleName As String ' METHODS for object: SampleMasterForm Sub Destruct() helpfile.Quit End Sub Sub ExitApplication_Click() helpfile.Quit Hide End Sub Sub HelpContents_Click() helpfile.Contents End Sub Function HelpContents_Enable() As Integer HelpContents_Enable = helpfile.Exists End Function Sub InitHelpFile helpfile.FileName = SampleDir & SampleName & ".hlp" End Sub Sub Preload SetSampleDir InitHelpFile If Me <> SampleMasterForm Then LoadForm ResetApplication_Click If Me <> SampleMasterForm Then Show End Sub Sub ResetApplication_Click() End Sub Sub SaveAsBinary ModuleManager.ModuleContaining(Me).SaveAs(SampleDir & SampleName & ".ebo", False) End Sub Sub SaveAsText ModuleManager.ModuleContaining(Me).SaveAs(SampleDir & SampleName & ".eto", True) End Sub Sub SetSampleDir() ' The purpose of this routine is to set "SampleDir", a string containing ' the directory from which the application was loaded. This may be useful ' in the event any data must be saved from the application and File objects ' were used and possibly changed our current directory. Dim m As ObjectModule Dim f As New File m = ModuleManager.ModuleContaining(Me) f.FileName = m.FileName SampleDir = f.Path SampleName = f.Name End Sub End Type Type FormEditor From FormEditor ' METHODS for object: FormEditor Function DblClick(item As Object, shift As Integer, x As Single, y As Single) As Integer ' If its a form, and SHIFT or CTRL is pressed ... If item && TypeOf item Is Form && shift Then ' If we are already editing the double-clicked form, edit parent, if it ' is not the EnvelopForm. Otherwise, call det If (CurForm = item) Then If item.Parent && (item.Parent <> EnvelopForm) Then CurForm = item.Parent Else CurForm = item End If Else ' Detailed edit for non forms... If ObjectEditorMgr.DetailedEdit(item) Then ' A specialized ObjectEditor handled the event. PropertyEditor.Refresh("ChangedProperty") Else ' DblClick on an object with no special DetailedEdit, gets a free trip ' to the MethodEditor MethodEditor.BringToTop End If End If End Function Sub KeyUp(keyCode As Integer, ByVal shift As Integer) If (keyCode = VK_F1) Then If NumSelected Then Envelop.Help.ShowObjectHelp(GetSelected(0)) Else Envelop.Help.ShowTopicHelp("Form_environment") End If ElseIf (keyCode = VK_DELETE) Then EnvelopForm.DeleteObject_Click() End If End Sub End Type Type SampleMasterFormFileMenu From PopupMenu End Type Type Debugger From Debugger End Type Type MenuEdit From Form Type menuList From IndentedList Dim bitmaps As New Bitmap End Type Dim ICN_CLOSEDFOLDER As Integer Dim ICN_OPENFOLDER As Integer Dim ICN_MENUITEM As Integer Dim ICN_SEPARATOR As Integer Dim DraggingIndex As Long Dim InputMenu As Menu Dim WorkingMenu As Menu Type menutools From ObjectBox Dim openmenu As New ToolGadget Dim testdrive As New ToolGadget Dim apply As New ToolGadget Dim insertitem As New ToolGadget Dim insertsubmenu As New ToolGadget Dim insertsep As New ToolGadget Dim delitem As New ToolGadget Dim moveup As New ToolGadget Dim movedown As New ToolGadget Dim properties As New ToolGadget End Type Dim Label1 As New Label Dim Label2 As New Label Dim txtCaption As New TextBox Dim txtName As New TextBox Dim Label3 As New Label Dim chkChecked As New CheckBox Dim cbAccel As New ComboBox Dim UpdatingProperties As Integer Dim SuppressUpdatingProperties As Integer Dim changed As Boolean ' METHODS for object: MenuEdit Function AllowSepAtIndex(ByVal index As Integer) As Integer Dim theMenu As Object Dim level As Integer Dim position As Integer If index = -1 Then AllowSepAtIndex = False ElseIf MenuEdit.menuList.ItemLevel(index) > 1 Then AllowSepAtIndex = True Else ' see if we are directly beneath a menu bar ' Only bother checking further if the top guy is a menubar theMenu = MenuEdit.menuList.ItemObject(0) If TypeOf theMenu Is FindObject("MenuBar") Then If index = 0 Then AllowSepAtIndex = False Else theMenu = MenuEdit.menuList.ItemObject(index) ' Submenu ---check to see if folder is open or closed If theMenu Then If MenuEdit.menuList.ItemIsExpanded(index) Then ' If folder is open, we'll allow inserting seps AllowSepAtIndex = True Else ' special check in case ' we have an empty folder....alway insertion If theMenu.ItemCount = 0 Then AllowSepAtIndex = True Else AllowSepAtIndex = False End If End If Else ' Must be command item, disallow sep insertion AllowSepAtIndex = False End If End If Else ' not beneath menubar AllowSepAtIndex = True End If End If End Function Sub apply_Click CloneMenuRecursively(InputMenu, WorkingMenu) changed = False End Sub Function apply_Enable As Integer apply_Enable = IIf(changed && MenuEdit.menuList.ListCount > 0, True, False) End Function Sub cbAccel_Click() Dim index As Integer Dim position As Integer Dim accelKey As Long Dim theMenu As Object Dim name As String If UpdatingProperties Then Exit Sub index = MenuEdit.menuList.ListIndex ' Get out if nothing is selected or it at the anchor If index <= 0 Then Exit Sub ' get the containing menu for the item at index where we st ' the item's relative position within that containing menu theMenu = GetPositionInfo(index, position) name = theMenu.ItemNameAt(position) accelKey = cbAccel.ListIndex If accelKey <> -1 Then theMenu.AccelKey = accelKey theMenu.SetAccelerator(name, accelKey) changed = True End If End Sub Sub chkChecked_Click() Dim index As Integer Dim position As Integer Dim theMenu As Object Dim name As String If UpdatingProperties Then Exit Sub index = MenuEdit.menuList.ListIndex ' Get out if nothing is selected or it at the anchor If index <= 0 Then Exit Sub ' get the containing menu for the item at index where we st ' the item's relative position within that containing menu theMenu = GetPositionInfo(index, position) name = theMenu.ItemNameAt(position) theMenu.CheckItem(name, chkChecked.Value) changed = True End Sub Sub CleanUp DestroyObject(MenuTester.MenuBar) MenuEdit.menuList.Clear End Sub Sub CloneMenuRecursively(destMenu As Object, sourceMenu As Object) Dim i As Integer Dim itemId As Long Dim subMenu As Object Dim newMenu As Object Dim name As String Dim pos As Integer Dim checked As Integer Dim accelKey As Long ' Gut the destination menu. Peel 'em off from the tail on up For i = destMenu.ItemCount - 1 To 0 Step -1 destMenu.RemoveItem(i) Next i ' go through the source menu and rebuild the dest menu ' from it For i = 0 To sourceMenu.ItemCount - 1 itemId = sourceMenu.ItemIdAt(i) name = sourceMenu.ItemNameAt(i) ' If the item is a submenu (id == -1), process it as well If (itemId = -1) Then subMenu = FindObject(name) If Not HostObject(subMenu) Then ' for submenus that are coming from top level popups (re-usable menus) ' prefix their names with 'REFD' name = "REFD" & name Else ' Get at the 'local' name pos = Instr(2, name, ".") While pos name = Right$(name, Len(name) - pos) pos = Instr(2, name, ".") Wend End If ' When doing the cloning that is applying changes to our input menu, and ' we have a submenu prefaced with REFD (indicating a top level reusable ' popup) we want to apply the changes to that popup at the top level ' and not embed the menu. If Left$(name, 4) = "REFD" Then newMenu = FindObject(Right$(name, Len(name) - 4)) If Not HostObject(newMenu) Then ' insert that popup into the dest menu destMenu.InsertPopup(newMenu, sourceMenu.ItemCaptionAt(i), i) CloneMenuRecursively(newMenu, subMenu) End If Else ' See if there is already a menu there with the same name newMenu = FindEmbed(destMenu, name) ' if not, embed a fresh one If Not newMenu Then newMenu = EmbedObject(destMenu, FindObject("PopupMenu"), name) End If ' insert that popup into the dest menu destMenu.InsertPopup(newMenu, sourceMenu.ItemCaptionAt(i), i) ' and recursively clone the submenu into the new embed CloneMenuRecursively(newMenu, subMenu) End If Else ' Looks like we'll have to use GetMenuState to determine if ' we have a separator...for now, just see if the name ' is blank If (name = "") Then destMenu.InsertSeparator(i) Else destMenu.InsertItem(name, sourceMenu.ItemCaptionAt(i), i) checked = IIf(sourceMenu.ItemIsChecked(name), 1, 0) destMenu.CheckItem(name, checked) accelKey = sourceMenu.GetAccelerator(name) If accelKey <> -1 Then destMenu.AccelKey = accelKey destMenu.SetAccelerator(name, accelKey) End If End If End If Next i End Sub Sub close_Click CleanUp MenuEdit.Hide MenuTester.Hide End Sub Sub DeleteListEntries(ByVal index As Integer, ByVal level As Integer) Dim l As Integer MenuEdit.menuList.RemoveItem(index) ' Note that after we removed the item, the next item in the list ' is now at position 'index', so we do not need to increment ' index l = MenuEdit.menuList.ItemLevel(index) While index < MenuEdit.menuList.ListCount && l > level MenuEdit.menuList.RemoveItem(index) l = MenuEdit.menuList.ItemLevel(index) Wend End Sub Sub delitem_Click RemoveCurrentItem changed = True End Sub Function delitem_Enable As Integer delitem_Enable = IIf(MenuEdit.menuList.ListIndex > 0, True, False) End Function Function FindNextSameLevelIndex(ByVal index As Integer) As Integer ' get the index for the first item after to us that has the same level as ours Dim l, level As Integer Dim count As Integer Dim returnIndex As Integer level = MenuEdit.menuList.ItemLevel(index) count = MenuEdit.menuList.ListCount returnIndex = index + 1 l = MenuEdit.menuList.ItemLevel(returnIndex) ' go forward in the list until we hit a guy with a ' level the same as ours While l <> level && returnIndex < count returnIndex = returnIndex + 1 l = MenuEdit.menuList.ItemLevel(returnIndex) Wend FindNextSameLevelIndex = returnIndex End Function Function FindPrevLevelIndex(ByVal index As Integer) As Integer ' get the index for the first item prior to us that has a level less than ours Dim l, level As Integer Dim returnIndex As Integer level = MenuEdit.menuList.ItemLevel(index) returnIndex = index - 1 l = MenuEdit.menuList.ItemLevel(returnIndex) ' go backward in the list until we hit a guy with a ' level less than our own While l >= level && returnIndex >= 0 returnIndex = returnIndex - 1 l = MenuEdit.menuList.ItemLevel(returnIndex) Wend FindPrevLevelIndex = returnIndex End Function Function FindPrevSameLevelIndex(ByVal index As Integer) As Integer ' get the index for the first item prior to us that has the same level as ours Dim l, level As Integer Dim returnIndex As Integer level = MenuEdit.menuList.ItemLevel(index) returnIndex = index - 1 l = MenuEdit.menuList.ItemLevel(returnIndex) ' go backward in the list until we hit a guy with a ' level the same as ours While l <> level && returnIndex > 0 returnIndex = returnIndex - 1 l = MenuEdit.menuList.ItemLevel(returnIndex) Wend FindPrevSameLevelIndex = returnIndex End Function Function GetPositionInfo(ByVal index As Integer, relativePosition As Integer) As Object Dim l, level As Integer ' get the containing menu for the item at the current index and ' the item's relative position within that containing menu relativePosition = 0 level = MenuEdit.menuList.ItemLevel(index) index = index - 1 l = MenuEdit.menuList.ItemLevel(index) ' go backward in the list until we hit a guy with a ' level less than our own While l >= level && index >= 0 ' only increment the relativePosition counter when we ' have encountered an entry at the same level If l = level Then relativePosition = relativePosition + 1 index = index - 1 l = MenuEdit.menuList.ItemLevel(index) Wend GetPositionInfo = MenuEdit.menuList.ItemObject(index) End Function Sub InsertItem(label As String, name As String, checked As Integer, accelKey As Long) Dim index As Integer Dim level As Integer Dim position As Integer Dim intoSubMenu As Boolean Dim theMenu As Object theMenu = PrepForInsertion(index, level, position) If index = -1 Then Exit Sub If theMenu Then ' add it to the menu theMenu.InsertItem(name, label, position) ' only do check & accels if we are within a popup If TypeOf theMenu Is FindObject("PopupMenu") Then ' check it if need be If checked Then theMenu.CheckItem(name, 1) ' deal with any acclerator key If accelKey <> -1 Then theMenu.AccelKey = accelKey theMenu.SetAccelerator(name, accelKey) End If End If ' add it to our list MenuEdit.menuList.InsertItem(label, ICN_MENUITEM, level, index + 1) MenuEdit.menuList.SetSelected(index + 1, True) UpdateProperties End If End Sub Sub insertitem_Click InsertItem("Item", "Item", 0, 0) changed = True End Sub Function insertitem_Enable As Integer insertitem_Enable = IIf(MenuEdit.menuList.ListIndex <> -1, True, False) End Function Sub InsertSeparator Dim index As Integer Dim level As Integer Dim position As Integer Dim intoSubMenu As Boolean Dim theMenu As Object theMenu = PrepForInsertion(index, level, position) If index = -1 Then Exit Sub If theMenu && TypeOf theMenu Is FindObject("PopupMenu") Then ' add it to the menu theMenu.InsertSeparator(position) ' add it to our list MenuEdit.menuList.InsertItem("<separator>", ICN_SEPARATOR, level, index + 1) MenuEdit.menuList.SetSelected(index + 1, True) UpdateProperties End If End Sub Sub insertsep_Click InsertSeparator changed = True End Sub Function insertsep_Enable As Integer insertsep_Enable = AllowSepAtIndex(MenuEdit.menuList.ListIndex) End Function Sub InsertSubMenu(label As String, name As String) Dim index As Integer Dim level As Integer Dim position As Integer Dim theMenu As Object Dim newMenu As PopupMenu theMenu = PrepForInsertion(index, level, position) If index = -1 Then Exit Sub If theMenu Then ' create a new popup and add it to the menu newMenu = EmbedObject(theMenu, FindObject("PopupMenu"), name) theMenu.InsertPopup(newMenu, label, position) index = index + 1 ' add it to our list MenuEdit.menuList.InsertItem(label, ICN_CLOSEDFOLDER, level, index) ' Indicate that this guy can expand & close MenuEdit.menuList.SetItemCanExpand(index, True) MenuEdit.menuList.SetItemObject(index, newMenu) MenuEdit.menuList.SetSelected(index, True) UpdateProperties End If End Sub Sub insertsubmenu_Click Dim retVal As Long Dim index As Integer Dim level As Integer Dim position As Integer Dim theMenu As Object theMenu = PrepForInsertion(index, level, position) ' Get a name for the Submenu retVal = InputDialog.Execute("Insert Submenu", "Enter a name for the submenu", UniqueEmbedName(theMenu, "Submenu")) If retVal = IDOK Then InsertSubMenu("Submenu", InputDialog.Text) changed = True End If End Sub Function insertsubmenu_Enable As Integer insertsubmenu_Enable = IIf(MenuEdit.menuList.ListIndex <> -1, True, False) End Function Sub menuList_Click() UpdateProperties End Sub Sub menuList_Collapsed(ByVal itemIndex as Integer, ByVal itemData as Long, itemObj as Object) MenuEdit.menuList.SetItemIcon(itemIndex, ICN_CLOSEDFOLDER) UpdateProperties End Sub Sub menuList_DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect) Dim targetIndex As Integer Dim dragLevel As Integer Dim position As Integer Dim i As Integer Dim ok As Boolean Dim dragIsFolder As Boolean Dim theMenu as Object Dim dragMenu As Object ' get the index of the list item under the cursor targetIndex = menuList.FindIndexUnderPoint(x, y) ' get out if we have an invalid target index or ' we're dropping a guy onto himself or trying to drag the 'anchor' If targetIndex = -1 || targetIndex = DraggingIndex || DraggingIndex = 0 Then ' show the No Drop cursor If state = 2 Then effect = 0 Exit Sub End If ' see if we are dragging a folder dragMenu = MenuEdit.menuList.ItemObject(DraggingIndex) If dragMenu Then dragIsFolder = True Else ' See if we are dragging a separator and if the target index should ' allow a drop (to prevent seps under menubars) ' Only need to bother if target index is <=1 ...minor optimization If MenuEdit.menuList.ItemLevel(targetIndex) <= 1 Then theMenu = GetPositionInfo(DraggingIndex, position) If theMenu.ItemNameAt(position) = "" && Not AllowSepAtIndex(targetIndex) Then ' show the No Drop cursor If state = 2 Then effect = 0 Exit Sub End If End If End If dragLevel = MenuEdit.menuList.ItemLevel(DraggingIndex) If dragIsFolder Then ' Must make sure we are not dragging a menu into one of its own descendants If targetIndex > DraggingIndex Then If MenuEdit.menuList.ItemLevel(DraggingIndex + 1) > dragLevel Then ok = False For i = DraggingIndex + 1 To targetIndex If MenuEdit.menuList.ItemLevel(i) <= dragLevel Then ok = True Exit For End If Next i If Not ok Then ' show the No Drop cursor If state = 2 Then effect = 0 Exit Sub End If End If End If End If ' beyond this point, we're not currently interested unless we are dropping If state = 3 Then RelocateItem(DraggingIndex, targetIndex, False) changed = True End If End Sub Sub menuList_DragStart(xfd As XferData, x As Single, y As Single) DraggingIndex = menuList.FindIndexUnderPoint(x, y) MenuEdit.menuList.SetSelected(DraggingIndex, True) UpdateProperties xfd.Drag(2) ' Drag and drop ends up eating the mouse up event. Since we ' are doing left mouse dnd, this leaves the list in a state where it ' is expecting a mouse up. The side effect is that the list tracks ' the cursor to highlight the selection (while the mouse is up). ' We will explicitly send a lbutton up message to the list's hwnd ' to fix the problem. SendMessage(menuList.hWnd, User32.WM_LBUTTONUP, 0, 0) End Sub Sub menuList_Expand(ByVal itemIndex as Integer, ByVal itemData as Long, itemObj as Object) Dim index As Integer Dim level As Integer Dim theMenu As Object ' display the 'expanded' icon MenuEdit.menuList.SetItemIcon(itemIndex, ICN_OPENFOLDER) ' Try to find the menu we want in the ' ItemObject of the list entry theMenu = MenuEdit.menuList.ItemObject(itemIndex) If Not theMenu Then Exit Sub level = MenuEdit.menuList.ItemLevel(itemIndex) index = itemIndex + 1 level = level + 1 ProcessMenusRecursively(theMenu, False, level, index) UpdateProperties End Sub Sub menuList_KeyDown(keyCode As Integer, ByVal shift As Integer) If (keyCode = VK_DELETE) Then RemoveCurrentItem changed = True End If End Sub Sub movedown_Click Dim index As Integer Dim level As Integer Dim level2 As Integer Dim pos As Integer index = MenuEdit.menuList.ListIndex ' Get out if nothing is selected or if dealing with the Anchor If index <= 0 Then Exit Sub If index + 1 >= MenuEdit.menuList.ListCount Then Exit Sub level = MenuEdit.menuList.ItemLevel(index) level2 = MenuEdit.menuList.ItemLevel(index + 1) If level2 < level Then Exit Sub If level2 <> level Then pos = FindNextSameLevelIndex(index) If MenuEdit.menuList.ItemIsExpanded(pos) Then pos = FindNextSameLevelIndex(pos) - 1 RelocateItem(index, pos, True) ElseIf MenuEdit.menuList.ItemIsExpanded(index + 1) Then pos = FindNextSameLevelIndex(index + 1) - 1 RelocateItem(index, pos, True) Else RelocateItem(index, index + 1, True) End If changed = True End Sub Function movedown_Enable As Integer Dim retVal As Integer Dim index As Integer Dim level As Integer Dim level2 As Integer retVal = False index = MenuEdit.menuList.ListIndex If index > 0 && index + 1 < MenuEdit.menuList.ListCount Then level = MenuEdit.menuList.ItemLevel(index) level2 = MenuEdit.menuList.ItemLevel(index + 1) If level2 >= level Then retVal = True End If movedown_Enable = retVal End Function Sub moveup_Click Dim index As Integer Dim level As Integer Dim level2 As Integer index = MenuEdit.menuList.ListIndex ' Get out if nothing is selected or if dealing with the Anchor If index <= 0 Then Exit Sub level = MenuEdit.menuList.ItemLevel(index) level2 = MenuEdit.menuList.ItemLevel(index - 1) If level - 1 = level2 Then Exit Sub If level2 <> level Then RelocateItem(index, FindPrevSameLevelIndex(index) - 1, True) Else ' use index -2 because it represent the spot after which ' the moved item is placed RelocateItem(index, index - 2, True) End If changed = True End Sub Function moveup_Enable As Integer Dim retVal As Integer Dim index As Integer Dim level As Integer Dim level2 As Integer retVal = False index = MenuEdit.menuList.ListIndex If index > 0 Then level = MenuEdit.menuList.ItemLevel(index) level2 = MenuEdit.menuList.ItemLevel(index - 1) If level - 1 <> level2 Then retVal = True End If moveup_Enable = retVal End Function Sub openmenu_Click Dim retVal As Long MenuSelector.optMbar.Value = True MenuSelector.Populate retVal = MenuSelector.ShowModal If retVal = IDOK Then ProcessMenu(FindObject(MenuSelector.cboMenus.Text)) End If End Sub Sub Preload() Dim enums As String dim curpos as Integer LoadForm ' build up the contents of the accelerator key combo box enums = GetEnumStrings("AcceleratorKey") cbAccel.Clear curpos = 1 While (curpos < Len(enums)) Dim eol as Integer eol = Instr(curpos, enums, Chr(13)) If eol = 0 Then Exit Do cbAccel.AddItem(Mid(enums, curpos, (eol - curpos))) curpos = eol + 2 Wend ' disable the property guys initially txtCaption.Enabled = False txtName.Enabled = False chkChecked.Enabled = False cbAccel.Enabled = False changed = False End Sub Function PrepForInsertion(index As Integer, level As Integer, position As Integer) As Object Dim index As Integer Dim level As Integer Dim intoSubMenu As Boolean Dim theMenu As Object ' This will retrieve the index, level, position, and containing menu in ' preparation for a menu insertion index = MenuEdit.menuList.ListIndex If index = -1 Then Exit Function ' deal with case for root object...always expand If index = 0 Then theMenu = MenuEdit.menuList.ItemObject(index) MenuEdit.menuList.ExpandItem(0) position = 0 level = 1 PrepForInsertion = theMenu Exit Function End If theMenu = MenuEdit.menuList.ItemObject(index) level = MenuEdit.menuList.ItemLevel(index) intoSubMenu = False ' Submenu ---check to see if folder is open or closed If theMenu Then If MenuEdit.menuList.ItemIsExpanded(index) Then ' If folder is open, we'll insert at the top of the menu level = level + 1 intoSubMenu = True Else ' special check in case ' we have an empty folder....alway add the ' new node to the empty folder (because empty folders will never ' let ItemIsExpanded return True If theMenu.ItemCount = 0 Then level = level + 1 intoSubMenu = True MenuEdit.menuList.SetItemIcon(index, ICN_OPENFOLDER) End If End If End If If intoSubMenu Then position = 0 Else ' get the containing menu for the item at the current index and ' the item's relative position within that containing menu theMenu = GetPositionInfo(index, position) position = position + 1 End If PrepForInsertion = theMenu End Function Sub ProcessMenu(theMenu As Object) Dim m As Object Dim stdMbar As MenuBar Dim index As Integer Dim name As String CleanUp If Not theMenu Then Exit Sub ' the reset is to get the icons drawn cuz ' when we are using an eto file, they don't show up MenuEdit.menuList.Reset name = theMenu ' get the menubar proto stdMbar = FindObject("MenuBar") If TypeOf theMenu Is stdMbar Then ' if we're dealing with a menubar, embed the menubar proto onto ' the testing form and then clone the input meubar into it ' EmbedObject(MenuTester, stdMbar, "TestingMenuBar") ' CloneMenu(MenuTester.TestingMenuBar, theMenu, False) EmbedObject(MenuTester, theMenu, "TestingMenuBar") SubsumeRecursively(MenuTester.TestingMenuBar) MenuTester.MenuBar = MenuTester.TestingMenuBar WorkingMenu = MenuTester.TestingMenuBar ElseIf TypeOf theMenu Is FindObject("PopupMenu") Then ' if we we're dealing with a pop-up, first embed the ' standard menubar into our test form EmbedObject(MenuTester, stdMbar, "TestingMenuBar") MenuTester.MenuBar = MenuTester.TestingMenuBar ' then embed a standard popupmenu into the menubar and ' clone the input menu into it ' EmbedObject(MenuTester.TestingMenuBar, FindObject("PopupMenu"), "TestingMenu") ' CloneMenu(MenuTester.TestingMenuBar.TestingMenu, theMenu, False) EmbedObject(MenuTester.TestingMenuBar, theMenu, "TestingMenu") SubsumeRecursively(MenuTester.TestingMenuBar.TestingMenu) WorkingMenu = MenuTester.TestingMenuBar.TestingMenu MenuTester.MenuBar.InsertPopup(WorkingMenu, name, 0) Else Exit Sub End If InputMenu = theMenu ' construct the list based upon info in the test menubar index = 0 ' Set the title bar of the menu editor MenuEdit.Caption = "Editing: " & name ' add the 'anchor' for our list MenuEdit.menuList.InsertItem(name, ICN_OPENFOLDER, 0, index) ' Set the list item's object to be the test menu MenuEdit.menuList.SetItemObject(index, WorkingMenu) ' Indicate that this guy can expand & close MenuEdit.menuList.SetItemCanExpand(index, True) ' Select the first item in the list MenuEdit.menuList.ListIndex = 0 index = index + 1 ProcessMenusRecursively(WorkingMenu, False, 1, index) End Sub Sub ProcessMenusRecursively(theMenu As Object, ByVal expandSubMenus As Boolean, ByVal level As Integer, index As Integer) Dim i As Integer Dim iconVal As Integer Dim itemId As Long Dim subMenu As Object Dim newMenu As Object Dim name As String Dim caption As String ' TODO Make sure theMenu is MenuBar or PopupMenu If theMenu Then For i = 0 To theMenu.ItemCount - 1 itemId = theMenu.ItemIdAt(i) name = theMenu.ItemNameAt(i) caption = theMenu.ItemCaptionAt(i) ' If the item is a submenu (id == -1), process it as well If (itemId = -1) Then subMenu = FindObject(name) If Not HostObject(subMenu) Then ' for submenus that are coming from top level popups (re-usable menus) ' prefix their names with 'REFD' name = "REFD" & name ' remove the menu item that referred to the reusable menu theMenu.RemoveItem(i) ' get a fresh embed to represent the ref'd menu newMenu = EmbedObject(theMenu, FindObject("PopupMenu"), name) ' clone the original ref'd submenu into our new embed CloneMenuRecursively(newMenu, subMenu) ' insert into the same spot theMenu.InsertPopup(newMenu, caption, i) subMenu = newMenu End If If expandSubMenus Then iconVal = ICN_OPENFOLDER Else iconVal = ICN_CLOSEDFOLDER End If MenuEdit.menuList.InsertItem(caption, iconVal, level, index) ' Set the list item's object to be the submenu MenuEdit.menuList.SetItemObject(index, subMenu) ' Indicate that this guy can expand & close MenuEdit.menuList.SetItemCanExpand(index, True) index = index + 1 ' Process the submenu If expandSubMenus Then ProcessMenusRecursively(subMenu, expandSubMenus, level + 1, index) Else ' Looks like we'll have to use GetMenuState to determine if ' we have a separator...for now, just see if the name ' is blank If (name = "") Then MenuEdit.menuList.InsertItem("<separator>", ICN_SEPARATOR, level, index) index = index + 1 Else MenuEdit.menuList.InsertItem(caption, ICN_MENUITEM, level, index) index = index + 1 End If End If Next i End If End Sub Sub properties_Click Dim vis As Boolean If menutools.properties.State = 1 Then menutools.properties.State = 0 ' Turn off all the property stuff vis = False Else menutools.properties.State = 1 vis = True End If ' Turn all the property stuff on or off Label1.Visible = vis Label2.Visible = vis Label3.Visible = vis txtCaption.Visible = vis txtName.Visible = vis chkChecked.Visible = vis cbAccel.Visible = vis ' resize the menuList Resize End Sub Sub RelocateItem(ByVal originalIndex As Integer, ByVal targetIndex As Integer, ByVal preserveLevel As Boolean) Dim originalLevel As Integer Dim targetLevel As Integer Dim originalContainer As Object Dim targetContainer As Object Dim originalPosition As Integer Dim targetPosition As Integer Dim i As Integer Dim ok As Boolean Dim iconVal As Integer Dim targetIsFolder As Boolean Dim originalIsFolder As Boolean Dim targetIsOpen As Boolean Dim targetMenu as Object Dim originalMenu As Object Dim copiedMenu As Object Dim newName As String Dim newCaption As String Dim checked As Boolean Dim accelKey As Long originalMenu = MenuEdit.menuList.ItemObject(originalIndex) If originalMenu Then originalIsFolder = True originalLevel = MenuEdit.menuList.ItemLevel(originalIndex) If originalIsFolder Then ' Must make sure we are not relocating a menu into one of its own descendants If targetIndex > originalIndex Then If MenuEdit.menuList.ItemLevel(originalIndex + 1) > originalLevel Then ok = False For i = originalIndex + 1 To targetIndex If MenuEdit.menuList.ItemLevel(i) <= originalLevel Then ok = True Exit For End If Next i If Not ok Then Exit Sub End If End If End If End If If Not preserveLevel Then targetMenu = MenuEdit.menuList.ItemObject(targetIndex) If targetMenu Then targetIsFolder = True ' see if the folder is open...Note that if the folder is empty, we ' will say that it is open, since dropping on a closed folder ' that is empty will result in dropping INTO the folder If MenuEdit.menuList.ItemIsExpanded(targetIndex) Then targetIsOpen = True ElseIf targetMenu.ItemCount = 0 Then targetIsOpen = True MenuEdit.menuList.SetItemIcon(targetIndex, ICN_OPENFOLDER) End If End If End If ' get the containing menu for the item at the original index and ' the item's relative position within that containing menu originalContainer = GetPositionInfo(originalIndex, originalPosition) If Not preserveLevel Then ' get the containing menu for the item at index where we are dropping and ' the item's relative position within that containing menu targetContainer = GetPositionInfo(targetIndex, targetPosition) targetLevel = MenuEdit.menuList.ItemLevel(targetIndex) targetIndex = targetIndex + 1 If targetIsFolder && targetIsOpen Then ' TARGET FOLDER IS OPEN --- ADD INTO IT targetContainer = targetMenu targetPosition = 0 targetLevel = targetLevel + 1 Else targetPosition = targetPosition + 1 End If Else targetContainer = originalContainer targetLevel = originalLevel targetIndex = targetIndex + 1 If targetIndex < originalIndex Then targetPosition = originalPosition - 1 Else targetPosition = originalPosition + 2 End If End If If originalIsFolder Then Dim pos As Integer ' Extract info for the original guy newName = originalContainer.ItemNameAt(originalPosition) ' Get at the 'local' name pos = Instr(2, newName, ".") While pos newName = Right$(newName, Len(newName) - pos) pos = Instr(2, newName, ".") Wend newCaption = originalContainer.ItemCaptionAt(originalPosition) iconVal = ICN_CLOSEDFOLDER ' copiedMenu = EmbedObject(targetContainer, FindObject("PopupMenu"), "bldrTmp") ' CloneMenu(copiedMenu, originalMenu, False) copiedMenu = EmbedObject(targetContainer, originalMenu, "bldrTmp") SubsumeRecursively(copiedMenu) originalContainer.RemoveItem(originalPosition) ' If within the same container, compensate for the guy we deleted if it was ' above the target position If originalContainer = targetContainer Then If originalPosition < targetPosition Then targetPosition = targetPosition - 1 End If targetContainer.InsertPopup(copiedMenu, newCaption, targetPosition) DestroyObject(originalMenu) RenameObject(copiedMenu, newName) ' Get the list up to date. Deal with lowest in the list first SuppressUpdatingProperties = 1 If originalIndex >= targetIndex Then MenuEdit.menuList.CollapseItem(originalIndex) MenuEdit.menuList.RemoveItem(originalIndex) MenuEdit.menuList.InsertItem(newCaption, iconVal, targetLevel, targetIndex) MenuEdit.menuList.SetItemCanExpand(targetIndex, True) MenuEdit.menuList.SetItemObject(targetIndex, copiedMenu) MenuEdit.menuList.SetSelected(targetIndex, True) Else MenuEdit.menuList.InsertItem(newCaption, iconVal, targetLevel, targetIndex) MenuEdit.menuList.SetItemCanExpand(targetIndex, True) MenuEdit.menuList.SetItemObject(targetIndex, copiedMenu) If MenuEdit.menuList.ItemIsExpanded(originalIndex) Then MenuEdit.menuList.CollapseItem(originalIndex) Else MenuEdit.menuList.SetSelected(targetIndex - 1, True) End If MenuEdit.menuList.RemoveItem(originalIndex) End If SuppressUpdatingProperties = 0 Else ' DRAG IS COMMAND ITEM OR SEPARATOR ' extract info from the original guy newName = originalContainer.ItemNameAt(originalPosition) If newName <> "" Then newCaption = originalContainer.ItemCaptionAt(originalPosition) If Not TypeOf originalContainer Is FindObject("MenuBar") Then checked = originalContainer.ItemIsChecked(newName) accelKey = originalContainer.GetAccelerator(newName) End If iconVal = ICN_MENUITEM Else newCaption = "<separator>" iconVal = ICN_SEPARATOR End If ' remove the original guy originalContainer.RemoveItem(originalPosition) ' If within the same container, compensate for the guy we deleted if it was ' above the target position If originalContainer = targetContainer Then If originalPosition < targetPosition Then targetPosition = targetPosition - 1 End If SuppressUpdatingProperties = 1 If newName <> "" Then targetContainer.InsertItem(newName, newCaption, targetPosition) If checked Then targetContainer.CheckItem(newName, checked) If accelKey Then targetContainer.AccelKey = accelKey targetContainer.SetAccelerator(newName, accelKey) End If Else targetContainer.InsertSeparator(targetPosition) End If ' Get the list up to date. Deal with lowest in the list first If originalIndex >= targetIndex Then MenuEdit.menuList.RemoveItem(originalIndex) MenuEdit.menuList.InsertItem(newCaption, iconVal, targetLevel, targetIndex) MenuEdit.menuList.SetSelected(targetIndex, True) Else MenuEdit.menuList.InsertItem(newCaption, iconVal, targetLevel, targetIndex) MenuEdit.menuList.RemoveItem(originalIndex) MenuEdit.menuList.SetSelected(targetIndex - 1, True) End If SuppressUpdatingProperties = 0 End If End Sub Sub RemoveCurrentItem Dim index As Integer Dim relativePosition As Integer Dim containingMenu As Object Dim theMenu As Object index = MenuEdit.menuList.ListIndex ' Get out if nothing is selected or if dealing with the Anchor If index <= 0 Then Exit Sub ' get the containing menu for the item at the current index and ' the item's relative position within that containing menu containingMenu = GetPositionInfo(index, relativePosition) If containingMenu Then containingMenu.RemoveItem(relativePosition) ' if we are not deleting a 're-usable' referenced menu, destroy any ' object held by the list item (only applies to submenu entries) theMenu = MenuEdit.menuList.ItemObject(index) If theMenu Then Dim name As String name = theMenu If Left$(name, 4) <> "REFD" Then DestroyObject(theMenu) End If ' delete the list entry and any sub menu items it may have DeleteListEntries(index, MenuEdit.menuList.ItemLevel(index)) If (index < MenuEdit.menuList.ListCount) Then MenuEdit.menuList.SetSelected(index, True) Else MenuEdit.menuList.SetSelected(index-1, True) End If End Sub Sub Resize() menutools.Top = 0 menutools.Left = 0 menutools.Width = ScaleWidth ' keep the indented list snuggly within our form If Label2.Visible Then menuList.Top = Label2.Top + Label2.Height menuList.Height = ScaleHeight - menuList.Top Else menuList.Top = menutools.Height menuList.Height = ScaleHeight - menuList.Top End If menuList.Left = 0 menuList.Width = ScaleWidth End Sub Sub SubsumeRecursively(theMenu As Object) ' TODO need to ensure that the menu is menubar or popup SubsumeParent(theMenu) EnumObjectEmbeds(theMenu, Me, "SubsumeRecursively") End Sub Sub testdrive_Click MenuTester.Show MenuTester.BringToTop End Sub Function testdrive_Enable As Integer testdrive_Enable = IIf(MenuEdit.menuList.ListCount > 0, True, False) End Function Sub txtCaption_KeyUp(keyCode As Integer, ByVal shift As Integer) Dim index As Integer Dim position As Integer Dim caption As String Dim theMenu As Object index = MenuEdit.menuList.ListIndex ' Get out if nothing is selected or it at the anchor If index <= 0 Then Exit Sub ' get the containing menu for the item at index where we st ' the item's relative position within that containing menu theMenu = GetPositionInfo(index, position) caption = txtCaption.Text theMenu.SetCaption(position, caption) MenuEdit.menuList.SetItemString(index, caption) changed = True End Sub Sub txtName_KeyUp(keyCode As Integer, ByVal shift As Integer) Dim index As Integer Dim position As Integer Dim theMenu As Object index = MenuEdit.menuList.ListIndex ' Get out if nothing is selected or it at the anchor If index <= 0 Then Exit Sub ' get the containing menu for the item at index where we st ' the item's relative position within that containing menu theMenu = GetPositionInfo(index, position) theMenu.SetName(position, txtName.Text) changed = True End Sub Sub UpdateProperties Dim index As Integer Dim position As Integer Dim name As String Dim caption As String Dim checked As Integer Dim accelKey As Long Dim theMenu As Object Dim pos As Integer Dim captionEnabled As Boolean Dim isCmdItem As Boolean If SuppressUpdatingProperties Then Exit Sub index = MenuEdit.menuList.ListIndex ' Get out if nothing is selected or it at the anchor If index <= 0 Then ' Clear out the properties. use the UpdatingProperties flag ' to prevent combo box click method from redundantly ' doing work after we set the list index on it UpdatingProperties = 1 txtCaption.Text = "" txtCaption.Enabled = False txtName.Text = "" txtName.Enabled = False chkChecked.Enabled = False cbAccel.Enabled = False chkChecked.Value = False cbAccel.ListIndex = 0 UpdatingProperties = 0 Exit Sub End If ' get the containing menu for the item at index where we started our drag and ' the item's relative position within that containing menu theMenu = GetPositionInfo(index, position) name = theMenu.ItemNameAt(position) caption = theMenu.ItemCaptionAt(position) captionEnabled = True If MenuEdit.menuList.ItemObject(index) Then ' PropertiesForm.Caption = "SubMenu Item Properties" ' Get at the 'local' name pos = Instr(2, name, ".") While pos name = Right$(name, Len(name) - pos) pos = Instr(2, name, ".") Wend Else ' PropertiesForm.Caption = "Command Item Properties" If name <> "" Then If Not TypeOf theMenu Is FindObject("MenuBar") Then checked = IIf(theMenu.ItemIsChecked(name), 1, 0) accelKey = theMenu.GetAccelerator(name) End If isCmdItem = True Else caption = "<separator>" captionEnabled = False End If End If ' update the properties. use the UpdatingProperties flag ' to prevent combo box click method from redundantly ' doing work after we set the list index on it UpdatingProperties = 1 txtCaption.Text = caption txtCaption.Enabled = captionEnabled txtName.Text = name txtName.Enabled = isCmdItem chkChecked.Enabled = isCmdItem cbAccel.Enabled = isCmdItem chkChecked.Value = checked cbAccel.ListIndex = accelKey UpdatingProperties = 0 End Sub End Type Type PropertyEditor From PropertyEditor Type DimensionArrayForm From Form Dim TBStmt As New TextBox Dim LblName As New Label Dim LblDims As New Label Dim CBType As New ComboBox Dim LblType As New Label Dim LblStmt As New Label Dim TBName As New TextBox Dim TBDims As New TextBox Dim posDim As Integer Dim posOpen As Integer Dim posName As Integer Dim posClose As Integer Dim posDims As Integer Dim posAs As Integer Dim posType As Integer Dim ignoreChange As Boolean Dim BtnOK As New Button Dim BtnCancel As New Button ' METHODS for object: PropertyEditor.DimensionArrayForm Sub BtnCancel_Click ModalResult IDCANCEL End Sub Sub BtnOK_Click ModalResult IDOK End Sub Sub CBType_Click() If Not ignoreChange Then ParseStatement UpdateStatementType End If End Sub Function Execute(dimStmt As String) As Integer Dim initName As String ' Make sure the form is loaded so that Change events work LoadForm DefaultButton = BtnOK CancelButton = BtnCancel ' Initial value of dimStmt is a suggested name. If we have no ' prior statement, then use default, otherwise just set name. initName = IIf(dimStmt = "", "array", dimStmt) If TBStmt.Text = "" Then TBStmt.Text = "Dim " & initName & " (10) As Integer" Else TBName.Text = initName End If Show TBName.SetFocus : TBName.SelStart = 0 : TBName.SelLength = 256 If ShowModal = IDOK Then dimStmt = TBStmt.Text Execute = 1 Else Execute = -1 End If Hide End Function Sub Load() CBType.AddItem "Integer" CBType.AddItem "Long" CBType.AddItem "String" CBType.AddItem "Single" CBType.AddItem "Double" CBType.AddItem "Object" End Sub Sub ParseStatement() Dim text As String text = TBStmt.Text posClose = 0 : posDims = 0 : posAs = 0 : posType = 0 ' Look for 'dim' followed by '('. posDim = Instr(1, text, "dim", 1) posOpen = Instr(posDim + 1, text, "(") posName = IIf(posDim > 0, posDim + 3, 0) ' OK, now look for the ')' and, if found, get dimens part posClose = Instr(posOpen + 1, text, ")") posDims = IIf(posOpen > 0, posOpen + 1, 0) ' Look for 'as', followed by space: rest is the type posAs = Instr(posClose + 1, text, "as", 1) posType = IIf(posAs > 0, posAs + 2, 0) End Sub Sub Resize() Dim m, l, w, h, effWidth As Single m = TBStmt.Top w = BtnOK.Width : h = BtnOK.Height effWidth = IIf(ScaleWidth < 4470, 4470, ScaleWidth) l = effWidth - w - m BtnOK.Move(l, m, w, h) BtnCancel.Move(l, BtnOK.Top + h + m, w, h) w = BtnOK.Left - m - TBStmt.Left TBStmt.Width = w TBName.Width = w TBDims.Width = w ' CBType.Width = w Refresh End Sub Sub TBDims_Change() If Not ignoreChange Then ParseStatement UpdateStatementDims End If End Sub Sub TBName_Change() If Not ignoreChange Then ParseStatement UpdateStatementName End If End Sub Sub TBStmt_Change() If Not ignoreChange Then ParseStatement UpdateNameDimType End If End Sub Sub UpdateNameDimType() Dim i As Integer Dim text, capType As String text = TBStmt.Text ' Update the name text if we can. ignoreChange = True If posDim = 0 || posOpen = 0 || Mid(text, posName, 1) <> " " Then TBName.Text = "" Else ' Trim the stuff between the dim and ( and call it the name. TBName.Text = Trim(Mid(text, posName, posOpen - posName)) End If ' Dimens part is whatever is between the parens. If posOpen = 0 || posClose = 0 Then TBDims.Text = "" Else TBDims.Text = Trim(Mid(text, posDims, posClose - posDims)) End If ' Type is whatever follows the 'as' If posAs = 0 || Mid(text, posType, 1) <> " " Then CBType.ListIndex = -1 Else capType = Trim(Mid(text, posType)) capType = UCase(Left(capType, 1)) & LCase(Mid(capType, 2)) If capType = "" Then CBType.ListIndex = -1 Else i = CBType.ItemIndex(capType) CBType.ListIndex = IIf(i <> -1, i, CBType.ListCount - 1) End If End If ignoreChange = False End Sub Sub UpdateStatementDims ' Replace dimens part (whatever is between the parens). If posOpen > 0 && posClose > 0 Then Dim text As String text = TBStmt.Text ignoreChange = True TBStmt.Text = Left(text, posOpen) & TBDims.Text & Mid(text, posClose) ignoreChange = False End If End Sub Sub UpdateStatementName Dim text As String text = TBStmt.Text ' Replace the stuff between the dim and ( with the name If posDim > 0 && posOpen > 0 && Mid(text, posName, 1) = " " Then ignoreChange = True TBStmt.Text = Left(text, posName) & TBName.Text & " " & Mid(text, posOpen) ignoreChange = False End If End Sub Sub UpdateStatementType Dim text As String text = TBStmt.Text ' Replace type in statement (whatever follows the 'as') If posAs > 0 && Mid(text, posType, 1) = " " Then ignoreChange = True TBStmt.Text = Left(text, posType) & CBType.Text ignoreChange = False End If End Sub End Type Type EnumPicker From Form Dim EnumList As New ListBox Dim BtnOk As New Button Dim BtnCancel As New Button ' METHODS for object: PropertyEditor.EnumPicker Sub BtnCancel_Click() Hide : ModalResult(IDCANCEL) End Sub Sub BtnOk_Click() Hide : ModalResult(IDOK) End Sub Function ShowModal() As Long dim f strictly As Form dim enums As String dim curpos, eol as integer ' Make sure Form is created and shown, so configurations below stick. LoadForm() Show() EnumList.SetFocus() curpos = 1 enums = GetEnumList() EnumList.Clear While (curpos < Len(enums)) dim eol as integer eol = Instr(curpos, enums, Chr(13)) If eol = 0 Then Exit Do EnumList.AddItem(Mid(enums, curpos, (eol - curpos))) curpos = eol + 2 Wend f = Me ShowModal = f.ShowModal End Function End Type Type ObjPicker From Form Dim BtnOk As New Button Dim BtnCancel As New Button Dim ObjList As New ObjectList Dim Label1 As New Label Dim CBReference As New CheckBox Dim CBUntyped As New CheckBox Dim CBShowEmbeds As New CheckBox ' METHODS for object: PropertyEditor.ObjPicker Sub BtnCancel_Click() Hide : ModalResult(IDCANCEL) End Sub Sub BtnOk_Click() Hide : ModalResult(IDOK) End Sub Sub CBShowEmbeds_Click() ObjList.ShowEmbeds = CBShowEmbeds.Value = "Checked" End Sub Sub CBUntyped_Click() ObjList.Enabled = CBUntyped.Value <> "Checked" CBShowEmbeds.Enabled = ObjList.Enabled End Sub Function IsLegalKey(keyAscii As Integer) As Integer Select Case keyAscii Case VK_BACK, Asc(" "), Asc("."), Asc("0") To Asc("9"), Asc("A") To Asc("z") IsLegalKey = True Case Else IsLegalKey = False End Select End Function Sub ObjList_KeyPress(keyAscii As Integer) dim newselection as integer newselection = -1 ' Process particular keys, and set "newselection" if key is processed. If (keyAscii = VK_BACK) Then Label1.Text = Left(Label1.Text, Len(Label1.Text) - 1) newselection = ObjList.FindString(Label1.Text, -1) ElseIf keyAscii = Asc(" ") || IsLegalKey(keyAscii) Then dim newstring as string If keyAscii = Asc(" ") Then newselection = ObjList.FindString(Label1.Text, ObjList.ListIndex) newstring = Label1.Text Else newstring = Label1.Text & Chr(keyAscii) newselection = ObjList.FindString(newstring, -1) End If If newselection = -1 Then keyAscii = 0 : Exit Sub Label1.Text = newstring End If If (newselection <> -1) Then ' Suppress keystroke that generated new selection ObjList.ListIndex = newselection keyAscii = 0 End If End Sub Sub ObjList_MouseUp(button As Integer, shift As Integer, x As Single, y As Single) Label1.Text = "" End Sub Sub Resize() Dim m, mm, l, t, w, h, effWidth As Single m = 90 : mm = 180 effWidth = IIf(ScaleWidth < 4370, 4370, ScaleWidth) t = CBReference.Top : w = CBReference.Width : h = CBReference.Height l = effWidth - w - m CBReference.Move(l, t, w, h) CBUntyped.Move(l, t + h + m, w, h) w = BtnOk.Width : h = BtnOk.Height l = effWidth - w - m BtnOk.Move(l, m, w, h) BtnCancel.Move(l, BtnOk.Top + h + m, w, h) w = CBReference.Left - m - ObjList.Left ObjList.Width = w Label1.Width = w t = ObjList.Top h = ScaleHeight - t - mm - CBShowEmbeds.Height CBShowEmbeds.Top = t + h + m ObjList.Height = h Refresh End Sub Function ShowModal() As Long dim f strictly As Form ' Make sure Form is created and shown, so configurations below stick. LoadForm() Show() Label1.Text = "" ObjList.Reset() ObjList.SetFocus() f = Me ShowModal = f.ShowModal End Function End Type ' METHODS for object: PropertyEditor Function ArrayConfig(dimStmt As String) As Integer ArrayConfig = DimensionArrayForm.Execute(dimStmt) End Function Function DblClick() As Integer ' Initialize the "handled" state of Event to not true. DblClick = False ' Independent of all else, Handle Embedded forms If SelPropIsEmbed Then Dim obj as Object obj = FindObject(SelPropString) If obj && ObjectEditorMgr.DetailedEdit(obj) Then ' A specialized ObjectEditor handled the event. Refresh("ChangedProperty") DblClick = True End If Else If ObjectEditorMgr.PropertyEdit(SelPropObject) || GenericPropertyEdit() Then ' A specialized ObjectEditor handled the event. Refresh("ChangedProperty") DblClick = True End If End If End Function Function EnumPick(enumName As String) As Integer If EnumPicker.ShowModal() = IDOK Then enumName = EnumPicker.EnumList.Text EnumPick = 1 Else EnumPick = -1 End If End Function Function GenericPropertyEdit() As Long Dim fName As String fName = SelPropName ' Initialize handled status to not true GenericPropertyEdit = False ' Handle Color Field for all object types If Instr(fName, "Color") && SelPropType = 1 Then ColorDialog.Title = fName ColorDialog.Color = SelPropString If ColorDialog.Execute = 1 Then SelPropAssign(ColorDialog.Color) GenericPropertyEdit = True End If ' Handle Font Reference Field For all object types ElseIf (StrComp(fName, "Font") = 0) && Not SelPropIsEmbed Then GenericPropertyEdit = SetWindowFont(SelPropObject) End If End Function Sub Help() If SelPropIsEmbed Then Envelop.Help.ShowObjectHelp(FindEmbed(SelPropObject, SelPropName)) Else Envelop.Help.ShowPropertyHelp(SelPropName, SelPropObject) End If End Sub Function ObjPick(asReference As Integer, result As Integer) As Object If ObjPicker.ShowModal() = IDOK Then asReference = ObjPicker.CBReference.Value = "Checked" ObjPick = IIf(ObjPicker.CBUntyped.Value = "Checked", Nothing, ObjPicker.ObjList.SelObject) result = 1 Else result = -1 End If End Function Function SetWindowFont(ByVal w as Window) As Integer dim editFont as Font ' Default to no change SetWindowFont = False ' If there is not a Font object to edit already, make a temporary one to work ' on until "OK" is pressed on FontDialog. If Not w.Font Then editFont = CopyObject(Font, "") Else editFont = w.Font End If ' Use font dialog to configure the font passed in. FontDialog.Title = w & "." & SelPropName FontDialog.Font = editFont FontDialog.Color = w.ForeColor If FontDialog.Execute = 1 Then ' Embed a Font object is not already there. If Not w.Font Then ' Copy the object from 'editFont', will copy all the configured properties. w.Font := EmbedObject(w, editFont, UniqueEmbedName(w, "font")) End If w.ForeColor = FontDialog.Color SetWindowFont = True End If End Function End Type Type MenuTester From Form Dim Label1 As New Label Dim font1 As New Font End Type Type MenuEditor From MenuEditor Type SelectPopupForm From Form Dim CBPopups As New ObjectCombo Dim OptExisting As New OptionButton Dim OptNew As New OptionButton Dim LblCaption As New Label Dim TECaption As New TextBox Dim TEName As New TextBox Dim BtnOK As New Button Dim BtnCancel As New Button Dim HostMenu As Menu Dim LblName As New Label ' METHODS for object: MenuEditor.SelectPopupForm Sub BtnCancel_Click() Hide ModalResult IDCANCEL End Sub Sub BtnOK_Click() If OptNew.Value Then Dim newName As String newName = TEName.Text If IsIdentifierValid(newName) = 0 Then Dim mb As New MessageBox mb.SetIconExclamation mb.Message("Invalid identifier", """" & newName & """ is not a valid object name") Exit Sub End If End If Hide ModalResult IDOK End Sub Function Execute(host As Menu, caption As String, handled As Integer) As PopupMenu Dim result As Integer LoadForm Font = DefaultDialogFont HostMenu = host OptNew.Value = True OptNew_Click CBPopups.SetFocus CBPopups.Reset result = ShowModal HostMenu = Nothing If result = IDOK Then Dim popup As PopupMenu If OptExisting.Value Then popup = CBPopups.SelObject Else If host Then popup = EmbedObject(host, FindObject("PopupMenu"), TEName.Text) Else popup = CopyObject(FindObject("PopupMenu"), TEName.Text) End If End If caption = TECaption.Text If caption = "" Then ' Fill in a default caption Dim nm As String Dim pos, lastPos As Integer nm = popup Do pos = Instr(nm, ".") If pos Then nm = Mid$(nm, pos + 1) Loop While pos <> 0 caption = nm End If handled = IDOK Execute = popup Else handled = IDCANCEL End If End Function Sub OptExisting_Click() CBPopups.Visible = True TEName.Visible = False End Sub Sub OptNew_Click() CBPopups.Visible = False TEName.Visible = True If HostMenu Then TEName.Text = UniqueEmbedName(HostMenu, "Popup") Else TEName.Text = UniqueObjectNameFromString("PopupMenu") End If End Sub Sub Resize() Dim m, mm, l, t, w, h As Single Dim effWidth As Single m = 90 : mm = 180 effWidth = IIf(ScaleWidth < 5000, 5000, ScaleWidth) w = BtnOK.Width h = BtnOK.Height l = effWidth - m - w BtnOK.Move(l, m, w, h) BtnCancel.Move(l, BtnOK.Top + h + m, w, h) l = CBPopups.Left h = CBPopups.Height w = BtnOK.Left - mm - l CBPopups.Move(l, CBPopups.Top, w, h) TEName.Move(l, TEName.Top, w, h) TECaption.Move(l, TECaption.Top, w, h) Refresh End Sub End Type ' METHODS for object: MenuEditor Sub Help() Envelop.Help.ShowTopicHelp("Menu_Editor") End Sub Function SelectPopup(container As Menu, caption As String, handled As Integer) As Object SelectPopup = SelectPopupForm.Execute(container, caption, handled) End Function End Type Type CtrlToolGadgetWizard From WizardMaster.Wizard Type SelectObject From WizardMaster.FrmStep Dim TextBox1 As New TextBox End Type Type SelectBitmap From WizardMaster.FrmStep Dim TextBox1 As New TextBox Dim BTNBrowse As New Button Dim BTNPreview As New Button Type SampleBox From ObjectBox Dim PreviewTool As New ToolGadget ' METHODS for object: CtrlToolGadgetWizard.SelectBitmap.SampleBox Sub Reposition dim l,t,w,h as long w = (PreviewTool.bitmap.Width + 4) * 15 If w > 4125 Then w = 4125 If w < 150 Then w = 150 h = (PreviewTool.bitmap.Height + 4) * 15 If h > 1575 Then h = 1575 If h < 150 Then h = 150 l = 2850 + ((4125 - w) / 2) t = 2175 + ((1575 - h) / 2) Move(l, t, w, h) PreviewTool.Refresh ForceLayout(True) End Sub End Type ' METHODS for object: CtrlToolGadgetWizard.SelectBitmap Sub BTNBrowse_Click() Dim length As Integer Dim open as New OpenDialog ' Set the title of the open dialog just before we display it. open.Title = "Configure Tool Gadget" ' Set the filter to look for bitmaps open.Filter = "Bitmap files|*.bmp|" ' Set the change directory open.NoChangeDir = False ' If a filename was picked, then remember it ' Let the picture on this wizard preview it If open.Execute <> IDCANCEL Then TextBox1.Text = open.FileName BTNPreview_Click End If End Sub Sub BTNPreview_Click() If TextBox1.Text <> "" Then SampleBox.PreviewTool.bitmap.LoadType = "FileBased" SampleBox.PreviewTool.bitmap.FileName = TextBox1.Text SampleBox.PreviewTool.bitmap.LoadType = "MemoryBased" End If SampleBox.Reposition End Sub End Type Dim ng As ControlTools.Gadget ' METHODS for object: CtrlToolGadgetWizard Sub Cancel() If ng Then ng.GadgetObject = "" ng.bitmap.LoadType = "FileBased" ng.bitmap.FileName = "" ng.bitmap.LoadType = "MemoryBased" End If End Sub Sub SelectBitmap_ValidateDisplay(ok As Boolean) If Not SelectBitmap.initialized Then ' If the new gadget's bitmap is not configured yet, give it a default With ng.bitmap If (.Width + .Height = 0) Then ' The default is in the EVDEV.DLL as Resource 3100. .LoadType = "ResourceBased" .FileName = "evdev.dll" .ResId = 3100 .LoadType = "MemoryBased" .FileName = "" End If ' copy the bitmap from the gadget into the preview area SelectBitmap.SampleBox.PreviewTool.bitmap.SetPicture(.GetPicture()) End With SelectBitmap.SampleBox.ForceLayout(True) SelectBitmap.initialized = True End If SelectBitmap.TextBox1.Text = ng.bitmap.FileName SelectBitmap.BTNPreview_Click End Sub Sub SelectBitmap_ValidateFinish(ok As Boolean) If ng Then If SelectBitmap.TextBox1.Text <> "" Then ng.bitmap.LoadType = "FileBased" ng.bitmap.FileName = SelectBitmap.TextBox1.Text ng.bitmap.LoadType = "MemoryBased" Else ng.bitmap.SetPicture SelectBitmap.SampleBox.PreviewTool.bitmap.GetPicture End If If ng.Parent Then ng.Parent.ForceLayout(True) End If End Sub Sub SelectObject_ValidateDisplay(ok As Boolean) If ng Then SelectObject.TextBox1.Text = ng.GadgetObject End If End Sub Sub SelectObject_ValidateFinish(ok As Boolean) SelectObject_ValidateNext(ok) End Sub Sub SelectObject_ValidateNext(ok As Boolean) If ng Then ng.GadgetObject = FindObject(SelectObject.TextBox1.Text) ' May want to add next line: ' If ng.GadgetObject = Nothing then WARNING End Sub End Type Type GroupEditor From ObjectEditor Property Visible Get getVisible Set setVisible As Boolean Type EditorForm From Form Dim GroupRef As Object Dim GroupList As New ListBox Dim ParentForReal As GroupEditor Dim Up As New Button Dim Down As New Button Dim Delete As New Button ' METHODS for object: GroupEditor.EditorForm Function CurrentPosition() As Long CurrentPosition = GroupList.ListIndex End Function Function CursorPosition(y as single) As Long dim pos as long ' Identify list position for a given cursor location pos = y / GroupList.ItemHeight If pos > GroupList.ListCount Then pos = GroupList.ListCount CursorPosition = pos End Function Sub Delete_Click() Dim obj as Object Dim i as integer ' If no selection, bail i = GroupList.ListIndex If i < 0 Then Exit Sub ' Delete the object at the selected index obj = GetCurrentObject() If obj Then GroupRef.RemoveAt(i) If i >= GroupRef.Count Then i = GroupRef.Count - 1 PopulateEditor(i) End If End Sub Sub Down_Click() Dim obj as Object Dim i, cnt as integer ' If list has no more than 1 member or the selected item is ' already at the bottom then do nothing i = GroupList.ListIndex cnt = GroupList.ListCount If cnt <= 1 || i >= cnt - 1 Then Exit Sub ' Get current object, remove it from group, add it back in ' one position down obj = GetCurrentObject() If obj Then GroupRef.RemoveAt(i) If i = cnt - 2 Then GroupRef.Append(obj) i = cnt - 1 Else GroupRef.InsertAt(obj, i + 1) i = i + 1 End If End If ' Rebuild the list and lets see it PopulateEditor(i) End Sub Sub Edit(obj As Object) ' If there's no object to edit or its ' not the right type, forget it. If Not obj Then Exit Sub If Not TypeOf obj Is Group && Not TypeOf obj Is ControlGroup Then Exit Sub ' Set our caption and group reference, then populate the list Caption = "Group: " & obj GroupRef = obj PopulateEditor(-1) End Sub Function GetCurrentObject() As Object GetCurrentObject = FindObject(GroupList.Text) End Function Function GetObjectCount(obj as Object) As Integer Dim manip as Integer If Not TypeOf obj Is Group && Not TypeOf obj Is ControlGroup Then Exit Function ' Set GroupRef and object count GroupRef = obj GetObjectCount = IIf(obj, obj.Count, 0) ' Enable the group manipulations for simple groups manip = (obj <> Nothing) && (TypeOf obj Is Group) Up.Enabled = manip Down.Enabled = manip Delete.Enabled = manip End Function Sub GroupList_DblClick() dim obj as Object ' Double clicking an entry in the group list Edits it obj = GetCurrentObject() If obj Then ObjectEditorMgr.ResetOthers(GroupEditor, obj) End Sub Sub GroupList_DragAndDrop(source As XferData, x As Single, y As Single, state As OleDropState, effect As OleDropEffect) effect = 0 If GroupRef && TypeOf GroupRef Is Group Then effect = 1 If state = 3 Then OG_DragAndDrop(source, x, y, state, effect) Else GroupList.ListIndex = CursorPosition(y) End If End If End Sub Sub GroupList_DragStart(data as XferData, x As Single, y As Single) dim obj as Object ' Start a drag with the current object obj = GetCurrentObject() If obj Then data.ObjectRef = obj data.Drag(1) End If End Sub Sub GroupList_KeyDown(keyCode As Integer, ByVal shift As Integer) ' If he hits delete and we have an object and we can delete it ' then do it. If (keyCode = VK_DELETE && GroupList.ListIndex <> -1) Then If Delete.Enabled Then Delete_Click End If If (keyCode = VK_F1) Then Envelop.Help.ShowTopicHelp("Group_Editor") End Sub Sub Load() If GroupRef Then PopulateEditor(-1) End If End Sub Sub OG_DragAndDrop(source as XferData, x as Single, y as Single, state as OleDropState, effect as OleDropEffect) dim idx as integer dim obj as Object ' Add the dragged object into the list at the positon ' given by the cursor location obj = source.ObjectRef idx = CursorPosition(y) If (idx > 0 && idx < GroupRef.Count) Then GroupRef.InsertAt(obj, idx) ElseIf (idx <= 0) Then idx = 0 GroupRef.Prepend(obj) ElseIf (idx >= GroupRef.Count) Then GroupRef.Append(obj) idx = GroupRef.Count - 1 End If ' Rebuild the list and lets see it PopulateEditor(idx) End Sub Sub PopulateEditor(ind as Integer) dim i as Integer dim count as Integer ' Add the objects in the group to the list ' after clearing it first GroupList.Clear count = GetObjectCount(GroupRef) If (count > 0) Then For i = 0 To count - 1 GroupList.AddItem(GroupRef(i)) Next i End If ' Set selection to requested index GroupList.ListIndex = ind End Sub Sub Resize() ' Resize the list to take up the whole form but the ' button area. GroupList.Move(0, GroupList.Top, ScaleWidth, ScaleHeight) Height = Height - ScaleHeight + GroupList.Height End Sub Sub Up_Click() Dim obj as Object Dim i, cnt as integer ' If list has no more than 1 member or the selected item is ' already at the top then do nothing i = GroupList.ListIndex cnt = GroupList.ListCount If cnt <= 1 || i <= 0 Then Exit Sub ' Get current object, remove it from group, add it back in ' one position up obj = GetCurrentObject() If obj Then GroupRef.RemoveAt(i) GroupRef.InsertAt(obj, i - 1) End If ' Rebuild the list and lets see it PopulateEditor(i - 1) End Sub End Type ' METHODS for object: GroupEditor Sub BringToTop() EditorForm.BringToTop() End Sub Sub Edit(obj As Object) EditorForm.Edit(obj) End Sub Function getVisible() As Boolean getVisible = EditorForm.Visible End Function Sub Hide() EditorForm.Hide() End Sub Sub setVisible(vis As Boolean) EditorForm.Visible = vis End Sub Sub Show() EditorForm.Show() End Sub End Type Type NewProjectForm From Form Dim LblProjType As New Label Dim LblProjName As New Label Dim LblProjFile As New Label Dim OptApplication As New OptionButton Dim OptLibrary As New OptionButton Dim LblEXEfile As New Label Dim TEProjName As New TextBox Dim TEProjFile As New TextBox Dim TEEXEfile As New TextBox Dim BtnOK As New Button Dim BtnCancel As New Button Dim BtnBrowseProjFile As New Button Dim BtnBrowseEXEfile As New Button Dim GeneratedName As String ' METHODS for object: NewProjectForm Sub BtnBrowseEXEfile_Click() Dim dlg As New OpenDialog Dim name As String name = TEEXEfile.Text If name <> "" Then Dim file As New File file.FileName = name dlg.FileName = file.Name & file.Extension dlg.InitialDir = IIf(Instr(name, "\") > 0, file.Path, Envelop.FileDialogDir) Else dlg.FileName = "*.exe" dlg.InitialDir = Envelop.FileDialogDir End If dlg.Title = "Select application EXE file" dlg.Filter = "Executable files (*.exe)|*.exe|All files (*.*)|*.*|" dlg.DefaultExtension = "exe" dlg.FilterIndex = 1 dlg.FileMustExist = False dlg.PathMustExist = True dlg.NoChangeDir = True If dlg.Execute = IDOK Then TEEXEfile.Text = dlg.FileName Envelop.FileDialogDir = dlg.FileName End If End Sub Sub BtnBrowseProjFile_Click() Dim dlg As New OpenDialog Dim name As String name = TEProjFile.Text If name <> "" Then Dim file As New File file.FileName = name dlg.FileName = file.Name & file.Extension dlg.InitialDir = IIf(Instr(name, "\") > 0, file.Path, Envelop.FileDialogDir) Else dlg.FileName = "*.epj" dlg.InitialDir = Envelop.FileDialogDir End If dlg.Title = "Select project file" dlg.Filter = "Envelop projects (*.epj)|*.epj|All files (*.*)|*.*|" dlg.DefaultExtension = "epj" dlg.FilterIndex = 1 dlg.FileMustExist = False dlg.PathMustExist = True dlg.NoChangeDir = True If dlg.Execute = IDOK Then TEProjFile.Text = dlg.FileName If OptApplication.Value Then Dim fle as New File fle.FileName = dlg.FileName TEEXEfile.Text = fle.Path & fle.Name & ".exe" End If Envelop.FileDialogDir = dlg.FileName End If End Sub Sub BtnCancel_Click() Hide ModalResult IDCANCEL End Sub Sub BtnOK_Click() Dim name as string Dim answer as integer Dim mb As New MessageBox mb.SetIconExclamation ' Check that we have a valid project object name. name = TEProjName.Text If name = "" Then mb.Message("Invalid project name", "To make a new project, you must^Mspecify a valid new project object name.") FocusOnTE TEProjName Exit Sub ElseIf IsIdentifierValid(name) = 0 Then mb.Message("Invalid project name", """" & name & """ is not a valid object name.^M^MTo make a new project, you must ^Mspecify a valid new project object name.") FocusOnTE TEProjName Exit Sub ElseIf FindObject(name) Then mb.Message("Invalid project name", "The object """ & name & """ already exists.^M^MTo make a new project, you must ^Mspecify a valid new project object name.") FocusOnTE TEProjName Exit Sub End If ' Check that the specified project file can be written. ' Allow the user to continue if she really wants to. name = TEProjFile.Text If name = "" Then answer = YesNoBox.Message("No project file name", "You have not specified a project file.^MDo you wish to continue anyway?") If answer <> IDYES Then FocusOnTE TEProjFile Exit Sub End If Else Dim file As New TextFile file.FileName = name If file.Exists Then answer = YesNoBox.Message("Project file exists", "The project file you selected already exists.^MDo you wish to continue anyway?") If answer <> IDYES Then FocusOnTE TEProjFile Exit Sub End If If file.ReadOnly Then answer = YesNoBox.Message("Read-only project file", "The project file you selected is read-only.^MDo you wish to continue anyway?") If answer <> IDYES Then FocusOnTE TEProjFile Exit Sub End If End If Else Try file.Create(False) Catch End Try If Not file.Exists Then answer = YesNoBox.Message("Can't make project file", "Unable to make project file: " & name & ".^MDo you wish to continue anyway?") If answer <> IDYES Then FocusOnTE TEProjFile Exit Sub End If End If file.Delete End If End If ' Check that the specified EXE file can be written. ' Allow the user to continue if she really wants to. If OptApplication.Value Then name = TEEXEfile.Text If name = "" Then answer = YesNoBox.Message("No EXE file name", "You have not specified an application EXE file.^MDo you wish to continue anyway?") If answer <> IDYES Then FocusOnTE TEEXEfile Exit Sub End If Else Dim file As New TextFile file.FileName = name If file.Exists Then answer = YesNoBox.Message("EXE file exists", "The application EXE file you selected already exists.^MDo you wish to continue anyway?") If answer <> IDYES Then FocusOnTE TEEXEfile Exit Sub End If If file.ReadOnly Then answer = YesNoBox.Message("Read-only EXE file", "The application EXE file you selected is read-only.^MDo you wish to continue anyway?") If answer <> IDYES Then FocusOnTE TEEXEfile Exit Sub End If End If Else Try file.Create(False) Catch End Try If Not file.Exists Then answer = YesNoBox.Message("Can't make EXE file", "Unable to make application EXE file: " & name & ".^MDo you wish to continue anyway?") If answer <> IDYES Then FocusOnTE TEEXEfile Exit Sub End If End If file.Delete End If End If End If Hide ModalResult IDOK End Sub Function DoExecute(ByVal auto As Boolean) As Project Dim name As String LoadForm Center OptApplication.Value = True OptLibrary.Value = False GenerateNames(True) TEEXEfile.Enabled = True BtnBrowseEXEfile.Enabled = True If auto || ShowModal = IDOK Then DoExecute = MakeProject(OptApplication.Value, TEProjName.Text, TEProjFile.Text, TEEXEfile.Text) Else DoExecute = Nothing End If End Function Function Execute As Project Execute = DoExecute(False) End Function Sub FocusOnTE(te As TextBox) te.SelStart = 0 te.SelLength = 32768 te.SetFocus End Sub Sub GenerateNames(app As Boolean) Dim name As String GeneratedName = UniqueObjectNameFromString(IIf(app, "Application", "Library")) TEProjName.Text = GeneratedName name = IIf(app, "app", "lib") & Mid(GeneratedName, IIf(app, 12, 8)) TEProjFile.Text = name & ".epj" If app Then TEEXEfile.Text = name & ".exe" End Sub Function MakeDefaultProject As Project MakeDefaultProject = DoExecute(True) End Function Function MakeProject(ByVal makeApp As Boolean, ByVal objName As String, ByVal projFile As String, ByVal exeFile As String) As Project Dim m As ObjectModule Dim p As Project Dim f As Form Dim nm As String Dim file As New File Dim appOrProj As Object ' Open a new untitled module m = ModuleManager.LoadModule("", False) ' In that module, make the new project object and a new form appOrProj = IIf(makeApp, Application, Project) nm = IIf(objName = "", UniqueObjectNameFromString(IIf(makeApp, "Application", "Library")), objName) p = CopyObject(appOrProj, nm) f = CopyObject(Form, UniqueObjectNameFromString("Form")) f.Caption = f ' Secure the project object against deletion EmbedObject(p, ACL, "AccessControl") SecureObject(p, p.AccessControl) p.AccessControl.ObjectAccess = "110 - R,W,C,M,P" ' Set default options on the new project and make it current If makeApp Then p.ModulePath = "base.ebo;win32.ebo;dialogs.ebo;tools.ebo;" & m.FileName Else p.ModulePath = m.FileName End If If projFile <> "" Then file.FileName = projFile p.ProjectFileName = file.Path & file.Name & file.Extension Else p.ProjectFileName = "" End If If makeApp Then If exeFile <> "" Then file.FileName = exeFile p.EXEFileName = file.Path & file.Name & file.Extension Else p.EXEFileName = "" End If p.MainForm = f End If ProjectManager.CurrentProject = p p.CurrentModule = m ObjectEditorMgr.Edit f MakeProject = p End Function Sub OptApplication_Click() If TEProjName.Text = GeneratedName Then GenerateNames(True) End If LblEXEfile.Enabled = True TEEXEfile.Enabled = True BtnBrowseEXEfile.Enabled = True End Sub Sub OptLibrary_Click() If TEProjName.Text = GeneratedName Then GenerateNames(False) End If LblEXEfile.Enabled = False TEEXEfile.Text = "" TEEXEfile.Enabled = False BtnBrowseEXEfile.Enabled = False End Sub Sub Resize Dim m, mm, l, t, w, h, decHeight, newHeight as integer Dim ActiveWidth as integer ' Initialize the variables m = 60 mm = m + m ActiveWidth = IIf(ScaleWidth > 4800, ScaleWidth, 4800) ' Make height just the size to show everything decHeight = Height - ScaleHeight newHeight = BtnBrowseEXEfile.Top + BtnBrowseEXEfile.Height + m + decHeight If newHeight <> Height Then Height = newHeight Else l = ActiveWidth - m - BtnOK.Width BtnCancel.Left = l BtnOK.Left = l w = BtnBrowseEXEfile.Width l = ActiveWidth - m - w BtnBrowseEXEfile.Left = l BtnBrowseProjFile.Left = l w = l - TEProjName.Left - m TEEXEfile.Width = w TEProjFile.Width = w TEProjName.Width = w Refresh End If End Sub End Type Type SelectModuleForm From Form Dim LstModules As New ListBox Dim BtnOK As New Button Dim BtnCancel As New Button Dim BtnBrowse As New Button Dim LblModules As New Label Dim module As ObjectModule Dim BtnNew As New Button ' METHODS for object: SelectModuleForm Sub BtnBrowse_Click() module = Envelop.EBOOpen.BrowseForModule If module Then BtnOK_Click Else BtnCancel_Click End Sub Sub BtnCancel_Click() Hide ModalResult IDCANCEL End Sub Sub BtnNew_Click() module = ModuleManager.LoadModule("", False) If module Then BtnOK_Click Else BtnCancel_Click End Sub Sub BtnOK_Click() Hide ModalResult IDOK End Sub Function Execute(t As String) As ObjectModule InitModuleList(Nothing, Nothing, Nothing) BtnNew.Visible = True BtnBrowse.Visible = True Caption = IIf(t = "", "Select module", t) Execute = IIf(ShowModal = IDOK, module, Nothing) End Function Function ExecuteExcluding(x As Group, t As String) As ObjectModule InitModuleList(Nothing, x, Nothing) BtnNew.Visible = True BtnBrowse.Visible = True Caption = IIf(t = "", "Select module", t) ExecuteExcluding = IIf(ShowModal = IDOK, module, Nothing) End Function Function ExecuteFromGroupOnly(g As Group, initMod As ObjectModule, t As String) As ObjectModule InitModuleList(g, Nothing, initMod) BtnNew.Visible = False BtnBrowse.Visible = False Caption = IIf(t = "", "Select module", t) ExecuteFromGroupOnly = IIf(ShowModal = IDOK, module, Nothing) End Function Sub InitModuleList(initial As Group, exclude As Group, initMod As ObjectModule) Dim i, n as integer Dim m as ObjectModule LoadForm module = Nothing LstModules.Clear LstModules.Sorted = False ' Use initial group if given, otherwise all modules. n = IIf(initial, initial.Count, ModuleManager.ModuleCount) - 1 For i = 0 To n m = IIf(initial, initial(i), ModuleManager.Module(i)) If (exclude = Nothing) || (exclude.ObjectIndex(m) = -1) Then LstModules.AddItem m.DisplayName End If Next i ' Select given initial module, or current module, or first module If LstModules.ListCount Then m = IIf(initMod, initMod, ModuleManager.CurrentModule) LstModules.ListIndex = IIf(m, LstModules.ItemIndex(m.DisplayName), 0) End If Show LstModules.SetFocus End Sub Sub LstModules_Click() Dim text As String text = LstModules.Text If text = ObjectModule.DisplayName Then module = ObjectModule Else module = ModuleManager.FindModule(text) End If End Sub Sub LstModules_DblClick() BtnOK_Click End Sub Sub Resize() Dim m, mm, l, t, w, h as single Dim effWidth as single m = 90 : mm = 180 effWidth = IIf(ScaleWidth > 3435, ScaleWidth, 3435) w = BtnOK.Width h = BtnOK.Height l = effWidth - m - w BtnOK.Move(l, m, w, h) BtnCancel.Move(l, BtnOK.Top + h + m, w, h) BtnBrowse.Move(l, ScaleHeight - m - h, w, h) BtnNew.Move(l, BtnBrowse.Top - m - h, w, h) t = LblModules.Top + LblModules.Height + m LstModules.Move(m, t, l - mm, ScaleHeight - m - t) End Sub End Type Type ImageListBrowser From HyperControl Dim CurrentIndex As Integer Dim ImageListRef As ImageList Dim Images As New Image Dim ImageScrollBar As New ScrollBar Property Capacity Get getCapacity As Integer Dim Spacer As Integer Property ImageCount Get getImageCount As Integer Property ImageHeight Get getImageHeight Set setImageHeight As Integer Property ImageWidth Get getImageWidth Set setImageWidth As Integer Event ImageSelected(index As Integer) ' METHODS for object: ImageListBrowser Function getCapacity() As Integer ' Default method for procedural property "Capacity" dim capacity as integer dim pixW as integer dim spacedW as integer If ImageListRef Then With ImageListRef ' get the width of a single image with leading & trailing spacer (in pixels) spacedW = .ImageWidth + 2 * Spacer ' get the width of the Images area (in pixels) pixW = Images.Width / Screen.TwipsPerPixelX ' compute the capacity capacity = pixW / spacedW End With Else capacity = 0 End If getCapacity = capacity End Function Function getImageCount() As Integer ' Default method for procedural property "ImageCount" getImageCount = IIf(ImageListRef, ImageListRef.Count, 0) End Function Function getImageHeight() As Integer ' Default method for procedural property "ImageHeight" getImageHeight = IIf(ImageListRef, ImageListRef.ImageHeight, 0) End Function Function getImageWidth() As Integer ' Default method for procedural property "ImageWidth" getImageWidth = IIf(ImageListRef, ImageListRef.ImageWidth, 0) End Function Sub ImageScrollBar_Change() Images.Cls End Sub Sub Images_KeyUp(keyCode As Integer, ByVal shift As Integer) Dim index As Integer Dim indexPos As Integer dim textY As Integer Dim startpos As Integer Dim spacedW as Integer index = CurrentIndex If keyCode = 37 Then If CurrentIndex > 0 Then index = index - 1 ElseIf keyCode = 39 Then If CurrentIndex < ImageCount - 1 Then index = index + 1 Else Exit Sub End If If ImageListRef Then spacedW = Screen.TwipsPerPixelX * (ImageListRef.ImageWidth + 2 * Spacer) If ImageScrollBar.Visible Then startpos = ImageScrollBar.Value Else startpos = 0 End If If index <> CurrentIndex Then ' if we picked an item other than the currently selected item ' take care of highlighting/unhighlighting indexPos = (index - startpos) * spacedW textY = 48 * Screen.TwipsPerPixelY ' put highlight rectangle around current index Images.Rectangle(indexPos, textY, indexPos + spacedW, Images.Height) ' unhighlight the previously selected choice (remember we're xor'ing) indexPos = (CurrentIndex - startpos) * spacedW Images.Rectangle(indexPos, textY, indexPos + spacedW, Images.Height) CurrentIndex = index SendEvent ImageSelected(index) End If End If End Sub Sub Images_MouseUp(button As Integer, shift As Integer, x As Single, y As Single) dim index as integer dim indexPos as integer dim startpos As integer dim spacedW as integer dim textY as integer If ImageListRef Then spacedW = Screen.TwipsPerPixelX * (ImageListRef.ImageWidth + 2 * Spacer) If ImageScrollBar.Visible Then startpos = ImageScrollBar.Value Else startpos = 0 End If ' compute index for image we picked index = startpos + x / spacedW ' if we picked an item other than the currently selected item ' take care of highlighting/unhighlighting If (index <> CurrentIndex) Then indexPos = (index - startpos) * spacedW textY = 48 * Screen.TwipsPerPixelY ' put highlight rectangle around current index Images.Rectangle(indexPos, textY, indexPos + spacedW, Images.Height) ' unhighlight the previously selected choice (remember we're xor'ing) indexPos = (CurrentIndex - startpos) * spacedW Images.Rectangle(indexPos, textY, indexPos + spacedW, Images.Height) CurrentIndex = index SendEvent ImageSelected(index) End If End If End Sub Sub Images_Paint() dim i as integer dim capacity as integer dim indexPos as integer dim startpos As integer dim spacedW as integer dim spacedPixW as integer dim textXOffset, textY as integer dim twipsperpixx as integer dim twipsperpixy as integer twipsperpixx = Screen.TwipsPerPixelX twipsperpixy = Screen.TwipsPerPixelY If ImageListRef Then With ImageListRef capacity = Capacity If capacity < .Count Then ImageScrollBar.Visible = True ImageScrollBar.Max = .Count - capacity startpos = ImageScrollBar.Value Else capacity = .Count startpos = 0 ImageScrollBar.Visible = False End If spacedPixW = .ImageWidth + 2 * Spacer spacedW = spacedPixW * twipsperpixx textXOffset = 5 * twipsperpixx textY = 48 * twipsperpixy For i = 0 To capacity - 1 ' Use the imagelist's Draw to paint the images into the specified dc .Draw(startpos + i, Images.hDC, i * spacedPixW + Spacer, 0, 0) ' output text representing the index number indexPos = i * spacedW Images.MoveTo(indexPos + textXOffset, textY) Images.Print (startpos + i) ' put highlight rectangle around current index If (startpos + i) = CurrentIndex Then Images.Rectangle(indexPos, textY, indexPos + spacedW, Images.Height) End If Next i End With End If End Sub Sub Init(il As ImageList) ImageListRef = il End Sub Sub Resize() Images.Width = ScaleWidth Images.Height = ScaleHeight - ImageScrollBar.Height ImageScrollBar.Width = ScaleWidth ImageScrollBar.Top = Images.Height End Sub Sub SelectIndex(index As Integer) dim capacity As integer dim scrollVal as integer If ImageListRef && index >= 0 Then CurrentIndex = index ImageScrollBar.Max = ImageListRef.Count - 1 capacity = Capacity scrollVal = index - capacity + 1 If scrollVal < 0 Then scrollVal = 0 If capacity < ImageListRef.Count Then ImageScrollBar.Value = scrollVal ' Cause the images region to repaint Images.Cls End If End Sub Sub setImageHeight(newValue As Integer) ' Default method for procedural property "ImageHeight" If ImageListRef Then ImageListRef.ImageHeight = newValue End Sub Sub setImageWidth(newValue As Integer) ' Default method for procedural property "ImageWidth" If ImageListRef Then ImageListRef.ImageWidth = newValue End Sub End Type Type ImageListBuilderForm From Form Dim btnAddImage As New Button Dim btnRemoveImage As New Button Dim btnOK As New Button Dim font1 As New Font Dim OpenPanel As New OpenDialog Dim CurrentImageList As ImageList Dim Frame1 As New Frame Dim Frame2 As New Frame Dim opt16x16 As New OptionButton Dim opt32x32 As New OptionButton Dim optCustom As New OptionButton Dim txtWidth As New TextBox Dim txtHeight As New TextBox Dim Label2 As New Label Dim opt48x48 As New OptionButton Dim ImageBrowser As New ImageListBrowser ' METHODS for object: ImageListBuilderForm Sub btnAddImage_Click() Dim f As New File Static initialDir As String Dim newBmp As New Bitmap ' Set the initial dir and filename to previous selection (or empty). OpenPanel.InitialDir = initialDir OpenPanel.FileName = "" ' If a filename was picked, then create a bitmap object and add the bitmapt to the imagelist. If OpenPanel.Execute <> IDCANCEL Then f.FileName = OpenPanel.FileName initialDir = f.Path ' set the bitmpap to the selected bmp file newBmp.FileName = OpenPanel.FileName ' If the user has specified dimenions to use and the ' image list has no images in it already, set the dimensions ' on the image list If ImageBrowser.ImageCount = 0 && txtWidth.Text <> "" && txtHeight.Text <> "" Then ImageBrowser.ImageWidth = txtWidth.Text ImageBrowser.ImageHeight = txtHeight.Text End If ' Add the bitmap to the image list ' ...we may want to add feature for letting user specify mask color ' If the image list did not already have its dimensions set, this will ' end up setting the width and height of the image list to be based ' upon the bitmap's W & H ImageBrowser.ImageListRef.AddBitmapScaled(newBmp) UpdateForIndex(ImageBrowser.ImageCount - 1) End If End Sub Sub btnCancel_Click() ModalResult IDCANCEL Hide End Sub Sub btnOK_Click() ModalResult IDOK Hide End Sub Sub btnRemoveImage_Click() Dim index As Integer index = ImageBrowser.CurrentIndex If ImageBrowser.ImageListRef && index >= 0 Then ImageBrowser.ImageListRef.RemoveImage(index) If index <= 0 Then index = 1 UpdateForIndex(index - 1) End If End Sub Sub DoImageListProps(il As ImageList) ImageBrowser.Init(il) UpdateForIndex(0) ShowModal End Sub Sub opt16x16_Click() txtWidth.Text = "16" txtHeight.Text = "16" txtWidth.Enabled = False txtHeight.Enabled = False End Sub Sub opt32x32_Click() txtWidth.Text = "32" txtHeight.Text = "32" txtWidth.Enabled = False txtHeight.Enabled = False End Sub Sub opt48x48_Click() txtWidth.Text = "48" txtHeight.Text = "48" txtWidth.Enabled = False txtHeight.Enabled = False End Sub Sub optCustom_Click() txtWidth.Text = "0" txtHeight.Text = "0" txtWidth.Enabled = True txtHeight.Enabled = True End Sub Sub Preload() LoadForm End Sub Sub Resize() Frame1.Width = ScaleWidth - 2 * Frame1.Left ImageBrowser.Width = Frame1.Width - 300 btnAddImage.Left = Frame1.Left + 150 btnRemoveImage.Left = Frame1.Left + Frame1.Width - btnRemoveImage.Width - 150 End Sub Sub UpdateForIndex(index As Integer) dim capacity As integer dim scrollVal as integer ImageBrowser.SelectIndex(index) If ImageBrowser.ImageCount > 0 Then txtWidth.Text = ImageBrowser.ImageWidth txtHeight.Text = ImageBrowser.ImageHeight txtWidth.Enabled = False txtHeight.Enabled = False opt16x16.Enabled = False opt32x32.Enabled = False opt48x48.Enabled = False optCustom.Enabled = False Else txtWidth.Enabled = True txtHeight.Enabled = True opt16x16.Enabled = True opt32x32.Enabled = True opt48x48.Enabled = True optCustom.Enabled = True optCustom.Value = True txtWidth.Text = 0 txtHeight.Text = 0 End If End Sub End Type Type ComCtlObjEditor From ObjectEditor ' METHODS for object: ComCtlObjEditor Function DetailedEdit(obj As Object) As Long If TypeOf obj Is TabStrip Then TabPropertyForm.DoTabStripProps(obj) ElseIf TypeOf obj Is ListView Then ListViewPropsForm.DoListViewProps(obj) ElseIf TypeOf obj Is ImageList Then ImageListBuilderForm.DoImageListProps(obj) End If End Function End Type Type ImageSelectForm From Form Dim ImageBrowse As New ImageListBrowser Dim btnOK As New Button Dim btnCancel As New Button ' METHODS for object: ImageSelectForm Sub btnCancel_Click() Hide ModalResult -1 End Sub Sub btnOK_Click() Hide ModalResult ImageBrowse.CurrentIndex End Sub Function GetSelectionFromImageList(il As ImageList) As Long ImageBrowse.ImageListRef = il ImageBrowse.SelectIndex(0) GetSelectionFromImageList = ShowModal End Function End Type Type TabPropertyForm From Form Dim Label1 As New Label Dim txtIndex As New TextBox Dim Label2 As New Label Dim txtCaption As New TextBox Dim btnAddTab As New Button Dim btnRemoveTab As New Button Dim btnOK As New Button Dim CurrentTabStrip As TabStrip Dim btnPrev As New Button Dim font1 As New Font Dim btnNext As New Button Dim cboImages As New ObjectCombo Dim btnImagesEdit As New Button Dim btnImagesClear As New Button Dim btnImagesNew As New Button Dim Label3 As New Label Dim Label4 As New Label Dim txtIconIndex As New TextBox Dim Frame1 As New Frame Dim Frame2 As New Frame Dim btnSelect As New Button Dim chkMultiRow As New CheckBox Dim chkForms As New CheckBox ' METHODS for object: TabPropertyForm Sub btnAddTab_Click() Dim newTab, tabForm As Object ' Embed a new tab newTab = EmbedObject(CurrentTabStrip, FindObject("TabStripTab"), UniqueEmbedName(CurrentTabStrip, "AutoTab")) If chkForms.Value = 1 Then ' Embed a form onto the current tab striup's parent form and set the TabForm ref property tabForm = EmbedObject(CurrentTabStrip.Parent, FindObject("Form"), UniqueEmbedName(CurrentTabStrip.Parent, "SubForm")) newTab.TabForm = tabForm ' Invoke the Click method on the new tab to size the tabform newTab.Click End If UpdateForIndex(newTab.Index) End Sub Sub btnApply_Click() Dim t As TabStripTab CurrentTabStrip.ImageListRef = cboImages.SelObject t = TabFromIndex(Val(txtIndex.Text)) If t Then t.Caption = txtCaption.Text t.Icon = txtIconIndex.Text End If End Sub Sub btnImagesClear_Click() cboImages.SelObject = Nothing CurrentTabStrip.ImageListRef = Nothing End Sub Sub btnImagesEdit_Click() If cboImages.SelObject Then ImageListBuilderForm.DoImageListProps(cboImages.SelObject) CurrentTabStrip.ImageListRef = cboImages.SelObject End If End Sub Sub btnImagesNew_Click() cboImages.SelObject = CreateNewImageList btnImagesEdit_Click End Sub Sub btnNext_Click() UpdateForIndex(Val(txtIndex.Text) + 1) End Sub Sub btnOK_Click() Dim t As TabStripTab CurrentTabStrip.ImageListRef = cboImages.SelObject t = TabFromIndex(Val(txtIndex.Text)) If t Then t.Caption = txtCaption.Text t.Icon = txtIconIndex.Text End If ModalResult IDOK Hide End Sub Sub btnPrev_Click() UpdateForIndex(Val(txtIndex.Text) - 1) End Sub Sub btnRemoveTab_Click() Dim t As TabStripTab Dim index As Integer index = Val(txtIndex.Text) t = TabFromIndex(index) If t Then If t.TabForm Then DestroyObject(t.TabForm) DestroyObject(t) If index <= 0 Then index = 1 UpdateForIndex(index - 1) End If End Sub Sub btnSelect_Click() Dim index As Integer If cboImages.SelObject Then index = ImageSelectForm.GetSelectionFromImageList(cboImages.SelObject) If index >= 0 Then Dim t As TabStripTab txtIconIndex.Text = index t = TabFromIndex(Val(txtIndex.Text)) If t Then t.Icon = index End If End If End Sub Sub cboImages_Click() CurrentTabStrip.ImageListRef = cboImages.SelObject End Sub Sub chkMultiRow_Click() CurrentTabStrip.MultiRow = IIf(chkMultiRow.Value = 1, True, False) End Sub Function CreateNewImageList() As Object Dim newImageList As Object ' embed a new image list into the current list view newImageList = EmbedObject(CurrentTabStrip, FindObject("ImageList"), UniqueEmbedName(CurrentTabStrip, "Img")) ' add it to our combo boxes cboImages.AddItem(newImageList) CreateNewImageList = newImageList End Function Sub DoTabStripProps(ts As TabStrip) CurrentTabStrip = ts UpdateForIndex(0) PopulateCombo cboImages.SelObject = CurrentTabStrip.ImageListRef chkMultiRow.Value = IIf(CurrentTabStrip.MultiRow, 1, 0) chkForms.Value = 1 ShowModal End Sub Sub PopulateCombo Dim name As String Dim i As Integer cboImages.Clear cboImages.RootObject = FindObject("ImageList") ' Filter out 'ImageList' For i = cboImages.ListCount - 1 To 0 Step -1 name = cboImages.List(i) If name = "ImageList" Then cboImages.RemoveItem(i) Exit For End If Next i End Sub Sub Preload() LoadForm End Sub Function TabFromIndex(index As Integer) As TabStripTab dim t as TabStripTab For Each t EmbeddedIn CurrentTabStrip If t.Index = index Then TabFromIndex = t Exit For End If Next End Function Sub txtCaption_KeyUp(keyCode As Integer, ByVal shift As Integer) Dim t As TabStripTab t = TabFromIndex(Val(txtIndex.Text)) If t Then t.Caption = txtCaption.Text End Sub Sub txtIconIndex_KeyPress(keyAscii As Integer) ' Allow backspace straight through... If keyAscii = 8 Then Exit Sub ' Restrict digits to 0-9 If Not (keyAscii >= Asc("0") && keyAscii <= Asc("9")) Then keyAscii = 0 End Sub Sub txtIconIndex_KeyUp(keyCode As Integer, ByVal shift As Integer) Dim t As TabStripTab t = TabFromIndex(Val(txtIndex.Text)) If t Then t.Icon = IIf(txtIconIndex.Text = "", -1, Val(txtIconIndex.Text)) End Sub Sub UpdateForIndex(index As Integer) Dim t As TabStripTab t = TabFromIndex(index) If t Then txtIndex.Enabled = True txtCaption.Enabled = True txtIconIndex.Enabled = True txtIndex.Text = index txtCaption.Text = t.Caption txtIconIndex.Text = IIf(t.Icon >= 0, t.Icon, "") ' see if we can get the one after this...if not disble me If Not TabFromIndex(index + 1) Then btnNext.Enabled = False Else btnNext.Enabled = True End If If index = 0 Then btnPrev.Enabled = False Else btnPrev.Enabled = True End If CurrentTabStrip.SelectedItem = t If t.TabForm Then t.TabForm.BringToTop Else txtIndex.Text = "" txtCaption.Text = "" txtIconIndex.Text = "" txtIndex.Enabled = False txtCaption.Enabled = False txtIconIndex.Enabled = False End If End Sub End Type Type ListViewPropsForm From Form Dim Label1 As New Label Dim txtIndex As New TextBox Dim Label2 As New Label Dim txtCaption As New TextBox Dim btnAddHdr As New Button Dim btnRemoveHdr As New Button Dim btnOK As New Button Dim btnPrev As New Button Dim font1 As New Font Dim btnNext As New Button Dim CurrentListView As ListView Dim Label3 As New Label Dim Label4 As New Label Dim cboSmall As New ObjectCombo Dim cboLarge As New ObjectCombo Dim btnSmallEdit As New Button Dim btnLargeEdit As New Button Dim btnSmallClear As New Button Dim btnLargeClear As New Button Dim btnSmallNew As New Button Dim btnLargeNew As New Button Dim Frame1 As New Frame Dim Frame2 As New Frame Dim Label5 As New Label Dim txtWidth As New TextBox ' METHODS for object: ListViewPropsForm Sub btnAddHdr_Click() Dim newHdr As Object newHdr = EmbedObject(CurrentListView, FindObject("ColumnHeader"), UniqueEmbedName(CurrentListView, "Hdr")) UpdateForIndex(newHdr.SubItemIndex) CurrentListView.Refresh End Sub Sub btnLargeClear_Click() cboLarge.SelObject = Nothing CurrentListView.LargeIcons = Nothing End Sub Sub btnLargeEdit_Click() If cboLarge.SelObject Then ImageListBuilderForm.DoImageListProps(cboLarge.SelObject) CurrentListView.LargeIcons = cboLarge.SelObject End If End Sub Sub btnLargeNew_Click() cboLarge.SelObject = CreateNewImageList btnLargeEdit_Click End Sub Sub btnNext_Click() UpdateForIndex(Val(txtIndex.Text) + 1) End Sub Sub btnOK_Click() Dim h As ColumnHeader h = HeaderFromIndex(Val(txtIndex.Text)) If h Then h.Caption = txtCaption.Text h.Width = txtWidth.Text End If CurrentListView.SmallIcons = cboSmall.SelObject CurrentListView.LargeIcons = cboLarge.SelObject ModalResult IDOK Hide End Sub Sub btnPrev_Click() UpdateForIndex(Val(txtIndex.Text) - 1) End Sub Sub btnRemoveHdr_Click() Dim h As ColumnHeader Dim index As Integer index = Val(txtIndex.Text) h = HeaderFromIndex(index) If h Then DestroyObject(h) If index <= 0 Then index = 1 UpdateForIndex(index - 1) CurrentListView.Refresh End If End Sub Sub btnSmallClear_Click() cboSmall.SelObject = Nothing CurrentListView.SmallIcons = Nothing End Sub Sub btnSmallEdit_Click() If cboSmall.SelObject Then ImageListBuilderForm.DoImageListProps(cboSmall.SelObject) CurrentListView.SmallIcons = cboSmall.SelObject End If End Sub Sub btnSmallNew_Click() cboSmall.SelObject = CreateNewImageList btnSmallEdit_Click End Sub Sub cboLarge_Click() CurrentListView.LargeIcons = cboLarge.SelObject End Sub Sub cboSmall_Click() CurrentListView.SmallIcons = cboSmall.SelObject End Sub Function CreateNewImageList() As Object Dim newImageList As Object ' embed a new image list into the current list view newImageList = EmbedObject(CurrentListView, FindObject("ImageList"), UniqueEmbedName(CurrentListView, "Img")) ' add it to our combo boxes cboSmall.AddItem(newImageList) cboLarge.AddItem(newImageList) CreateNewImageList = newImageList End Function Sub DoListViewProps(lv As ListView) CurrentListView = lv UpdateForIndex(0) PopulateCombos cboSmall.SelObject = CurrentListView.SmallIcons cboLarge.SelObject = CurrentListView.LargeIcons ShowModal End Sub Function HeaderFromIndex(index As Integer) As ColumnHeader dim h as ColumnHeader For Each h EmbeddedIn CurrentListView If h.SubItemIndex = index Then HeaderFromIndex = h Exit For End If Next End Function Sub PopulateCombos Dim name As String Dim i As Integer cboSmall.Clear cboLarge.Clear cboSmall.RootObject = FindObject("ImageList") cboLarge.RootObject = FindObject("ImageList") ' Filter out 'ImageList' For i = cboSmall.ListCount - 1 To 0 Step -1 name = cboSmall.List(i) If name = "ImageList" Then cboSmall.RemoveItem(i) cboLarge.RemoveItem(i) Exit For End If Next i End Sub Sub Preload() LoadForm End Sub Sub txtCaption_KeyUp(keyCode As Integer, ByVal shift As Integer) Dim h As ColumnHeader h = HeaderFromIndex(Val(txtIndex.Text)) If h Then h.Caption = txtCaption.Text End Sub Sub txtWidth_KeyUp(keyCode As Integer, ByVal shift As Integer) Dim h As ColumnHeader h = HeaderFromIndex(Val(txtIndex.Text)) If h Then h.Width = txtWidth.Text End Sub Sub UpdateForIndex(index As Integer) Dim h As ColumnHeader h = HeaderFromIndex(index) If h Then txtIndex.Text = index txtCaption.Enabled = True txtCaption.Text = h.Caption txtWidth.Enabled = True txtWidth.Text = h.Width If index < CurrentListView.NumColumns - 1 Then btnNext.Enabled = True Else btnNext.Enabled = False End If If index = 0 Then btnPrev.Enabled = False Else btnPrev.Enabled = True End If Else txtIndex.Text = "" txtCaption.Text = "" txtWidth.Text = "" txtCaption.Enabled = False txtWidth.Enabled = False End If End Sub End Type Type RegistryKey Dim key As Long Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long Declare Function RegOpenKeyA Lib "advapi32" (ByVal hKey As Long, ByVal subKey As String, returnKey As Long) As Long Declare Function RegQueryValueA Lib "advapi32" (ByVal hKey As Long, ByVal subKey As String, ByVal value As String, valsiz As Long) As Long Dim path As String Dim enumcnt As Long Declare Function RegEnumKeyA Lib "advapi32" (ByVal hKey As Long, ByVal subKey As Long, ByVal name As String, ByVal namsiz As Long) As Long ' METHODS for object: RegistryKey Function Close() As Long Close = RegCloseKey(key) End Function Function NextKey(s as string) As Long s = Space(251) NextKey = RegEnumKeyA(key, enumcnt, s, 250) enumcnt = enumcnt + 1 End Function Function OpenClasses(skey as string) As Long dim k as long k = "0x80000000" path = skey OpenClasses = RegOpenKeyA(k, path, key) End Function Function OpenMachine(skey as string) As Long dim k as long k = "0x80000002" path = skey OpenMachine = RegOpenKeyA(k, path, key) End Function Function OpenUser(skey as string) As Long dim k as long k = "0x80000001" path = skey OpenUser = RegOpenKeyA(k, path, key) End Function Function OpenUsers(skey as string) As Long dim k as long k = "0x80000003" path = skey OpenUsers = RegOpenKeyA(k, path, key) End Function Function Start(s as string) As Long enumcnt = 0 Start = NextKey(s) End Function Function Value(path as string, v as string) As Long v = Space(251) Value = RegQueryValueA(key, path, v, 250) End Function End Type Type HashObjList From ListBox Dim HashObjs As New HashStringObject Dim selectedobj As Object Event SelectObj() ' METHODS for object: HashObjList Function AddObject(s as string, o as object) As Integer HashObjs.InsertKeyAndValue(s, o) AddObject = AddItem(s) End Function Sub Click() dim f as integer selectedobj = HashObjs.FindValue(Text, f) If f Then SendEvent SelectObj End If End Sub Sub Empty() Clear HashObjs.Clear selectedobj = Nothing End Sub End Type Type OcxRegEntry Dim RegKey As String Dim ClassName As String Dim Tag As String Dim ResId As Integer Dim ControlName As String Dim BitmapFile As String Dim OcxFile As String Declare Function RegisterOcx Lib "eviui2.dll" Alias "_RegisterOcx" (ByVal s As String, ByVal r As Long) As Long ' METHODS for object: OcxRegEntry Sub AddOcx(r as RegistryKey, cid as string, lst as HashObjList) dim nocx as new OcxRegEntry dim spid,sfile,sicon,nn as string dim l as integer If r.Value(cid & "\Control", nocx.Tag) = 0 Then spid = cid & "\ProgID" sicon = cid & "\ToolboxBitmap32" sfile = cid & "\InprocServer32" r.Value(spid, nocx.ClassName) r.Value(sicon, nocx.BitmapFile) r.Value(cid, nocx.Tag) r.Value(sfile, nocx.OcxFile) nocx.RegKey = "CLSID\" & cid l = Instr(nocx.BitmapFile, ", ") nocx.ResId = Val(Mid$(nocx.BitmapFile, l + 2)) nocx.BitmapFile = Left$(nocx.BitmapFile, l - 1) l = Instr(nocx.ClassName, ".") nn = Mid$(nocx.ClassName, l + 1) l = Instr(nn, ".") If l > 0 Then nn = Left$(nn, l - 1) End If nocx.ControlName = nn & "Ocx" lst.AddObject(nocx.Tag, nocx) End If End Sub Sub AddToPalette() dim ng as ToolGadget Dim nocx as Ocx Dim X as Integer ' Strip blanks from name Do While Instr(ControlName, " ") X = Instr(ControlName, " ") ControlName = Left$(ControlName, X - 1) & Mid$(ControlName, X + 1) Loop If FindEmbed(ControlTools.Palette, "GadOcx" & ControlName) Then MessageBox.Message("Duplicate control error", "A control with the name, " & "GadOcx" & ControlName & ", is already on the Controls Palette") Else ng = EmbedObject(ControlTools.Palette, ControlTools.Gadget, "GadOcx" & ControlName) ng.GadgetObject = ControlName nocx = CopyObject(Ocx, ControlName) nocx.OCXClassName = ClassName With ng.bitmap .LoadType = "ResourceBased" .FileName = BitmapFile .ResId = ResId End With ControlTools.Palette.ForceLayout(0) End If End Sub Sub Fill(lst as HashObjList) dim r as new RegistryKey dim s1,s2 as string r.OpenClasses("CLSID") If r.Start(s1) = 0 Then While r.NextKey(s1) = 0 AddOcx(r, s1, lst) Wend End If r.Close End Sub Function Register() As Integer OpenDialog.DefaultExtension = "ocx" OpenDialog.Filter = "OleCustomControl|*.ocx" If OpenDialog.Execute = IDOK Then MessageBox.style = 48 If RegisterOcx(OpenDialog.FileName, 1) Then MessageBox.Message("Ocx Registration", "Registration Succeeded") Register = -1 Else MessageBox.Message("Ocx Registration", "Registration Failed") Register = 0 End If Else Register = 0 End If End Function Sub RemoveFromPalette() Dim X as Integer ' Strip blanks from name Do While Instr(ControlName, " ") X = Instr(ControlName, " ") ControlName = Left$(ControlName, X - 1) & Mid$(ControlName, X + 1) Loop DestroyObject(FindObject(ControlName)) DestroyObject(FindEmbed(ControlTools.Palette, "GadOcx" & ControlName)) ControlTools.Palette.ForceLayout(0) End Sub Function Unregister(s as string) As Integer MessageBox.style = 48 If RegisterOcx(s, 0) Then MessageBox.Message("Ocx Registration", "Unregistration Succeeded") Unregister = -1 Else MessageBox.Message("Ocx Registration", "Unregistration Failed") Unregister = 0 End If End Function End Type Type OcxTool From Form Dim OcxList As New HashObjList Dim TextBox1 As New TextBox Dim Image1 As New Image Dim Button3 As New Button Dim Button4 As New Button Dim TextBox2 As New TextBox Dim Button5 As New Button Dim Button6 As New Button Dim Frame1 As New Frame Dim Frame2 As New Frame Dim Frame3 As New Frame Dim Frame4 As New Frame Dim PaletteGroup As New Group Dim RegisterGroup As New Group Type TabStrip1 From TabStrip Dim AutoTab1 As New TabStripTab Dim AutoTab2 As New TabStripTab ' METHODS for object: OcxTool.TabStrip1 Sub AutoTab1_Click() If OcxTool.RegisterGroup(0).Visible = False Then OcxTool.ToggleControls End Sub Sub AutoTab2_Click() If OcxTool.RegisterGroup(0).Visible = True Then OcxTool.ToggleControls End Sub End Type ' METHODS for object: OcxTool Sub Resize() Dim LTop as single ScaleMode = 3 ' Pixels ' Ensure that we have minimum size If (ScaleHeight < 175) Then Height = 210 * Screen.TwipsPerPixelY ' The Height will cause another resize, so Exit Sub to avoid redundance Exit Sub End If If (ScaleWidth < 335) Then Width = 345 * Screen.TwipsPerPixelX ' Ditto Exit Sub End If ' The Actual Resize Stuff TabStrip1.Move(10, 10, ScaleWidth - 20, ScaleHeight - 20) Frame4.Move(20, 40, ScaleWidth - 40, ScaleHeight - 130) LTop = Frame4.Top + Frame4.Height Frame1.Move(20, LTop, ScaleWidth - 40, 70) Frame2.Move(20, LTop, ScaleWidth - 160, 70) Frame3.Move(ScaleWidth - 140, LTop, 120, 70) OcxList.Move(30, 60, ScaleWidth - 60, ScaleHeight - 150) Image1.Move(Frame2.Left + Frame2.Width - 40, Frame2.Top + 24, 30, 30) TextBox1.Move(30, Frame2.Top + 20, Image1.Left - 40, 40) Button3.Move(Frame3.Left + 10, Frame3.Top + 20, 100, 20) Button4.Move(Frame3.Left + 10, Frame3.Top + 40, 100, 20) Button5.Move(Frame1.Left + Frame1.Width - 10 - 80, Frame1.Top + 20, 80, 20) Button6.Move(Button5.Left, Button5.Top + 20, 80, 20) TextBox2.Move(30, Frame2.Top + 20, Button5.Left - 40, Frame1.Height - 30) Refresh End Sub Sub Button1_Click() OcxRegEntry.Fill(OcxList) End Sub Sub Button2_Click() OcxList.Empty Image1.Picture = Nothing TextBox1.Text = "" TextBox2.Text = "" End Sub Sub Button3_Click() If OcxList.selectedobj <> Nothing Then OcxList.selectedobj.AddToPalette End If End Sub Sub Button4_Click() If OcxList.selectedobj <> Nothing Then OcxList.selectedobj.RemoveFromPalette End If End Sub Sub Button5_Click() If OcxRegEntry.Register Then Button2_Click OcxRegEntry.Fill(OcxList) End If End Sub Sub Button6_Click() If OcxRegEntry.Unregister(TextBox2.Text) Then Button2_Click OcxRegEntry.Fill(OcxList) End If End Sub Sub Load() OcxRegEntry.Fill(OcxList) TextBox1.Text = "" TextBox2.Text = "" End Sub Sub OcxList_SelectObj() Dim hocx as OcxRegEntry Dim bm as new Bitmap hocx = OcxList.selectedobj If hocx <> Nothing Then TextBox1.Text = hocx.ClassName TextBox2.Text = hocx.OcxFile With bm .LoadType = "ResourceBased" .FileName = hocx.BitmapFile .ResId = hocx.ResId End With Image1.Picture = bm Image1.Refresh End If End Sub Sub ToggleControls Dim o as Control Dim PalOn as Boolean ' PalOn represents if the PaletteGroup is visible at the beginning ' of the method PalOn = PaletteGroup(0).Visible For Each o In PaletteGroup o.Visible = Not PalOn Next o For Each o In RegisterGroup o.Visible = PalOn Next o End Sub End Type Begin Code ' Reconstruction commands for object: SampleMasterFormHelpMenu ' With SampleMasterFormHelpMenu .InsertItem("HelpContents", "&Contents", -1) End With 'SampleMasterFormHelpMenu ' Reconstruction commands for object: Envelop ' With Envelop .ModulePath := "base.ebo;win32.ebo;dialogs.ebo;tools.ebo;database.ebo;dbtools.ebo;options.ebo;envelop.ebo;evhelp.ebo" .MainForm := EnvelopForm .Path := "D:\ENVELOP\PROGRAM\" .EXEName := "ENVELOP" .SplashFileName := "evsplash.bmp" With .Help .FileName := "D:\ENVELOP\PROGRAM\..\help\envelop.hlp" .IsShowing := -1 End With 'Envelop.Help With .EBOOpen .FileName := "W:\source\envelop\loadtest.eto" .Filter := "Envelop binary (*.ebo)|*.ebo|Envelop text (*.eto)|*.eto|Envelop temp (ebo*.tmp)|ebo*.tmp|All files (*.*)|*.*|" .FilterIndex := 2 .NoChangeDir := False End With 'Envelop.EBOOpen With .ETOOpen .FileName := "D:\envelop\My God, we're caught in quicksand.eto" .Filter := "Envelop text (*.eto)|*.eto|Text files (*.txt)|*.txt|All files (*.*)|*.*|" .FilterIndex := 1 End With 'Envelop.ETOOpen With .SADlg .Title := "Save Module As" .FileName := "W:\SOURCE\ENVELOP\envelop.eto" .Filter := "Envelop binary (*.ebo)" .FilterIndex := 2 .InitialDir := "D:\envelop\" .NoChangeDir := True End With 'Envelop.SADlg End With 'Envelop ' Reconstruction commands for object: ProjectStartupOptionsDialog ' With ProjectStartupOptionsDialog .Caption := "Startup Options" .Move(3660, 3372, 4956, 2460) .DefaultButton := ProjectStartupOptionsDialog.BtnOK .CancelButton := ProjectStartupOptionsDialog.BtnCancel .MaxButton := False With .BtnOK .Caption := "OK" .ZOrder := 7 .Move(3840, 60, 960, 360) End With 'ProjectStartupOptionsDialog.BtnOK With .BtnCancel .Caption := "Cancel" .ZOrder := 8 .Move(3840, 480, 960, 360) End With 'ProjectStartupOptionsDialog.BtnCancel With .OptDefaultProj .Caption := "Start with automatic default project" .ZOrder := 2 .Move(60, 60, 3720, 300) .TabGroup := True End With 'ProjectStartupOptionsDialog.OptDefaultProj With .OptShowDialog .Caption := "Display project startup dialog" .ZOrder := 3 .Move(60, 480, 3720, 300) End With 'ProjectStartupOptionsDialog.OptShowDialog With .OptNewProj .Caption := "Configure new project" .ZOrder := 4 .Move(60, 900, 3720, 300) End With 'ProjectStartupOptionsDialog.OptNewProj With .OptOpenProj .Caption := "Browse for existing project" .ZOrder := 5 .Move(60, 1320, 3720, 300) End With 'ProjectStartupOptionsDialog.OptOpenProj With .OptNoProj .Caption := "Start with no project" .ZOrder := 6 .Move(60, 1740, 3720, 300) End With 'ProjectStartupOptionsDialog.OptNoProj End With 'ProjectStartupOptionsDialog ' Reconstruction commands for object: GadgetConfigWizard ' With GadgetConfigWizard .title_ := "Configure Tool Gadget" .Title := "Configure Tool Gadget" .GraphicFileName := "envelop.ero" .FirstStep := GadgetConfigWizard.ToolName .LastStep := GadgetConfigWizard.ToolBitmap With .ToolName .Caption := "Configure Tool Gadget" .Move(4860, 4770, 7155, 4815) .DefaultButton := GadgetConfigWizard.ToolName.BtnNext .CancelButton := GadgetConfigWizard.ToolName.BtnCancel .wizard := GadgetConfigWizard .NextStep := GadgetConfigWizard.ToolHintText .initialized := -1 With .TBName .ZOrder := 1 .Move(2850, 1350, 4050, 300) End With 'GadgetConfigWizard.ToolName.TBName With .BtnFinish .ZOrder := 5 .Move(6225, 4050, 825, 300) End With 'GadgetConfigWizard.ToolName.BtnFinish With .BtnNext .ZOrder := 4 .Move(5325, 4050, 825, 300) End With 'GadgetConfigWizard.ToolName.BtnNext With .BtnBack .Enabled := False .ZOrder := 3 .Move(4500, 4050, 825, 300) End With 'GadgetConfigWizard.ToolName.BtnBack With .BtnCancel .ZOrder := 2 .Move(3600, 4050, 825, 300) End With 'GadgetConfigWizard.ToolName.BtnCancel With .ImgGraphic .ZOrder := 8 .Move(225, 225, 2475, 3150) .Picture := GadgetConfigWizard.Bitmap End With 'GadgetConfigWizard.ToolName.ImgGraphic With .LblInstruction .Caption := "Enter a Name for the ToolGadget." .ZOrder := 7 .Move(2850, 300, 4125, 375) End With 'GadgetConfigWizard.ToolName.LblInstruction With .Frame1 .ZOrder := 6 .Move(75, 3825, 6975, 75) End With 'GadgetConfigWizard.ToolName.Frame1 End With 'GadgetConfigWizard.ToolName With .ToolHintText .Caption := "Configure Tool Gadget" .Move(4860, 4770, 7155, 4815) .DefaultButton := GadgetConfigWizard.ToolHintText.BtnNext .CancelButton := Nothing .wizard := GadgetConfigWizard .NextStep := GadgetConfigWizard.ToolBitmap .BackStep := GadgetConfigWizard.ToolName With .TBHintText .ZOrder := 1 .Move(2850, 1200, 4050, 600) End With 'GadgetConfigWizard.ToolHintText.TBHintText With .BtnFinish .ZOrder := 5 .Move(6225, 4050, 825, 300) End With 'GadgetConfigWizard.ToolHintText.BtnFinish With .BtnNext .ZOrder := 4 .Move(5325, 4050, 825, 300) End With 'GadgetConfigWizard.ToolHintText.BtnNext With .BtnBack .ZOrder := 3 .Move(4500, 4050, 825, 300) End With 'GadgetConfigWizard.ToolHintText.BtnBack With .BtnCancel .ZOrder := 2 .Move(3600, 4050, 825, 300) End With 'GadgetConfigWizard.ToolHintText.BtnCancel With .ImgGraphic .ZOrder := 8 .Move(225, 225, 2475, 3150) .Picture := GadgetConfigWizard.Bitmap End With 'GadgetConfigWizard.ToolHintText.ImgGraphic With .LblInstruction .Caption := "Enter a HintText for the ToolGadget." .ZOrder := 7 .Move(2850, 300, 4125, 300) End With 'GadgetConfigWizard.ToolHintText.LblInstruction With .Frame1 .ZOrder := 6 .Move(75, 3825, 6975, 75) End With 'GadgetConfigWizard.ToolHintText.Frame1 End With 'GadgetConfigWizard.ToolHintText With .ToolBitmap .Caption := "Configure Tool Gadget" .Move(4860, 4770, 7155, 4815) .DefaultButton := GadgetConfigWizard.ToolBitmap.BtnFinish .CancelButton := Nothing .wizard := GadgetConfigWizard .BackStep := GadgetConfigWizard.ToolHintText With .LblBitmap .Caption := "Picture file:" .ZOrder := 5 .Move(2850, 825, 1500, 225) End With 'GadgetConfigWizard.ToolBitmap.LblBitmap With .TBBitmap .Caption := "TBBitmap" .ZOrder := 4 .Move(2850, 1125, 4050, 450) End With 'GadgetConfigWizard.ToolBitmap.TBBitmap With .BTNBrowse .Caption := "Browse..." .ZOrder := 3 .Move(2850, 1725, 1050, 375) End With 'GadgetConfigWizard.ToolBitmap.BTNBrowse With .SampleBox .Caption := "SampleBox" .ZOrder := 2 .Move(4785, 2835, 240, 240) .Visible := True With .PreviewTool .Position := 1 .HintText := "New Object" With .bitmap .FileName := "envelop.ero" .ResId := 0 End With 'GadgetConfigWizard.ToolBitmap.SampleBox.PreviewTool.bitmap End With 'GadgetConfigWizard.ToolBitmap.SampleBox.PreviewTool End With 'GadgetConfigWizard.ToolBitmap.SampleBox With .BTNPreview .Caption := "Preview" .ZOrder := 1 .Move(5625, 1725, 1200, 375) End With 'GadgetConfigWizard.ToolBitmap.BTNPreview With .BtnFinish .ZOrder := 9 .Move(6225, 4050, 825, 300) End With 'GadgetConfigWizard.ToolBitmap.BtnFinish With .BtnNext .Enabled := False .ZOrder := 8 .Move(5325, 4050, 825, 300) End With 'GadgetConfigWizard.ToolBitmap.BtnNext With .BtnBack .ZOrder := 7 .Move(4500, 4050, 825, 300) End With 'GadgetConfigWizard.ToolBitmap.BtnBack With .BtnCancel .ZOrder := 6 .Move(3600, 4050, 825, 300) End With 'GadgetConfigWizard.ToolBitmap.BtnCancel With .ImgGraphic .ZOrder := 12 .Move(225, 225, 2475, 3150) .Picture := GadgetConfigWizard.Bitmap End With 'GadgetConfigWizard.ToolBitmap.ImgGraphic With .LblInstruction .Caption := "Type a FileName for the bitmap or the ToolGadget, or press Browse..." .ZOrder := 11 .Move(2850, 300, 4125, 450) End With 'GadgetConfigWizard.ToolBitmap.LblInstruction With .Frame1 .ZOrder := 10 .Move(75, 3825, 6975, 75) End With 'GadgetConfigWizard.ToolBitmap.Frame1 End With 'GadgetConfigWizard.ToolBitmap With .TempGadget .HintText := "New Object" .PsuedoName := "NewObject" With .bitmap .FileName := "envelop.ero" .ResId := 244 End With 'GadgetConfigWizard.TempGadget.bitmap End With 'GadgetConfigWizard.TempGadget With .BlankBitmap .LoadType := "MemoryBased" .FileName := "envelop.ero" .ResId := 488 End With 'GadgetConfigWizard.BlankBitmap With .Bitmap .LoadType := "MemoryBased" .FileName := "envelop.ero" .ResId := 880 End With 'GadgetConfigWizard.Bitmap End With 'GadgetConfigWizard ' Reconstruction commands for object: ObjectEditor ' With ObjectEditor .Enabled := True End With 'ObjectEditor ' Reconstruction commands for object: MethodEditor ' With MethodEditor .AnimateDelay := 100 .HighlightSyntax := True .BackColor := 16777215 .ForeColor := 0 .ColorNextStmtFG := 16777215 .ColorNextStmtBG := 32768 .ColorEnabledBreakFG := 16777215 .ColorEnabledBreakBG := 255 .ColorDisabledBreakFG := 16777215 .ColorDisabledBreakBG := 128 .ColorCommentFG := 32768 .ColorCommentBG := -1 .ColorKeywordFG := 8388608 .ColorKeywordBG := -1 .ColorIdentifierFG := -1 .ColorIdentifierBG := -1 .ColorStringFG := -1 .ColorStringBG := -1 .ColorIntegerFG := -1 .ColorIntegerBG := -1 .ColorFloatFG := -1 .ColorFloatBG := -1 .ColorOctalFG := -1 .ColorOctalBG := -1 .ColorHexFG := -1 .ColorHexBG := -1 .ColorOperatorFG := -1 .ColorOperatorBG := -1 End With 'MethodEditor ' Reconstruction commands for object: ObjectEditorMgr ' With ObjectEditorMgr .UndoLimit := 5 .RedoLimit := 5 End With 'ObjectEditorMgr ' Reconstruction commands for object: SamplesBrowser ' With SamplesBrowser .Caption := "Samples Browser" .Font := EnvelopFont .Move(4065, 1815, 6570, 6720) .AccelForm := EnvelopForm .CurrentSampleModule := Nothing .CurrentSecondModule := Nothing .DirBasicTraining := "W:\BIN\..\bootcamp\basic" .DirAdvancedTraining := "W:\BIN\..\bootcamp\advanced" .DirConceptsTraining := "W:\BIN\..\bootcamp\concepts" .DirComponents := "W:\BIN\..\arsenal\parts" .DirApplications := "W:\BIN\..\arsenal\apps" .DirTools := "W:\BIN\..\arsenal\tools" .ScanCategory := "" .initializing := 0 .PopulateMasterListPunchOut := 0 With .ChkBasicTraining .Caption := "Basic Training" .ZOrder := 2 .Move(2250, 150, 1980, 225) End With 'SamplesBrowser.ChkBasicTraining With .ChkAdvancedTraining .Caption := "Advanced Training" .ZOrder := 3 .Move(2250, 450, 1980, 225) End With 'SamplesBrowser.ChkAdvancedTraining With .ChkConceptsTraining .Caption := "Concepts Training" .ZOrder := 4 .Move(2250, 750, 1980, 165) End With 'SamplesBrowser.ChkConceptsTraining With .ChkComponents .Caption := "Components" .ZOrder := 5 .Move(4650, 150, 1500, 225) End With 'SamplesBrowser.ChkComponents With .ChkApplications .Caption := "Applications" .ZOrder := 6 .Move(4650, 450, 1500, 225) End With 'SamplesBrowser.ChkApplications With .ChkTools .Caption := "Tools" .ZOrder := 7 .Move(4650, 750, 1500, 165) End With 'SamplesBrowser.ChkTools With .ChkKeywordSearch .Caption := "Search by keyword" .ZOrder := 8 .Move(150, 1050, 2385, 300) End With 'SamplesBrowser.ChkKeywordSearch With .Label1 .Caption := "Type a word, or select one from the list. Then choose Show Topics." .ForeColor := 16711680 .ZOrder := 9 .Move(705, 1425, 3960, 450) End With 'SamplesBrowser.Label1 With .TxtKeySearch .Enabled := False .ZOrder := 10 .Move(735, 1980, 3885, 345) End With 'SamplesBrowser.TxtKeySearch With .BtnShowTopics .Caption := "Show Topics" .Enabled := False .ZOrder := 11 .Move(4950, 1950, 1350, 345) End With 'SamplesBrowser.BtnShowTopics With .LstKeywords .Caption := "LstKeywords" .Enabled := False .ZOrder := 12 .Move(900, 2400, 5400, 1200) End With 'SamplesBrowser.LstKeywords With .Label2 .Caption := "Select topic then choose Load Sample or Help." .ForeColor := 16711680 .ZOrder := 13 .Move(150, 3960, 4575, 270) End With 'SamplesBrowser.Label2 With .BtnLoadSample .Caption := "Load Sample" .ZOrder := 14 .Move(4950, 3900, 1380, 345) End With 'SamplesBrowser.BtnLoadSample With .BtnHelp .Caption := "Help" .Enabled := False .ZOrder := 15 .Move(4950, 4350, 1380, 345) End With 'SamplesBrowser.BtnHelp With .LstTopics .Caption := "LstTopics" .ZOrder := 16 .Move(150, 4770, 6150, 1200) End With 'SamplesBrowser.LstTopics With .LstSearchMaster .ZOrder := 17 .Move(0, 0, 30, 30) .Visible := False End With 'SamplesBrowser.LstSearchMaster With .LstSampleNameIndex .ZOrder := 18 .Move(0, 0, 705, 30) .Visible := False End With 'SamplesBrowser.LstSampleNameIndex With .LblTopics .Caption := "<category>:<sample>" .ZOrder := 19 .Move(150, 4455, 3900, 240) End With 'SamplesBrowser.LblTopics With .helpfile End With 'SamplesBrowser.helpfile With .BtnUpdate .Caption := "Update" .Enabled := False .ZOrder := 1 .Move(150, 150, 1350, 345) End With 'SamplesBrowser.BtnUpdate End With 'SamplesBrowser ' Reconstruction commands for object: MenuSelector ' With MenuSelector .Caption := "Select Menu" .Font := DefaultDialogFont .Move(5160, 2295, 5340, 2295) .DefaultButton := MenuSelector.btnOK With .Label1 .Caption := "Select the menu or menubar to modify" .ZOrder := 7 .Move(150, 150, 4050, 300) End With 'MenuSelector.Label1 With .btnOK .Caption := "OK" .ZOrder := 6 .Move(4260, 150, 900, 345) End With 'MenuSelector.btnOK With .btnCancel .Caption := "Cancel" .ZOrder := 5 .Move(4260, 600, 900, 345) End With 'MenuSelector.btnCancel With .Label2 .Caption := "Menu Type:" .ZOrder := 4 .Move(150, 600, 1050, 300) End With 'MenuSelector.Label2 With .optMbar .Caption := "Menubar" .ZOrder := 2 .Move(1350, 600, 1800, 300) .TabStop := True End With 'MenuSelector.optMbar With .optPopup .Caption := "Popup" .ZOrder := 3 .Move(1350, 975, 1800, 300) End With 'MenuSelector.optPopup With .cboMenus .ZOrder := 1 .Move(150, 1425, 4920, 315) .ShowEmbeds := True End With 'MenuSelector.cboMenus End With 'MenuSelector ' Reconstruction commands for object: EnvelopFont ' With EnvelopFont .FaceName := "MS Sans Serif" .Size := 8.000000 .Bold := True .Italic := False .Strikethru := False End With 'EnvelopFont ' Reconstruction commands for object: ProjectAndModuleView ' With ProjectAndModuleView .BackColor := 12632256 .DragMode := "LeftMouse" .Move(-15, 376, 3570, 6165) .Visible := False .IconBitmap := ProjectAndModuleView.bitmap .kIconProject := 0 .kIconModule := 4 .kIconObject := 8 .kLevelProject := 0 .kLevelModule := 0 .kLevelObject := 0 With .bitmap .LoadType := "MemoryBased" .FileName := "envelop.ero" .ResId := 2588 End With 'ProjectAndModuleView.bitmap End With 'ProjectAndModuleView ' Reconstruction commands for object: Debug ' With Debug End With 'Debug ' Reconstruction commands for object: SourceIterator ' With SourceIterator .CurObject := Nothing .CurMethod := "" .HitStart := -1 .SearchPattern := "" End With 'SourceIterator ' Reconstruction commands for object: ApplicationEditor ' With ApplicationEditor With .form .Caption := "Application: Application1" .Font := EnvelopFont .Move(3735, 3480, 5550, 3495) .KeyPreview := True .AccelForm := EnvelopForm With .LblApp .Caption := "Application:" .ZOrder := 2 .Move(60, 105, 1095, 270) .Alignment := "Right" End With 'ApplicationEditor.form.LblApp With .CBApps .ZOrder := 3 .Move(1215, 60, 2250, 300) .RootObject := Application .Style := "Tree" End With 'ApplicationEditor.form.CBApps With .BtnNewApp .Caption := "&New Application..." .ZOrder := 4 .Move(3585, 45, 1785, 330) End With 'ApplicationEditor.form.BtnNewApp With .LblMainForm .Caption := "Main form:" .ZOrder := 5 .Move(60, 465, 1095, 270) .Alignment := "Right" End With 'ApplicationEditor.form.LblMainForm With .CBForms .ZOrder := 6 .Move(1215, 420, 2250, 300) .RootObject := Form .Style := "Tree" End With 'ApplicationEditor.form.CBForms With .LblEXE .Caption := "EXE file:" .ZOrder := 7 .Move(60, 855, 1095, 270) .Alignment := "Right" End With 'ApplicationEditor.form.LblEXE With .TEEXE .ZOrder := 8 .Move(1215, 810, 2250, 300) End With 'ApplicationEditor.form.TEEXE With .BtnBrowseEXE .Caption := "Browse EXE..." .ZOrder := 9 .Move(3585, 795, 1785, 330) End With 'ApplicationEditor.form.BtnBrowseEXE With .LblSplash .Caption := "Splash file:" .ZOrder := 10 .Move(60, 1245, 1095, 270) .Alignment := "Right" End With 'ApplicationEditor.form.LblSplash With .TESplash .ZOrder := 11 .Move(1215, 1200, 2250, 300) End With 'ApplicationEditor.form.TESplash With .BtnBrowseSplash .Caption := "Browse splash..." .ZOrder := 12 .Move(3585, 1185, 1785, 330) End With 'ApplicationEditor.form.BtnBrowseSplash With .LblModules .Caption := "Modules:" .ZOrder := 13 .Move(60, 1620, 1095, 270) .Alignment := "Right" End With 'ApplicationEditor.form.LblModules With .LstModules .ZOrder := 14 .Move(1215, 1620, 2250, 1395) .Sorted := False End With 'ApplicationEditor.form.LstModules With .BtnWriteEXE .Caption := "Write EXE" .ZOrder := 15 .Move(3585, 2700, 1785, 330) End With 'ApplicationEditor.form.BtnWriteEXE With .ChkNoMainForm .Caption := "No main form" .ZOrder := 16 .Move(3585, 435, 1800, 300) End With 'ApplicationEditor.form.ChkNoMainForm With .BtnAddModule .Caption := "Add module..." .ZOrder := 17 .Move(3585, 1590, 1785, 330) End With 'ApplicationEditor.form.BtnAddModule With .BtnDelModule .Caption := "Remove module..." .ZOrder := 1 .Move(3585, 1980, 1785, 330) End With 'ApplicationEditor.form.BtnDelModule End With 'ApplicationEditor.form End With 'ApplicationEditor ' Reconstruction commands for object: EnvelopScreenLayout ' With EnvelopScreenLayout End With 'EnvelopScreenLayout ' Reconstruction commands for object: WinDebug ' With WinDebug .Window := Nothing End With 'WinDebug ' Reconstruction commands for object: ObjectViewer ' With ObjectViewer .Caption := "Objects" .Font := EnvelopFont .PopupMenu := PopupMenu .Move(10665, 1815, 3660, 4380) .AccelForm := EnvelopForm With .ProjectView .ZOrder := 5 .Move(-30, 375, 3570, 3615) .Visible := True .ExpandOnDblClick := True .IconBitmap := ObjectViewer.ProjectView.bitmap .IconHeight := 12 .IconWidth := 20 .IndentWidth := 12 .kLevelModule := 1 .kLevelObject := 2 With .bitmap .ResId := 5104 End With 'ObjectViewer.ProjectView.bitmap End With 'ObjectViewer.ProjectView With .HierView .BackColor := 12632256 .DragMode := "LeftMouse" .ZOrder := 1 .Move(-30, 375, 3570, 3615) .Visible := False .dirty := True End With 'ObjectViewer.HierView With .ModuleView .ZOrder := 2 .Move(-30, 375, 3570, 3615) .ExpandOnDblClick := True .IconBitmap := ObjectViewer.ModuleView.bitmap .IconHeight := 12 .IconWidth := 20 .IndentWidth := 12 .kLevelProject := -1 .kLevelObject := 1 With .bitmap .ResId := 7620 End With 'ObjectViewer.ModuleView.bitmap End With 'ObjectViewer.ModuleView With .AlphaView .BackColor := 12632256 .DragMode := "LeftMouse" .ZOrder := 4 .Move(-30, 375, 3570, 3615) .Visible := False .ListIndex := 1 .SelObject := AboutEnvelopForm End With 'ObjectViewer.AlphaView With .toolbar .ZOrder := 3 .Move(-30, -30, 3570, 405) .LayoutStyle := "ToolBar" .MarginLeft := 5 .Visible := True With .ViewProject .Position := 1 .State := "Down" .ButtonType := "Exclusive" .HintText := "Project view" With .bitmap .FileName := "envelop.ero" .ResId := 10136 End With 'ObjectViewer.toolbar.ViewProject.bitmap End With 'ObjectViewer.toolbar.ViewProject With .ViewModule .Position := 2 .ButtonType := "Exclusive" .HintText := "Module view" With .bitmap .FileName := "envelop.ero" .ResId := 10380 End With 'ObjectViewer.toolbar.ViewModule.bitmap End With 'ObjectViewer.toolbar.ViewModule With .ViewAlphabetical .Position := 3 .ButtonType := "Exclusive" .HintText := "Objects: alphabetic view" With .bitmap .FileName := "envelop.ero" .ResId := 10624 End With 'ObjectViewer.toolbar.ViewAlphabetical.bitmap End With 'ObjectViewer.toolbar.ViewAlphabetical With .ViewHierarchical .Separator := 10 .Position := 4 .ButtonType := "Exclusive" .HintText := "Objects: inheritance view" With .bitmap .FileName := "envelop.ero" .ResId := 10868 End With 'ObjectViewer.toolbar.ViewHierarchical.bitmap End With 'ObjectViewer.toolbar.ViewHierarchical With .MakeCurrent .Separator := 11 .Position := 5 .HintText := "Make selected project/module current" With .bitmap .FileName := "envelop.ero" .ResId := 11112 End With 'ObjectViewer.toolbar.MakeCurrent.bitmap End With 'ObjectViewer.toolbar.MakeCurrent With .AddModule .Position := 6 .HintText := "Add module to project: Application1" With .bitmap .FileName := "envelop.ero" .ResId := 11356 End With 'ObjectViewer.toolbar.AddModule.bitmap End With 'ObjectViewer.toolbar.AddModule With .NewModule .Position := 7 .HintText := "New module" With .bitmap .FileName := "envelop.ero" .ResId := 11600 End With 'ObjectViewer.toolbar.NewModule.bitmap End With 'ObjectViewer.toolbar.NewModule With .LoadModule .Position := 8 .HintText := "Load module" With .bitmap .FileName := "envelop.ero" .ResId := 11844 End With 'ObjectViewer.toolbar.LoadModule.bitmap End With 'ObjectViewer.toolbar.LoadModule With .SaveModule .Position := 9 .HintText := "Save module: envelop.ebo" With .bitmap .FileName := "envelop.ero" .ResId := 12088 End With 'ObjectViewer.toolbar.SaveModule.bitmap End With 'ObjectViewer.toolbar.SaveModule With .UnloadModule .Enabled := False .Position := 10 .HintText := "Unload module" With .bitmap .FileName := "envelop.ero" .ResId := 12332 End With 'ObjectViewer.toolbar.UnloadModule.bitmap End With 'ObjectViewer.toolbar.UnloadModule End With 'ObjectViewer.toolbar With .ObjectEditorHook End With 'ObjectViewer.ObjectEditorHook With .ObjectPopup .InsertItem("ObjCopy", "&Copy Object: ...", -1) .InsertItem("ObjRename", "&Rename Object...", -1) .AccelKey = "Ctrl+R" .SetAccelerator("ObjRename", .AccelKey) .InsertItem("ObjAbstract", "&Abstract Object...", -1) .InsertSeparator(-1) .InsertItem("ObjMoveToModule", "&Move to <Intrinsic module>", -1) .AccelKey = "Ctrl+M" .SetAccelerator("ObjMoveToModule", .AccelKey) .InsertSeparator(-1) .InsertItem("ObjDestroy", "&Destroy Object", -1) .AccelKey = "Ctrl+D" .SetAccelerator("ObjDestroy", .AccelKey) End With 'ObjectViewer.ObjectPopup With .ModulePopup .InsertItem("ModSave", "&Save Module", -1) .AccelKey = "Ctrl+S" .SetAccelerator("ModSave", .AccelKey) .InsertItem("ModSaveAs", "Save Module &As...", -1) .InsertSeparator(-1) .InsertItem("MakeCurrent", "Select Module as &Current Module", -1) .InsertItem("ModAddToProj", "Add to Current &Project", -1) .InsertItem("ModRemoveFromProj", "&Remove From Current Project", -1) .InsertSeparator(-1) .InsertItem("ModUnload", "&Unload Module", -1) End With 'ObjectViewer.ModulePopup With .ProjectPopup .InsertItem("ProjSave", "&Save Project", -1) .InsertItem("ProjSaveAs", "Save Project &As...", -1) .InsertItem("ProjAddModules", "Add &Modules To Project...", -1) .InsertSeparator(-1) .InsertItem("MakeCurrent", "Select Project as &Current Project", -1) .InsertItem("ProjWriteEXE", "Write E&XE", -1) .InsertSeparator(-1) .InsertItem("ProjClose", "&Close Project", -1) End With 'ObjectViewer.ProjectPopup End With 'ObjectViewer ' Reconstruction commands for object: SourceSearcher ' With SourceSearcher .Caption := "Source Searcher" .Font := EnvelopFont .Move(7080, 1125, 8085, 6525) .KeyPreview := True .DefaultButton := SourceSearcher.Search .AccelForm := EnvelopForm .MaxEntries := 5 .SearchModule := Nothing With .Search .Caption := "Search" .ZOrder := 1 .Move(75, 1350, 900, 300) End With 'SourceSearcher.Search With .ModuleCombo .ZOrder := 2 .Move(75, 375, 5475, 300) .Sorted := False .Style := "DropdownList" End With 'SourceSearcher.ModuleCombo With .Label3 .Caption := "Use objects from Module:" .ZOrder := 3 .Move(75, 75, 2625, 300) End With 'SourceSearcher.Label3 With .SearchCombo .ZOrder := 4 .Move(75, 900, 5475, 300) .Sorted := False End With 'SourceSearcher.SearchCombo With .HitResults .Caption := "HitResults" .BackColor := 12632256 .ZOrder := 5 .Move(45, 1665, 7875, 4410) .IconBitmap := SourceSearcher.bitmap .IconHeight := 12 .IconWidth := 12 .Sorted := True End With 'SourceSearcher.HitResults With .bitmap .LoadType := "MemoryBased" .FileName := "envelop.ero" .ResId := 12576 End With 'SourceSearcher.bitmap With .ObjectsBtn .Caption := "Objects" .ZOrder := 6 .Move(4650, 1350, 900, 300) End With 'SourceSearcher.ObjectsBtn With .HitFilter .Caption := "Only show hits" .ZOrder := 7 .Move(1050, 1350, 1800, 300) End With 'SourceSearcher.HitFilter With .AutoExpand .Caption := "Auto Expand" .ZOrder := 8 .Move(2925, 1350, 1575, 300) End With 'SourceSearcher.AutoExpand With .Help .Caption := "Help" .ZOrder := 9 .Move(5700, 1350, 750, 300) End With 'SourceSearcher.Help With .searchGroup .Persistent := False End With 'SourceSearcher.searchGroup With .ListObject .obj := Nothing End With 'SourceSearcher.ListObject With .ListMethod .meth := "" End With 'SourceSearcher.ListMethod With .ListHit .hitStart := 0 .hitLength := 0 End With 'SourceSearcher.ListHit With .ResetCurObject End With 'SourceSearcher.ResetCurObject End With 'SourceSearcher ' Reconstruction commands for object: ObjectBoxEditor ' With ObjectBoxEditor With .ObjBoxForm .Caption := "Editing: toolbar" .ForeColor := 0 .Font := EnvelopFont .Move(1005, 1785, 7755, 840) .KeyPreview := True .MaxButton := False .MinButton := False With .Toolbox .ZOrder := 2 .Move(0, 0, 4065, 420) .NumColumns := 10 .LayoutStyle := "ToolBar" .Visible := True .EditOnAdd = True .GadgetPrototype = ToolGadget With .MovePrevious .Position := 1 .HintText := "Previous Gadget" With .bitmap .FileName := "envelop.ero" .ResId := 12932 End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.MovePrevious.bitmap End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.MovePrevious With .MoveNext .Position := 2 .HintText := "Next Gadget" With .bitmap .FileName := "envelop.ero" .ResId := 13324 End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.MoveNext.bitmap End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.MoveNext With .NewGadget .Position := 3 .HintText := "Embed New Gadget" With .bitmap .FileName := "envelop.ero" .ResId := 13716 End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.NewGadget.bitmap End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.NewGadget With .DelGadget .Position := 4 With .bitmap .FileName := "envelop.ero" .ResId := 14108 End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.DelGadget.bitmap End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.DelGadget With .Configure .Position := 5 With .bitmap .FileName := "envelop.ero" .ResId := 14500 End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.Configure.bitmap End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.Configure With .ConfigureTool .Position := 6 With .bitmap .FileName := "envelop.ero" .ResId := 14892 End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.ConfigureTool.bitmap End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.ConfigureTool With .SlidePrevious .Position := 7 .HintText := "Slide Gadget Position Back" With .bitmap .FileName := "envelop.ero" .ResId := 15284 End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.SlidePrevious.bitmap End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.SlidePrevious With .SlideNext .Position := 8 .HintText := "Slide Gadget Position Forward" With .bitmap .FileName := "envelop.ero" .ResId := 15676 End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.SlideNext.bitmap End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.SlideNext With .SeparatorInc .Position := 9 .HintText := "Increase Separator" With .bitmap .FileName := "envelop.ero" .ResId := 16068 End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.SeparatorInc.bitmap End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.SeparatorInc With .SeparatorDec .Position := 10 .HintText := "Decrease Separator" With .bitmap .FileName := "envelop.ero" .ResId := 16460 End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.SeparatorDec.bitmap End With 'ObjectBoxEditor.ObjBoxForm.Toolbox.SeparatorDec End With 'ObjectBoxEditor.ObjBoxForm.Toolbox With .CBGadget .ZOrder := 1 .Move(4200, 75, 3135, 315) .Sorted := False .SuppressClick := False End With 'ObjectBoxEditor.ObjBoxForm.CBGadget End With 'ObjectBoxEditor.ObjBoxForm End With 'ObjectBoxEditor ' Reconstruction commands for object: MenuEditHook ' With MenuEditHook End With 'MenuEditHook ' Reconstruction commands for object: EnvelopForm ' With EnvelopForm .Caption := "Envelop" .Move(15, 15, 15330, 1125) .Outlined := True .KeyPreview := True .MenuBar := EnvelopForm.EnvelopMenus .FileDrop := True .MaxButton := False With .EnvelopMenus .InsertPopup(EnvelopForm.EnvelopMenus.EnvelopFileMenu, "&File", -1) .InsertPopup(EnvelopForm.EnvelopMenus.EnvelopObjectMenu, "&Object", -1) .InsertPopup(EnvelopForm.EnvelopMenus.EnvelopOptionsMenu, "O&ptions", -1) .InsertPopup(EnvelopForm.EnvelopMenus.EnvelopToolsMenu, "&Tools", -1) .InsertPopup(EnvelopForm.EnvelopMenus.EnvelopHelpMenu, "&Help", -1) With .EnvelopFileMenu .InsertItem("NewProject", "New Project", -1) .InsertItem("OpenProject", "Open Project", -1) .InsertSeparator(-1) .InsertItem("SaveProject", "Save Project", -1) .InsertItem("SaveProjectAs", "Save Project As...", -1) .InsertItem("CloseProject", "Close Project", -1) .InsertSeparator(-1) .InsertItem("NewModule", "&New Module", -1) .InsertItem("LoadModule", "&Load Module", -1) .InsertItem("MergeModule", "&Merge Module...", -1) .InsertSeparator(-1) .InsertItem("SaveModule", "&Save Module", -1) .AccelKey = "Ctrl+S" .SetAccelerator("SaveModule", .AccelKey) .InsertItem("SaveModuleAs", "Save Module As...", -1) .InsertItem("UnloadModule", "&Unload Module", -1) .InsertSeparator(-1) .InsertItem("SaveAll", "Save &All", -1) .AccelKey = "Ctrl+A" .SetAccelerator("SaveAll", .AccelKey) .InsertSeparator(-1) .InsertItem("QuitApp", "E&xit", -1) .AccelKey = "Alt+End" .SetAccelerator("QuitApp", .AccelKey) End With 'EnvelopForm.EnvelopMenus.EnvelopFileMenu With .EnvelopObjectMenu .InsertItem("NewObject", "&New...", -1) .InsertItem("NewForm", "New &Form", -1) .InsertItem("CopyObject", "&Copy...", -1) .InsertItem("QuickCopy", "&Quick copy", -1) .AccelKey = "Ctrl+C" .SetAccelerator("QuickCopy", .AccelKey) .InsertItem("AbstractObject", "&Abstract...", -1) .InsertSeparator(-1) .InsertItem("RenameObject", "&Rename...", -1) .AccelKey = "Ctrl+R" .SetAccelerator("RenameObject", .AccelKey) .InsertItem("MoveObject", "Move to envelop.ebo", -1) .AccelKey = "Ctrl+M" .SetAccelerator("MoveObject", .AccelKey) .InsertSeparator(-1) .InsertItem("DeleteObject", "&Destroy Object", -1) .AccelKey = "Ctrl+D" .SetAccelerator("DeleteObject", .AccelKey) .InsertSeparator(-1) .InsertItem("WriteText", "&Save As Text...", -1) .AccelKey = "Ctrl+W" .SetAccelerator("WriteText", .AccelKey) End With 'EnvelopForm.EnvelopMenus.EnvelopObjectMenu With .EnvelopOptionsMenu .InsertItem("TrapInterp", "Trap Interpretive Exceptions", -1) .InsertItem("TrapSys", "Trap System Exceptions", -1) .InsertSeparator(-1) .InsertItem("ToggleEdit", "Enable Form Editor", -1) .AccelKey = "Ctrl+F" .SetAccelerator("ToggleEdit", .AccelKey) .InsertSeparator(-1) .InsertItem("ConfigureLayout", "Window Layouts...", -1) .InsertSeparator(-1) .InsertItem("StartupOptions", "Startup...", -1) End With 'EnvelopForm.EnvelopMenus.EnvelopOptionsMenu With .EnvelopHelpMenu .InsertItem("HelpTopics", "Envelop &Help Topics", -1) .InsertSeparator(-1) .InsertItem("HelpSamples", "&Samples", -1) .InsertSeparator(-1) .InsertItem("About", "About Envelop", -1) End With 'EnvelopForm.EnvelopMenus.EnvelopHelpMenu With .EnvelopToolsMenu .InsertItem("PropertyEditor", "&Property Editor", -1) .InsertItem("ObjectBrowser", "&Object Viewer", -1) .InsertItem("MethodBrowser", "&Method Editor", -1) .InsertItem("SourceBrowser", "&Source Searcher", -1) .InsertItem("MenuEditor", "Me&nu Editor", -1) .InsertItem("AppEditor", "&Application Editor", -1) .InsertItem("WorkSet", "&WorkSet", -1) .InsertItem("GroupEditor", "&Group Editor", -1) .InsertItem("OcxTool", "Oc&x Tool", -1) .InsertSeparator(-1) .InsertItem("ToolPalette", "&Tool Palette", -1) .InsertItem("ControlPalette", "&Controls Palette", -1) .InsertSeparator(-1) .InsertItem("DebugWindow", "&Debug Window", -1) .InsertSeparator(-1) .InsertItem("CloseAll", "Close All", -1) End With 'EnvelopForm.EnvelopMenus.EnvelopToolsMenu End With 'EnvelopForm.EnvelopMenus With .LblEditObj .Caption := "Selected:" .Font := EnvelopFont .ZOrder := 2 .Move(10845, 60, 900, 255) .WordWrap := False End With 'EnvelopForm.LblEditObj With .toolbar .ZOrder := 3 .Move(-30, -30, 15240, 405) .LayoutStyle := "ToolBar" .MarginLeft := 10 .Visible := True With .NewProject .Separator := 3 .Position := 1 .HintText := "New project" With .bitmap .FileName := "envelop.ero" .ResId := 16852 End With 'EnvelopForm.toolbar.NewProject.bitmap End With 'EnvelopForm.toolbar.NewProject With .OpenProject .Separator := 3 .Position := 2 .HintText := "Open project" With .bitmap .FileName := "envelop.ero" .ResId := 17096 End With 'EnvelopForm.toolbar.OpenProject.bitmap End With 'EnvelopForm.toolbar.OpenProject With .SaveProject .Separator := 3 .Position := 3 .HintText := "Save project: Application1" With .bitmap .FileName := "envelop.ero" .ResId := 17340 End With 'EnvelopForm.toolbar.SaveProject.bitmap End With 'EnvelopForm.toolbar.SaveProject With .CloseProject .Separator := 21 .Position := 4 .HintText := "Close project: Application1" With .bitmap .FileName := "envelop.ero" .ResId := 17584 End With 'EnvelopForm.toolbar.CloseProject.bitmap End With 'EnvelopForm.toolbar.CloseProject With .WorksetLeft .Separator := 3 .Position := 5 .HintText := "Workset Previous" With .bitmap .FileName := "envelop.ero" .ResId := 17828 End With 'EnvelopForm.toolbar.WorksetLeft.bitmap End With 'EnvelopForm.toolbar.WorksetLeft With .Finger .Separator := 3 .Position := 6 .HintText := "Find Object to Edit" .oldCaption := "Envelop" .fingerStarted := False .oldAutoBusy := True .fingerPointer := 2 With .bitmap .FileName := "envelop.ero" .ResId := 18072 End With 'EnvelopForm.toolbar.Finger.bitmap End With 'EnvelopForm.toolbar.Finger With .WorksetRight .Separator := 19 .Position := 7 .HintText := "Workset Next" With .bitmap .FileName := "envelop.ero" .ResId := 18316 End With 'EnvelopForm.toolbar.WorksetRight.bitmap End With 'EnvelopForm.toolbar.WorksetRight With .NewForm .Separator := 3 .Position := 8 .HintText := "New Form" With .bitmap .FileName := "envelop.ero" .ResId := 18560 End With 'EnvelopForm.toolbar.NewForm.bitmap End With 'EnvelopForm.toolbar.NewForm With .CopyObject .Separator := 3 .Position := 10 .HintText := "Copy Object" With .bitmap .FileName := "envelop.ero" .ResId := 18804 End With 'EnvelopForm.toolbar.CopyObject.bitmap End With 'EnvelopForm.toolbar.CopyObject With .AbstractObject .Separator := 3 .Position := 11 .HintText := "Abstract Object" With .bitmap .FileName := "envelop.ero" .ResId := 19048 End With 'EnvelopForm.toolbar.AbstractObject.bitmap End With 'EnvelopForm.toolbar.AbstractObject With .DeleteObject .Separator := 30 .Position := 12 .HintText := "Delete Object" With .bitmap .FileName := "envelop.ero" .ResId := 19292 End With 'EnvelopForm.toolbar.DeleteObject.bitmap End With 'EnvelopForm.toolbar.DeleteObject With .ToggleEdit .Separator := 30 .Position := 13 .State := "Down" .ButtonType := "NonExclusive" With .bitmap .FileName := "envelop.ero" .ResId := 19536 End With 'EnvelopForm.toolbar.ToggleEdit.bitmap End With 'EnvelopForm.toolbar.ToggleEdit With .RestoreLayout .Separator := 30 .Position := 14 .HintText := "Restore Default Layout" With .bitmap .FileName := "envelop.ero" .ResId := 19780 End With 'EnvelopForm.toolbar.RestoreLayout.bitmap End With 'EnvelopForm.toolbar.RestoreLayout With .Help .Position := 15 .HintText := "Help Contents" .oldAutoBusy := False .fingerPointer := 13 With .bitmap .ResId := 20024 End With 'EnvelopForm.toolbar.Help.bitmap End With 'EnvelopForm.toolbar.Help With .NewObject .Separator := 3 .Position := 9 .HintText := "New Object" With .bitmap .FileName := "envelop.ero" .ResId := 20268 End With 'EnvelopForm.toolbar.NewObject.bitmap End With 'EnvelopForm.toolbar.NewObject End With 'EnvelopForm.toolbar With .CBSelectedObject .Font := EnvelopFont .ZOrder := 1 .Move(11820, 15, 3315, 315) End With 'EnvelopForm.CBSelectedObject End With 'EnvelopForm ' Reconstruction commands for object: ObjDebug ' With ObjDebug .Obj := Nothing .Descriptor := "" End With 'ObjDebug ' Reconstruction commands for object: ProjectStartupDialog ' With ProjectStartupDialog .Caption := "ProjectStartupDialog" .ForeColor := 16711680 .Font := ProjectStartupDialog.font1 .Move(2868, 2112, 6540, 4992) .BevelInner := "Raised" .BevelOuter := "Raised" .BorderWidth := 2 .CancelButton := ProjectStartupDialog.BTNNoProject .BorderStyle := "None" .MaxButton := False .MinButton := False With .BTNOpenProject .Caption := "&Open Project" .Font := ProjectStartupDialog.BTNNewProject.font1 .ZOrder := 2 .Move(216, 2076, 1872, 1284) End With 'ProjectStartupDialog.BTNOpenProject With .BTNNewProject .Caption := "&New Project" .ForeColor := 0 .Font := ProjectStartupDialog.BTNNewProject.font1 .ZOrder := 3 .Move(216, 744, 1872, 1284) With .font1 .FaceName := "MS Sans Serif" .Size := 12.000000 .Bold := True .Italic := False .Strikethru := False End With 'ProjectStartupDialog.BTNNewProject.font1 End With 'ProjectStartupDialog.BTNNewProject With .BTNNoProject .Caption := "No Project" .Font := ProjectStartupDialog.BTNNewProject.font1 .ZOrder := 4 .Move(216, 3432, 1872, 1284) End With 'ProjectStartupDialog.BTNNoProject With .LblNewProject .Caption := "Configure a new application or component library project." .ZOrder := 5 .Move(2250, 1140, 4110, 465) End With 'ProjectStartupDialog.LblNewProject With .LblNoProject .Caption := "Start with no project opened." .ZOrder := 6 .Move(2250, 3975, 4110, 225) End With 'ProjectStartupDialog.LblNoProject With .LblOpenProject .Caption := "Browse for an existing project file to open." .ZOrder := 7 .Move(2250, 2475, 4110, 450) End With 'ProjectStartupDialog.LblOpenProject With .LblHeader .Caption := "Envelop Startup" .BackColor := 8421504 .ForeColor := 0 .Font := ProjectStartupDialog.LblHeader.font .ZOrder := 1 .Move(120, 120, 6300, 444) .Alignment := "Center" With .font .FaceName := "MS Sans Serif" .Size := 18.000000 .Bold := True .Italic := False .Strikethru := False End With 'ProjectStartupDialog.LblHeader.font End With 'ProjectStartupDialog.LblHeader With .font1 .FaceName := "MS Sans Serif" .Size := 9.000000 .Bold := True .Italic := False .Strikethru := False End With 'ProjectStartupDialog.font1 End With 'ProjectStartupDialog ' Reconstruction commands for object: AboutEnvelopForm ' With AboutEnvelopForm .Caption := "About Envelop" .Move(3144, 2808, 6000, 3600) .KeyPreview := True .BorderStyle := "None" With .bitmap .LoadType := "MemoryBased" .FileName := "envelop.ero" .ResId := 20512 End With 'AboutEnvelopForm.bitmap With .imgAbout .ZOrder := 11 .Move(0, 0, 6000, 3600) .BevelOuter := "None" .AutoInitCropRect := False .Picture := AboutEnvelopForm.bitmap .ResizeMode := "Clip" .ScrollBars := "Never" .ScaleX := 1 .ScaleY := 1 End With 'AboutEnvelopForm.imgAbout With .lstDLLs .Font := DefaultDialogFont .ZOrder := 1 .Move(3984, 576, 1536, 1944) .Visible := False .Sorted := False End With 'AboutEnvelopForm.lstDLLs With .MLReadMe .Caption := "MLReadMe" .ZOrder := 2 .Move(3984, 576, 1536, 192) End With 'AboutEnvelopForm.MLReadMe With .MLRelNotes .Caption := "MLRelNotes" .ZOrder := 3 .Move(3984, 768, 1536, 192) End With 'AboutEnvelopForm.MLRelNotes With .MLLicense .Caption := "MLLicense" .ZOrder := 5 .Move(3984, 1212, 1536, 192) End With 'AboutEnvelopForm.MLLicense With .MLStory .Caption := "MLStory" .ZOrder := 7 .Move(3984, 1656, 1536, 192) End With 'AboutEnvelopForm.MLStory With .MLOK .Caption := "MLOK" .ZOrder := 9 .Move(3984, 2100, 1536, 192) End With 'AboutEnvelopForm.MLOK With .MLVersion .ZOrder := 10 .Move(3984, 2352, 1536, 192) End With 'AboutEnvelopForm.MLVersion End With 'AboutEnvelopForm ' Reconstruction commands for object: WorkSet ' With WorkSet With .WorkSetForm .Caption := "WorkSet" .Move(6735, 2220, 3420, 2835) .AccelForm := EnvelopForm .ListMaxItems := 10 .IgnoreClick := 0 With .List .BackColor := 12632256 .ZOrder := 1 .Move(0, 0, 3300, 2430) .Sorted := False End With 'WorkSet.WorkSetForm.List End With 'WorkSet.WorkSetForm End With 'WorkSet ' Reconstruction commands for object: ObjectBoxConfigWizard ' With ObjectBoxConfigWizard .title_ := "Configure ObjectBox" .Title := "Configure ObjectBox" .GraphicFileName := "envelop.ero" .FirstStep := ObjectBoxConfigWizard.ObjBoxMargin .LastStep := ObjectBoxConfigWizard.ObjBoxColumns With .ObjBoxMargin .Caption := "Configure ObjectBox" .Move(5850, 5595, 7155, 4815) .DefaultButton := ObjectBoxConfigWizard.ObjBoxMargin.BtnNext .CancelButton := Nothing .wizard := ObjectBoxConfigWizard .NextStep := ObjectBoxConfigWizard.ObjBoxLayout .initialized := -1 With .TBTop .ZOrder := 8 .Move(4200, 1500, 1200, 300) End With 'ObjectBoxConfigWizard.ObjBoxMargin.TBTop With .TBLeft .ZOrder := 7 .Move(3000, 2100, 1200, 300) End With 'ObjectBoxConfigWizard.ObjBoxMargin.TBLeft With .TBRight .ZOrder := 5 .Move(5400, 2100, 1200, 300) End With 'ObjectBoxConfigWizard.ObjBoxMargin.TBRight With .TBBottom .ZOrder := 6 .Move(4200, 2775, 1200, 300) End With 'ObjectBoxConfigWizard.ObjBoxMargin.TBBottom With .LBLTop .Caption := "Top" .ZOrder := 4 .Move(4200, 1200, 1200, 225) .Alignment := "Center" End With 'ObjectBoxConfigWizard.ObjBoxMargin.LBLTop With .LBLLeft .Caption := "Left" .ZOrder := 3 .Move(3000, 1800, 1200, 225) .Alignment := "Center" End With 'ObjectBoxConfigWizard.ObjBoxMargin.LBLLeft With .LBLRight .Caption := "Right" .ZOrder := 1 .Move(5400, 1800, 1200, 225) .Alignment := "Center" End With 'ObjectBoxConfigWizard.ObjBoxMargin.LBLRight With .LBLBottom .Caption := "Bottom" .ZOrder := 2 .Move(4200, 2475, 1200, 225) .Alignment := "Center" End With 'ObjectBoxConfigWizard.ObjBoxMargin.LBLBottom With .BtnFinish .ZOrder := 12 .Move(6225, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxMargin.BtnFinish With .BtnNext .ZOrder := 11 .Move(5325, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxMargin.BtnNext With .BtnBack .Enabled := False .ZOrder := 10 .Move(4500, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxMargin.BtnBack With .BtnCancel .ZOrder := 9 .Move(3600, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxMargin.BtnCancel With .ImgGraphic .ZOrder := 15 .Move(225, 225, 2475, 3150) .Picture := ObjectBoxConfigWizard.Bitmap End With 'ObjectBoxConfigWizard.ObjBoxMargin.ImgGraphic With .LblInstruction .Caption := "Set the Top, Bottom, Left and Right Margins for the ObjectBox" .ZOrder := 14 .Move(2850, 300, 4125, 450) End With 'ObjectBoxConfigWizard.ObjBoxMargin.LblInstruction With .Frame1 .ZOrder := 13 .Move(75, 3825, 6975, 75) End With 'ObjectBoxConfigWizard.ObjBoxMargin.Frame1 End With 'ObjectBoxConfigWizard.ObjBoxMargin With .ObjBoxLayout .Caption := "Configure ObjectBox" .Move(5850, 5595, 7155, 4815) .DefaultButton := ObjectBoxConfigWizard.ObjBoxLayout.BtnBack .CancelButton := Nothing .wizard := ObjectBoxConfigWizard .NextStep := ObjectBoxConfigWizard.ObjBoxColumns .BackStep := ObjectBoxConfigWizard.ObjBoxMargin With .OBToolBar .Caption := "ToolBar" .ZOrder := 2 .Move(3000, 975, 3675, 300) End With 'ObjectBoxConfigWizard.ObjBoxLayout.OBToolBar With .OBToolBox .Caption := "ToolBox" .ZOrder := 1 .Move(3000, 1350, 3675, 300) .TabStop := True End With 'ObjectBoxConfigWizard.ObjBoxLayout.OBToolBox With .BtnFinish .ZOrder := 6 .Move(6225, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxLayout.BtnFinish With .BtnNext .ZOrder := 5 .Move(5325, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxLayout.BtnNext With .BtnBack .ZOrder := 4 .Move(4500, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxLayout.BtnBack With .BtnCancel .ZOrder := 3 .Move(3600, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxLayout.BtnCancel With .ImgGraphic .ZOrder := 9 .Move(225, 225, 2475, 3150) .Picture := ObjectBoxConfigWizard.Bitmap End With 'ObjectBoxConfigWizard.ObjBoxLayout.ImgGraphic With .LblInstruction .Caption := "Select the LayoutStyle for the ObjectBox" .ZOrder := 8 .Move(2850, 300, 4125, 225) End With 'ObjectBoxConfigWizard.ObjBoxLayout.LblInstruction With .Frame1 .ZOrder := 7 .Move(75, 3825, 6975, 75) End With 'ObjectBoxConfigWizard.ObjBoxLayout.Frame1 End With 'ObjectBoxConfigWizard.ObjBoxLayout With .ObjBoxTileDir .Caption := "Configure ObjectBox" .Move(5850, 5595, 7155, 4815) .DefaultButton := ObjectBoxConfigWizard.ObjBoxTileDir.BtnFinish .CancelButton := Nothing .wizard := ObjectBoxConfigWizard .BackStep := ObjectBoxConfigWizard.ObjBoxLayout With .OBHoriz .Caption := "Horizontal tiling" .ZOrder := 2 .Move(3300, 1050, 3300, 375) .TabStop := True End With 'ObjectBoxConfigWizard.ObjBoxTileDir.OBHoriz With .OBVertical .Caption := "Vertical tiling" .ZOrder := 1 .Move(3300, 1500, 3300, 375) End With 'ObjectBoxConfigWizard.ObjBoxTileDir.OBVertical With .BtnFinish .ZOrder := 6 .Move(6225, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxTileDir.BtnFinish With .BtnNext .Enabled := False .ZOrder := 5 .Move(5325, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxTileDir.BtnNext With .BtnBack .ZOrder := 4 .Move(4500, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxTileDir.BtnBack With .BtnCancel .ZOrder := 3 .Move(3600, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxTileDir.BtnCancel With .ImgGraphic .ZOrder := 9 .Move(225, 225, 2475, 3150) .Picture := ObjectBoxConfigWizard.Bitmap End With 'ObjectBoxConfigWizard.ObjBoxTileDir.ImgGraphic With .LblInstruction .Caption := "Select Horizontal or Vertical tiling for your ToolBar." .ZOrder := 8 .Move(2850, 300, 4125, 450) End With 'ObjectBoxConfigWizard.ObjBoxTileDir.LblInstruction With .Frame1 .ZOrder := 7 .Move(75, 3825, 6975, 75) End With 'ObjectBoxConfigWizard.ObjBoxTileDir.Frame1 End With 'ObjectBoxConfigWizard.ObjBoxTileDir With .ObjBoxColumns .Caption := "Configure ObjectBox" .Move(5850, 5595, 7155, 4815) .DefaultButton := ObjectBoxConfigWizard.ObjBoxColumns.BtnFinish .CancelButton := Nothing .wizard := ObjectBoxConfigWizard .BackStep := ObjectBoxConfigWizard.ObjBoxLayout With .SBColumns .Caption := "SBColumns" .ZOrder := 2 .Move(3000, 1800, 3675, 300) .SmallChange := 1 .LargeChange := 5 .Max := 20 .Orientation := "Horizontal" .Move(3000, 1800, 3675, 300) End With 'ObjectBoxConfigWizard.ObjBoxColumns.SBColumns With .LblColumns .Caption := "Columns: 2" .ZOrder := 1 .Move(4200, 1500, 1350, 225) .Alignment := "Center" End With 'ObjectBoxConfigWizard.ObjBoxColumns.LblColumns With .BtnFinish .ZOrder := 6 .Move(6225, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxColumns.BtnFinish With .BtnNext .Enabled := False .ZOrder := 5 .Move(5325, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxColumns.BtnNext With .BtnBack .ZOrder := 4 .Move(4500, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxColumns.BtnBack With .BtnCancel .ZOrder := 3 .Move(3600, 4050, 825, 300) End With 'ObjectBoxConfigWizard.ObjBoxColumns.BtnCancel With .ImgGraphic .ZOrder := 9 .Move(225, 225, 2475, 3150) .Picture := ObjectBoxConfigWizard.Bitmap End With 'ObjectBoxConfigWizard.ObjBoxColumns.ImgGraphic With .LblInstruction .Caption := "How many columns should there be in the ObjectBox." .ZOrder := 8 .Move(2850, 300, 4125, 450) End With 'ObjectBoxConfigWizard.ObjBoxColumns.LblInstruction With .Frame1 .ZOrder := 7 .Move(75, 3825, 6975, 75) End With 'ObjectBoxConfigWizard.ObjBoxColumns.Frame1 End With 'ObjectBoxConfigWizard.ObjBoxColumns With .TempBox .Move(0, 0, 0, 0) End With 'ObjectBoxConfigWizard.TempBox With .Bitmap .LoadType := "MemoryBased" .FileName := "envelop.ero" .ResId := 171588 End With 'ObjectBoxConfigWizard.Bitmap End With 'ObjectBoxConfigWizard ' Reconstruction commands for object: SampleMasterFormMenuBar ' With SampleMasterFormMenuBar .InsertPopup(SampleMasterFormFileMenu, "&File", -1) .InsertPopup(SampleMasterFormHelpMenu, "&Help", -1) End With 'SampleMasterFormMenuBar ' Reconstruction commands for object: SampleMasterForm ' With SampleMasterForm .Caption := "BOOT CAMP Sample" .Move(3840, 1170, 8370, 6060) .Outlined := True .MenuBar := SampleMasterFormMenuBar .SampleDir := "D:\ENVELOP\PROGRAM\" .SampleName := "envelop" With .helpfile .FileName := "D:\ENVELOP\PROGRAM\envelop.hlp" End With 'SampleMasterForm.helpfile End With 'SampleMasterForm ' Reconstruction commands for object: FormEditor ' With FormEditor .ShowOrder := False .GridOn := True .GridX := 10 .GridY := 10 .HitMode := "RgnTouches" .Editing := True End With 'FormEditor ' Reconstruction commands for object: SampleMasterFormFileMenu ' With SampleMasterFormFileMenu .InsertItem("ResetApplication", "&Reset", -1) .InsertSeparator(-1) .InsertItem("ExitApplication", "E&xit", -1) End With 'SampleMasterFormFileMenu ' Reconstruction commands for object: Debugger ' With Debugger .TrapSystemExceptions := True .TrapInterpretiveExceptions := False .IgnoreExceptionsModule := 7 End With 'Debugger ' Reconstruction commands for object: MenuEdit ' With MenuEdit .Caption := "MenuEdit" .Font := DefaultDialogFont .Move(1185, 1815, 6540, 8655) .ICN_CLOSEDFOLDER := 0 .ICN_OPENFOLDER := 1 .ICN_MENUITEM := 2 .ICN_SEPARATOR := 3 .DraggingIndex := 1 .InputMenu := Nothing .WorkingMenu := Nothing .UpdatingProperties := 0 .SuppressUpdatingProperties := 0 .changed := False With .menuList .Caption := "menuList" .BackColor := 12632256 .DragMode := "LeftMouse" .ZOrder := 9 .Move(0, 1275, 6420, 6975) .ExpandOnDblClick := True .IconBitmap := MenuEdit.menuList.bitmaps .IconHeight := 16 .IconWidth := 20 .IndentWidth := 20 With .bitmaps .LoadType := "MemoryBased" .FileName := "envelop.ero" .ResId := 173296 End With 'MenuEdit.menuList.bitmaps End With 'MenuEdit.menuList With .menutools .Caption := "ObjectBox1" .ZOrder := 8 .Move(0, 0, 6420, 405) .LayoutStyle := "ToolBar" .Visible := True With .openmenu .Position := 1 .HintText := "Open new menu to edit" With .bitmap .FileName := "envelop.ero" .ResId := 174372 End With 'MenuEdit.menutools.openmenu.bitmap End With 'MenuEdit.menutools.openmenu With .testdrive .Enabled := False .Position := 2 .HintText := "Test drive your menus" With .bitmap .FileName := "envelop.ero" .ResId := 175704 End With 'MenuEdit.menutools.testdrive.bitmap End With 'MenuEdit.menutools.testdrive With .apply .Enabled := False .Separator := 13 .Position := 3 .HintText := "Apply your changes to the orginal menu" With .bitmap .FileName := "envelop.ero" .ResId := 177036 End With 'MenuEdit.menutools.apply.bitmap End With 'MenuEdit.menutools.apply With .insertitem .Enabled := False .Position := 4 .HintText := "Insert a new command item" With .bitmap .FileName := "envelop.ero" .ResId := 178368 End With 'MenuEdit.menutools.insertitem.bitmap End With 'MenuEdit.menutools.insertitem With .insertsubmenu .Enabled := False .Position := 5 .HintText := "Insert a new sub-menu" With .bitmap .FileName := "envelop.ero" .ResId := 179700 End With 'MenuEdit.menutools.insertsubmenu.bitmap End With 'MenuEdit.menutools.insertsubmenu With .insertsep .Enabled := False .Separator := 12 .Position := 6 .HintText := "Insert a new separator" With .bitmap .FileName := "envelop.ero" .ResId := 181032 End With 'MenuEdit.menutools.insertsep.bitmap End With 'MenuEdit.menutools.insertsep With .delitem .Enabled := False .Position := 8 .HintText := "Delete the current item" With .bitmap .FileName := "envelop.ero" .ResId := 182364 End With 'MenuEdit.menutools.delitem.bitmap End With 'MenuEdit.menutools.delitem With .moveup .Enabled := False .Position := 9 .HintText := "Move the current item up" With .bitmap .FileName := "envelop.ero" .ResId := 183696 End With 'MenuEdit.menutools.moveup.bitmap End With 'MenuEdit.menutools.moveup With .movedown .Enabled := False .Position := 10 .HintText := "Move the current item down" With .bitmap .FileName := "envelop.ero" .ResId := 185028 End With 'MenuEdit.menutools.movedown.bitmap End With 'MenuEdit.menutools.movedown With .properties .Position := 7 .State := "Down" .HintText := "Modify item properties" With .bitmap .FileName := "envelop.ero" .ResId := 186360 End With 'MenuEdit.menutools.properties.bitmap End With 'MenuEdit.menutools.properties End With 'MenuEdit.menutools With .Label1 .Caption := "Caption:" .ZOrder := 7 .Move(0, 525, 900, 300) .Alignment := "Right" End With 'MenuEdit.Label1 With .Label2 .Caption := "Name:" .ZOrder := 6 .Move(0, 975, 900, 300) .Alignment := "Right" End With 'MenuEdit.Label2 With .txtCaption .Enabled := False .ZOrder := 1 .Move(900, 450, 2400, 300) End With 'MenuEdit.txtCaption With .txtName .Enabled := False .ZOrder := 2 .Move(900, 900, 2400, 300) End With 'MenuEdit.txtName With .Label3 .Caption := "Shortcut:" .ZOrder := 5 .Move(3600, 525, 900, 300) .Alignment := "Right" End With 'MenuEdit.Label3 With .chkChecked .Caption := "Checked" .Enabled := False .ZOrder := 4 .Move(3750, 900, 1500, 300) End With 'MenuEdit.chkChecked With .cbAccel .Enabled := False .ZOrder := 3 .Move(4500, 450, 1800, 315) .Sorted := False .Style := "DropdownList" End With 'MenuEdit.cbAccel End With 'MenuEdit ' Reconstruction commands for object: PropertyEditor ' With PropertyEditor .SimplePropTextStyle := "Normal" .SimplePropTextColor := -1 .EmbedPropTextStyle := "Normal" .EmbedPropTextColor := 8388608 .ReferencePropTextStyle := "Italic" .ReferencePropTextColor := 128 .InheritedPropTextStyle := "Normal" .InheritedPropTextColor := -1 .NonInheritedPropTextStyle := "Bold" .NonInheritedPropTextColor := -1 With .DimensionArrayForm .Caption := "Dimension Array" .Font := EnvelopFont .Move(4560, 3570, 4635, 1935) .DefaultButton := PropertyEditor.DimensionArrayForm.BtnOK .CancelButton := PropertyEditor.DimensionArrayForm.BtnCancel .posDim := 1 .posOpen := 7 .posName := 4 .posClose := 10 .posDims := 8 .posAs := 12 .posType := 14 .ignoreChange := False With .TBStmt .ZOrder := 1 .Move(1155, 90, 2280, 285) End With 'PropertyEditor.DimensionArrayForm.TBStmt With .LblName .Caption := "Name:" .ZOrder := 10 .Move(75, 540, 1035, 240) .Alignment := "Right" End With 'PropertyEditor.DimensionArrayForm.LblName With .LblDims .Caption := "Dimensions:" .ZOrder := 9 .Move(75, 855, 1035, 240) .Alignment := "Right" End With 'PropertyEditor.DimensionArrayForm.LblDims With .CBType .ZOrder := 4 .Move(1155, 1140, 1140, 300) .Sorted := False .Style := "DropdownList" End With 'PropertyEditor.DimensionArrayForm.CBType With .LblType .Caption := "Type:" .ZOrder := 8 .Move(75, 1170, 1035, 240) .Alignment := "Right" End With 'PropertyEditor.DimensionArrayForm.LblType With .LblStmt .Caption := "Statement:" .ZOrder := 7 .Move(75, 135, 1035, 240) .Alignment := "Right" End With 'PropertyEditor.DimensionArrayForm.LblStmt With .TBName .ZOrder := 2 .Move(1155, 495, 2280, 285) End With 'PropertyEditor.DimensionArrayForm.TBName With .TBDims .ZOrder := 3 .Move(1155, 825, 2280, 270) End With 'PropertyEditor.DimensionArrayForm.TBDims With .BtnOK .Caption := "OK" .ZOrder := 5 .Move(3525, 90, 900, 300) End With 'PropertyEditor.DimensionArrayForm.BtnOK With .BtnCancel .Caption := "Cancel" .ZOrder := 6 .Move(3525, 480, 900, 300) End With 'PropertyEditor.DimensionArrayForm.BtnCancel End With 'PropertyEditor.DimensionArrayForm With .EnumPicker .Caption := "Select an Enumeration type" .Font := EnvelopFont .Move(4695, 3480, 4650, 2955) .DefaultButton := PropertyEditor.EnumPicker.BtnOk .CancelButton := PropertyEditor.EnumPicker.BtnCancel With .EnumList .Caption := "EnumList" .BackColor := 16777215 .ZOrder := 3 .Move(150, 150, 2700, 2175) End With 'PropertyEditor.EnumPicker.EnumList With .BtnOk .Caption := "OK" .ZOrder := 2 .Move(3150, 150, 1200, 375) End With 'PropertyEditor.EnumPicker.BtnOk With .BtnCancel .Caption := "Cancel" .ZOrder := 1 .Move(3150, 675, 1200, 375) End With 'PropertyEditor.EnumPicker.BtnCancel End With 'PropertyEditor.EnumPicker With .ObjPicker .Caption := "Select Object" .Font := EnvelopFont .Move(4875, 3750, 4470, 2985) .BevelOuter := "Raised" .DefaultButton := PropertyEditor.ObjPicker.BtnOk .CancelButton := PropertyEditor.ObjPicker.BtnCancel With .BtnOk .Caption := "OK" .ZOrder := 2 .Move(3230, 90, 1050, 300) End With 'PropertyEditor.ObjPicker.BtnOk With .BtnCancel .Caption := "Cancel" .ZOrder := 3 .Move(3230, 480, 1050, 300) End With 'PropertyEditor.ObjPicker.BtnCancel With .ObjList .Caption := "ObjList" .ZOrder := 1 .Move(150, 375, 2850, 1800) End With 'PropertyEditor.ObjPicker.ObjList With .Label1 .ZOrder := 7 .Move(150, 75, 2855, 300) End With 'PropertyEditor.ObjPicker.Label1 With .CBReference .Caption := "&Reference" .ZOrder := 4 .Move(3095, 1155, 1185, 225) End With 'PropertyEditor.ObjPicker.CBReference With .CBUntyped .Caption := "&Untyped" .ZOrder := 5 .Move(3095, 1470, 1185, 225) End With 'PropertyEditor.ObjPicker.CBUntyped With .CBShowEmbeds .Caption := "Show &embedded objects" .ZOrder := 6 .Move(135, 2265, 2775, 225) End With 'PropertyEditor.ObjPicker.CBShowEmbeds End With 'PropertyEditor.ObjPicker End With 'PropertyEditor ' Reconstruction commands for object: MenuTester ' With MenuTester .Caption := "MenuTester" .ForeColor := 0 .Font := MenuTester.font1 .Move(7770, 1815, 6330, 1680) With .Label1 .Caption := "Test Drive Your Menu" .ZOrder := 1 .Move(150, 450, 6000, 600) .Alignment := "Center" End With 'MenuTester.Label1 With .font1 .FaceName := "Times New Roman" .Size := 18.000000 .Bold := True .Italic := False .Strikethru := False End With 'MenuTester.font1 End With 'MenuTester ' Reconstruction commands for object: MenuEditor ' With MenuEditor .Enabled := False With .SelectPopupForm .Caption := "Select PopupMenu" .Font := DefaultDialogFont .Move(4395, 4260, 5415, 1905) .DefaultButton := MenuEditor.SelectPopupForm.BtnOK .CancelButton := MenuEditor.SelectPopupForm.BtnCancel .MaxButton := False .HostMenu := Nothing With .CBPopups .ZOrder := 4 .Move(915, 570, 3225, 300) .Visible := False .ShowDynamics := True .ShowEmbeds := True .RootObject := PopupMenu .Style := "Tree" End With 'MenuEditor.SelectPopupForm.CBPopups With .OptExisting .Caption := "&Existing:" .ZOrder := 2 .Move(1950, 150, 1050, 285) .TabStop := True End With 'MenuEditor.SelectPopupForm.OptExisting With .OptNew .Caption := "&New:" .ZOrder := 1 .Move(900, 150, 1050, 285) .TabGroup := True End With 'MenuEditor.SelectPopupForm.OptNew With .LblCaption .Caption := "Caption:" .ZOrder := 9 .Move(150, 1080, 720, 240) .Alignment := "Right" End With 'MenuEditor.SelectPopupForm.LblCaption With .TECaption .ZOrder := 5 .Move(915, 1050, 3225, 300) End With 'MenuEditor.SelectPopupForm.TECaption With .TEName .ZOrder := 3 .Move(915, 570, 3225, 300) End With 'MenuEditor.SelectPopupForm.TEName With .BtnOK .Caption := "OK" .ZOrder := 6 .Move(4320, 90, 885, 300) End With 'MenuEditor.SelectPopupForm.BtnOK With .BtnCancel .Caption := "Cancel" .ZOrder := 7 .Move(4320, 480, 885, 300) End With 'MenuEditor.SelectPopupForm.BtnCancel With .LblName .Caption := "Name:" .ZOrder := 8 .Move(150, 600, 735, 300) .Alignment := "Right" End With 'MenuEditor.SelectPopupForm.LblName End With 'MenuEditor.SelectPopupForm End With 'MenuEditor ' Reconstruction commands for object: CtrlToolGadgetWizard ' With CtrlToolGadgetWizard .title_ := "Configure ControlTools.Gadget" .Title := "Configure ControlTools.Gadget" .GraphicFileName := "envelop.ero" .FirstStep := CtrlToolGadgetWizard.SelectObject .LastStep := CtrlToolGadgetWizard.SelectBitmap .ng := Nothing With .SelectObject .Caption := "Configure ControlTools.Gadget" .Move(3585, 6150, 7155, 4815) .DefaultButton := CtrlToolGadgetWizard.SelectObject.BtnNext .CancelButton := Nothing .wizard := CtrlToolGadgetWizard .NextStep := CtrlToolGadgetWizard.SelectBitmap With .TextBox1 .ZOrder := 1 .Move(2850, 1050, 4050, 525) End With 'CtrlToolGadgetWizard.SelectObject.TextBox1 With .BtnFinish .ZOrder := 5 .Move(6225, 4050, 825, 300) End With 'CtrlToolGadgetWizard.SelectObject.BtnFinish With .BtnNext .ZOrder := 4 .Move(5325, 4050, 825, 300) End With 'CtrlToolGadgetWizard.SelectObject.BtnNext With .BtnBack .Enabled := False .ZOrder := 3 .Move(4500, 4050, 825, 300) End With 'CtrlToolGadgetWizard.SelectObject.BtnBack With .BtnCancel .ZOrder := 2 .Move(3600, 4050, 825, 300) End With 'CtrlToolGadgetWizard.SelectObject.BtnCancel With .ImgGraphic .ZOrder := 8 .Move(225, 225, 2475, 3150) .Picture := CtrlToolGadgetWizard.Bitmap End With 'CtrlToolGadgetWizard.SelectObject.ImgGraphic With .LblInstruction .Caption := "What Object should we install?" .ZOrder := 7 .Move(2850, 225, 4125, 300) End With 'CtrlToolGadgetWizard.SelectObject.LblInstruction With .Frame1 .ZOrder := 6 .Move(75, 3825, 6975, 75) End With 'CtrlToolGadgetWizard.SelectObject.Frame1 End With 'CtrlToolGadgetWizard.SelectObject With .SelectBitmap .Caption := "Configure ControlTools.Gadget" .Move(3585, 6150, 7155, 4815) .DefaultButton := CtrlToolGadgetWizard.SelectBitmap.BtnFinish .CancelButton := Nothing .wizard := CtrlToolGadgetWizard .BackStep := CtrlToolGadgetWizard.SelectObject With .TextBox1 .Caption := "TextBox1" .ZOrder := 3 .Move(2850, 1050, 4050, 525) End With 'CtrlToolGadgetWizard.SelectBitmap.TextBox1 With .BTNBrowse .Caption := "Browse..." .ZOrder := 2 .Move(2850, 1725, 900, 375) End With 'CtrlToolGadgetWizard.SelectBitmap.BTNBrowse With .BTNPreview .Caption := "Preview" .ZOrder := 1 .Move(6000, 1725, 900, 375) End With 'CtrlToolGadgetWizard.SelectBitmap.BTNPreview With .SampleBox .ZOrder := 11 .Move(4665, 2715, 480, 480) .Visible := True With .PreviewTool .Position := 1 With .bitmap .FileName := "envelop.ero" .ResId := 187180 End With 'CtrlToolGadgetWizard.SelectBitmap.SampleBox.PreviewTool.bitmap End With 'CtrlToolGadgetWizard.SelectBitmap.SampleBox.PreviewTool End With 'CtrlToolGadgetWizard.SelectBitmap.SampleBox With .BtnFinish .ZOrder := 7 .Move(6225, 4050, 825, 300) End With 'CtrlToolGadgetWizard.SelectBitmap.BtnFinish With .BtnNext .Enabled := False .ZOrder := 6 .Move(5325, 4050, 825, 300) End With 'CtrlToolGadgetWizard.SelectBitmap.BtnNext With .BtnBack .ZOrder := 5 .Move(4500, 4050, 825, 300) End With 'CtrlToolGadgetWizard.SelectBitmap.BtnBack With .BtnCancel .ZOrder := 4 .Move(3600, 4050, 825, 300) End With 'CtrlToolGadgetWizard.SelectBitmap.BtnCancel With .ImgGraphic .ZOrder := 10 .Move(225, 225, 2475, 3150) .Picture := CtrlToolGadgetWizard.Bitmap End With 'CtrlToolGadgetWizard.SelectBitmap.ImgGraphic With .LblInstruction .Caption := "What Bitmap should be used in the Palette?" .ZOrder := 9 .Move(2850, 225, 4125, 375) End With 'CtrlToolGadgetWizard.SelectBitmap.LblInstruction With .Frame1 .ZOrder := 8 .Move(75, 3825, 6975, 75) End With 'CtrlToolGadgetWizard.SelectBitmap.Frame1 End With 'CtrlToolGadgetWizard.SelectBitmap With .Bitmap .LoadType := "MemoryBased" .FileName := "envelop.ero" .ResId := 187808 End With 'CtrlToolGadgetWizard.Bitmap End With 'CtrlToolGadgetWizard ' Reconstruction commands for object: GroupEditor ' With GroupEditor With .EditorForm .Caption := "Group: GadgetConfigWizard" .Move(4590, 2520, 3660, 3795) .AccelForm := EnvelopForm .GroupRef := GadgetConfigWizard .ParentForReal := GroupEditor With .GroupList .BackColor := 12632256 .ZOrder := 4 .Move(0, 255, 3540, 3390) .Sorted := False End With 'GroupEditor.EditorForm.GroupList With .Up .Caption := "Up" .ZOrder := 1 .Move(0, 0, 825, 270) End With 'GroupEditor.EditorForm.Up With .Down .Caption := "Down" .ZOrder := 2 .Move(750, 0, 855, 270) End With 'GroupEditor.EditorForm.Down With .Delete .Caption := "Delete" .ZOrder := 3 .Move(1590, 0, 855, 270) End With 'GroupEditor.EditorForm.Delete End With 'GroupEditor.EditorForm End With 'GroupEditor ' Reconstruction commands for object: NewProjectForm ' With NewProjectForm .Caption := "New Project" .Font := DefaultDialogFont .Move(4005, 3960, 4995, 2340) .DefaultButton := NewProjectForm.BtnOK .CancelButton := NewProjectForm.BtnCancel .MaxButton := False .MinButton := False .GeneratedName := "Application1" With .LblProjType .Caption := "Project type:" .ZOrder := 13 .Move(135, 135, 1200, 300) .WordWrap := False End With 'NewProjectForm.LblProjType With .LblProjName .Caption := "Project object name:" .ZOrder := 12 .Move(135, 930, 1800, 300) .Alignment := "Right" End With 'NewProjectForm.LblProjName With .LblProjFile .Caption := "Project file:" .ZOrder := 11 .Move(135, 1275, 1800, 210) .Alignment := "Right" End With 'NewProjectForm.LblProjFile With .OptApplication .Caption := "&Application" .ZOrder := 1 .Move(1350, 90, 1275, 270) .TabStop := True .TabGroup := True .Value := True End With 'NewProjectForm.OptApplication With .OptLibrary .Caption := "Component &Library" .ZOrder := 2 .Move(1350, 420, 1935, 270) End With 'NewProjectForm.OptLibrary With .LblEXEfile .Caption := "Application EXE file:" .ZOrder := 10 .Move(135, 1620, 1800, 240) .Alignment := "Right" End With 'NewProjectForm.LblEXEfile With .TEProjName .ZOrder := 3 .Move(1935, 900, 1845, 300) End With 'NewProjectForm.TEProjName With .TEProjFile .ZOrder := 4 .Move(1935, 1230, 1845, 300) End With 'NewProjectForm.TEProjFile With .TEEXEfile .ZOrder := 5 .Move(1935, 1575, 1845, 300) End With 'NewProjectForm.TEEXEfile With .BtnOK .Caption := "OK" .ZOrder := 6 .Move(3915, 60, 900, 315) End With 'NewProjectForm.BtnOK With .BtnCancel .Caption := "Cancel" .ZOrder := 7 .Move(3915, 435, 900, 315) End With 'NewProjectForm.BtnCancel With .BtnBrowseProjFile .Caption := "Browse..." .ZOrder := 8 .Move(3840, 1230, 975, 300) End With 'NewProjectForm.BtnBrowseProjFile With .BtnBrowseEXEfile .Caption := "Browse..." .ZOrder := 9 .Move(3840, 1575, 975, 300) End With 'NewProjectForm.BtnBrowseEXEfile End With 'NewProjectForm ' Reconstruction commands for object: SelectModuleForm ' With SelectModuleForm .Caption := "Select module to add" .Font := DefaultDialogFont .Move(5070, 4365, 3615, 2475) .MaxButton := False .MinButton := False .module := Nothing With .LstModules .ZOrder := 1 .Move(90, 360, 2220, 1590) .Sorted := False End With 'SelectModuleForm.LstModules With .BtnOK .Caption := "OK" .ZOrder := 2 .Move(2400, 90, 1005, 315) End With 'SelectModuleForm.BtnOK With .BtnCancel .Caption := "Cancel" .ZOrder := 3 .Move(2400, 495, 1005, 315) End With 'SelectModuleForm.BtnCancel With .BtnBrowse .Caption := "&Browse..." .ZOrder := 5 .Move(2400, 1665, 1005, 315) End With 'SelectModuleForm.BtnBrowse With .LblModules .Caption := "Modules:" .ZOrder := 6 .Move(90, 90, 900, 180) End With 'SelectModuleForm.LblModules With .BtnNew .Caption := "&New" .ZOrder := 4 .Move(2400, 1260, 1005, 315) End With 'SelectModuleForm.BtnNew End With 'SelectModuleForm ' ' Reconstruction commands for object: ImageListBrowser ' With ImageListBrowser .Move(11760, 6780, 4620, 1710) .CurrentIndex := 0 .ImageListRef := Nothing .Spacer := 4 .ImageHeight := 0 .ImageWidth := 0 With .Images .Caption := "Images" .ZOrder := 2 .Move(0, 0, 4500, 1005) .DrawMode := "Xor Pen" End With 'ImageListBrowser.Images With .ImageScrollBar .Caption := "ImageScrollBar" .ZOrder := 1 .Move(0, 1005, 4500, 300) .Visible := False .SmallChange := 1 .LargeChange := 5 .Max := 1 .Orientation := "Horizontal" .Move(0, 1005, 4500, 300) End With 'ImageListBrowser.ImageScrollBar End With 'ImageListBrowser ' Reconstruction commands for object: ImageListBuilderForm ' With ImageListBuilderForm .Caption := "Image List Builder" .ForeColor := 0 .Font := ImageListBuilderForm.font1 .Move(4335, 1545, 5220, 4950) .CurrentImageList := Nothing With .opt16x16 .Caption := "16x16" .ZOrder := 1 .Move(300, 450, 900, 300) End With 'ImageListBuilderForm.opt16x16 With .opt32x32 .Caption := "32x32" .ZOrder := 2 .Move(1350, 450, 900, 300) End With 'ImageListBuilderForm.opt32x32 With .opt48x48 .Caption := "48x48" .ZOrder := 3 .Move(2550, 450, 900, 300) End With 'ImageListBuilderForm.opt48x48 With .optCustom .Caption := "Custom" .ZOrder := 4 .Move(3675, 390, 1050, 375) .TabStop := True End With 'ImageListBuilderForm.optCustom With .txtWidth .ZOrder := 5 .Move(1725, 900, 450, 300) End With 'ImageListBuilderForm.txtWidth With .txtHeight .Enabled := False .ZOrder := 6 .Move(2625, 900, 450, 300) End With 'ImageListBuilderForm.txtHeight With .btnAddImage .Caption := "Add Image..." .ZOrder := 7 .Move(300, 3525, 1500, 300) End With 'ImageListBuilderForm.btnAddImage With .btnRemoveImage .Caption := "Remove Image" .ZOrder := 8 .Move(3285, 3525, 1515, 300) End With 'ImageListBuilderForm.btnRemoveImage With .btnOK .Caption := "OK" .ZOrder := 9 .Move(2175, 4125, 600, 300) End With 'ImageListBuilderForm.btnOK With .Label2 .Caption := "X" .ZOrder := 10 .Move(2250, 975, 300, 300) .Alignment := "Center" End With 'ImageListBuilderForm.Label2 With .ImageBrowser .ZOrder := 11 .Move(300, 1950, 4500, 1455) .Outlined := False .BorderStyle := "None" .MinButton := True .ControlBox := False .Parent := ImageListBuilderForm .Visible := True With .Images .ZOrder := 1 .Move(0, 0, 4500, 1155) End With 'ImageListBuilderForm.ImageBrowser.Images With .ImageScrollBar .ZOrder := 2 .Move(0, 1155, 4500, 300) .Move(0, 1155, 4500, 300) End With 'ImageListBuilderForm.ImageBrowser.ImageScrollBar End With 'ImageListBuilderForm.ImageBrowser With .Frame2 .Caption := "Image Size" .ZOrder := 12 .Move(150, 150, 4800, 1200) End With 'ImageListBuilderForm.Frame2 With .Frame1 .Caption := "Images" .ZOrder := 13 .Move(150, 1575, 4800, 2400) End With 'ImageListBuilderForm.Frame1 With .font1 .FaceName := "MS Sans Serif" .Size := 9.000000 .Bold := True .Italic := False .Strikethru := False End With 'ImageListBuilderForm.font1 With .OpenPanel .Title := "Select Bitmap" .DefaultExtension := "BMP" .Filter := "Bitmap Files(*.BMP)|*.BMP|" .FilterIndex := 1 End With 'ImageListBuilderForm.OpenPanel End With 'ImageListBuilderForm ' Reconstruction commands for object: ComCtlObjEditor ' With ComCtlObjEditor End With 'ComCtlObjEditor ' Reconstruction commands for object: ImageSelectForm ' With ImageSelectForm .Caption := "Image Select" .Move(3810, 3240, 5805, 2430) With .ImageBrowse .ZOrder := 1 .Move(150, 150, 5400, 1455) .Outlined := False .BorderStyle := "None" .MinButton := True .ControlBox := False .Parent := ImageSelectForm .Visible := True With .Images .ZOrder := 1 .Move(0, 0, 5400, 1155) End With 'ImageSelectForm.ImageBrowse.Images With .ImageScrollBar .ZOrder := 2 .Move(0, 1155, 5400, 300) .Move(0, 1155, 5400, 300) End With 'ImageSelectForm.ImageBrowse.ImageScrollBar End With 'ImageSelectForm.ImageBrowse With .btnOK .Caption := "OK" .ZOrder := 2 .Move(1500, 1650, 900, 300) End With 'ImageSelectForm.btnOK With .btnCancel .Caption := "Cancel" .ZOrder := 3 .Move(3300, 1650, 900, 300) End With 'ImageSelectForm.btnCancel End With 'ImageSelectForm ' Reconstruction commands for object: TabPropertyForm ' With TabPropertyForm .Caption := "Tab Strip Properties" .ForeColor := 0 .Font := TabPropertyForm.font1 .Move(7095, 5130, 7260, 3945) .CurrentTabStrip := Nothing With .txtIndex .ZOrder := 1 .Move(1350, 525, 450, 300) .ReadOnly := True End With 'TabPropertyForm.txtIndex With .btnPrev .Caption := "<-" .Enabled := False .ZOrder := 2 .Move(1950, 525, 300, 300) End With 'TabPropertyForm.btnPrev With .btnNext .Caption := "->" .Enabled := False .ZOrder := 3 .Move(2250, 525, 300, 300) End With 'TabPropertyForm.btnNext With .btnAddTab .Caption := "Add Tab" .ZOrder := 4 .Move(2850, 525, 1200, 300) End With 'TabPropertyForm.btnAddTab With .btnRemoveTab .Caption := "Remove Tab" .ZOrder := 5 .Move(4350, 525, 1350, 300) End With 'TabPropertyForm.btnRemoveTab With .txtCaption .ZOrder := 6 .Move(1350, 1050, 5400, 300) End With 'TabPropertyForm.txtCaption With .txtIconIndex .ZOrder := 7 .Move(1350, 1575, 750, 300) End With 'TabPropertyForm.txtIconIndex With .btnSelect .Caption := "Select..." .ZOrder := 8 .Move(2250, 1575, 975, 300) End With 'TabPropertyForm.btnSelect With .chkForms .Caption := "TabForms" .ZOrder := 9 .Move(4350, 1500, 1200, 300) End With 'TabPropertyForm.chkForms With .chkMultiRow .Caption := "MultiRow" .ZOrder := 10 .Move(5700, 1500, 1125, 300) End With 'TabPropertyForm.chkMultiRow With .cboImages .ZOrder := 11 .Move(1350, 2475, 2850, 300) .ShowEmbeds := True .RootObject := ImageList .Style := "Unsorted" End With 'TabPropertyForm.cboImages With .btnImagesNew .Caption := "New..." .ZOrder := 12 .Move(4350, 2475, 675, 300) End With 'TabPropertyForm.btnImagesNew With .btnImagesEdit .Caption := "Edit..." .ZOrder := 13 .Move(5175, 2475, 675, 300) End With 'TabPropertyForm.btnImagesEdit With .btnImagesClear .Caption := "Clear" .ZOrder := 14 .Move(6000, 2475, 675, 300) End With 'TabPropertyForm.btnImagesClear With .btnOK .Caption := "OK" .ZOrder := 15 .Move(3000, 3150, 1050, 300) End With 'TabPropertyForm.btnOK With .Label1 .Caption := "Index:" .ZOrder := 16 .Move(450, 525, 900, 300) .Alignment := "Right" End With 'TabPropertyForm.Label1 With .Label2 .Caption := "Caption:" .ZOrder := 17 .Move(450, 1050, 900, 300) .Alignment := "Right" End With 'TabPropertyForm.Label2 With .Label4 .Caption := "Icon Index:" .ZOrder := 18 .Move(300, 1575, 1050, 300) .Alignment := "Right" End With 'TabPropertyForm.Label4 With .Label3 .Caption := "Icons:" .ZOrder := 19 .Move(600, 2475, 750, 300) .Alignment := "Right" End With 'TabPropertyForm.Label3 With .Frame1 .Caption := "Tabs" .ZOrder := 20 .Move(225, 150, 6675, 1800) End With 'TabPropertyForm.Frame1 With .Frame2 .Caption := "Icons" .ZOrder := 21 .Move(225, 2250, 6675, 675) End With 'TabPropertyForm.Frame2 With .font1 .FaceName := "MS Sans Serif" .Size := 9.000000 .Bold := True .Italic := False .Strikethru := False End With 'TabPropertyForm.font1 End With 'TabPropertyForm ' Reconstruction commands for object: ListViewPropsForm ' With ListViewPropsForm .Caption := "List View Properties" .ForeColor := 0 .Font := ListViewPropsForm.font1 .Move(7065, 5145, 7290, 3945) .CurrentListView := Nothing With .txtIndex .ZOrder := 1 .Move(1050, 375, 450, 300) .ReadOnly := True End With 'ListViewPropsForm.txtIndex With .btnPrev .Caption := "<-" .Enabled := False .ZOrder := 2 .Move(1650, 375, 300, 300) End With 'ListViewPropsForm.btnPrev With .btnNext .Caption := "->" .Enabled := False .ZOrder := 3 .Move(1950, 375, 300, 300) End With 'ListViewPropsForm.btnNext With .btnAddHdr .Caption := "Add Column Header" .ZOrder := 4 .Move(2550, 375, 1950, 300) End With 'ListViewPropsForm.btnAddHdr With .btnRemoveHdr .Caption := "Remove Column Header" .ZOrder := 5 .Move(4650, 375, 2175, 300) End With 'ListViewPropsForm.btnRemoveHdr With .txtCaption .ZOrder := 6 .Move(1125, 825, 5775, 300) End With 'ListViewPropsForm.txtCaption With .txtWidth .ZOrder := 7 .Move(1125, 1275, 1575, 300) End With 'ListViewPropsForm.txtWidth With .cboSmall .Move(1350, 2100, 2550, 300) .ShowEmbeds := True .RootObject := ImageList .Style := "Unsorted" .ZOrder := 8 End With 'ListViewPropsForm.cboSmall With .btnSmallNew .Caption := "New..." .ZOrder := 9 .Move(4050, 2100, 675, 300) End With 'ListViewPropsForm.btnSmallNew With .btnSmallEdit .Caption := "Edit..." .ZOrder := 10 .Move(4875, 2100, 675, 300) End With 'ListViewPropsForm.btnSmallEdit With .btnSmallClear .Caption := "Clear" .ZOrder := 11 .Move(5700, 2100, 675, 300) End With 'ListViewPropsForm.btnSmallClear With .cboLarge .Move(1350, 2550, 2550, 300) .ShowEmbeds := True .RootObject := ImageList .Style := "Unsorted" .ZOrder := 12 End With 'ListViewPropsForm.cboLarge With .btnLargeNew .Caption := "New..." .ZOrder := 13 .Move(4050, 2550, 675, 300) End With 'ListViewPropsForm.btnLargeNew With .btnLargeEdit .Caption := "Edit..." .ZOrder := 14 .Move(4050, 2550, 675, 300) .Move(4875, 2550, 675, 300) End With 'ListViewPropsForm.btnLargeEdit With .btnLargeClear .Caption := "Clear" .ZOrder := 15 .Move(5700, 2550, 675, 300) End With 'ListViewPropsForm.btnLargeClear With .btnOK .Caption := "OK" .ZOrder := 16 .Move(3150, 3150, 1050, 300) End With 'ListViewPropsForm.btnOK With .Label1 .Caption := "Index:" .ZOrder := 17 .Move(300, 375, 750, 300) .Alignment := "Right" End With 'ListViewPropsForm.Label1 With .Label2 .Caption := "Caption:" .ZOrder := 18 .Move(300, 825, 825, 300) .Alignment := "Right" End With 'ListViewPropsForm.Label2 With .Label5 .Caption := "Width:" .ZOrder := 19 .Move(300, 1275, 825, 300) .Alignment := "Right" End With 'ListViewPropsForm.Label5 With .Label3 .Caption := "Small Icons:" .ZOrder := 20 .Move(225, 2100, 1125, 300) .Alignment := "Right" End With 'ListViewPropsForm.Label3 With .Label4 .Caption := "Large Icons:" .ZOrder := 21 .Move(225, 2550, 1125, 300) .Alignment := "Right" End With 'ListViewPropsForm.Label4 With .Frame1 .Caption := "Column Headers" .ZOrder := 22 .Move(150, 75, 6825, 1575) End With 'ListViewPropsForm.Frame1 With .Frame2 .Caption := "Icons" .ZOrder := 23 .Move(150, 1800, 6825, 1200) End With 'ListViewPropsForm.Frame2 With .font1 .FaceName := "MS Sans Serif" .Size := 9.000000 .Bold := True .Italic := False .Strikethru := False End With 'ListViewPropsForm.font1 End With 'ListViewPropsForm ' Reconstruction commands for object: RegistryKey ' With RegistryKey .key := 0 .path := "0" .enumcnt := 0 End With 'RegistryKey ' Reconstruction commands for object: HashObjList ' With HashObjList .Move(0, 0, 0, 0) .selectedobj := Nothing With .HashObjs End With 'HashObjList.HashObjs End With 'HashObjList ' Reconstruction commands for object: OcxRegEntry ' With OcxRegEntry .RegKey := "" .ClassName := "" .Tag := "" .ResId := 0 .ControlName := "" .BitmapFile := "" .OcxFile := "" End With 'OcxRegEntry ' Reconstruction commands for object: OcxTool ' With OcxTool .Caption := "OcxTool" .Move(4485, 1635, 5610, 5505) With .OcxList .Caption := "OcxList" .ZOrder := 8 .Move(450, 900, 4650, 2670) With .HashObjs End With 'OcxTool.OcxList.HashObjs End With 'OcxTool.OcxList With .TextBox1 .Caption := "TextBox1" .ZOrder := 7 .Move(450, 4050, 2250, 450) .Visible := False End With 'OcxTool.TextBox1 With .Image1 .Caption := "Image1" .ZOrder := 6 .Move(2850, 4050, 450, 450) .Visible := False .AutoInitCropRect := False .CropXSize := 16 .CropYSize := 15 End With 'OcxTool.Image1 With .Button3 .Caption := "Add" .ZOrder := 5 .Move(3900, 4050, 1185, 300) .Visible := False End With 'OcxTool.Button3 With .Button4 .Caption := "Remove" .ZOrder := 4 .Move(3900, 4350, 1185, 300) .Visible := False End With 'OcxTool.Button4 With .TextBox2 .Caption := "TextBox2" .ZOrder := 3 .Move(450, 4050, 3300, 450) End With 'OcxTool.TextBox2 With .Button5 .Caption := "Register..." .ZOrder := 2 .Move(3900, 4050, 1200, 300) End With 'OcxTool.Button5 With .Button6 .Caption := "Unregister" .ZOrder := 1 .Move(3900, 4350, 1200, 300) End With 'OcxTool.Button6 With .Frame1 .Caption := "OCX File Name" .ZOrder := 9 .Move(300, 3750, 4950, 1050) End With 'OcxTool.Frame1 With .Frame2 .Caption := "OCX Class Name" .ZOrder := 10 .Move(300, 3750, 3150, 1050) .Visible := False End With 'OcxTool.Frame2 With .Frame3 .Caption := "Controls Palette" .ZOrder := 11 .Move(3450, 3750, 1800, 1050) .Visible := False End With 'OcxTool.Frame3 With .Frame4 .Caption := "OCX controls list" .ZOrder := 12 .Move(300, 600, 4950, 3150) End With 'OcxTool.Frame4 With .PaletteGroup .Append(OcxTool.Frame2) .Append(OcxTool.TextBox1) .Append(OcxTool.Image1) .Append(OcxTool.Frame3) .Append(OcxTool.Button3) .Append(OcxTool.Button4) End With 'OcxTool.PaletteGroup With .RegisterGroup .Append(OcxTool.Frame1) .Append(OcxTool.TextBox2) .Append(OcxTool.Button5) .Append(OcxTool.Button6) End With 'OcxTool.RegisterGroup With .TabStrip1 .Caption := "TabStrip1" .ZOrder := 13 .Move(150, 150, 5250, 4800) .SelectedItem := OcxTool.TabStrip1.AutoTab1 .TabWidthStyle := "Justified" .TabFixedWidth := 2610 With .AutoTab1 .Caption := "Register OCX controls" End With 'OcxTool.TabStrip1.AutoTab1 With .AutoTab2 .Caption := "Modify Control Palette" End With 'OcxTool.TabStrip1.AutoTab2 End With 'OcxTool.TabStrip1 End With 'OcxTool End Code