Пример #1
36
 /*
  * The default constructor
  */
 public NumberBox()
 {
     this.InputScope = new InputScope();
     this.InputScope.Names.Add(new InputScopeName(InputScopeNameValue.Number));
     TextChanged += new TextChangedEventHandler(OnTextChanged);
     KeyDown += new KeyEventHandler(OnKeyDown);
 }
Пример #2
0
        public MainForm()
        {
            InitializeComponent();

            Text = "SharpMapTracker v" + Constants.MAP_TRACKER_VERSION;

            DataBindings.Add("TopMost", alwaysOnTopCheckBox, "Checked");
            DataBindings.Add("TrackMoveableItems", trackMoveableItemsCheckBox, "Checked");
            DataBindings.Add("TrackSplashes", trackSplashesCheckBox, "Checked");
            DataBindings.Add("TrackMonsters", trackMonstersCheckBox, "Checked");
            DataBindings.Add("TrackNPCs", trackNpcsCheckBox, "Checked");
            DataBindings.Add("TrackOnlyCurrentFloor", trackOnlyCurrentFloorCheckBox, "Checked");
            DataBindings.Add("RetrackTiles", retrackTilesToolStripMenuItem, "Checked");
            DataBindings.Add("NPCAutoTalk", npcAutoTalkCheckBox, "Checked");
            DataBindings.Add("ShareTrackedMap", shareTrackedMapCheckBox, "Checked");

            Trace.Listeners.Add(new TextBoxTraceListener(traceTextBox));
            Trace.Listeners.Add(new TextWriterTraceListener("log.txt"));

            Trace.AutoFlush = true;

            KeyDown += new KeyEventHandler(MainForm_KeyDown);
            Load += MainForm_Load;
            FormClosed += new FormClosedEventHandler(MainForm_FormClosed);
            miniMap.MiniMapClick += new EventHandler<MiniMapClickEventArgs>(miniMap_MiniMapClick);
        }
Пример #3
0
        public PyjamaForm(string[] args)
        {
            InitializeComponent();
            KeyDown += new KeyEventHandler(mainForm_KeyDown);

            _controller = new PyjamaFormController(this);
            _printEngine = new PrintEngine(_controller);

            Text = string.Format(Text, ApplicationInformation.Title(), ApplicationInformation.Version());

            SetButtonsStatus();
            ApplyUserSettings(ApplicationOptions.LoadUserSettings(ApplicationOptions.GetIsolatedStorage()));
            //this.ActiveControl = this.outputWindow.output; // Output window gets cursor

            int opened = 0;
            foreach (string filename in args)
            {
                string fullFilename = Path.GetFullPath(filename);
                // FIXME: if file exists, or allow create, if dir exists?
                OpenFile(fullFilename);
                opened++;
            }
            if (opened == 0)
            {
                NewFile();
            }

            this.ActiveControl = _docManager.GetCurrentTabTextBox(); // tab text gets cursor
            // FIXME: make a general language changer
            this.languageName.Text = "Python";
            this.columnNumber.Text = "" + 1;
            this.lineNumber.Text = "" + 1;
        }
Пример #4
0
 public AboutWindow(DynamoViewModel dynamoViewModel)
 {
     InitializeComponent();
     InstallNewUpdate = false;
     PreviewKeyDown += new KeyEventHandler(HandleEsc);
     DataContext = dynamoViewModel;
 }
Пример #5
0
 public mainWindow()
 {
     InitializeComponent();
     // Intializes this componet not really sure of its purpose
     // Ask Chris about this below
     KeyDown += new KeyEventHandler(Form1_KeyDown);
 }
Пример #6
0
        public DashGlobal(
            EventHandler<TextChangedEventArgs> textAreaTextChanged,
            EventHandler<TextChangedEventArgs> textAreaTextChangedDelayed,
            KeyEventHandler textAreaKeyUp,
            EventHandler textAreaSelectionChangedDelayed,
            DragEventHandler textAreaDragDrop,
            DragEventHandler textAreaDragEnter,
            TabControl mainTabControl,
            AutocompleteMenu armaSense,
            Main mainWindow)
        {
            EditorHelper = new EditorHelper(
                textAreaTextChanged,
                textAreaTextChangedDelayed,
                textAreaKeyUp,
                textAreaSelectionChangedDelayed,
                textAreaDragDrop,
                textAreaDragEnter,
                mainTabControl,
                armaSense,
                this);

            TabsHelper = new TabsHelper(
                textAreaTextChanged,
                textAreaSelectionChangedDelayed,
                mainTabControl,
                this);

            FilesHelper = new FilesHelper(this);
            SettingsHelper = new SettingsHelper();

            MainWindow = mainWindow;
        }
        public SpreadsheetView()
            : base()
        {
            SpreadsheetModel = new SpreadsheetModel(new CellCollection());            
            Dock = DockStyle.Fill;
            CellMouseDoubleClick += new DataGridViewCellMouseEventHandler(SpreadsheetView_CellMouseDoubleClick);
            CellMouseClick += new DataGridViewCellMouseEventHandler(SpreadsheetView_CellMouseClick);
            RowHeaderMouseClick += new DataGridViewCellMouseEventHandler(SpreadsheetView_RowHeaderMouseClick);
            RowHeightChanged += new DataGridViewRowEventHandler(SpreadsheetView_RowHeightChanged);
            ColumnWidthChanged += new DataGridViewColumnEventHandler(SpreadsheetView_ColumnWidthChanged);
            KeyDown += new KeyEventHandler(SpreadsheetView_KeyDown);
            KeyUp += new KeyEventHandler(SpreadsheetView_KeyUp);
            ParentChanged += delegate
            {
                Columns.Clear();

                for (int k = 0; k < ColumnCount; k++)
                {
                    Columns.Add(MakeColumnLabel(k), MakeColumnLabel(k));
                    Columns[k].SortMode = DataGridViewColumnSortMode.NotSortable;
                }

                Rows.Add(RowCount);

                AllowUserToOrderColumns = false;
                SelectionMode = DataGridViewSelectionMode.ColumnHeaderSelect;
            };

            CellEndEdit += new DataGridViewCellEventHandler(SpreadsheetView_CellEndEdit);
            CellBeginEdit += new DataGridViewCellCancelEventHandler(SpreadsheetView_CellBeginEdit);
            RowsRemoved += new DataGridViewRowsRemovedEventHandler(SpreadsheetView_RowsRemoved);

            this.DefaultCellStyle.Font = new Font("Times", 12);
        }
Пример #8
0
        public MainForm()
        {
            InitializeComponent();

            setupSocketConnection();// We need to setup the socket connection first

            LogWriter writer = LogWriter.Instance;
            writer.WriteToLog("This is a test");
            writer.WriteToLog("WORK!");
            writer.WriteToLog("DealtDamage", "Hitted enemy for 10% damage");
            writer.WriteToLog("DamageRecieved", "Left tires hit. 10% damage");
            labelCamera.Text            = "100%";
            labelControllUnit.Text      = "100%";
            labelRightWheels.Text       = "100%";
            labelLeftWheels.Text        = "100%";
            labelAmmo.Text              = "100%";
            labelClip.Text =            "6 Ammo / 2 Clips";

            browser = new ChromiumWebBrowser("http://"+ Properties.Settings.Default.IPAddress + "/rcam/index.php");
            panel1.Controls.Add(browser);

            this.KeyPreview = true;
            KeyDown +=
                new KeyEventHandler(BattleHudKeyHandler);
        }
Пример #9
0
 public MainWindow()
 {
     InitializeComponent();
     sb = new Sailboat();
     Loaded += new RoutedEventHandler(MainWindow_Loaded);
     PreviewKeyDown += new KeyEventHandler(MainWindow_PreviewKeyDown);
 }
        public MainWindow()
        {
            InitializeComponent();

               // new list1<database.{Name=“Anuska Sharama”,Age=21,Email=“[email protected]”,Image=“anuska.jpg”},

              //ResearcherList.add_R_listitems(list1, rlist); //Traverse all the items of researcher list and add into Listbox

              // list1.ItemsSource = rlist;

            list1.ItemsSource = rlist;

            KeyDown += new KeyEventHandler(sc1_KeyDown);

            for (int i = 1900; i <= 2100; i++)
            {
                //int year = 1900;
                cbo1.Items.Add(i.ToString());
                cbo2.Items.Add(i.ToString());

            }
            //cbo1.
            cbo1.SelectedItem = "2000";
            //cbo1.SelectionLength = 5;
            cbo1.PopupMaxHeight = 30;
            //cbo1.MinHeight = 20;
            cbo1.PopupMaxHeight = 100;

            cbo2.SelectedItem = "2015";
            //cbo1.SelectionLength = 5;
            cbo2.PopupMaxHeight = 30;
            //cbo1.MinHeight = 20;
            cbo2.PopupMaxHeight = 100;
        }
Пример #11
0
        public FloatingToolForm()
        {
            this.KeyPreview = true;
            controlAddedDelegate = new ControlEventHandler(ControlAddedHandler);
            controlRemovedDelegate = new ControlEventHandler(ControlRemovedHandler);
            keyUpDelegate = new KeyEventHandler(KeyUpHandler);

            this.ControlAdded += controlAddedDelegate; // we don't override OnControlAdded so we can re-use the method (see code below for ControlAdded)
            this.ControlRemoved += controlRemovedDelegate;

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            try
            {
                SystemLayer.UserSessions.SessionChanged += new EventHandler(UserSessions_SessionChanged);
                Microsoft.Win32.SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged);
            }

            catch (Exception ex)
            {
                Tracing.Ping("Exception while signing up for some system events: " + ex.ToString());
            }
        }
Пример #12
0
        public MainWindow()
        {
            InitializeComponent();

            StatusBarText = String.Empty;
            IsHlrOffPushed = false;
            IsHlrOnPushed = true;
            IsZoomWinEnabled = true;

            #region menu operations

            CommandBinding aBind_New = new CommandBinding( IECommands.New );
            aBind_New.Executed += NewCommand_Executed;
            CommandBindings.Add( aBind_New );

            CommandBinding aBind_Close = new CommandBinding( IECommands.Close );
            aBind_Close.Executed += CloseCommand_Executed;
            aBind_Close.CanExecute += CloseCommand_CanExecute;
            CommandBindings.Add( aBind_Close );

            CommandBinding aBind_Quit = new CommandBinding( IECommands.Quit );
            aBind_Quit.Executed += QuitCommand_Executed;
            CommandBindings.Add( aBind_Quit );

            CommandBinding aBind_About = new CommandBinding( IECommands.About );
            aBind_About.Executed += AboutCommand_Executed;
            CommandBindings.Add( aBind_About );

            # endregion

            PreviewKeyDown += new KeyEventHandler( OnPreviewKeyDown );
            PreviewKeyUp += new KeyEventHandler( OnPreviewKeyUp );
        }
Пример #13
0
        /// <summary>
        /// Initialize class events.
        /// </summary>
        private void InitializeEvents()
        {
            TextChanged += new EventHandler(HandleTextChanged);
            UpdateUI += new EventHandler<UpdateUIEventArgs>(HandleUpdateUI);

            // enable drag & drop
            AllowDrop = true;
            DragOver += new DragEventHandler(HandleDragOver);
            DragDrop += new DragEventHandler(HandleDragDrop);

            // search & replace
            KeyUp += new KeyEventHandler(HandleKeyUp);
            KeyDown += new KeyEventHandler(HandleKeyDown);
            InsertCheck += new EventHandler<InsertCheckEventArgs>(HandleInsertCheck);
            CharAdded += new EventHandler<CharAddedEventArgs>(HandleCharAdded);
            
            MouseWheel += new MouseEventHandler(HandleMouseWheel);
            Painted += new EventHandler<EventArgs>(HandlePainted);

            // create default pens
            grayPen = new Pen(Brushes.Gray);
            dashedPen = new Pen(Brushes.LightGray);
            dashedPen.DashPattern = new[] { 3f, 6f };

            // measure default line size
            lineSize = TextRenderer.MeasureText(new string('/', NewLineHelper), Font);
        }
Пример #14
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            KeyDown += new KeyEventHandler(InputHandler.OnKeyDown);
            KeyUp += new KeyEventHandler(InputHandler.OnKeyUp);

            game.Start();
        }
Пример #15
0
 private void CatchHotkey_Load(object sender, EventArgs e)
 {
     KeyPreview = true;
     KeyDown += new KeyEventHandler(CatchHotkey_KeyDown);
     KeyUp += new KeyEventHandler(CatchHotkey_KeyUp);
     Closed += new EventHandler(CatchHotkey_Closed);
 }
		private void Init()
		{
			InitializeComponent();

			MouseUp += new MouseEventHandler(OnMouseUp);
			KeyUp += new KeyEventHandler(OnKeyUp);
		}
Пример #17
0
        public Surface(Image backgroundImage = null)
        {
            ScreenRectangle = CaptureHelpers.GetScreenBounds();
            ScreenRectangle0Based = CaptureHelpers.FixScreenCoordinates(ScreenRectangle);

            InitializeComponent();

            SurfaceImage = backgroundImage;
            Prepare();

            DrawableObjects = new List<DrawableObject>();
            Config = new SurfaceOptions();
            timer = new Stopwatch();

            borderPen = new Pen(Color.DarkBlue);
            borderDotPen = new Pen(Color.Black, 1);
            borderDotPen.DashPattern = new float[] { 5, 5 };
            borderDotPen2 = new Pen(Color.White, 1);
            borderDotPen2.DashPattern = new float[] { 5, 5 };
            borderDotPen2.DashOffset = 5;
            shadowBrush = new SolidBrush(Color.FromArgb(75, Color.Black));
            lightBrush = new SolidBrush(Color.FromArgb(10, Color.Black));
            nodeBackgroundBrush = new SolidBrush(Color.White);
            textFont = new Font("Arial", 12, FontStyle.Bold);

            Shown += new EventHandler(Surface_Shown);
            KeyUp += new KeyEventHandler(Surface_KeyUp);
            MouseDoubleClick += new MouseEventHandler(Surface_MouseDoubleClick);
        }
Пример #18
0
		public DropEdit(string id, string dropChance, ServerDbs sdb, GenericDatabase gdb) : base("Item edit", "cde.ico", SizeToContent.Height, ResizeMode.NoResize) {
			_id = id;
			_dropChance = dropChance;
			_sdb = sdb;
			_gdb = gdb;

			InitializeComponent();

			_tbChance.Text = _dropChance;
			_tbId.Text = _id;

			PreviewKeyDown += new KeyEventHandler(_dropEdit_PreviewKeyDown);

			Loaded += delegate {
				_tbChance.SelectAll();
				_tbChance.Focus();
			};

			if (sdb != null) {
				_buttonQuery.Click += new RoutedEventHandler(_buttonQuery_Click);
			}
			else {
				_buttonQuery.Visibility = Visibility.Collapsed;
			}
		}
Пример #19
0
 public Board()
 {
     BackColor = Color.Black;
     DoubleBuffered = true;
     this.ClientSize = new Size(width, height);
     try {
         dot   = new Bitmap("dot.png");
         apple = new Bitmap("apple.png");
         head  = new Bitmap("head.png");
     } catch (Exception e) {
         Console.WriteLine(e.Message);
         Environment.Exit(1);
     }
     for (int z = 0; z < dots; z++) {
         x[z] = startPos - z * dotSize;
         y[z] = startPos;
     }
     locateApple();
     timer = new Timer();
     timer.Enabled = true;
     timer.Interval = 100;
     timer.Tick += new System.EventHandler(this.OnTick);
     Paint += new PaintEventHandler(this.OnPaint);
     KeyUp += new KeyEventHandler(OnKeyUp);
 }
Пример #20
0
        /*
         * The default constructor
         */
        public TextBoxNum()
        {
            VerticalContentAlignment = System.Windows.VerticalAlignment.Center;

            TextChanged += new TextChangedEventHandler(OnTextChanged);
            KeyDown += new KeyEventHandler(OnKeyDown);
        }
Пример #21
0
        public ExtendedTextBox()
        {
            InitializeComponent();

            KeyDown += new KeyEventHandler(OnKeyDown);
            base.TextChanged += new EventHandler(OnTextChanged);
        }
Пример #22
0
        void Window1_Loaded(object sender, RoutedEventArgs e)
        {
            Logging.Setup();
            Logging.AddToAuthorun();
            ShowInTaskbar = false;
            RegisterHotkey();
            
            _Model = new Model();
            this.DataContext = _Model;
            foreach (string s in Environment.GetCommandLineArgs())
            {
                if (File.Exists(s) && System.IO.Path.GetExtension(s) != ".exe")
                {
                    _Model.Open(s);
                }
            }
            if (!_Model._Loaded) _Model.Load();
            KeyDown += new KeyEventHandler(Window1_KeyDown);
            Closed += new EventHandler(Window1_Closed);
            
            Closing += new System.ComponentModel.CancelEventHandler(Window1_Closing);
            App.Current.Deactivated += new EventHandler(Current_Deactivated);
            _RitchTextBox.Focus();
            _RitchTextBox.TextChanged += new TextChangedEventHandler(RitchTextBox_TextChanged);

            new DispatcherTimer().StartRepeatMethod(60 * 10, Update);
            this.Show(); 
           
            
        }
Пример #23
0
 /// <summary>
 /// Register new event for the given page
 /// </summary>
 /// <param name="page">Name of the current page</param>
 /// <param name="keyboard">Handler to call when a KeyDown event is triggered</param>
 /// <param name="mousewheel">Handler to call when a MouseWheel event is triggered</param>
 public static void RegisterShortcuts(string page, KeyEventHandler keyboard, MouseWheelEventHandler mousewheel)
 {
     if (!isRegister)
     {
         isRegister = true;
         Application.Current.MainWindow.PreviewKeyDown += App_PreviewKeyDown;
         Application.Current.MainWindow.PreviewMouseWheel += App_PreviewMouseWheel;
     }
     if (!keyboardEvents.ContainsKey(page))
     {
         keyboardEvents.Add(page, new List<KeyEventHandler>());
     }
     if (!mouseWheelEvents.ContainsKey(page))
     {
         mouseWheelEvents.Add(page, new List<MouseWheelEventHandler>());
     }
     if (keyboard != null)
     {
         keyboardEvents[page].Add(keyboard);
     }
     if (mousewheel != null)
     {
         mouseWheelEvents[page].Add(mousewheel);
     }
 }
Пример #24
0
        public MainWindow()
        {
            InitializeComponent();

            //Init a decoder for video and listen for new frames
            _mjpeg = new MjpegDecoder();
            _mjpeg.FrameReady += mjpeg_FrameReady;

            //Init an handler for keyboard
            this.keyboardEventHandler = new KeyEventHandler(OnButtonKeyDown);
            listeningToKeyboardEvents = false;

            try
            {
                kinectControler = new KinectControler();
                //Init KinectControler handlers
                this.kinectControler.NewControlDataIsReady += KinectControlerHasNewControl;
                this.kinectControler.UserDetectionStatusChanged += KinectControlerUserDetectionStatusHasChanged;

            }
            catch (Exception ex)
            {
                button1.IsEnabled = false;
                MessageBox.Show("Aucune Kinect n'a été détectée. Pour utiliser la Kinect avec l'application, connectez une Kinect puis relancez le logiciel");
            }
        }
Пример #25
0
        private string[] snippets = { }; //{ "diag_log \"\";", "for \"_i\" from 1 to 10 do { debugLog _i; };", "call compile preprocessFileLine Numbers \"\";" };

        #endregion Fields

        #region Constructors

        public EditorHelper(
            EventHandler<TextChangedEventArgs> textAreaTextChanged,
            EventHandler<TextChangedEventArgs> textAreaTextChangedDelayed,
            KeyEventHandler textAreaKeyUp,
            EventHandler textAreaSelectionChangedDelayed,
            DragEventHandler textAreaDragDrop,
            DragEventHandler textAreaDragEnter,
            TabControl mainTabControl,
            AutocompleteMenu armaSense,
            DashGlobal dashGlobal)
        {
            TextAreaTextChanged = textAreaTextChanged;
            TextAreaTextChangedDelayed = textAreaTextChangedDelayed;
            TextAreaKeyUp = textAreaKeyUp;
            TextAreaSelectionChangedDelayed = textAreaSelectionChangedDelayed;
            TextAreaDragDrop = textAreaDragDrop;
            TextAreaDragEnter = textAreaDragEnter;
            MainTabControl = mainTabControl;
            ArmaSense = armaSense;

            DashGlobal = dashGlobal;

            ArmaListItemsCount = 0;
            ArmaSenseKeywords = new List<AutocompleteItem>();

            foreach (var item in keywordList)
            {
                ArmaSenseKeywords.Add(new AutocompleteItem(item) { ImageIndex = 0, ToolTipTitle = "Arma Script Command", ToolTipText = item });
            }
        }
Пример #26
0
        public homeScreen()
        {
            InitializeComponent();

            // Sets up the handling of key input in the form.
            KeyPreview = true;
            KeyDown += new KeyEventHandler(homeScreen_KeyDown);
        }
Пример #27
0
 public NumericTextBox()
 {
     LostFocus += new EventHandler(TextBox_LostFocus);
     GotFocus += new EventHandler(TextBox_GotFocus);
     TextChanged += new EventHandler(TextBox_TextChanged);
     KeyDown += new KeyEventHandler(TextBox_KeyDown);
     KeyPress += new KeyPressEventHandler(TextBox_KeyPress);
 }
Пример #28
0
 public AboutWindow(ILogger logger, DynamoViewModel model)
 {
     InitializeComponent();
     this.logger = logger;
     InstallNewUpdate = false;
     PreviewKeyDown += new KeyEventHandler(HandleEsc);
     DataContext = model;
 }
Пример #29
0
 public MainForm()
 {
     InitializeComponent();
     Load += new EventHandler(MainForm_Load);
     KeyUp += new KeyEventHandler(MainForm_KeyUp);
     FormClosing += new FormClosingEventHandler(MainForm_FormClosing);
     AppSettings.Instance.Initialize(AppSettings.KeyDeploySettings);
 }
Пример #30
-1
        public void BindGameController()
        {

            _mouse_up = new MouseEventHandler(OnMouseUp);
            _game_control.GetTargetControl().MouseUp += _mouse_up;

            _mouse_click = new MouseEventHandler(OnMouseClick);
            _game_control.GetTargetControl().MouseClick += _mouse_click;

            _mouse_down = new MouseEventHandler(OnMouseDown);
            _game_control.GetTargetControl().MouseDown += _mouse_down;

            _mouse_move = new MouseEventHandler(OnMouseMove);
            _game_control.GetTargetControl().MouseMove += _mouse_move;

            _mouse_wheel = new MouseEventHandler(OnMouseWheel);
            _game_control.GetTargetControl().MouseWheel += _mouse_wheel;

            _mouse_double_click = new MouseEventHandler(OnMouseDoubleClick);
            _game_control.GetTargetControl().MouseDoubleClick += _mouse_double_click;

            _key_press = new KeyPressEventHandler(OnKeyPress);
            _game_control.GetTargetControl().KeyPress += _key_press;

            _key_down = new KeyEventHandler(OnKeyDown);
            _game_control.GetTargetControl().KeyDown += _key_down;

            _key_up = new KeyEventHandler(OnKeyUp);
            _game_control.GetTargetControl().KeyUp += _key_up;

        }