Esempio n. 1
0
 public AdminForm(string token)
 {
     Token = token;
     InitializeComponent();
     BuildGrid();
     Closing += new System.ComponentModel.CancelEventHandler(this.OnWindowClosing);
 }
Esempio n. 2
0
        public Inspector()
        {
            InitializeComponent();

            this.SizeChanged += new SizeChangedEventHandler(Inspector_SizeChanged);
            Closing          += new System.ComponentModel.CancelEventHandler(Inspector_Closing);
        }
Esempio n. 3
0
        public MainForm()
        {
            InitializeComponent();

            // The SDK may fire events from arbitrary thread context. Therefore if you want to change
            // the state of controls or windows from any of the SDK' events, you have to use this
            // synchronization context to execute the event handler code on the main GUI thread.
            _syncContext = WindowsFormsSynchronizationContext.Current;

            //Setting up WindowsCE-specific event handlers manually, as they are lost from the Designer.cs file upon save
#if !WindowsCE
            cbEnableKeepAlive.CheckedChanged += new System.EventHandler(this.cbEnableKeepAlive_CheckedChanged);
#else
            cbEnableKeepAlive.CheckStateChanged += new System.EventHandler(this.cbEnableKeepAlive_CheckedChanged);
#endif

#if !WindowsCE
            cbLiveDisplay.CheckedChanged += new System.EventHandler(this.cbLiveDisplay_CheckedChanged);
#else
            cbLiveDisplay.CheckStateChanged += new System.EventHandler(this.cbLiveDisplay_CheckedChanged);
#endif

#if !WindowsCE
            cbLoggingEnabled.CheckedChanged += new System.EventHandler(this.cbLoggingEnabled_CheckedChanged);
#else
            cbLoggingEnabled.CheckStateChanged += new System.EventHandler(this.cbLoggingEnabled_CheckedChanged);
#endif

#if !WindowsCE
            FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing);
#else
            Closing += new System.ComponentModel.CancelEventHandler(this.MainForm_FormClosing);
#endif
        }
Esempio n. 4
0
        public Locality(Config conf, Calendar cal)
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);

            InitializeComponent();

            comboBoxZones.Items.Add("Select time zone...");
            comboBoxZones.Items.AddRange(Config.AllZones);
            this.conf    = conf;
            formCalendar = cal;
            formCalendar.FormLocalityOpen = true;
            Closing += new System.ComponentModel.CancelEventHandler(this.formClosing);
            for (int i = 0; i < conf.PlaceNum; i++)
            {
                comboBoxCity.Items.Add(conf.Places[i].Name);
            }
            comboBoxCity.Text = conf.DefaultLocality.Name;

            if (!PInvoke.VisualStylesEnabled())
            {
                Config.FixRadioButtons(Controls, FlatStyle.Standard);
            }
        }
Esempio n. 5
0
        public SettingsWindow()
        {
            InitializeComponent();
            Loaded  += new RoutedEventHandler(SettingsWindow_Loaded);
            Closing += new System.ComponentModel.CancelEventHandler(SettingsWindow_Closing);
            maxImageTextBox.Text = Properties.Settings.Default.ImageMaxWidth.ToString();
            if (Properties.Settings.Default.ColorPrimary == "#343a40")
            {
                toggleButtonColor.IsChecked = true; textBlockColor.Text = "Czarny Styl";
            }
            else
            {
                toggleButtonColor.IsChecked = false; textBlockColor.Text = "Biały Styl";
            }
            toggleButtonText.IsChecked     = Properties.Settings.Default.NormalText;
            toggleButtonAppClose.IsChecked = !Properties.Settings.Default.AppClose;
            fileListToggle.IsChecked       = Properties.Settings.Default.FileDropList;

            if (Properties.Settings.Default.MaxElement != 0)
            {
                maxElementTB.Text = Properties.Settings.Default.MaxElement.ToString();
            }

            TBkey1.Text          = ((Key)Properties.Settings.Default.Key1).ToString();
            TBkey2.SelectedIndex = Properties.Settings.Default.Key2;
            TBkey3.SelectedIndex = Properties.Settings.Default.Key3;

            toggleButtonSystem.IsChecked = Properties.Settings.Default.SystemStart;
        }
        public RichTextContextMenuStrip(RichTextBox rtb)
            : base()
        {
            this.rtb = rtb;
            Opening += new System.ComponentModel.CancelEventHandler(RichTextContextMenuStrip_Opening);
            ToolStripMenuItem special = new ToolStripMenuItem("&Insert special", null,
                                                              new ToolStripMenuItem("\x22ee"), //vertical ellipsis
                                                              new ToolStripMenuItem("\x2205"), //empty set
                                                              new ToolStripMenuItem("\x2203"), //there exists
                                                              new ToolStripMenuItem("\x2200")  //for all
                                                              );

            special.DropDownItemClicked += new ToolStripItemClickedEventHandler(special_DropDownItemClicked);
            ToolStripMenuItem undo        = new ToolStripMenuItem("&Undo", null, Undo);
            ToolStripMenuItem cut         = new ToolStripMenuItem("Cu&t", null, Cut);
            ToolStripMenuItem copy        = new ToolStripMenuItem("&Copy", null, Copy);
            ToolStripMenuItem paste       = new ToolStripMenuItem("&Paste", null, Paste);
            ToolStripMenuItem pasteastext = new ToolStripMenuItem("Paste as &Text", null, PasteAsText);
            ToolStripMenuItem selectall   = new ToolStripMenuItem("Select &All", null, SelectAll);

            this.Items.AddRange(new ToolStripItem[] {
                special,
                new ToolStripSeparator(),
                undo,
                new ToolStripSeparator(),
                cut,
                copy,
                paste,
                pasteastext,
                new ToolStripSeparator(),
                selectall,
            });
        }
 /// <summary>
 /// Raises the <see cref="FileOk" /> event.
 /// </summary>
 /// <param name="e">A <see cref="System.ComponentModel.CancelEventArgs" /> that contains the event data.</param>
 protected virtual void OnFileOk(System.ComponentModel.CancelEventArgs e)
 {
     System.ComponentModel.CancelEventHandler handler = FileOk;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Esempio n. 8
0
        public CommonDialog()
        {
            InitializeComponent();

            DefaultOkCommand     = new DelegateCommand <object>(OnDefaultOkCommand);
            DefaultCancelCommand = new DelegateCommand <object>(OnDefaultCancelCommand);

            Closing += new System.ComponentModel.CancelEventHandler(CommonDialog_Closing);
        }
Esempio n. 9
0
        protected virtual void OnValidateStep(CancelEventArgs e)
        {
            System.ComponentModel.CancelEventHandler handler = (System.ComponentModel.CancelEventHandler)Events[BaseStep.validateStep];

            if (handler != null)
            {
                handler(this, e);
            }
        }
Esempio n. 10
0
 public ListTeams(BPMSMain parent)
 {
     myParent = parent;
     InitializeComponent();
     configreNamesFromTeamInfo();
     deleteFromListButton.Enabled = false;
     queueFromListButton.Enabled  = false;
     Closing += new System.ComponentModel.CancelEventHandler(okButtonClicked);
     paintMe(myParent.Data.Theme, myParent.myThemeColors);
 }
Esempio n. 11
0
        public MainWindow()
        {
            InitializeComponent();

            CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
            Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);

            _sensor = new NuiSensor("SamplesConfig.xml");

            _worker.DoWork += new DoWorkEventHandler(Worker_DoWork);
        }
Esempio n. 12
0
        public MainWindow()
        {
            InitializeComponent();

            CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
            Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);

            _sensor = new NuiSensor("SamplesConfig.xml");

            _worker.DoWork += new DoWorkEventHandler(Worker_DoWork);
        }
Esempio n. 13
0
        public MainWindow()
        {
            InitializeComponent();

            console = new Console();
            console.Show();
            console.Top  = 0;
            console.Left = 0;

            Console.Write("TrackingNI by Richard Pianka and Ramsey Abouzahra");

            context        = new Context(CONFIG_FILE);
            imageGenerator = new ImageGenerator(context);
            depthGenerator = new DepthGenerator(context);
            userGenerator  = new UserGenerator(context);

            poseDetectionCapability = userGenerator.PoseDetectionCapability;
            skeletonCapability      = userGenerator.SkeletonCapability;

            MapOutputMode mapMode = depthGenerator.MapOutputMode;

            int width  = (int)mapMode.XRes;
            int height = (int)mapMode.YRes;

            imageBitmap          = new WriteableBitmap(width, height, DPI_X, DPI_Y, PixelFormats.Rgb24, null);
            depthBitmap          = new WriteableBitmap(width, height, DPI_X, DPI_Y, PixelFormats.Rgb24, null);
            depthBitmapCorrected = new WriteableBitmap(width, height, DPI_X, DPI_Y, PixelFormats.Rgb24, null);
            imageData            = new ImageMetaData();
            depthData            = new DepthMetaData();

            skeletonDraw = new SkeletonDraw();

            Histogram = new int[depthGenerator.DeviceMaxDepth];

            reader = new Thread(new ThreadStart(Reader));
            reader.IsBackground = true;
            worker = new BackgroundWorker();
            stop   = false;

            CompositionTarget.Rendering += new EventHandler(Worker);
            Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);

            userGenerator.NewUser  += new EventHandler <NewUserEventArgs>(NewUser);
            userGenerator.LostUser += new EventHandler <UserLostEventArgs>(LostUser);

            skeletonCapability.CalibrationStart += new EventHandler <CalibrationStartEventArgs>(CalibrationStart);
            skeletonCapability.CalibrationEnd   += new EventHandler <CalibrationEndEventArgs>(CalibrationEnd);
            skeletonCapability.SetSkeletonProfile(SkeletonProfile.All);
            poseDetectionCapability.PoseDetected += new EventHandler <PoseDetectedEventArgs>(PoseDetected);
            poseDetectionCapability.PoseEnded    += new EventHandler <PoseEndedEventArgs>(PoseEnded);
            reader.Start();
            worker.DoWork += new DoWorkEventHandler(WorkerTick);
        }
Esempio n. 14
0
 private void OnWindowEvent(object sender, System.ComponentModel.CancelEventArgs e)
 {
     System.ComponentModel.CancelEventHandler handler = (System.ComponentModel.CancelEventHandler)eventDestination.Target;
     if (handler != null)
     {
         handler.Invoke(sender, e);
     }
     else
     {
         Deregister();
     }
 }
Esempio n. 15
0
        /// <summary>
        /// 等待任务完成
        /// </summary>
        /// <param name="callBack"></param>
        /// <returns></returns>
        public bool WaitForExit(System.ComponentModel.CancelEventHandler callBack)
        {
            while (true)
            {
                if (this.IsRunning == false)
                {
                    break;
                }
                if (callBack != null)
                {
                    System.ComponentModel.CancelEventArgs args = new CancelEventArgs();
                    args.Cancel = false;
                    callBack(this, args);
                    if (args.Cancel)
                    {
                        this.Cancel();
                        break;
                    }
                }
                System.Threading.Thread.Sleep(100);
            }//while

            if ((this.Status & PrintJobStatus.ERROR) == PrintJobStatus.ERROR)
            {
                return(false);
            }
            if ((this.Status & PrintJobStatus.DELETING) == PrintJobStatus.DELETING)
            {
                return(false);
            }
            if ((this.Status & PrintJobStatus.DELETED) == PrintJobStatus.DELETED)
            {
                return(false);
            }
            if ((this.Status & PrintJobStatus.OFFLINE) == PrintJobStatus.OFFLINE)
            {
                return(false);
            }

            if ((this.Status & PrintJobStatus.PRINTING) == PrintJobStatus.PRINTING ||
                (this.Status & PrintJobStatus.PRINTED) == PrintJobStatus.PRINTED)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 16
0
        public WindowEventWrapper(Window source, EventType eventType, System.ComponentModel.CancelEventHandler handler)
        {
            eventSource      = source;
            eventDestination = new WeakReference(handler);

            if (eventType == EventType.Closing)
            {
                eventSource.Closing += OnWindowEvent;
            }
            else
            {
                eventSource      = null;
                eventDestination = null;
            }
        }
Esempio n. 17
0
		public ManualTZ(string posixTZ) {
			InitializeComponent();
            this.DataContext = this;
			btnApply.Content = LocalButtons.instance.apply;

			valueTZ.CreateBinding(TextBox.TextProperty, this, t => t.posixTZ,
				(m, o) => {
					m.posixTZ = o;
					posix = PosixTz.TryParse(o);
					ValidateUI();
				}
			);
			this.posixTZ = posixTZ;
			Loaded+=new RoutedEventHandler((o,e)=>{ValidateUI();});
            Closing += new System.ComponentModel.CancelEventHandler(Upgrade_Closing);
		}
Esempio n. 18
0
        public ManualTZ(string posixTZ)
        {
            InitializeComponent();
            this.DataContext = this;
            btnApply.Content = LocalButtons.instance.apply;

            valueTZ.CreateBinding(TextBox.TextProperty, this, t => t.posixTZ,
                                  (m, o) => {
                m.posixTZ = o;
                posix     = PosixTz.TryParse(o);
                ValidateUI();
            }
                                  );
            this.posixTZ = posixTZ;
            Loaded      += new RoutedEventHandler((o, e) => { ValidateUI(); });
            Closing     += new System.ComponentModel.CancelEventHandler(Upgrade_Closing);
        }
Esempio n. 19
0
        public AboutOld(Config conf)
        {
            InitializeComponent();

            // We do our own painting in this form, see About.OnPaintBackground
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);

            this.conf = conf;
            conf.Core.FormAboutOpen = true;
            Closing += new System.ComponentModel.CancelEventHandler(formClosing);

                        #if BETA
            if (!conf.Core.Photogenic)
            {
                labelVer.Text = String.Format("{0} (Build {1}), {2}", Config.BetaVersion, Application.ProductVersion, Config.CopyrightString);
            }
            else
            {
                        #endif
            labelVer.Text = String.Format("Version {0}, {1}", Config.Version, Config.CopyrightString);
                        #if BETA
        }
                        #endif

            labelVer.Left         = labelName.Left + 2;
            linkLabelLicense.Left = labelName.Left + 2;

            pictureBox1.Image = Image.FromStream(conf.Fx.GlyphGif("Saturn"));

            //xpLabelAddress.Text = Config.PostalAddress;

            /*
             *      xpLabelOS = new XPLabel();
             *      xpLabelOS.Size = new Size (340, 20);
             *      xpLabelOS.Location = new Point (8, 336);
             *      xpLabelOS.BackColor = Color.Transparent;
             #if MONO
             *              xpLabelOS.Text = String.Format("{0} (with Mono)", Config.OSVersion());
             #else
             *              xpLabelOS.Text = String.Format("{0} (.NET Framework {1})", Config.OSVersion(), Environment.Version.ToString());
             #endif
             *      Controls.Add(xpLabelOS);
             */
        }
        public FrozenFinalDialog(YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
            YellowstonePathology.Business.Test.Surgical.IntraoperativeConsultationResult intraoperativeConsultation,
            YellowstonePathology.UI.TypingShortcutUserControl typingShortcutUserControl)
        {
            this.m_PathologistUsers = YellowstonePathology.Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetUsersByRole(YellowstonePathology.Business.User.SystemUserRoleDescriptionEnum.Pathologist, true);
            this.m_AccessionOrder = accessionOrder;
            this.m_IntraoperativeConsultation = intraoperativeConsultation;
            this.m_TypingShortcutUserControl = typingShortcutUserControl;

            YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder panelSetOrderSurgical = (YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder)accessionOrder.PanelSetOrderCollection.GetSurgical();
            YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen surgicalSpecimen = (from ssr in panelSetOrderSurgical.SurgicalSpecimenCollection
                                                                                                            where ssr.SurgicalSpecimenId == intraoperativeConsultation.SurgicalSpecimenId
                                                                                           select ssr).Single<YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen>();
            this.m_SpecimenOrder = surgicalSpecimen.SpecimenOrder;
            InitializeComponent();

            this.DataContext = this;
            Closing += new System.ComponentModel.CancelEventHandler(FrozenFinalDialog_Closing);
        }
Esempio n. 21
0
        public FrozenFinalDialog(YellowstonePathology.Business.Test.AccessionOrder accessionOrder,
                                 YellowstonePathology.Business.Test.Surgical.IntraoperativeConsultationResult intraoperativeConsultation,
                                 YellowstonePathology.UI.TypingShortcutUserControl typingShortcutUserControl)
        {
            this.m_PathologistUsers           = YellowstonePathology.Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetUsersByRole(YellowstonePathology.Business.User.SystemUserRoleDescriptionEnum.Pathologist, true);
            this.m_AccessionOrder             = accessionOrder;
            this.m_IntraoperativeConsultation = intraoperativeConsultation;
            this.m_TypingShortcutUserControl  = typingShortcutUserControl;

            YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder panelSetOrderSurgical = (YellowstonePathology.Business.Test.Surgical.SurgicalTestOrder)accessionOrder.PanelSetOrderCollection.GetSurgical();
            YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen  surgicalSpecimen      = (from ssr in panelSetOrderSurgical.SurgicalSpecimenCollection
                                                                                                   where ssr.SurgicalSpecimenId == intraoperativeConsultation.SurgicalSpecimenId
                                                                                                   select ssr).Single <YellowstonePathology.Business.Test.Surgical.SurgicalSpecimen>();
            this.m_SpecimenOrder = surgicalSpecimen.SpecimenOrder;
            InitializeComponent();

            this.DataContext = this;
            Closing         += new System.ComponentModel.CancelEventHandler(FrozenFinalDialog_Closing);
        }
Esempio n. 22
0
        public ShowRichTextBox(Config conf)
        {
            this.conf = conf;
            InitializeComponent();
            Closing += new System.ComponentModel.CancelEventHandler(formClose);

            string filename;

            //if (type == FileType.License)
            //{
            filename  = Path.Combine(conf.Path, LicenseFile);
            this.Text = conf.GetString("License.Title");
            conf.Core.FormLicenseOpen = true;
            //}
            //else
            //{
            //    filename = conf.Path + ReadMeFile;
            //    this.Text = conf.GetString ("Read Me.Title");
            //    conf.Core.FormReadMeOpen = true;
            //}

            if (File.Exists(filename))
            {
                try
                {
                    richTextBox1.LoadFile(filename);
                }
                catch
                {
                    MessageBox.Show("Failed opening file: " + filename, "File Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    conf.Core.FormLicenseOpen = false;
                    Dispose();
                }
            }
            else
            {
                MessageBox.Show("File not found: " + filename, "File Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error);
                conf.Core.FormReadMeOpen = false;
                Dispose();
            }
            richTextBox1.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(linkClicked);
        }
Esempio n. 23
0
        public DockingWindow()
        {
            try {
                App.container.SatisfyImportsOnce(this);
            } catch (CompositionException exc) {
                var ie = exc.RootCauses.Select(rc => rc.InnerException).FirstOrDefault() ?? exc.InnerException;
                while (ie.InnerException != null)
                {
                    ie = ie.InnerException;
                }
                ExceptionDispatchInfo.Capture(ie).Throw();
            }
            StyleManager.ApplicationTheme = new VistaTheme();
            InitializeComponent();
            var trader = App.container.GetExportedValue <TraderModel>();

            trader.SubscribeToPropertyChanged(t => t.IpPortActual, t => {
                base.Title = "HH in " + t.TitleRoot + "{" + Assembly.GetExecutingAssembly().GetName().Version + "}";
            });
            ((INotifyPropertyChanged)RootVisual.DataContext).PropertyChanged += DataContext_PropertyChanged;
            #region Window Events
            Closing      += new System.ComponentModel.CancelEventHandler(DockingWindow_Closing);
            StateChanged += DockingWindow_StateChanged;
            #endregion
            #region Message Registration
            GalaSoft.MvvmLight.Messaging.Messenger.Default.Register <CharterControl>(this, (object)CharterControl.MessageType.Add, AddCharter);
            GalaSoft.MvvmLight.Messaging.Messenger.Default.Register <CharterControl>(this, (object)CharterControl.MessageType.Remove, RemoveCharter);
            #endregion
            #region RootVisual Events
            RootVisual.Loaded          += RootVisual_Loaded;
            RootVisual.Close           += RootVisual_Close;
            RootVisual.PaneStateChange += RootVisual_PaneStateChange;
            RootVisual.ElementCleaning += RootVisual_ElementCleaning;
            RootVisual.ElementLoaded   += RootVisual_ElementLoaded;
            #endregion
        }
        public MainWindow()
        {
            InitializeComponent();
            Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
            DataContext = this;
            TheCharacter = "█";
            FromLeft = 0;
            FromTop = 0;
            TheFontSize = 9;
            //xp.Minimum = 0; // set the progress bar min and max
            //xp.Maximum = 640;
            //yp.Minimum = 0;
            //yp.Maximum = 480;
            try {
                motor = CLNUIDevice.CreateMotor();
                camera = CLNUIDevice.CreateCamera();
                CLNUIDevice.SetMotorLED(motor, 3);
            }
            catch (System.Exception ex) {
                System.Windows.MessageBox.Show(ex.ToString());
                this.Close(); // no point opening the program if it cant find kinect
            }
            ClickWait = new DispatcherTimer(TimeSpan.FromMilliseconds(200), DispatcherPriority.Normal, (EventHandler)delegate(object sender, EventArgs e)  {
                canclick = true;
                ClickWait.Stop();
            }, Dispatcher);
            //create the images
            colorImage = new NUIImage(640, 480);
            color.Source = colorImage.BitmapSource;
            depthImage = new NUIImage(640, 480);
            realImage = new NUIImage(640, 480);
            real.Source = realImage.BitmapSource;
            //depth.Source = depthImage.BitmapSource;
            processedImage = new WriteableBitmap(depthImage.BitmapSource);
            depth.Source = processedImage;
            // Create camera capture thread
            running = true;
            captureThread = new Thread(delegate() {
                CLNUIDevice.StartCamera(camera);
                int numLoops = 0;
                int pixelStep = 3;
                int loopStep = 1;
                while (running) {
                    CLNUIDevice.GetCameraDepthFrameRGB32(camera, colorImage.ImageData, 500); //normal feed (top)
                    CLNUIDevice.GetCameraDepthFrameRGB32(camera, depthImage.ImageData, 0); //to be altered feed (bottom)
                    CLNUIDevice.GetCameraColorFrameRGB32(camera, realImage.ImageData, 0);
                    int red = 255;
                    int green = 255;
                    int blue = 255;
                    Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)delegate() {
                        if (numLoops == 0 || numLoops == loopStep) {
                            int height = (int)depthImage.BitmapSource.Height;
                            int width = (int)depthImage.BitmapSource.Width;
                            int stride = (depthImage.BitmapSource.PixelWidth * depthImage.BitmapSource.Format.BitsPerPixel + 7) / 8;
                            byte[] newPixels = new byte[height * width * processedImage.Format.BitsPerPixel / 8];
                            bool found = false;
                            // Loop through the all the pixels row by row
                            bool foundclick = false;
                            bool draw = false;
                            for (int row = 0; row < height; row = row + pixelStep) {//for each row of pixels
                                for (int col = 0; col < width; col = col + pixelStep) {//for each collumn of pixels
                                    // Disregard top 10% and lower 10% to speed up the app
                                    if ( row < height* 0.1 || row > height * 0.9) {
                                        break;
                                    }

                                    // Get current pixel
                                    //========================================
                                    //Overview of below code:
                                    //-----------------------
                                    //basically it goes through each pixel.. if it is a certian colour (set via depth) it then changes is colour to white/red/green - i did warn you, its ugly
                                    //================================-=======
                                    byte[] currentPixel = new byte[4];
                                    depthImage.BitmapSource.CopyPixels(new Int32Rect((int)col, (int)row, 1, 1), currentPixel, stride, 0);
                                    /*
                                    // Blue Green Red Alpha
                                    //Console.WriteLine("Test: " + currentPixel[0] + "," + currentPixel[1] + "," + currentPixel[2] + "," + currentPixel[3]);
                                    */
                                    int index = (row * stride) + (col * 4);
                                    //IF STATEMENT BELOW:
                                    // currentPixel[0] = Blue
                                    // currentPixel[1] = Green
                                    // currentPixel[2] = Red
                                    // currentPixel[3] = Alpha - we dont actually need to use this
                                    if (currentPixel[0] == 255
                                        && (currentPixel[1] <= 45 && currentPixel[1] >= 15)
                                        && (currentPixel[2] <= 45 && currentPixel[2] >= 15))   // set this to your bacground colour - This is the colour the paper in my demo shows up as
                                    {
                                            red = 255;
                                            green = 255;
                                            blue = 255;
                                        // if it is found it changes the pixels to white with the above code
                                    }
                                    //else if (currentPixel[0] == 255
                                    else if ((currentPixel[1] == 255)
                                        && (currentPixel[0] == 0 )
                                        && (currentPixel[2] >= 40 && currentPixel[2] <= 150))
                                        //&& (currentPixel[1] <= 50 && currentPixel[1] >= 46)
                                        //&& (currentPixel[2] <= 50 && currentPixel[2] >= 46))   // set this to your finger tip touching the background colour
                                    {
                                        if (col <= 80 && row <= 60) //this if statement checks if the pixel is found in the top right of the screen it will be used as the clicker (thats how i set it up)
                                        {
                                            red = 0;
                                            green = 255; //sets it to come up green
                                            blue = 0;
                                            if (usemouse == true) // if i have clicked enable mouse
                                            {
                                                if (canclick == true) // this is the 200 ms gap between clicks i made, if it wasnt there it would click each frame my finger is detected
                                                {
                                                    SendDoubleClick(); // sends single click command (although its named doubble)
                                                    canclick = false; // disables can click
                                                    ClickWait.Start(); //starts 200ms wait timer
                                                }
                                            }
                                        }
                                        else // if its not in the 'click corner' then it will be used to set the point
                                        {
                                            red = 255; //sets the fingertip to red
                                            green = 0;
                                            blue = 0;
                                            if (!found)  {
                                                RawDat(col, row); //Update RawDat and to see the code executed when it finds the finger
                                                found = true;
                                            }
                                        }
                                    }
                                    else if (currentPixel[0] == 255 // just to make it a bit more tidy, it makes the rest of the hand white instead of black
                                        && currentPixel[1] >= 47
                                        && currentPixel[2] >= 47)
                                    {
                                        red = 255;
                                        green = 255;
                                        blue = 255;
                                    }
                                    else // anything else is set to black
                                    {
                                        /*
                                        red = currentPixel[2];
                                        green = currentPixel[1];
                                        blue = currentPixel[0];
                                         */
                                        red = 0;
                                        green = 0;
                                        blue = 0;
                                    }
                                    // Set pixel with NEW colour
                                    newPixels[index] = (byte)blue;
                                    newPixels[index + 1] = (byte)green;
                                    newPixels[index + 2] = (byte)red;
                                    newPixels[index + 3] = 255;

                                    // Draw more pixels
                                    // Left pixel
                                    if (col >= 4)
                                    {
                                        newPixels[index - 4] = (byte)blue;
                                        newPixels[index - 4 + 1] = (byte)green;
                                        newPixels[index - 4 + 2] = (byte)red;
                                        newPixels[index - 4 + 3] = 255;
                                    }
                                    // Top pixel and left to pixel
                                    if (row > 0)
                                    {
                                        newPixels[index - (stride)] = (byte)blue;
                                        newPixels[index - (stride) + 1] = (byte)green;
                                        newPixels[index - (stride) + 2] = (byte)red;
                                        newPixels[index - (stride) + 3] = 255;

                                        newPixels[index - (stride) - 4] = (byte)blue;
                                        newPixels[index - (stride) - 4 + 1] = (byte)green;
                                        newPixels[index - (stride) - 4 + 2] = (byte)red;
                                        newPixels[index - (stride) - 4 + 3] = 255;
                                    }
                                }
                            }

                            // Draw the entire image
                            stride = (width * processedImage.Format.BitsPerPixel + 7) / 8;
                            processedImage.WritePixels(new Int32Rect(0, 0, width, height), newPixels, stride, 0);

                            numLoops = 0;
                        }
                        colorImage.Invalidate();
                        realImage.Invalidate();
                        //depthImage.Invalidate();
                        numLoops++;
                    });
                }
                CLNUIDevice.StopCamera(camera);
            });
            captureThread.IsBackground = true;
            captureThread.Start();
        }
Esempio n. 25
0
        public CameraWindow(string devSerial)
        {
            this.devSerial = devSerial;
            InitializeComponent();
            Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
            try
            {
                motor  = CLNUIDevice.CreateMotor(devSerial);
                camera = CLNUIDevice.CreateCamera(devSerial);
                labelSERIAL.Content = string.Format("Serial Number: {0}", devSerial);
            }
            catch
            {
                MessageBox.Show("Is your device connected! Drivers installed?", "Kinect Not Found!");
                errquit = true;
                this.Close();
            }
            DataContext        = this;
            TheCharacter       = "█";
            FromLeft           = 526;
            FromTop            = 136;
            TheFontSize        = 5;
            accelerometerTimer = new DispatcherTimer(TimeSpan.FromMilliseconds(100), DispatcherPriority.Normal, (EventHandler) delegate(object sender, EventArgs e)
            {
                short _x = 0, _y = 0, _z = 0;
                CLNUIDevice.GetMotorAccelerometer(motor, ref _x, ref _y, ref _z);
                double gx = 0;
                double gy = 0;
                _x        = (short)(_x - _xCal);
                _y        = (short)(_y - _yCal);
                _z        = (short)(_z - _zCal);
                if (comboXAXIS.SelectedIndex == 0)
                {
                    gx = _x + 1000;
                }
                else if (comboXAXIS.SelectedIndex == 1)
                {
                    gx = _y + 1000;
                }
                else if (comboXAXIS.SelectedIndex == 2)
                {
                    gx = _z + 1000;
                }
                if (comboYAXIS.SelectedIndex == 0)
                {
                    gy = _x + 1000;
                }
                else if (comboYAXIS.SelectedIndex == 1)
                {
                    gy = _y + 1000;
                }
                else if (comboYAXIS.SelectedIndex == 2)
                {
                    gy = _z + 1000;
                }
                FromLeft        = 389 + (int)(gx / 9.661835748792271);
                FromTop         = 34 + (int)(gy / 9.661835748792271);
                labelX.Content  = "X: " + (_x).ToString();
                progressX.Value = _x;
                labelY.Content  = "Y: " + (_y).ToString();
                progressY.Value = _y;
                labelZ.Content  = "Z: " + (_z).ToString();
                progressZ.Value = _z;
            }, Dispatcher);
            accelerometerTimer.Start();

            comboLED.SelectionChanged     += new SelectionChangedEventHandler(comboLED_SelectionChanged);
            comboLED.SelectedIndex         = 0;
            comboFEED.SelectionChanged    += new SelectionChangedEventHandler(comboBox1_SelectionChanged);
            comboFEED.SelectedIndex        = 0;
            comboXAXIS.SelectedIndex       = 0;
            comboYAXIS.SelectedIndex       = 1;
            comboTheSize.SelectionChanged += new SelectionChangedEventHandler(comboBox1_SelectionChanged_1);
            comboTheSize.SelectedIndex     = 5;
            sliderTILT.Maximum             = 8000;
            sliderTILT.Minimum             = -8000;
            sliderTILT.Value = 0;
            CLNUIDevice.SetMotorPosition(motor, 0);
        }
Esempio n. 26
0
        public MainWindow()
        {
            InitializeComponent();
            WindowState = System.Windows.WindowState.Maximized;
            greeting = new TextBlock();

            _sensor = new SensorData();
            _sensor.updated += new SensorData.UpdatedEventHandler(_sensor_updated);
            _sensor.imageUpdate += new SensorData.SendImageHandler(_sensor_imageUpdate);

            CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
            Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);

            _worker = new BackgroundWorker();
            _worker.DoWork += new DoWorkEventHandler(Worker_DoWork);

            _clientThread = new BackgroundWorker();
            _clientThread.DoWork += new DoWorkEventHandler(_clientThread_DoWork);

            _imageThread = new BackgroundWorker();
            _imageThread.DoWork += new DoWorkEventHandler(_imageThread_DoWork);

            imageSendCounter = 1;
            serverImage = new WriteableBitmap(TRANSMIT_WIDTH, TRANSMIT_HEIGHT, DPI_X, DPI_Y, PixelFormats.Bgra32, null);
            ASCIIEncoding enc = new ASCIIEncoding();
            COMPLETE_MESSAGE = enc.GetBytes("rcomplete");
            HELLO_MESSAGE = enc.GetBytes("hello");

            pushCount = 0;
            imageSelectedIndex = -1;
            imageSelectedId = -1;

            collection = new ActiveImageCollection();
            initializeButtonImages();
            drawActiveImages();
            gallery = new ImageGallery();
        }
Esempio n. 27
0
        public CameraWindow(string devSerial)
        {
            this.devSerial = devSerial;
            InitializeComponent();
            Closing += new System.ComponentModel.CancelEventHandler(MainWindow_Closing);
            try
            {
                motor = CLNUIDevice.CreateMotor(devSerial);
                camera = CLNUIDevice.CreateCamera(devSerial);
                labelSERIAL.Content = string.Format("Serial Number: {0}", devSerial);
            }
            catch
            {
                MessageBox.Show("Is your device connected! Drivers installed?", "Kinect Not Found!");
                errquit = true;
                this.Close();
            }
            DataContext = this;
            TheCharacter = "█";
            FromLeft = 526;
            FromTop = 136;
            TheFontSize = 5;
            accelerometerTimer = new DispatcherTimer(TimeSpan.FromMilliseconds(100), DispatcherPriority.Normal, (EventHandler)delegate(object sender, EventArgs e)
            {
                short _x = 0, _y = 0, _z = 0;
                CLNUIDevice.GetMotorAccelerometer(motor, ref _x, ref _y, ref _z);
                double gx = 0;
                double gy = 0;
                _x = (short)(_x - _xCal);
                _y = (short)(_y - _yCal);
                _z = (short)(_z - _zCal);
                if (comboXAXIS.SelectedIndex == 0)
                {
                    gx = _x + 1000;
                }
                else if (comboXAXIS.SelectedIndex == 1)
                {
                    gx = _y + 1000;
                }
                else if (comboXAXIS.SelectedIndex == 2)
                {
                    gx = _z + 1000;
                }
                if (comboYAXIS.SelectedIndex == 0)
                {
                    gy = _x + 1000;
                }
                else if (comboYAXIS.SelectedIndex == 1)
                {
                    gy = _y + 1000;
                }
                else if (comboYAXIS.SelectedIndex == 2)
                {
                    gy = _z + 1000;
                }
                FromLeft = 389 + (int)(gx / 9.661835748792271);
                FromTop = 34 + (int)(gy / 9.661835748792271);
                labelX.Content = "X: " + (_x).ToString();
                progressX.Value = _x;
                labelY.Content = "Y: " + (_y).ToString();
                progressY.Value = _y;
                labelZ.Content = "Z: " + (_z).ToString();
                progressZ.Value = _z;
            }, Dispatcher);
            accelerometerTimer.Start();

            comboLED.SelectionChanged += new SelectionChangedEventHandler(comboLED_SelectionChanged);
            comboLED.SelectedIndex = 0;
            comboFEED.SelectionChanged += new SelectionChangedEventHandler(comboBox1_SelectionChanged);
            comboFEED.SelectedIndex = 0;
            comboXAXIS.SelectedIndex = 0;
            comboYAXIS.SelectedIndex = 1;
            comboTheSize.SelectionChanged += new SelectionChangedEventHandler(comboBox1_SelectionChanged_1);
            comboTheSize.SelectedIndex = 5;
            sliderTILT.Maximum = 8000;
            sliderTILT.Minimum = -8000;
            sliderTILT.Value = 0;
            CLNUIDevice.SetMotorPosition(motor, 0);
        }
Esempio n. 28
0
 public RichTextContextMenuStrip(RichTextBox rtb)
     : base()
 {
     this.rtb = rtb;
     Opening += new System.ComponentModel.CancelEventHandler(RichTextContextMenuStrip_Opening);
     ToolStripMenuItem special = new ToolStripMenuItem("&Insert special", null,
         new ToolStripMenuItem("\x22ee"), //vertical ellipsis
         new ToolStripMenuItem("\x2205"), //empty set
         new ToolStripMenuItem("\x2203"), //there exists
         new ToolStripMenuItem("\x2200")  //for all
         );
     special.DropDownItemClicked += new ToolStripItemClickedEventHandler(special_DropDownItemClicked);
     ToolStripMenuItem undo = new ToolStripMenuItem("&Undo", null, Undo);
     ToolStripMenuItem cut = new ToolStripMenuItem("Cu&t", null, Cut);
     ToolStripMenuItem copy = new ToolStripMenuItem("&Copy", null, Copy);
     ToolStripMenuItem paste = new ToolStripMenuItem("&Paste", null, Paste);
     ToolStripMenuItem pasteastext = new ToolStripMenuItem("Paste as &Text", null, PasteAsText);
     ToolStripMenuItem selectall = new ToolStripMenuItem("Select &All", null, SelectAll);
     this.Items.AddRange(new ToolStripItem[] {
         special,
         new ToolStripSeparator(),
         undo,
         new ToolStripSeparator(),
         cut,
         copy,
         paste,
         pasteastext,
         new ToolStripSeparator(),
             selectall,
         });
 }
Esempio n. 29
0
        public MainWindow()
        {
            InitializeComponent();
            __Document.Styles.StyleChanged += new EventHandler<StyleChangedArgs>(Styles_StyleChanged);
            SetupColumns();

            InitFontComboBox();
            Loaded += new RoutedEventHandler(Window1_Loaded);
            Closing += new System.ComponentModel.CancelEventHandler(Window1_Closing);
            TryLoadPosition(OutlinerDocument.DefaultFileName);

            __Document.Add(new OutlinerNote(__Document.RootNode));

            UpdateOutlinerTreeItemsSource();
            OutlinerTree.Focus();
            OutlinerTree.SizeChanged += new SizeChangedEventHandler(OutlinerTree_SizeChanged);

            ReloadRecentItems();

            if (Application.Current.Properties["FileNameToOpen"] != null)
                OpenFile((string)Application.Current.Properties["FileNameToOpen"]);
            else
            {
                if (((app)Application.Current).NoAutoLoad == false && UVOutliner.Settings.AutoOpenLastSavedFile == true)
                {
                    OpenRecentFile();
                }
            }

            AddCommandBindings();

            AddHandler(MyEdit.EditorGotFocusEvent, new RoutedEventHandler(OnEditGotFocus));
            AddHandler(MyEdit.EditorLostFocusEvent, new RoutedEventHandler(OnEditLostFocus));

            AddHandler(MyEdit.MoveToPrevLine, new RoutedEventHandler(OnMoveToPrevLine));
            AddHandler(NoteContentPresenter.TemplateChangedEvent, new RoutedEventHandler(OnTemplateChangeOnContentControl));
            AddHandler(MyEdit.MoveToNextLine, new RoutedEventHandler(OnMoveToNextLine));
            AddHandler(MyEdit.UndoActionEvent, new RoutedEventHandler(OnUndoAction));
            AddHandler(MyEdit.MoveToNextColumn, new RoutedEventHandler(OnMoveToNextColumn));
            AddHandler(MyEdit.MoveToPrevColumn, new RoutedEventHandler(OnMoveToPrevColumn));

            AddHandler(TreeListViewItem.EditingFinishedEvent, new RoutedEventHandler(OnEditingFinished));

            AddHandler(CommandManager.PreviewExecutedEvent, new ExecutedRoutedEventHandler(PreviewExecutedEvent));

            if (UVOutliner.Settings.FontSelectionPreview)
                StartFontsPreload();

            OutlinerTree.SelectedItemChanged += new RoutedPropertyChangedEventHandler<object>(OutlinerTree_SelectedItemChanged);

            SelectColorImage.MouseLeftButtonDown += new MouseButtonEventHandler(SelectColorImage_MouseLeftButtonDown);
            SelectColorBorder.MouseLeftButtonDown += new MouseButtonEventHandler(SelectColorBorder_MouseLeftButtonDown);

            DataContext = this;

            CheckForUpdates();

            /*TimeInterval t0 = new TimeInterval("2h 2h 3h 3h 1d 2d 2d 2h 2h 2h 2h 2h 8d 1h 1d 1h 1h 1d 3d 2d 1w 1w 2d");

            TimeInterval t = new TimeInterval("3d 5m");
            TimeInterval t2 = new TimeInterval("1h");
            TimeInterval t3 = t + t2;*/
        }
Esempio n. 30
0
 private void InitializeComponent()
 {
     groupVehicles       = new System.Windows.Forms.GroupBox();
     btnDeleteVehicle    = new System.Windows.Forms.Button();
     btnNewVehicle       = new System.Windows.Forms.Button();
     listVehicles        = new System.Windows.Forms.ListBox();
     groupProfile        = new System.Windows.Forms.GroupBox();
     groupBox1           = new System.Windows.Forms.GroupBox();
     btnCalcSpeedo       = new System.Windows.Forms.Button();
     txtSpeedoFactor     = new System.Windows.Forms.TextBox();
     groupTimeout        = new System.Windows.Forms.GroupBox();
     lblTimeoutUnits     = new System.Windows.Forms.Label();
     numTimeout          = new System.Windows.Forms.NumericUpDown();
     lblTimeout          = new System.Windows.Forms.Label();
     btnSave             = new System.Windows.Forms.Button();
     btnDiscard          = new System.Windows.Forms.Button();
     groupNotes          = new System.Windows.Forms.GroupBox();
     txtNotes            = new System.Windows.Forms.TextBox();
     groupMisc           = new System.Windows.Forms.GroupBox();
     txtDragCoeff        = new System.Windows.Forms.TextBox();
     label1              = new System.Windows.Forms.Label();
     lblPounds           = new System.Windows.Forms.Label();
     txtWeight           = new System.Windows.Forms.TextBox();
     lblWeight           = new System.Windows.Forms.Label();
     groupWheels         = new System.Windows.Forms.GroupBox();
     lblRimDiameterUnits = new System.Windows.Forms.Label();
     lblTireAspectUnits  = new System.Windows.Forms.Label();
     lblTireWidthUnits   = new System.Windows.Forms.Label();
     lblExampleEnd       = new System.Windows.Forms.Label();
     lblExampleDiameter  = new System.Windows.Forms.Label();
     lblExampleAspect    = new System.Windows.Forms.Label();
     lblExampleSlash     = new System.Windows.Forms.Label();
     lblExampleDash      = new System.Windows.Forms.Label();
     lblExampleWidth     = new System.Windows.Forms.Label();
     lblExample          = new System.Windows.Forms.Label();
     txtRimDiameter      = new System.Windows.Forms.TextBox();
     lblRimDiameter      = new System.Windows.Forms.Label();
     txtAspectRatio      = new System.Windows.Forms.TextBox();
     lblTireAspectRatio  = new System.Windows.Forms.Label();
     txtTireWidth        = new System.Windows.Forms.TextBox();
     lblTireWidth        = new System.Windows.Forms.Label();
     groupDrivetrain     = new System.Windows.Forms.GroupBox();
     radioManual         = new System.Windows.Forms.RadioButton();
     radioAutomatic      = new System.Windows.Forms.RadioButton();
     txtName             = new System.Windows.Forms.TextBox();
     lblName             = new System.Windows.Forms.Label();
     btnExit             = new System.Windows.Forms.Button();
     groupVehicles.SuspendLayout();
     groupProfile.SuspendLayout();
     groupBox1.SuspendLayout();
     groupTimeout.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(numTimeout)).BeginInit();
     groupNotes.SuspendLayout();
     groupMisc.SuspendLayout();
     groupWheels.SuspendLayout();
     groupDrivetrain.SuspendLayout();
     SuspendLayout();
     //
     // groupVehicles
     //
     groupVehicles.Controls.Add(btnDeleteVehicle);
     groupVehicles.Controls.Add(btnNewVehicle);
     groupVehicles.Controls.Add(listVehicles);
     groupVehicles.Location = new System.Drawing.Point(5, 9);
     groupVehicles.Name     = "groupVehicles";
     groupVehicles.Size     = new System.Drawing.Size(150, 364);
     groupVehicles.TabIndex = 0;
     groupVehicles.TabStop  = false;
     groupVehicles.Text     = "Vehicles";
     //
     // btnDeleteVehicle
     //
     btnDeleteVehicle.Location = new System.Drawing.Point(77, 330);
     btnDeleteVehicle.Name     = "btnDeleteVehicle";
     btnDeleteVehicle.Size     = new System.Drawing.Size(63, 25);
     btnDeleteVehicle.TabIndex = 2;
     btnDeleteVehicle.Text     = "&Delete";
     btnDeleteVehicle.Click   += new System.EventHandler(btnDeleteVehicle_Click);
     //
     // btnNewVehicle
     //
     btnNewVehicle.Location = new System.Drawing.Point(10, 330);
     btnNewVehicle.Name     = "btnNewVehicle";
     btnNewVehicle.Size     = new System.Drawing.Size(62, 25);
     btnNewVehicle.TabIndex = 1;
     btnNewVehicle.Text     = "&New";
     btnNewVehicle.Click   += new System.EventHandler(btnNewVehicle_Click);
     //
     // listVehicles
     //
     listVehicles.Location              = new System.Drawing.Point(10, 20);
     listVehicles.Name                  = "listVehicles";
     listVehicles.Size                  = new System.Drawing.Size(130, 303);
     listVehicles.TabIndex              = 0;
     listVehicles.SelectedIndexChanged += new System.EventHandler(listVehicles_SelectedIndexChanged);
     //
     // groupProfile
     //
     groupProfile.Controls.Add(groupBox1);
     groupProfile.Controls.Add(groupTimeout);
     groupProfile.Controls.Add(btnSave);
     groupProfile.Controls.Add(btnDiscard);
     groupProfile.Controls.Add(groupNotes);
     groupProfile.Controls.Add(groupMisc);
     groupProfile.Controls.Add(groupWheels);
     groupProfile.Controls.Add(groupDrivetrain);
     groupProfile.Controls.Add(txtName);
     groupProfile.Controls.Add(lblName);
     groupProfile.Location = new System.Drawing.Point(160, 9);
     groupProfile.Name     = "groupProfile";
     groupProfile.Size     = new System.Drawing.Size(424, 364);
     groupProfile.TabIndex = 1;
     groupProfile.TabStop  = false;
     groupProfile.Text     = "Selected vehicle profile";
     //
     // groupBox1
     //
     groupBox1.Controls.Add(btnCalcSpeedo);
     groupBox1.Controls.Add(txtSpeedoFactor);
     groupBox1.Location = new System.Drawing.Point(11, 177);
     groupBox1.Name     = "groupBox1";
     groupBox1.Size     = new System.Drawing.Size(205, 65);
     groupBox1.TabIndex = 4;
     groupBox1.TabStop  = false;
     groupBox1.Text     = "Speedometer Calibration Factor";
     //
     // btnCalcSpeedo
     //
     btnCalcSpeedo.Location = new System.Drawing.Point(105, 27);
     btnCalcSpeedo.Name     = "btnCalcSpeedo";
     btnCalcSpeedo.Size     = new System.Drawing.Size(82, 23);
     btnCalcSpeedo.TabIndex = 1;
     btnCalcSpeedo.Text     = "&Calculate";
     btnCalcSpeedo.Click   += new System.EventHandler(btnCalcSpeedo_Click);
     //
     // txtSpeedoFactor
     //
     txtSpeedoFactor.Location  = new System.Drawing.Point(18, 28);
     txtSpeedoFactor.Name      = "txtSpeedoFactor";
     txtSpeedoFactor.Size      = new System.Drawing.Size(72, 20);
     txtSpeedoFactor.TabIndex  = 0;
     txtSpeedoFactor.Text      = "1.000";
     txtSpeedoFactor.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
     //
     // groupTimeout
     //
     groupTimeout.Controls.Add(lblTimeoutUnits);
     groupTimeout.Controls.Add(numTimeout);
     groupTimeout.Controls.Add(lblTimeout);
     groupTimeout.Location = new System.Drawing.Point(10, 48);
     groupTimeout.Name     = "groupTimeout";
     groupTimeout.Size     = new System.Drawing.Size(205, 58);
     groupTimeout.TabIndex = 2;
     groupTimeout.TabStop  = false;
     groupTimeout.Text     = "OBD-II Timing";
     //
     // lblTimeoutUnits
     //
     lblTimeoutUnits.Location  = new System.Drawing.Point(165, 20);
     lblTimeoutUnits.Name      = "lblTimeoutUnits";
     lblTimeoutUnits.Size      = new System.Drawing.Size(22, 20);
     lblTimeoutUnits.TabIndex  = 2;
     lblTimeoutUnits.Text      = "ms";
     lblTimeoutUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // numTimeout
     //
     numTimeout.Increment = new decimal(new int[] {
         4,
         0,
         0,
         0
     });
     numTimeout.Location = new System.Drawing.Point(93, 20);
     numTimeout.Maximum  = new decimal(new int[] {
         1020,
         0,
         0,
         0
     });
     numTimeout.Minimum = new decimal(new int[] {
         32,
         0,
         0,
         0
     });
     numTimeout.Name     = "numTimeout";
     numTimeout.Size     = new System.Drawing.Size(61, 20);
     numTimeout.TabIndex = 1;
     numTimeout.Value    = new decimal(new int[] {
         200,
         0,
         0,
         0
     });
     numTimeout.ValueChanged += new System.EventHandler(numTimeout_ValueChanged);
     //
     // lblTimeout
     //
     lblTimeout.Location  = new System.Drawing.Point(13, 20);
     lblTimeout.Name      = "lblTimeout";
     lblTimeout.Size      = new System.Drawing.Size(75, 20);
     lblTimeout.TabIndex  = 0;
     lblTimeout.Text      = "ELM &Timeout:";
     lblTimeout.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // btnSave
     //
     btnSave.Location = new System.Drawing.Point(255, 330);
     btnSave.Name     = "btnSave";
     btnSave.Size     = new System.Drawing.Size(75, 25);
     btnSave.TabIndex = 8;
     btnSave.Text     = "&Save";
     btnSave.Click   += new System.EventHandler(btnSave_Click);
     //
     // btnDiscard
     //
     btnDiscard.Location = new System.Drawing.Point(335, 330);
     btnDiscard.Name     = "btnDiscard";
     btnDiscard.Size     = new System.Drawing.Size(75, 25);
     btnDiscard.TabIndex = 9;
     btnDiscard.Text     = "D&iscard";
     btnDiscard.Click   += new System.EventHandler(btnDiscard_Click);
     //
     // groupNotes
     //
     groupNotes.Controls.Add(txtNotes);
     groupNotes.Location = new System.Drawing.Point(225, 177);
     groupNotes.Name     = "groupNotes";
     groupNotes.Size     = new System.Drawing.Size(185, 148);
     groupNotes.TabIndex = 7;
     groupNotes.TabStop  = false;
     groupNotes.Text     = "Notes";
     //
     // txtNotes
     //
     txtNotes.Location     = new System.Drawing.Point(10, 20);
     txtNotes.Multiline    = true;
     txtNotes.Name         = "txtNotes";
     txtNotes.ScrollBars   = System.Windows.Forms.ScrollBars.Vertical;
     txtNotes.Size         = new System.Drawing.Size(165, 119);
     txtNotes.TabIndex     = 0;
     txtNotes.TextChanged += new System.EventHandler(ValueChanged);
     //
     // groupMisc
     //
     groupMisc.Controls.Add(txtDragCoeff);
     groupMisc.Controls.Add(label1);
     groupMisc.Controls.Add(lblPounds);
     groupMisc.Controls.Add(txtWeight);
     groupMisc.Controls.Add(lblWeight);
     groupMisc.Location = new System.Drawing.Point(10, 250);
     groupMisc.Name     = "groupMisc";
     groupMisc.Size     = new System.Drawing.Size(205, 75);
     groupMisc.TabIndex = 5;
     groupMisc.TabStop  = false;
     groupMisc.Text     = "Miscellaneous";
     //
     // txtDragCoeff
     //
     txtDragCoeff.Location     = new System.Drawing.Point(90, 45);
     txtDragCoeff.Name         = "txtDragCoeff";
     txtDragCoeff.Size         = new System.Drawing.Size(50, 20);
     txtDragCoeff.TabIndex     = 4;
     txtDragCoeff.TextChanged += new System.EventHandler(ValueChanged);
     //
     // label1
     //
     label1.Location  = new System.Drawing.Point(15, 45);
     label1.Name      = "label1";
     label1.Size      = new System.Drawing.Size(70, 20);
     label1.TabIndex  = 3;
     label1.Text      = "&Drag coeff.:";
     label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // lblPounds
     //
     lblPounds.Location  = new System.Drawing.Point(145, 20);
     lblPounds.Name      = "lblPounds";
     lblPounds.Size      = new System.Drawing.Size(50, 20);
     lblPounds.TabIndex  = 2;
     lblPounds.Text      = "lbs";
     lblPounds.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // txtWeight
     //
     txtWeight.Location     = new System.Drawing.Point(90, 20);
     txtWeight.Name         = "txtWeight";
     txtWeight.Size         = new System.Drawing.Size(50, 20);
     txtWeight.TabIndex     = 1;
     txtWeight.TextChanged += new System.EventHandler(ValueChanged);
     //
     // lblWeight
     //
     lblWeight.Location  = new System.Drawing.Point(15, 20);
     lblWeight.Name      = "lblWeight";
     lblWeight.Size      = new System.Drawing.Size(70, 20);
     lblWeight.TabIndex  = 0;
     lblWeight.Text      = "W&eight:";
     lblWeight.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // groupWheels
     //
     groupWheels.Controls.Add(lblRimDiameterUnits);
     groupWheels.Controls.Add(lblTireAspectUnits);
     groupWheels.Controls.Add(lblTireWidthUnits);
     groupWheels.Controls.Add(lblExampleEnd);
     groupWheels.Controls.Add(lblExampleDiameter);
     groupWheels.Controls.Add(lblExampleAspect);
     groupWheels.Controls.Add(lblExampleSlash);
     groupWheels.Controls.Add(lblExampleDash);
     groupWheels.Controls.Add(lblExampleWidth);
     groupWheels.Controls.Add(lblExample);
     groupWheels.Controls.Add(txtRimDiameter);
     groupWheels.Controls.Add(lblRimDiameter);
     groupWheels.Controls.Add(txtAspectRatio);
     groupWheels.Controls.Add(lblTireAspectRatio);
     groupWheels.Controls.Add(txtTireWidth);
     groupWheels.Controls.Add(lblTireWidth);
     groupWheels.Location = new System.Drawing.Point(225, 48);
     groupWheels.Name     = "groupWheels";
     groupWheels.Size     = new System.Drawing.Size(185, 122);
     groupWheels.TabIndex = 6;
     groupWheels.TabStop  = false;
     groupWheels.Text     = "Wheels";
     //
     // lblRimDiameterUnits
     //
     lblRimDiameterUnits.Location  = new System.Drawing.Point(145, 92);
     lblRimDiameterUnits.Name      = "lblRimDiameterUnits";
     lblRimDiameterUnits.Size      = new System.Drawing.Size(30, 20);
     lblRimDiameterUnits.TabIndex  = 15;
     lblRimDiameterUnits.Text      = "in";
     lblRimDiameterUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // lblTireAspectUnits
     //
     lblTireAspectUnits.Location  = new System.Drawing.Point(145, 67);
     lblTireAspectUnits.Name      = "lblTireAspectUnits";
     lblTireAspectUnits.Size      = new System.Drawing.Size(30, 20);
     lblTireAspectUnits.TabIndex  = 12;
     lblTireAspectUnits.Text      = "%";
     lblTireAspectUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // lblTireWidthUnits
     //
     lblTireWidthUnits.Location  = new System.Drawing.Point(145, 42);
     lblTireWidthUnits.Name      = "lblTireWidthUnits";
     lblTireWidthUnits.Size      = new System.Drawing.Size(30, 20);
     lblTireWidthUnits.TabIndex  = 9;
     lblTireWidthUnits.Text      = "mm";
     lblTireWidthUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // lblExampleEnd
     //
     lblExampleEnd.Location  = new System.Drawing.Point(170, 20);
     lblExampleEnd.Name      = "lblExampleEnd";
     lblExampleEnd.Size      = new System.Drawing.Size(5, 20);
     lblExampleEnd.TabIndex  = 6;
     lblExampleEnd.Text      = ")";
     lblExampleEnd.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExampleDiameter
     //
     lblExampleDiameter.Font      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     lblExampleDiameter.ForeColor = System.Drawing.SystemColors.ControlText;
     lblExampleDiameter.Location  = new System.Drawing.Point(145, 20);
     lblExampleDiameter.Name      = "lblExampleDiameter";
     lblExampleDiameter.Size      = new System.Drawing.Size(25, 20);
     lblExampleDiameter.TabIndex  = 5;
     lblExampleDiameter.Text      = "17";
     lblExampleDiameter.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExampleAspect
     //
     lblExampleAspect.Font      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     lblExampleAspect.ForeColor = System.Drawing.SystemColors.ControlText;
     lblExampleAspect.Location  = new System.Drawing.Point(105, 20);
     lblExampleAspect.Name      = "lblExampleAspect";
     lblExampleAspect.Size      = new System.Drawing.Size(30, 20);
     lblExampleAspect.TabIndex  = 3;
     lblExampleAspect.Text      = "40";
     lblExampleAspect.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExampleSlash
     //
     lblExampleSlash.Location  = new System.Drawing.Point(95, 20);
     lblExampleSlash.Name      = "lblExampleSlash";
     lblExampleSlash.Size      = new System.Drawing.Size(10, 20);
     lblExampleSlash.TabIndex  = 2;
     lblExampleSlash.Text      = "/";
     lblExampleSlash.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExampleDash
     //
     lblExampleDash.Font      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     lblExampleDash.ForeColor = System.Drawing.SystemColors.ControlText;
     lblExampleDash.Location  = new System.Drawing.Point(135, 20);
     lblExampleDash.Name      = "lblExampleDash";
     lblExampleDash.Size      = new System.Drawing.Size(10, 20);
     lblExampleDash.TabIndex  = 4;
     lblExampleDash.Text      = "-";
     lblExampleDash.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExampleWidth
     //
     lblExampleWidth.Font      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     lblExampleWidth.ForeColor = System.Drawing.SystemColors.ControlText;
     lblExampleWidth.Location  = new System.Drawing.Point(65, 20);
     lblExampleWidth.Name      = "lblExampleWidth";
     lblExampleWidth.Size      = new System.Drawing.Size(30, 20);
     lblExampleWidth.TabIndex  = 1;
     lblExampleWidth.Text      = "275";
     lblExampleWidth.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExample
     //
     lblExample.Location  = new System.Drawing.Point(5, 20);
     lblExample.Name      = "lblExample";
     lblExample.Size      = new System.Drawing.Size(55, 20);
     lblExample.TabIndex  = 0;
     lblExample.Text      = "(Example:";
     lblExample.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtRimDiameter
     //
     txtRimDiameter.Location     = new System.Drawing.Point(90, 92);
     txtRimDiameter.Name         = "txtRimDiameter";
     txtRimDiameter.Size         = new System.Drawing.Size(50, 20);
     txtRimDiameter.TabIndex     = 14;
     txtRimDiameter.TextChanged += new System.EventHandler(ValueChanged);
     txtRimDiameter.Enter       += new System.EventHandler(txtRimDiameter_Enter);
     txtRimDiameter.Leave       += new System.EventHandler(txtRimDiameter_Leave);
     //
     // lblRimDiameter
     //
     lblRimDiameter.Location  = new System.Drawing.Point(10, 92);
     lblRimDiameter.Name      = "lblRimDiameter";
     lblRimDiameter.Size      = new System.Drawing.Size(75, 20);
     lblRimDiameter.TabIndex  = 13;
     lblRimDiameter.Text      = "Rim &diameter:";
     lblRimDiameter.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtAspectRatio
     //
     txtAspectRatio.Location     = new System.Drawing.Point(90, 67);
     txtAspectRatio.Name         = "txtAspectRatio";
     txtAspectRatio.Size         = new System.Drawing.Size(50, 20);
     txtAspectRatio.TabIndex     = 11;
     txtAspectRatio.TextChanged += new System.EventHandler(ValueChanged);
     txtAspectRatio.Enter       += new System.EventHandler(txtAspectRatio_Enter);
     txtAspectRatio.Leave       += new System.EventHandler(txtAspectRatio_Leave);
     //
     // lblTireAspectRatio
     //
     lblTireAspectRatio.Location  = new System.Drawing.Point(10, 67);
     lblTireAspectRatio.Name      = "lblTireAspectRatio";
     lblTireAspectRatio.Size      = new System.Drawing.Size(75, 20);
     lblTireAspectRatio.TabIndex  = 10;
     lblTireAspectRatio.Text      = "Tire &aspect:";
     lblTireAspectRatio.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtTireWidth
     //
     txtTireWidth.Location     = new System.Drawing.Point(90, 42);
     txtTireWidth.Name         = "txtTireWidth";
     txtTireWidth.Size         = new System.Drawing.Size(50, 20);
     txtTireWidth.TabIndex     = 8;
     txtTireWidth.TextChanged += new System.EventHandler(ValueChanged);
     txtTireWidth.Enter       += new System.EventHandler(txtTireWidth_Enter);
     txtTireWidth.Leave       += new System.EventHandler(txtTireWidth_Leave);
     //
     // lblTireWidth
     //
     lblTireWidth.Location  = new System.Drawing.Point(10, 42);
     lblTireWidth.Name      = "lblTireWidth";
     lblTireWidth.Size      = new System.Drawing.Size(75, 20);
     lblTireWidth.TabIndex  = 7;
     lblTireWidth.Text      = "Tire &width:";
     lblTireWidth.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // groupDrivetrain
     //
     groupDrivetrain.Controls.Add(radioManual);
     groupDrivetrain.Controls.Add(radioAutomatic);
     groupDrivetrain.Location = new System.Drawing.Point(10, 114);
     groupDrivetrain.Name     = "groupDrivetrain";
     groupDrivetrain.Size     = new System.Drawing.Size(205, 56);
     groupDrivetrain.TabIndex = 3;
     groupDrivetrain.TabStop  = false;
     groupDrivetrain.Text     = "Transmission";
     //
     // radioManual
     //
     radioManual.Checked         = true;
     radioManual.Location        = new System.Drawing.Point(116, 20);
     radioManual.Name            = "radioManual";
     radioManual.Size            = new System.Drawing.Size(75, 20);
     radioManual.TabIndex        = 1;
     radioManual.TabStop         = true;
     radioManual.Text            = "&Manual";
     radioManual.CheckedChanged += new System.EventHandler(ValueChanged);
     //
     // radioAutomatic
     //
     radioAutomatic.Location        = new System.Drawing.Point(15, 20);
     radioAutomatic.Name            = "radioAutomatic";
     radioAutomatic.Size            = new System.Drawing.Size(75, 20);
     radioAutomatic.TabIndex        = 0;
     radioAutomatic.Text            = "&Automatic";
     radioAutomatic.CheckedChanged += new System.EventHandler(ValueChanged);
     //
     // txtName
     //
     txtName.Location     = new System.Drawing.Point(60, 20);
     txtName.MaxLength    = 20;
     txtName.Name         = "txtName";
     txtName.Size         = new System.Drawing.Size(350, 20);
     txtName.TabIndex     = 1;
     txtName.TextChanged += new System.EventHandler(ValueChanged);
     //
     // lblName
     //
     lblName.Location  = new System.Drawing.Point(5, 20);
     lblName.Name      = "lblName";
     lblName.Size      = new System.Drawing.Size(50, 20);
     lblName.TabIndex  = 0;
     lblName.Text      = "Name:";
     lblName.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // btnExit
     //
     btnExit.Location = new System.Drawing.Point(496, 384);
     btnExit.Name     = "btnExit";
     btnExit.Size     = new System.Drawing.Size(75, 25);
     btnExit.TabIndex = 2;
     btnExit.Text     = "D&one";
     btnExit.Click   += new System.EventHandler(btnExit_Click);
     //
     // VehicleForm
     //
     AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     ClientSize        = new System.Drawing.Size(586, 416);
     Controls.Add(groupProfile);
     Controls.Add(groupVehicles);
     Controls.Add(btnExit);
     FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     MaximizeBox     = false;
     MinimizeBox     = false;
     Name            = "VehicleForm";
     StartPosition   = System.Windows.Forms.FormStartPosition.CenterParent;
     Text            = "Vehicle Profile Manager";
     Closing        += new System.ComponentModel.CancelEventHandler(VehicleForm_Closing);
     Load           += new System.EventHandler(VehicleForm_Load);
     groupVehicles.ResumeLayout(false);
     groupProfile.ResumeLayout(false);
     groupProfile.PerformLayout();
     groupBox1.ResumeLayout(false);
     groupBox1.PerformLayout();
     groupTimeout.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(numTimeout)).EndInit();
     groupNotes.ResumeLayout(false);
     groupNotes.PerformLayout();
     groupMisc.ResumeLayout(false);
     groupMisc.PerformLayout();
     groupWheels.ResumeLayout(false);
     groupWheels.PerformLayout();
     groupDrivetrain.ResumeLayout(false);
     ResumeLayout(false);
 }
        private void useTrayIcon()
        {
            var trayIcon = new System.Windows.Forms.NotifyIcon();
            trayIcon.Text = "Instant Rice Messenger";
            trayIcon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetEntryAssembly().Location);
            trayIcon.ContextMenu = new ContextMenu(new MenuItem[] { new MenuItem("E&xit", (sender, e) => {
                saveConfig();
                trayIcon.Visible = false;
                trayIcon.Dispose();
                trayIcon = null;
                Close();
                System.Windows.Application.Current.Shutdown();
            })});
            trayIcon.Visible = true;
            trayIcon.DoubleClick += (sender, e) =>
            {
                WindowState = WindowState.Normal;
                eventWindowChanged(sender, e);
            };

            StateChanged += eventWindowChanged;
            Closing += new System.ComponentModel.CancelEventHandler((sender, e) =>
            {
                e.Cancel = true;
                WindowState = WindowState.Minimized;
            });
        }
Esempio n. 32
0
 private void InitializeComponent()
 {
     groupVehicles = new System.Windows.Forms.GroupBox();
     btnDeleteVehicle = new System.Windows.Forms.Button();
     btnNewVehicle = new System.Windows.Forms.Button();
     listVehicles = new System.Windows.Forms.ListBox();
     groupProfile = new System.Windows.Forms.GroupBox();
     groupBox1 = new System.Windows.Forms.GroupBox();
     btnCalcSpeedo = new System.Windows.Forms.Button();
     txtSpeedoFactor = new System.Windows.Forms.TextBox();
     groupTimeout = new System.Windows.Forms.GroupBox();
     lblTimeoutUnits = new System.Windows.Forms.Label();
     numTimeout = new System.Windows.Forms.NumericUpDown();
     lblTimeout = new System.Windows.Forms.Label();
     btnSave = new System.Windows.Forms.Button();
     btnDiscard = new System.Windows.Forms.Button();
     groupNotes = new System.Windows.Forms.GroupBox();
     txtNotes = new System.Windows.Forms.TextBox();
     groupMisc = new System.Windows.Forms.GroupBox();
     txtDragCoeff = new System.Windows.Forms.TextBox();
     label1 = new System.Windows.Forms.Label();
     lblPounds = new System.Windows.Forms.Label();
     txtWeight = new System.Windows.Forms.TextBox();
     lblWeight = new System.Windows.Forms.Label();
     groupWheels = new System.Windows.Forms.GroupBox();
     lblRimDiameterUnits = new System.Windows.Forms.Label();
     lblTireAspectUnits = new System.Windows.Forms.Label();
     lblTireWidthUnits = new System.Windows.Forms.Label();
     lblExampleEnd = new System.Windows.Forms.Label();
     lblExampleDiameter = new System.Windows.Forms.Label();
     lblExampleAspect = new System.Windows.Forms.Label();
     lblExampleSlash = new System.Windows.Forms.Label();
     lblExampleDash = new System.Windows.Forms.Label();
     lblExampleWidth = new System.Windows.Forms.Label();
     lblExample = new System.Windows.Forms.Label();
     txtRimDiameter = new System.Windows.Forms.TextBox();
     lblRimDiameter = new System.Windows.Forms.Label();
     txtAspectRatio = new System.Windows.Forms.TextBox();
     lblTireAspectRatio = new System.Windows.Forms.Label();
     txtTireWidth = new System.Windows.Forms.TextBox();
     lblTireWidth = new System.Windows.Forms.Label();
     groupDrivetrain = new System.Windows.Forms.GroupBox();
     radioManual = new System.Windows.Forms.RadioButton();
     radioAutomatic = new System.Windows.Forms.RadioButton();
     txtName = new System.Windows.Forms.TextBox();
     lblName = new System.Windows.Forms.Label();
     btnExit = new System.Windows.Forms.Button();
     groupVehicles.SuspendLayout();
     groupProfile.SuspendLayout();
     groupBox1.SuspendLayout();
     groupTimeout.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(numTimeout)).BeginInit();
     groupNotes.SuspendLayout();
     groupMisc.SuspendLayout();
     groupWheels.SuspendLayout();
     groupDrivetrain.SuspendLayout();
     SuspendLayout();
     //
     // groupVehicles
     //
     groupVehicles.Controls.Add(btnDeleteVehicle);
     groupVehicles.Controls.Add(btnNewVehicle);
     groupVehicles.Controls.Add(listVehicles);
     groupVehicles.Location = new System.Drawing.Point(5, 9);
     groupVehicles.Name = "groupVehicles";
     groupVehicles.Size = new System.Drawing.Size(150, 364);
     groupVehicles.TabIndex = 0;
     groupVehicles.TabStop = false;
     groupVehicles.Text = "Vehicles";
     //
     // btnDeleteVehicle
     //
     btnDeleteVehicle.Location = new System.Drawing.Point(77, 330);
     btnDeleteVehicle.Name = "btnDeleteVehicle";
     btnDeleteVehicle.Size = new System.Drawing.Size(63, 25);
     btnDeleteVehicle.TabIndex = 2;
     btnDeleteVehicle.Text = "&Delete";
     btnDeleteVehicle.Click += new System.EventHandler(btnDeleteVehicle_Click);
     //
     // btnNewVehicle
     //
     btnNewVehicle.Location = new System.Drawing.Point(10, 330);
     btnNewVehicle.Name = "btnNewVehicle";
     btnNewVehicle.Size = new System.Drawing.Size(62, 25);
     btnNewVehicle.TabIndex = 1;
     btnNewVehicle.Text = "&New";
     btnNewVehicle.Click += new System.EventHandler(btnNewVehicle_Click);
     //
     // listVehicles
     //
     listVehicles.Location = new System.Drawing.Point(10, 20);
     listVehicles.Name = "listVehicles";
     listVehicles.Size = new System.Drawing.Size(130, 303);
     listVehicles.TabIndex = 0;
     listVehicles.SelectedIndexChanged += new System.EventHandler(listVehicles_SelectedIndexChanged);
     //
     // groupProfile
     //
     groupProfile.Controls.Add(groupBox1);
     groupProfile.Controls.Add(groupTimeout);
     groupProfile.Controls.Add(btnSave);
     groupProfile.Controls.Add(btnDiscard);
     groupProfile.Controls.Add(groupNotes);
     groupProfile.Controls.Add(groupMisc);
     groupProfile.Controls.Add(groupWheels);
     groupProfile.Controls.Add(groupDrivetrain);
     groupProfile.Controls.Add(txtName);
     groupProfile.Controls.Add(lblName);
     groupProfile.Location = new System.Drawing.Point(160, 9);
     groupProfile.Name = "groupProfile";
     groupProfile.Size = new System.Drawing.Size(424, 364);
     groupProfile.TabIndex = 1;
     groupProfile.TabStop = false;
     groupProfile.Text = "Selected vehicle profile";
     //
     // groupBox1
     //
     groupBox1.Controls.Add(btnCalcSpeedo);
     groupBox1.Controls.Add(txtSpeedoFactor);
     groupBox1.Location = new System.Drawing.Point(11, 177);
     groupBox1.Name = "groupBox1";
     groupBox1.Size = new System.Drawing.Size(205, 65);
     groupBox1.TabIndex = 4;
     groupBox1.TabStop = false;
     groupBox1.Text = "Speedometer Calibration Factor";
     //
     // btnCalcSpeedo
     //
     btnCalcSpeedo.Location = new System.Drawing.Point(105, 27);
     btnCalcSpeedo.Name = "btnCalcSpeedo";
     btnCalcSpeedo.Size = new System.Drawing.Size(82, 23);
     btnCalcSpeedo.TabIndex = 1;
     btnCalcSpeedo.Text = "&Calculate";
     btnCalcSpeedo.Click += new System.EventHandler(btnCalcSpeedo_Click);
     //
     // txtSpeedoFactor
     //
     txtSpeedoFactor.Location = new System.Drawing.Point(18, 28);
     txtSpeedoFactor.Name = "txtSpeedoFactor";
     txtSpeedoFactor.Size = new System.Drawing.Size(72, 20);
     txtSpeedoFactor.TabIndex = 0;
     txtSpeedoFactor.Text = "1.000";
     txtSpeedoFactor.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
     //
     // groupTimeout
     //
     groupTimeout.Controls.Add(lblTimeoutUnits);
     groupTimeout.Controls.Add(numTimeout);
     groupTimeout.Controls.Add(lblTimeout);
     groupTimeout.Location = new System.Drawing.Point(10, 48);
     groupTimeout.Name = "groupTimeout";
     groupTimeout.Size = new System.Drawing.Size(205, 58);
     groupTimeout.TabIndex = 2;
     groupTimeout.TabStop = false;
     groupTimeout.Text = "OBD-II Timing";
     //
     // lblTimeoutUnits
     //
     lblTimeoutUnits.Location = new System.Drawing.Point(165, 20);
     lblTimeoutUnits.Name = "lblTimeoutUnits";
     lblTimeoutUnits.Size = new System.Drawing.Size(22, 20);
     lblTimeoutUnits.TabIndex = 2;
     lblTimeoutUnits.Text = "ms";
     lblTimeoutUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // numTimeout
     //
     numTimeout.Increment = new decimal(new int[] {
     4,
     0,
     0,
     0});
     numTimeout.Location = new System.Drawing.Point(93, 20);
     numTimeout.Maximum = new decimal(new int[] {
     1020,
     0,
     0,
     0});
     numTimeout.Minimum = new decimal(new int[] {
     32,
     0,
     0,
     0});
     numTimeout.Name = "numTimeout";
     numTimeout.Size = new System.Drawing.Size(61, 20);
     numTimeout.TabIndex = 1;
     numTimeout.Value = new decimal(new int[] {
     200,
     0,
     0,
     0});
     numTimeout.ValueChanged += new System.EventHandler(numTimeout_ValueChanged);
     //
     // lblTimeout
     //
     lblTimeout.Location = new System.Drawing.Point(13, 20);
     lblTimeout.Name = "lblTimeout";
     lblTimeout.Size = new System.Drawing.Size(75, 20);
     lblTimeout.TabIndex = 0;
     lblTimeout.Text = "ELM &Timeout:";
     lblTimeout.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // btnSave
     //
     btnSave.Location = new System.Drawing.Point(255, 330);
     btnSave.Name = "btnSave";
     btnSave.Size = new System.Drawing.Size(75, 25);
     btnSave.TabIndex = 8;
     btnSave.Text = "&Save";
     btnSave.Click += new System.EventHandler(btnSave_Click);
     //
     // btnDiscard
     //
     btnDiscard.Location = new System.Drawing.Point(335, 330);
     btnDiscard.Name = "btnDiscard";
     btnDiscard.Size = new System.Drawing.Size(75, 25);
     btnDiscard.TabIndex = 9;
     btnDiscard.Text = "D&iscard";
     btnDiscard.Click += new System.EventHandler(btnDiscard_Click);
     //
     // groupNotes
     //
     groupNotes.Controls.Add(txtNotes);
     groupNotes.Location = new System.Drawing.Point(225, 177);
     groupNotes.Name = "groupNotes";
     groupNotes.Size = new System.Drawing.Size(185, 148);
     groupNotes.TabIndex = 7;
     groupNotes.TabStop = false;
     groupNotes.Text = "Notes";
     //
     // txtNotes
     //
     txtNotes.Location = new System.Drawing.Point(10, 20);
     txtNotes.Multiline = true;
     txtNotes.Name = "txtNotes";
     txtNotes.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
     txtNotes.Size = new System.Drawing.Size(165, 119);
     txtNotes.TabIndex = 0;
     txtNotes.TextChanged += new System.EventHandler(ValueChanged);
     //
     // groupMisc
     //
     groupMisc.Controls.Add(txtDragCoeff);
     groupMisc.Controls.Add(label1);
     groupMisc.Controls.Add(lblPounds);
     groupMisc.Controls.Add(txtWeight);
     groupMisc.Controls.Add(lblWeight);
     groupMisc.Location = new System.Drawing.Point(10, 250);
     groupMisc.Name = "groupMisc";
     groupMisc.Size = new System.Drawing.Size(205, 75);
     groupMisc.TabIndex = 5;
     groupMisc.TabStop = false;
     groupMisc.Text = "Miscellaneous";
     //
     // txtDragCoeff
     //
     txtDragCoeff.Location = new System.Drawing.Point(90, 45);
     txtDragCoeff.Name = "txtDragCoeff";
     txtDragCoeff.Size = new System.Drawing.Size(50, 20);
     txtDragCoeff.TabIndex = 4;
     txtDragCoeff.TextChanged += new System.EventHandler(ValueChanged);
     //
     // label1
     //
     label1.Location = new System.Drawing.Point(15, 45);
     label1.Name = "label1";
     label1.Size = new System.Drawing.Size(70, 20);
     label1.TabIndex = 3;
     label1.Text = "&Drag coeff.:";
     label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // lblPounds
     //
     lblPounds.Location = new System.Drawing.Point(145, 20);
     lblPounds.Name = "lblPounds";
     lblPounds.Size = new System.Drawing.Size(50, 20);
     lblPounds.TabIndex = 2;
     lblPounds.Text = "lbs";
     lblPounds.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // txtWeight
     //
     txtWeight.Location = new System.Drawing.Point(90, 20);
     txtWeight.Name = "txtWeight";
     txtWeight.Size = new System.Drawing.Size(50, 20);
     txtWeight.TabIndex = 1;
     txtWeight.TextChanged += new System.EventHandler(ValueChanged);
     //
     // lblWeight
     //
     lblWeight.Location = new System.Drawing.Point(15, 20);
     lblWeight.Name = "lblWeight";
     lblWeight.Size = new System.Drawing.Size(70, 20);
     lblWeight.TabIndex = 0;
     lblWeight.Text = "W&eight:";
     lblWeight.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // groupWheels
     //
     groupWheels.Controls.Add(lblRimDiameterUnits);
     groupWheels.Controls.Add(lblTireAspectUnits);
     groupWheels.Controls.Add(lblTireWidthUnits);
     groupWheels.Controls.Add(lblExampleEnd);
     groupWheels.Controls.Add(lblExampleDiameter);
     groupWheels.Controls.Add(lblExampleAspect);
     groupWheels.Controls.Add(lblExampleSlash);
     groupWheels.Controls.Add(lblExampleDash);
     groupWheels.Controls.Add(lblExampleWidth);
     groupWheels.Controls.Add(lblExample);
     groupWheels.Controls.Add(txtRimDiameter);
     groupWheels.Controls.Add(lblRimDiameter);
     groupWheels.Controls.Add(txtAspectRatio);
     groupWheels.Controls.Add(lblTireAspectRatio);
     groupWheels.Controls.Add(txtTireWidth);
     groupWheels.Controls.Add(lblTireWidth);
     groupWheels.Location = new System.Drawing.Point(225, 48);
     groupWheels.Name = "groupWheels";
     groupWheels.Size = new System.Drawing.Size(185, 122);
     groupWheels.TabIndex = 6;
     groupWheels.TabStop = false;
     groupWheels.Text = "Wheels";
     //
     // lblRimDiameterUnits
     //
     lblRimDiameterUnits.Location = new System.Drawing.Point(145, 92);
     lblRimDiameterUnits.Name = "lblRimDiameterUnits";
     lblRimDiameterUnits.Size = new System.Drawing.Size(30, 20);
     lblRimDiameterUnits.TabIndex = 15;
     lblRimDiameterUnits.Text = "in";
     lblRimDiameterUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // lblTireAspectUnits
     //
     lblTireAspectUnits.Location = new System.Drawing.Point(145, 67);
     lblTireAspectUnits.Name = "lblTireAspectUnits";
     lblTireAspectUnits.Size = new System.Drawing.Size(30, 20);
     lblTireAspectUnits.TabIndex = 12;
     lblTireAspectUnits.Text = "%";
     lblTireAspectUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // lblTireWidthUnits
     //
     lblTireWidthUnits.Location = new System.Drawing.Point(145, 42);
     lblTireWidthUnits.Name = "lblTireWidthUnits";
     lblTireWidthUnits.Size = new System.Drawing.Size(30, 20);
     lblTireWidthUnits.TabIndex = 9;
     lblTireWidthUnits.Text = "mm";
     lblTireWidthUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // lblExampleEnd
     //
     lblExampleEnd.Location = new System.Drawing.Point(170, 20);
     lblExampleEnd.Name = "lblExampleEnd";
     lblExampleEnd.Size = new System.Drawing.Size(5, 20);
     lblExampleEnd.TabIndex = 6;
     lblExampleEnd.Text = ")";
     lblExampleEnd.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExampleDiameter
     //
     lblExampleDiameter.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     lblExampleDiameter.ForeColor = System.Drawing.SystemColors.ControlText;
     lblExampleDiameter.Location = new System.Drawing.Point(145, 20);
     lblExampleDiameter.Name = "lblExampleDiameter";
     lblExampleDiameter.Size = new System.Drawing.Size(25, 20);
     lblExampleDiameter.TabIndex = 5;
     lblExampleDiameter.Text = "17";
     lblExampleDiameter.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExampleAspect
     //
     lblExampleAspect.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     lblExampleAspect.ForeColor = System.Drawing.SystemColors.ControlText;
     lblExampleAspect.Location = new System.Drawing.Point(105, 20);
     lblExampleAspect.Name = "lblExampleAspect";
     lblExampleAspect.Size = new System.Drawing.Size(30, 20);
     lblExampleAspect.TabIndex = 3;
     lblExampleAspect.Text = "40";
     lblExampleAspect.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExampleSlash
     //
     lblExampleSlash.Location = new System.Drawing.Point(95, 20);
     lblExampleSlash.Name = "lblExampleSlash";
     lblExampleSlash.Size = new System.Drawing.Size(10, 20);
     lblExampleSlash.TabIndex = 2;
     lblExampleSlash.Text = "/";
     lblExampleSlash.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExampleDash
     //
     lblExampleDash.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     lblExampleDash.ForeColor = System.Drawing.SystemColors.ControlText;
     lblExampleDash.Location = new System.Drawing.Point(135, 20);
     lblExampleDash.Name = "lblExampleDash";
     lblExampleDash.Size = new System.Drawing.Size(10, 20);
     lblExampleDash.TabIndex = 4;
     lblExampleDash.Text = "-";
     lblExampleDash.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExampleWidth
     //
     lblExampleWidth.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     lblExampleWidth.ForeColor = System.Drawing.SystemColors.ControlText;
     lblExampleWidth.Location = new System.Drawing.Point(65, 20);
     lblExampleWidth.Name = "lblExampleWidth";
     lblExampleWidth.Size = new System.Drawing.Size(30, 20);
     lblExampleWidth.TabIndex = 1;
     lblExampleWidth.Text = "275";
     lblExampleWidth.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // lblExample
     //
     lblExample.Location = new System.Drawing.Point(5, 20);
     lblExample.Name = "lblExample";
     lblExample.Size = new System.Drawing.Size(55, 20);
     lblExample.TabIndex = 0;
     lblExample.Text = "(Example:";
     lblExample.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtRimDiameter
     //
     txtRimDiameter.Location = new System.Drawing.Point(90, 92);
     txtRimDiameter.Name = "txtRimDiameter";
     txtRimDiameter.Size = new System.Drawing.Size(50, 20);
     txtRimDiameter.TabIndex = 14;
     txtRimDiameter.TextChanged += new System.EventHandler(ValueChanged);
     txtRimDiameter.Enter += new System.EventHandler(txtRimDiameter_Enter);
     txtRimDiameter.Leave += new System.EventHandler(txtRimDiameter_Leave);
     //
     // lblRimDiameter
     //
     lblRimDiameter.Location = new System.Drawing.Point(10, 92);
     lblRimDiameter.Name = "lblRimDiameter";
     lblRimDiameter.Size = new System.Drawing.Size(75, 20);
     lblRimDiameter.TabIndex = 13;
     lblRimDiameter.Text = "Rim &diameter:";
     lblRimDiameter.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtAspectRatio
     //
     txtAspectRatio.Location = new System.Drawing.Point(90, 67);
     txtAspectRatio.Name = "txtAspectRatio";
     txtAspectRatio.Size = new System.Drawing.Size(50, 20);
     txtAspectRatio.TabIndex = 11;
     txtAspectRatio.TextChanged += new System.EventHandler(ValueChanged);
     txtAspectRatio.Enter += new System.EventHandler(txtAspectRatio_Enter);
     txtAspectRatio.Leave += new System.EventHandler(txtAspectRatio_Leave);
     //
     // lblTireAspectRatio
     //
     lblTireAspectRatio.Location = new System.Drawing.Point(10, 67);
     lblTireAspectRatio.Name = "lblTireAspectRatio";
     lblTireAspectRatio.Size = new System.Drawing.Size(75, 20);
     lblTireAspectRatio.TabIndex = 10;
     lblTireAspectRatio.Text = "Tire &aspect:";
     lblTireAspectRatio.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtTireWidth
     //
     txtTireWidth.Location = new System.Drawing.Point(90, 42);
     txtTireWidth.Name = "txtTireWidth";
     txtTireWidth.Size = new System.Drawing.Size(50, 20);
     txtTireWidth.TabIndex = 8;
     txtTireWidth.TextChanged += new System.EventHandler(ValueChanged);
     txtTireWidth.Enter += new System.EventHandler(txtTireWidth_Enter);
     txtTireWidth.Leave += new System.EventHandler(txtTireWidth_Leave);
     //
     // lblTireWidth
     //
     lblTireWidth.Location = new System.Drawing.Point(10, 42);
     lblTireWidth.Name = "lblTireWidth";
     lblTireWidth.Size = new System.Drawing.Size(75, 20);
     lblTireWidth.TabIndex = 7;
     lblTireWidth.Text = "Tire &width:";
     lblTireWidth.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // groupDrivetrain
     //
     groupDrivetrain.Controls.Add(radioManual);
     groupDrivetrain.Controls.Add(radioAutomatic);
     groupDrivetrain.Location = new System.Drawing.Point(10, 114);
     groupDrivetrain.Name = "groupDrivetrain";
     groupDrivetrain.Size = new System.Drawing.Size(205, 56);
     groupDrivetrain.TabIndex = 3;
     groupDrivetrain.TabStop = false;
     groupDrivetrain.Text = "Transmission";
     //
     // radioManual
     //
     radioManual.Checked = true;
     radioManual.Location = new System.Drawing.Point(116, 20);
     radioManual.Name = "radioManual";
     radioManual.Size = new System.Drawing.Size(75, 20);
     radioManual.TabIndex = 1;
     radioManual.TabStop = true;
     radioManual.Text = "&Manual";
     radioManual.CheckedChanged += new System.EventHandler(ValueChanged);
     //
     // radioAutomatic
     //
     radioAutomatic.Location = new System.Drawing.Point(15, 20);
     radioAutomatic.Name = "radioAutomatic";
     radioAutomatic.Size = new System.Drawing.Size(75, 20);
     radioAutomatic.TabIndex = 0;
     radioAutomatic.Text = "&Automatic";
     radioAutomatic.CheckedChanged += new System.EventHandler(ValueChanged);
     //
     // txtName
     //
     txtName.Location = new System.Drawing.Point(60, 20);
     txtName.MaxLength = 20;
     txtName.Name = "txtName";
     txtName.Size = new System.Drawing.Size(350, 20);
     txtName.TabIndex = 1;
     txtName.TextChanged += new System.EventHandler(ValueChanged);
     //
     // lblName
     //
     lblName.Location = new System.Drawing.Point(5, 20);
     lblName.Name = "lblName";
     lblName.Size = new System.Drawing.Size(50, 20);
     lblName.TabIndex = 0;
     lblName.Text = "Name:";
     lblName.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // btnExit
     //
     btnExit.Location = new System.Drawing.Point(496, 384);
     btnExit.Name = "btnExit";
     btnExit.Size = new System.Drawing.Size(75, 25);
     btnExit.TabIndex = 2;
     btnExit.Text = "D&one";
     btnExit.Click += new System.EventHandler(btnExit_Click);
     //
     // VehicleForm
     //
     AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     ClientSize = new System.Drawing.Size(586, 416);
     Controls.Add(groupProfile);
     Controls.Add(groupVehicles);
     Controls.Add(btnExit);
     FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     MaximizeBox = false;
     MinimizeBox = false;
     Name = "VehicleForm";
     StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     Text = "Vehicle Profile Manager";
     Closing += new System.ComponentModel.CancelEventHandler(VehicleForm_Closing);
     Load += new System.EventHandler(VehicleForm_Load);
     groupVehicles.ResumeLayout(false);
     groupProfile.ResumeLayout(false);
     groupProfile.PerformLayout();
     groupBox1.ResumeLayout(false);
     groupBox1.PerformLayout();
     groupTimeout.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(numTimeout)).EndInit();
     groupNotes.ResumeLayout(false);
     groupNotes.PerformLayout();
     groupMisc.ResumeLayout(false);
     groupMisc.PerformLayout();
     groupWheels.ResumeLayout(false);
     groupWheels.PerformLayout();
     groupDrivetrain.ResumeLayout(false);
     ResumeLayout(false);
 }
Esempio n. 33
0
        void SetupBrowser(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            DocumentCompleted -= SetupBrowser;
            SHDocVw.WebBrowser xBrowser = (SHDocVw.WebBrowser)ActiveXInstance;
            xBrowser.BeforeNavigate2 += BeforeNavigate;
            DocumentCompleted += PageLoaded;
            NewWindow += new System.ComponentModel.CancelEventHandler(WinFormBrowser_NewWindow);

            ScriptErrorsSuppressed = true;
        }