VERSION 5.00 Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX" Begin VB.Form frmMain Caption = "VBCommander" ClientHeight = 5610 ClientLeft = 165 ClientTop = 735 ClientWidth = 6945 LinkTopic = "Form1" ScaleHeight = 5610 ScaleWidth = 6945 StartUpPosition = 3 'Windows Default Begin VB.VScrollBar VelScroll Height = 375 LargeChange = 10 Left = 1440 Max = 80 TabIndex = 7 Top = 2040 Value = 30 Width = 375 End Begin VB.TextBox WCStatus Height = 375 Left = 480 TabIndex = 0 Text = "Not Connected" Top = 960 Width = 3975 End Begin VB.CommandButton Coast Caption = "Coast" Height = 285 Left = 3600 TabIndex = 4 Top = 2040 Width = 855 End Begin VB.CommandButton Go Caption = "Go!" Height = 285 Left = 2640 TabIndex = 3 Top = 2040 Width = 735 End Begin VB.TextBox Velocity Height = 375 Left = 480 TabIndex = 1 Text = "30" Top = 2040 Width = 975 End Begin MSComctlLib.StatusBar sbStatusBar Align = 2 'Align Bottom Height = 405 Left = 0 TabIndex = 2 Top = 5205 Width = 6945 _ExtentX = 12250 _ExtentY = 714 _Version = 393216 BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} NumPanels = 1 BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} EndProperty EndProperty End Begin VB.Label Label2 Caption = "Velocity:" Height = 375 Left = 480 TabIndex = 6 Top = 1680 Width = 1095 End Begin VB.Label Label1 Caption = "WheelCommander Status:" Height = 375 Left = 480 TabIndex = 5 Top = 600 Width = 2295 End Begin VB.Menu mnuFile Caption = "&File" Begin VB.Menu mnuFileNew Caption = "&New" Shortcut = ^N End Begin VB.Menu mnuFileOpen Caption = "&Open..." End Begin VB.Menu mnuFileClose Caption = "&Close" End Begin VB.Menu mnuFileBar0 Caption = "-" End Begin VB.Menu mnuFileSave Caption = "&Save" End Begin VB.Menu mnuFileSaveAs Caption = "Save &As..." End Begin VB.Menu mnuFileSaveAll Caption = "Save A&ll" End Begin VB.Menu mnuFileBar1 Caption = "-" End Begin VB.Menu mnuFileProperties Caption = "Propert&ies" End Begin VB.Menu mnuFileBar2 Caption = "-" End Begin VB.Menu mnuFilePageSetup Caption = "Page Set&up..." End Begin VB.Menu mnuFilePrintPreview Caption = "Print Pre&view" End Begin VB.Menu mnuFilePrint Caption = "&Print..." End Begin VB.Menu mnuFileBar3 Caption = "-" End Begin VB.Menu mnuFileSend Caption = "Sen&d..." End Begin VB.Menu mnuFileBar4 Caption = "-" End Begin VB.Menu mnuFileMRU Caption = "" Index = 1 Visible = 0 'False End Begin VB.Menu mnuFileMRU Caption = "" Index = 2 Visible = 0 'False End Begin VB.Menu mnuFileMRU Caption = "" Index = 3 Visible = 0 'False End Begin VB.Menu mnuFileBar5 Caption = "-" Visible = 0 'False End Begin VB.Menu mnuFileExit Caption = "E&xit" End End Begin VB.Menu mnuEdit Caption = "&Edit" Begin VB.Menu mnuEditUndo Caption = "&Undo" End Begin VB.Menu mnuEditBar0 Caption = "-" End Begin VB.Menu mnuEditCut Caption = "Cu&t" Shortcut = ^X End Begin VB.Menu mnuEditCopy Caption = "&Copy" Shortcut = ^C End Begin VB.Menu mnuEditPaste Caption = "&Paste" Shortcut = ^V End Begin VB.Menu mnuEditPasteSpecial Caption = "Paste &Special..." End End Begin VB.Menu mnuView Caption = "&View" Begin VB.Menu mnuViewToolbar Caption = "&Toolbar" Checked = -1 'True End Begin VB.Menu mnuViewStatusBar Caption = "Status &Bar" Checked = -1 'True End Begin VB.Menu mnuViewBar0 Caption = "-" End Begin VB.Menu mnuViewRefresh Caption = "&Refresh" End Begin VB.Menu mnuViewOptions Caption = "&Options..." End Begin VB.Menu mnuViewWebBrowser Caption = "&Web Browser" End End Begin VB.Menu mnuTools Caption = "&Tools" Begin VB.Menu mnuToolsOptions Caption = "&Options..." End End Begin VB.Menu mnuHelp Caption = "&Help" Begin VB.Menu mnuHelpContents Caption = "&Contents" End Begin VB.Menu mnuHelpSearchForHelpOn Caption = "&Search For Help On..." End Begin VB.Menu mnuHelpBar0 Caption = "-" End Begin VB.Menu mnuHelpAbout Caption = "&About " End End End Attribute VB_Name = "frmMain" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any) Private velTextBoxChanging As Boolean Private Sub Coast_Click() NdiCmd_Coast handle ' tell WheelCommander to stop moving End Sub Private Sub Go_Click() NdiCmd_Go handle ' tell WheelCommander to start using current velocity setting End Sub Private Sub Velocity_Change() Dim vel As Integer vel = Velocity.Text velTextBoxChanging = True VelScroll.Value = vel velTextBoxChanging = False NdiCmd_SetVelocity handle, vel ' pass velocity value from form to WheelCommander End Sub Private Sub VelScroll_Change() If velTextBoxChanging = False Then Velocity.Text = VelScroll.Value End If End Sub Private Sub Form_Load() Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000) Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000) Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500) Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500) End Sub Private Sub Form_Unload(Cancel As Integer) Dim i As Integer 'close all sub forms For i = Forms.Count - 1 To 1 Step -1 Unload Forms(i) Next If Me.WindowState <> vbMinimized Then SaveSetting App.Title, "Settings", "MainLeft", Me.Left SaveSetting App.Title, "Settings", "MainTop", Me.Top SaveSetting App.Title, "Settings", "MainWidth", Me.Width SaveSetting App.Title, "Settings", "MainHeight", Me.Height End If End Sub Private Sub mnuHelpAbout_Click() frmAbout.Show vbModal, Me End Sub Private Sub mnuHelpSearchForHelpOn_Click() Dim nRet As Integer 'if there is no helpfile for this project display a message to the user 'you can set the HelpFile for your application in the 'Project Properties dialog If Len(App.HelpFile) = 0 Then MsgBox "Unable to display Help Contents. There is no Help associated with this project.", vbInformation, Me.Caption Else On Error Resume Next nRet = OSWinHelp(Me.hwnd, App.HelpFile, 261, 0) If Err Then MsgBox Err.Description End If End If End Sub Private Sub mnuHelpContents_Click() Dim nRet As Integer 'if there is no helpfile for this project display a message to the user 'you can set the HelpFile for your application in the 'Project Properties dialog If Len(App.HelpFile) = 0 Then MsgBox "Unable to display Help Contents. There is no Help associated with this project.", vbInformation, Me.Caption Else On Error Resume Next nRet = OSWinHelp(Me.hwnd, App.HelpFile, 3, 0) If Err Then MsgBox Err.Description End If End If End Sub Private Sub mnuToolsOptions_Click() frmOptions.Show vbModal, Me End Sub Private Sub mnuViewWebBrowser_Click() Dim frmB As New frmBrowser frmB.StartingAddress = "http://www.nubotics.com" frmB.Show End Sub Private Sub mnuViewOptions_Click() frmOptions.Show vbModal, Me End Sub Private Sub mnuViewRefresh_Click() 'ToDo: Add 'mnuViewRefresh_Click' code. MsgBox "Add 'mnuViewRefresh_Click' code." End Sub Private Sub mnuViewStatusBar_Click() mnuViewStatusBar.Checked = Not mnuViewStatusBar.Checked sbStatusBar.Visible = mnuViewStatusBar.Checked End Sub Private Sub mnuEditPasteSpecial_Click() 'ToDo: Add 'mnuEditPasteSpecial_Click' code. MsgBox "Add 'mnuEditPasteSpecial_Click' code." End Sub Private Sub mnuEditPaste_Click() 'ToDo: Add 'mnuEditPaste_Click' code. MsgBox "Add 'mnuEditPaste_Click' code." End Sub Private Sub mnuEditCopy_Click() 'ToDo: Add 'mnuEditCopy_Click' code. MsgBox "Add 'mnuEditCopy_Click' code." End Sub Private Sub mnuEditCut_Click() 'ToDo: Add 'mnuEditCut_Click' code. MsgBox "Add 'mnuEditCut_Click' code." End Sub Private Sub mnuEditUndo_Click() 'ToDo: Add 'mnuEditUndo_Click' code. MsgBox "Add 'mnuEditUndo_Click' code." End Sub Private Sub mnuFileExit_Click() 'unload the form Unload Me End Sub Private Sub mnuFileSend_Click() 'ToDo: Add 'mnuFileSend_Click' code. MsgBox "Add 'mnuFileSend_Click' code." End Sub Private Sub mnuFilePrint_Click() 'ToDo: Add 'mnuFilePrint_Click' code. MsgBox "Add 'mnuFilePrint_Click' code." End Sub Private Sub mnuFilePrintPreview_Click() 'ToDo: Add 'mnuFilePrintPreview_Click' code. MsgBox "Add 'mnuFilePrintPreview_Click' code." End Sub Private Sub mnuFilePageSetup_Click() On Error Resume Next With dlgCommonDialog .DialogTitle = "Page Setup" .CancelError = True .ShowPrinter End With End Sub Private Sub mnuFileProperties_Click() 'ToDo: Add 'mnuFileProperties_Click' code. MsgBox "Add 'mnuFileProperties_Click' code." End Sub Private Sub mnuFileSaveAll_Click() 'ToDo: Add 'mnuFileSaveAll_Click' code. MsgBox "Add 'mnuFileSaveAll_Click' code." End Sub Private Sub mnuFileSaveAs_Click() 'ToDo: Add 'mnuFileSaveAs_Click' code. MsgBox "Add 'mnuFileSaveAs_Click' code." End Sub Private Sub mnuFileSave_Click() 'ToDo: Add 'mnuFileSave_Click' code. MsgBox "Add 'mnuFileSave_Click' code." End Sub Private Sub mnuFileClose_Click() 'ToDo: Add 'mnuFileClose_Click' code. MsgBox "Add 'mnuFileClose_Click' code." End Sub Private Sub mnuFileOpen_Click() Dim sFile As String With dlgCommonDialog .DialogTitle = "Open" .CancelError = False 'ToDo: set the flags and attributes of the common dialog control .Filter = "All Files (*.*)|*.*" .ShowOpen If Len(.FileName) = 0 Then Exit Sub End If sFile = .FileName End With 'ToDo: add code to process the opened file End Sub Private Sub mnuFileNew_Click() 'ToDo: Add 'mnuFileNew_Click' code. MsgBox "Add 'mnuFileNew_Click' code." End Sub