Esempio n. 1
0
        internal ViewSp(Conn conn, ConnOpts connOpts, UInt16 width, UInt16 height) : base(conn, connOpts, width, height)
        {
            mouseAccelModeHdr = new EventHandler(MouseAccelModeClicked);

            MenuItem item;
            MenuItem subItem;

            item        = new MenuItem();
            item.Text   = App.GetStr("Left click");
            item.Click += new EventHandler(LeftClicked);
            menu.MenuItems.Add(item);
            item      = new MenuItem();
            item.Text = App.GetStr("Menu");
            menu.MenuItems.Add(item);

            subItem        = new MenuItem();
            subItem.Text   = App.GetStr("Right click");
            subItem.Click += new EventHandler(RightClicked);
            item.MenuItems.Add(subItem);
            subItem      = new MenuItem();
            subItem.Text = "-";
            item.MenuItems.Add(subItem);
            item.MenuItems.Add(connMenu);
            connMenu.MenuItems.Add(newConnItem);
            connMenu.MenuItems.Add(refreshItem);
            item.MenuItems.Add(viewMenu);
            item.MenuItems.Add(keysMenu);
            item.MenuItems.Add(optionsMenu);
            subItem         = new MenuItem();
            subItem.Text    = App.GetStr("Send mouse location when idle");
            subItem.Checked = connOpts.ViewOpts.SendMouseLocWhenIdle;
            subItem.Click  += new EventHandler(SendMouseLocWhenIdleClicked);
            optionsMenu.MenuItems.Add(subItem);
            mouseAccelModeMenu.Text = App.GetStr("Mouse speed");
            optionsMenu.MenuItems.Add(mouseAccelModeMenu);
            subItem         = new MenuItem();
            subItem.Text    = App.GetStr("Acceleration on");
            subItem.Checked = connOpts.ViewOpts.MouseAccelMode;
            subItem.Click  += mouseAccelModeHdr;
            mouseAccelModeMenu.MenuItems.Add(subItem);
            subItem         = new MenuItem();
            subItem.Text    = App.GetStr("Low");
            subItem.Checked = !connOpts.ViewOpts.MouseAccelMode && (connOpts.ViewOpts.MouseSpeed == MouseSpeed.Low);
            subItem.Click  += mouseAccelModeHdr;
            mouseAccelModeMenu.MenuItems.Add(subItem);
            subItem         = new MenuItem();
            subItem.Text    = App.GetStr("Normal");
            subItem.Checked = !connOpts.ViewOpts.MouseAccelMode && (connOpts.ViewOpts.MouseSpeed == MouseSpeed.Normal);
            subItem.Click  += mouseAccelModeHdr;
            mouseAccelModeMenu.MenuItems.Add(subItem);
            subItem         = new MenuItem();
            subItem.Text    = App.GetStr("High");
            subItem.Checked = !connOpts.ViewOpts.MouseAccelMode && (connOpts.ViewOpts.MouseSpeed == MouseSpeed.High);
            subItem.Click  += mouseAccelModeHdr;
            mouseAccelModeMenu.MenuItems.Add(subItem);
            subItem      = new MenuItem();
            subItem.Text = "-";
            item.MenuItems.Add(subItem);
            item.MenuItems.Add(aboutItem);
            item.MenuItems.Add(closeConnItem);

            cursorTimer.Tick    += new EventHandler(CursorTicked);
            cursorTimer.Interval = CursorDelta;
            cursorTimer.Enabled  = true;

            mouseIdleTimer.Tick    += new EventHandler(MouseIdleTicked);
            mouseIdleTimer.Interval = MouseIdleDelta;
            mouseIdleTimer.Enabled  = connOpts.ViewOpts.SendMouseLocWhenIdle;

            Graphics graphics = CreateGraphics();

            inputTimer.Tick      += new EventHandler(InputTicked);
            inputTimer.Interval   = InputDelta;
            inputBox.Enabled      = false;
            inputBox.Visible      = false;
            inputBox.MaxLength    = 1;
            inputBox.Size         = graphics.MeasureString("M", Font).ToSize(); // M should be the widest character
            inputBox.Width       += App.DialogSpacing;                          // Give the textbox some more space.
            inputBox.TextChanged += new EventHandler(OnInputTextChanged);
            inputBox.KeyDown     += new KeyEventHandler(OnInputKeyDown);
            inputBox.KeyUp       += new KeyEventHandler(OnInputKeyUp);
            inputBox.KeyPress    += new KeyPressEventHandler(OnInputKeyPress);
            Controls.Add(inputBox);

            graphics.Dispose();
        }
Esempio n. 2
0
 internal ViewDt(Conn conn, ConnOpts connOpts, UInt16 width, UInt16 height) : base(conn, connOpts, width, height)
 {
 }
Esempio n. 3
0
 internal static void RemoveConn(Conn conn)
 {
     connList.Remove(conn);
 }
Esempio n. 4
0
        //internal static void NewConn(string fileName)
        //{
        //    try
        //    {
        //        ConnOpts connOpts = new ConnOpts(fileName);
        //        Conn conn = new Conn();
        //        conn.Run(connOpts);
        //    }
        //    catch (FileNotFoundException)
        //    {
        //        MessageBox.Show(App.GetStr("Unable to open the file!"),
        //                        App.GetStr("Error"),
        //                        MessageBoxButtons.OK,
        //                        MessageBoxIcon.Exclamation,
        //                        MessageBoxDefaultButton.Button1);
        //    }
        //    catch (IOException)
        //    {
        //        MessageBox.Show(App.GetStr("Unable to read from the file!"),
        //                        App.GetStr("Error"),
        //                        MessageBoxButtons.OK,
        //                        MessageBoxIcon.Exclamation,
        //                        MessageBoxDefaultButton.Button1);
        //    }
        //    catch (XmlException)
        //    {
        //        MessageBox.Show(App.GetStr("The file is corrupted!"),
        //                        App.GetStr("Error"),
        //                        MessageBoxButtons.OK,
        //                        MessageBoxIcon.Exclamation,
        //                        MessageBoxDefaultButton.Button1);
        //    }
        //    catch (FormatException)
        //    {
        //        MessageBox.Show(App.GetStr("The file is corrupted!"),
        //                        App.GetStr("Error"),
        //                        MessageBoxButtons.OK,
        //                        MessageBoxIcon.Exclamation,
        //                        MessageBoxDefaultButton.Button1);
        //    }
        //}

        internal static void NewConn(string ip, string port, bool readOnly, string info)
        {
            Conn conn = new Conn();

            conn.Run(ip, port, readOnly, info);
        }
Esempio n. 5
0
 internal static void AddConn(Conn conn)
 {
     connList.Add(conn);
 }