コード例 #1
0
        public void PopupShowAsync(Point aLocation, HeapCellArrayWithStatistics aCells, HeapStatistics aStats, Size aOffset, System.Windows.Forms.KeyEventHandler aKeyHandler)
        {
            //System.Diagnostics.Debug.WriteLine( "PopupBase - Timer Started" );
            iKeyHandler = aKeyHandler;
            PrepareContent(aCells, aStats);
            //
            iHoverPos = aLocation;
            //
            iShowPos = aLocation;
            iShowPos.Offset(aOffset.Width, aOffset.Height);

            // If we are using an async timer delay then we must start the timer and
            // when it expires, the popup will become visible. Otherwise, we show
            // the popup immediately.
            if (VisibilityDelay > 0)
            {
                iTimer.Stop();
                iTimer.Enabled = true;
                iTimer.Start();
            }
            else
            {
                PopupShow();
            }
        }
コード例 #2
0
        public Display(Game game)
        {
            this.game = game;

            //Init display
            InitializeComponent();

            //Init framebuffer
            DoubleBuffered = true;

            //Change cur

            //Cursor.Hide();

            //Init events
            KeyDown += new System.Windows.Forms.KeyEventHandler(game.keyManager.KeyDown);
            KeyUp   += new System.Windows.Forms.KeyEventHandler(game.keyManager.KeyUp);

            MouseDown  += new System.Windows.Forms.MouseEventHandler(game.mouseManager.mouseDown);
            MouseMove  += new System.Windows.Forms.MouseEventHandler(game.mouseManager.mouseMove);
            MouseUp    += new System.Windows.Forms.MouseEventHandler(game.mouseManager.mouseUp);
            MouseWheel += new MouseEventHandler(game.mouseManager.mouseWheel);

            this.MouseEnter += new System.EventHandler(game.mouseManager.mouseEnter);
            this.MouseLeave += new System.EventHandler(game.mouseManager.mouseLeave);
            this.MouseHover += new System.EventHandler(game.mouseManager.mouseHover);

            Paint      += new System.Windows.Forms.PaintEventHandler(game.render);
            FormClosed += new System.Windows.Forms.FormClosedEventHandler(game.displayClosed);
        }
コード例 #3
0
 private void InitializeComponent()
 {
     SuspendLayout();
     Name     = "ListControl";
     KeyDown += new System.Windows.Forms.KeyEventHandler(ListControl_KeyDown);
     ResumeLayout(false);
 }
コード例 #4
0
ファイル: LocalList.cs プロジェクト: maxsnts/XwRemote
        //*************************************************************************************************************
        public LocalList()
        {
            FullRowSelect = true;
            Columns.Add("Name", 205);
            Columns.Add("Size", 100, HorizontalAlignment.Right);
            Columns.Add("Last Update", 125);

            DoubleClick    += new System.EventHandler(this_DoubleClick);
            ItemDrag       += new System.Windows.Forms.ItemDragEventHandler(this_ItemDrag);
            DragDrop       += new System.Windows.Forms.DragEventHandler(this_DragDrop);
            DragEnter      += new System.Windows.Forms.DragEventHandler(this_DragEnter);
            KeyDown        += new System.Windows.Forms.KeyEventHandler(this_KeyDown);
            MouseUp        += new System.Windows.Forms.MouseEventHandler(this_MouseUp);
            AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this_AfterLabelEdit);

            fileSystemWatcher.IncludeSubdirectories = false;
            fileSystemWatcher.NotifyFilter          = NotifyFilters.Attributes
                                                      | NotifyFilters.CreationTime
                                                      | NotifyFilters.DirectoryName
                                                      | NotifyFilters.FileName
                                                      | NotifyFilters.LastWrite
                                                      | NotifyFilters.Size;

            fileSystemWatcher.SynchronizingObject = this;
            fileSystemWatcher.Changed            += new System.IO.FileSystemEventHandler(this.fileSystemWatcher_Changed);
            fileSystemWatcher.Created            += new System.IO.FileSystemEventHandler(this.fileSystemWatcher_Changed);
            fileSystemWatcher.Deleted            += new System.IO.FileSystemEventHandler(this.fileSystemWatcher_Changed);
            fileSystemWatcher.Renamed            += new System.IO.RenamedEventHandler(this.fileSystemWatcher_Renamed);
            ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.List_ColumnClick);
        }
コード例 #5
0
ファイル: Game_Screen.cs プロジェクト: brlaswel/Magma-Game
 public Game_Screen()
 {
     this.KeyPreview = true;
     InitializeComponent();
     KeyDown += new System.Windows.Forms.KeyEventHandler(Form1_KeyDown);
     Create_Game_Window();
 }
コード例 #6
0
ファイル: Game_Screen.cs プロジェクト: brlaswel/Magma-Game
        private void Create_Game_Window()
        {
            //Test_Label.Show();
            Red_Magma_Control();
            KeyDown += new System.Windows.Forms.KeyEventHandler(Form1_KeyDown);

            //MessageBox.Show("You are not Crazy.");
        }
コード例 #7
0
        public OptionsView()
        {
            InitializeComponent();

            viewModel           = mainGrid.DataContext as OptionsViewModel;
            globalEventProvider = new GlobalEventProvider();
            //makes sure all up keys are parsed, before resetting with the debounced down key event
            globalKeyUpEventHandler = globalEventProvider.CreateDebounceKeyEventHandler(Global_OnKeyUp, TimeSpan.FromMilliseconds(300));

            AttachGlobalKeyListener();
        }
コード例 #8
0
        public SelectKey_Storage(Models.MSelectKey_Storage storage)
        {
            this.storage = storage;

            InitializeComponent();

            foreach (Control c in Controls)
            {
                c.KeyUp += new System.Windows.Forms.KeyEventHandler(this.SelectKey_Storage_KeyUp);
            }
            KeyUp += new System.Windows.Forms.KeyEventHandler(this.SelectKey_Storage_KeyUp);
        }
コード例 #9
0
ファイル: QueueList.cs プロジェクト: maxsnts/XwRemote
        //*************************************************************************************************************
        public QueueList()
        {
            InsertColumn("Progress", 120);
            InsertColumn("Local", 500);
            InsertColumn("", 18);
            InsertColumn("Remote", 500);
            InsertColumn("Size", 100);
            ShowItemToolTips = true;

            DoubleClick += new System.EventHandler(this_DoubleClick);
            KeyDown     += new System.Windows.Forms.KeyEventHandler(this_KeyDown);
            MouseUp     += new System.Windows.Forms.MouseEventHandler(this_MouseUp);
        }
コード例 #10
0
ファイル: Form1.cs プロジェクト: ShartepStudy/C_sharp
        public Form1()
        {
            this.Text          = "Перетащите jpg изображение на форму...";
            this.StartPosition = 0;
            this.Size          = new Size(SystemInformation.PrimaryMonitorSize.Width / 2, SystemInformation.PrimaryMonitorSize.Height - 40);

            pb.Parent     = this;
            pb.AllowDrop  = true;
            pb.DragDrop  += new DragEventHandler(pb_DragDrop);
            pb.DragEnter += new DragEventHandler(pb_DragEnter);
            KeyDown      += new System.Windows.Forms.KeyEventHandler(Form2_KeyDown);

            lb.Parent  = this;
            lb2.Parent = this;
        }
コード例 #11
0
ファイル: ViewController.cs プロジェクト: zanderphh/Project
        public void Start()
        {
            if (!this.isStarted && this.openGLControl != null && !this.openGLControl.IsDisposed)
            {
                if (keyDownEvent == null)
                {
                    keyDownEvent = new System.Windows.Forms.KeyEventHandler(openGLControl_KeyDown);
                }
                this.openGLControl.KeyDown += keyDownEvent;
                if (keyUpEvent == null)
                {
                    keyUpEvent = new System.Windows.Forms.KeyEventHandler(openGLControl_KeyUp);
                }
                this.openGLControl.KeyUp += keyUpEvent;
                if (mouseDownEvent == null)
                {
                    mouseDownEvent = new MouseEventHandler(openGLControl_MouseDown);
                }
                this.openGLControl.MouseDown += mouseDownEvent;
                if (mouseMoveEvent == null)
                {
                    mouseMoveEvent = new MouseEventHandler(openGLControl_MouseMove);
                }
                this.openGLControl.MouseMove += mouseMoveEvent;
                if (mouseEnterEvent == null)
                {
                    mouseEnterEvent = new EventHandler(openGLControl_MouseEnter);
                }
                this.openGLControl.MouseEnter += mouseEnterEvent;
                if (mouseLeaveEvent == null)
                {
                    mouseLeaveEvent = new EventHandler(openGLControl_MouseLeave);
                }
                this.openGLControl.MouseLeave += mouseLeaveEvent;
                if (resizedEvent == null)
                {
                    resizedEvent = new EventHandler(openGLControl_Resized);
                }
                this.openGLControl.Resized += resizedEvent;
                this.isStarted              = true;
                this.openGLControl_Resized(openGLControl, null);

                this.thrViewController = new Thread(viewControllerThreadFunc);
                this.thrViewController.IsBackground = true;
                this.thrViewController.Priority     = ThreadPriority.Highest;
                this.thrViewController.Start();
            }
        }
コード例 #12
0
        //*************************************************************************************************************
        public RemoteList()
        {
            FullRowSelect = true;
            Columns.Add("Name", 220);
            Columns.Add("Size", 100, HorizontalAlignment.Right);
            Columns.Add("Last Update", 125);

            DoubleClick    += new System.EventHandler(this_DoubleClick);
            ItemDrag       += new System.Windows.Forms.ItemDragEventHandler(this_ItemDrag);
            DragDrop       += new System.Windows.Forms.DragEventHandler(this_DragDrop);
            DragEnter      += new System.Windows.Forms.DragEventHandler(this_DragEnter);
            KeyDown        += new System.Windows.Forms.KeyEventHandler(this_KeyDown);
            MouseUp        += new System.Windows.Forms.MouseEventHandler(this_MouseUp);
            AfterLabelEdit += new System.Windows.Forms.LabelEditEventHandler(this_AfterLabelEdit);
            ColumnClick    += new System.Windows.Forms.ColumnClickEventHandler(this.List_ColumnClick);
        }
コード例 #13
0
        public SelectKey(Config.Data cfg, string Tag)
        {
            InitializeComponent();

            this.cfg = cfg;
            this.Tag = Tag;

            this.Text += Tag;

            foreach (Control c in Controls)
            {
                c.KeyUp += new System.Windows.Forms.KeyEventHandler(this.SelectKey_KeyUp);
            }

            KeyUp += new System.Windows.Forms.KeyEventHandler(this.SelectKey_KeyUp);
        }
コード例 #14
0
ファイル: GLControl .cs プロジェクト: unitycoder/Drawing3D
 void InitializeCtrlHandler()
 {
     PaintHandler            = new System.Windows.Forms.PaintEventHandler(_Paint);
     MouseDoubleClickHandler = new System.Windows.Forms.MouseEventHandler(_MouseDoubleClick);
     MouseDownHandler        = new System.Windows.Forms.MouseEventHandler(_MouseDown);
     HandleDestroyedHandler  = new EventHandler(_Destroy);
     MouseWheelHandler       = new System.Windows.Forms.MouseEventHandler(_MouseWheel);
     SizeChangedHandler      = new System.EventHandler(_SizeChanged);
     MouseUpHandler          = new System.Windows.Forms.MouseEventHandler(_MouseUp);
     PaintHandler            = new System.Windows.Forms.PaintEventHandler(_Paint);
     MouseMoveHandler        = new System.Windows.Forms.MouseEventHandler(_MouseMove);
     KeyPressHandler         = new System.Windows.Forms.KeyPressEventHandler(_KeyPress);
     KeyUpHandler            = new System.Windows.Forms.KeyEventHandler(_KeyUp);
     KeyDownHandler          = new System.Windows.Forms.KeyEventHandler(_KeyDown);
     NCMoveHandler           = new NCMouseMoveHandler(NCMouse);
     CtrlNCMouseMoveHandler  = new System.Windows.Forms.MouseEventHandler(CtrlNCMouseMove);
 }
コード例 #15
0
        /// <summary>
        /// Initialize a new form
        /// </summary>
        /// <param name="FileName">"" if new form</param>
        public Form1(string FileName)
        {
            InitializeComponent();

            Spreadsheet ss;

            if (FileName == "")
            {
                ss = new Spreadsheet(validator, s => s.ToUpper(), "ps6");
            }
            else
            {
                ss        = new Spreadsheet(FileName, validator, s => s.ToUpper(), "ps6");
                this.Text = FileName.Substring(FileName.LastIndexOf("\\") + 1);
            }

            spreadsheetPanel1.setSS(ss);
            spreadsheetPanel1.setSelectedCell("A1");
            spreadsheetPanel1.SetSelection(0, 0);

            // Adding event handlers to Form items
            // Some of the handlers take in additional variables to use
            spreadsheetPanel1.SelectionChanged += displaySelection;
            newMenuItem.Click         += newMenuItem_Click;
            closeMenuItem.Click       += closeMenuItem_Click;
            openMenuItem.Click        += (sender, e) => openMenuItem_Click(sender, e, spreadsheetPanel1, ref FileName);
            saveMenuItem.Click        += (sender, e) => saveMenuItem_Click(sender, e, spreadsheetPanel1, ref FileName);
            saveAsMenuItem.Click      += (sender, e) => saveAsMenuItem_Click(sender, e, spreadsheetPanel1, ref FileName);
            cancelBtn.Click           += (sender, e) => cancelBtn_Click(sender, e, spreadsheetPanel1);
            goBtn.Click               += (sender, e) => goBtn_Click(sender, e, spreadsheetPanel1);
            OpeningSpreadsheet.DoWork += new System.ComponentModel.DoWorkEventHandler((sender, e) => OpenSpreadsheet_Worker(sender, e, spreadsheetPanel1));
            KeyDown     += new System.Windows.Forms.KeyEventHandler((sender, e) => Form1_KeyDown(sender, e, spreadsheetPanel1));
            FormClosing += new System.Windows.Forms.FormClosingEventHandler((sender, e) => Form1_FormClosing(sender, e, spreadsheetPanel1));
            ContentTxtBox.TextChanged += new System.EventHandler((sender, e) => ContentTxtBox_TextChanged(sender, e, spreadsheetPanel1));

            // This needs to be set to true allow the arrow keys to work
            this.KeyPreview = true;

            // run a worker thread to load all the cells that may contain data
            OpeningSpreadsheet.RunWorkerAsync();

            ContentTxtBox.Focus();
        }
コード例 #16
0
ファイル: VistaButton.cs プロジェクト: iNewLegend/livechat
 private void InitializeComponent()
 {
     //
     // VistaButton
     //
     Name           = "VistaButton";
     Size           = new System.Drawing.Size(100, 32);
     Paint         += new System.Windows.Forms.PaintEventHandler(VistaButton_Paint);
     KeyUp         += new System.Windows.Forms.KeyEventHandler(VistaButton_KeyUp);
     KeyDown       += new System.Windows.Forms.KeyEventHandler(VistaButton_KeyDown);
     MouseEnter    += new System.EventHandler(VistaButton_MouseEnter);
     MouseLeave    += new System.EventHandler(VistaButton_MouseLeave);
     MouseUp       += new MouseEventHandler(VistaButton_MouseUp);
     MouseDown     += new System.Windows.Forms.MouseEventHandler(VistaButton_MouseDown);
     GotFocus      += new EventHandler(VistaButton_MouseEnter);
     LostFocus     += new EventHandler(VistaButton_MouseLeave);
     mFadeIn.Tick  += new EventHandler(mFadeIn_Tick);
     mFadeOut.Tick += new EventHandler(mFadeOut_Tick);
     Resize        += new EventHandler(VistaButton_Resize);
 }
コード例 #17
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     SuspendLayout();
     //
     // ShellTextBox
     //
     AcceptsReturn = true;
     AcceptsTab    = true;
     BackColor     = System.Drawing.Color.Black;
     BorderStyle   = System.Windows.Forms.BorderStyle.None;
     Dock          = System.Windows.Forms.DockStyle.Fill;
     ForeColor     = System.Drawing.Color.LawnGreen;
     MaxLength     = 0;
     Multiline     = true;
     ScrollBars    = ScrollBars.Both;
     Size          = new System.Drawing.Size(400, 176);
     KeyDown      += new System.Windows.Forms.KeyEventHandler(ShellControl_KeyDown);
     KeyPress     += new System.Windows.Forms.KeyPressEventHandler(shellTextBox_KeyPress);
     ResumeLayout(false);
 }
コード例 #18
0
 private void InitializePicutreBox()
 {
     BackColor       = System.Drawing.Color.White;
     BorderStyle     = System.Windows.Forms.BorderStyle.FixedSingle;
     Cursor          = System.Windows.Forms.Cursors.Default;
     DoubleBuffering = true;
     Name            = "cadPictBox";
     Ortho           = false;
     Position        = new System.Drawing.Point(0, 0);
     ScrollBars      = CADImport.FaceModule.ScrollBarsShow.None;
     TabStop         = false;
     VirtualSize     = new System.Drawing.Size(0, 0);
     Paint          += new System.Windows.Forms.PaintEventHandler(this.cadPictBox_Paint);
     KeyDown        += new System.Windows.Forms.KeyEventHandler(this.cadPictBox_KeyDown);
     MouseDown      += new System.Windows.Forms.MouseEventHandler(this.cadPictBox_MouseDown);
     MouseMove      += new System.Windows.Forms.MouseEventHandler(this.cadPictBox_MouseMove);
     MouseUp        += new System.Windows.Forms.MouseEventHandler(this.cadPictBox_MouseUp);
     Resize         += new System.EventHandler(this.cadPictBox_Resize);
     SetGDIStyle();
     CADLayerForm = new LayerForm();
 }
コード例 #19
0
 public virtual void PopupShowAsyncImpl(HeapCell aCell, RawItem aItem, HeapStatistics aStats, Point aLocalControlCoordiantes, Point aScreenCoordinates, Size aOffsetBy, System.Windows.Forms.KeyEventHandler aKeyHandler)
 {
 }
コード例 #20
0
 private void set_define_event()
 {
     m_cmd_save.Click += new System.EventHandler(m_cmd_save_Click);
     m_cmd_exit.Click += new System.EventHandler(m_cmd_exit_Click);
     KeyDown += new System.Windows.Forms.KeyEventHandler(f448_DM_V_GD_PHONG_BAN_DINH_MUC_DE_KeyDown);
     m_cbo_loai_dm.SelectedValueChanged += new EventHandler(m_cbo_loai_dm_SelectedValueChanged);
 }
コード例 #21
0
ファイル: ListControl.cs プロジェクト: CecleCW/ProductMan
 private void InitializeComponent()
 {
     SuspendLayout();
     Name = "ListControl";
     KeyDown += new System.Windows.Forms.KeyEventHandler( ListControl_KeyDown );
     ResumeLayout( false );
 }
コード例 #22
0
 public override void PopupShowAsyncImpl(HeapCellArrayWithStatistics aCells, HeapStatistics aStats, Point aLocalControlCoordinates, Point aScreenCoordinates, Size aCellBoxSizeIncludingPadding, System.Windows.Forms.KeyEventHandler aKeyHandler)
 {
     base.PopupShowAsyncImpl(aCells, aStats, aLocalControlCoordinates, aScreenCoordinates, aCellBoxSizeIncludingPadding, aKeyHandler);
 }
        public override void PopupShowAsyncImpl(HeapCellArrayWithStatistics aCells, HeapStatistics aStats, Point aLocalControlCoordinates, Point aScreenCoordinates, Size aOffsetBy, System.Windows.Forms.KeyEventHandler aKeyHandler)
        {
            PopupHide();
            //
            if (aCells.Count == 1)
            {
                HeapCell cell = aCells[0];
                //
                switch (cell.Type)
                {
                default:
                case HeapCell.TType.EAllocated:
                    if (cell.Symbol != null)
                    {
                        iActivePopup = new PopupCellAllocatedSymbols();
                    }
                    else
                    {
                        iActivePopup = new PopupCellAllocatedRaw();
                    }
                    break;

                case HeapCell.TType.EFree:
                    iActivePopup = new PopupCellFree();
                    break;
                }
            }
            else if (aCells.Count > 1)
            {
                iActivePopup = new PopupMultiCellSelection();
                iActivePopup.VisibilityDelay = 0;
            }
            //
            iActivePopup.PopupShowAsync(aScreenCoordinates, aCells, aStats, aOffsetBy, aKeyHandler);
        }
        public override void PopupShowAsyncImpl(HeapCellArrayWithStatistics aCells, HeapStatistics aStats, Point aLocalControlCoordinates, Point aScreenCoordinates, Size aCellBoxSizeIncludingPadding, System.Windows.Forms.KeyEventHandler aKeyHandler)
        {
            PopupHide();
            //
            if (aCells.Count == 1)
            {
                HeapCell cell = aCells[0];

                // If there's a free cell with a symbol (possible, if the user wanted to decode free cell contents)
                // then we should just display the allocated symbol popup (even though it's a free cell!)
                if (cell.Symbol != null)
                {
                    if (cell.Type == HeapCell.TType.EFree)
                    {
                        int x = 0;
                        x++;
                    }
                    iActivePopup = new PopupCellAllocatedSymbols();
                }
                else if (cell.Type == HeapCell.TType.EAllocated)
                {
                    iActivePopup = new PopupCellAllocatedRaw();
                }
                else if (cell.Type == HeapCell.TType.EFree)
                {
                    iActivePopup = new PopupCellFree();
                }

                iActivePopup.ColourFromHoverCoordinate = true;
            }
            else if (aCells.Count > 1)
            {
                iActivePopup = new PopupMultiCellSelection();
                iActivePopup.VisibilityDelay = 0;
            }
            //
            iActivePopup.PopupShowAsync(aScreenCoordinates, aCells, aStats, aCellBoxSizeIncludingPadding, aKeyHandler);
        }
コード例 #25
0
 private void set_define_events()
 {
     m_cmd_exit.Click += new EventHandler(m_cmd_exit_Click);
     m_cmd_insert.Click += new EventHandler(m_cmd_insert_Click);
     m_cmd_update.Click += new EventHandler(m_cmd_update_Click);
     m_cmd_delete.Click += new EventHandler(m_cmd_delete_Click);
     m_cmd_view.Click += new EventHandler(m_cmd_view_Click);
     m_txt_tim_kiem.TextChanged += new System.EventHandler(m_txt_tim_kiem_TextChanged);
     m_cbo_trung_tam.SelectedIndexChanged += new System.EventHandler(m_cbo_trung_tam_SelectedIndexChanged);
     m_cbo_loai_dm.SelectedIndexChanged += new System.EventHandler(m_cbo_loai_dm_SelectedIndexChanged);
     KeyDown += new System.Windows.Forms.KeyEventHandler(f446_DM_V_GD_PHONG_BAN_DINH_MUC_KeyDown);
     Load += new System.EventHandler(f446_DM_V_GD_PHONG_BAN_DINH_MUC_Load);
 }
コード例 #26
0
ファイル: MusterMainFrm.cs プロジェクト: drichards2/muster
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Event handler. Called by textBox when typing stops. </summary>
        ///
        /// <param name="sender">   Source of the event. </param>
        /// <param name="e">        Event information. </param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        private void textBox_Validated(object sender, EventArgs e)
        {
            // Start sending keypresses to Abel again
            KeyDown += new System.Windows.Forms.KeyEventHandler(this.Muster_KeyDown);
        }
コード例 #27
0
ファイル: BlockAppCodeBox.cs プロジェクト: mm-binary/DARF
        public void Init()
        {
            AllowDrop = true;
            CurrentFileName = null;
            Dock = System.Windows.Forms.DockStyle.Fill;
            Folding.Flags = ScintillaNET.FoldFlag.Box;
            Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            Indentation.BackspaceUnindents = true;
            Indentation.IndentWidth = 4;
            Indentation.ShowGuides = true;
            Indentation.SmartIndentType = ScintillaNET.SmartIndent.Simple;
            Indentation.TabWidth = 4;
            IsBraceMatching = true;
            Location = new System.Drawing.Point(3, 3);
            Margins.Margin0.Width = 30;
            Margins.Margin1.Width = 0;
            SearchFlags = ScintillaNET.SearchFlags.MatchCase;
            Size = new System.Drawing.Size(842, 280);
            Styles.BraceBad.Size = 11F;
            Styles.BraceLight.Size = 11F;
            Styles.ControlChar.Size = 11F;
            Styles.Default.BackColor = System.Drawing.SystemColors.Window;
            Styles.Default.Size = 11F;
            Styles.IndentGuide.Size = 11F;
            Styles.LastPredefined.Size = 11F;
            Styles.LineNumber.Size = 11F;
            Styles.Max.Size = 11F;
            TabIndex = 0;
            SelectionChanged += new System.EventHandler(this.txtInput2_SelectionChanged);
            KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtInput2_KeyDown);

            ConfigurationManager.CustomLocation = ".";
            Lexing.Lexer = ScintillaNET.Lexer.Cpp;
            Lexing.LexerLanguageMap["blockApp"] = "cpp";
            ConfigurationManager.Language = "blockApp";
            ConfigurationManager.Configure();

            Font xFont = Font;
            Styles.Default.Font = xFont;
            Styles[0].Font = xFont;
            Styles[1].Font = xFont;
            Styles[2].Font = xFont;
            Styles[3].Font = xFont;
            Styles[4].Font = xFont;
            Styles[5].Font = xFont;
            Styles[6].Font = xFont;
            Styles[7].Font = xFont;
            Styles[8].Font = xFont;
            Styles[9].Font = xFont;
            Styles[10].Font = xFont;
            Styles[11].Font = xFont;
            Styles[12].Font = xFont;
            Styles[14].Font = xFont;
            Styles[15].Font = xFont;
            Styles[16].Font = xFont;
            Styles[19].Font = xFont;
            Styles[32].Font = xFont;

            resetInputText("");
            CurrentFileName = null;
        }
コード例 #28
0
 public void PopupShowAsync(HeapCell aCell, RawItem aItem, HeapStatistics aStats, Point aLocalControlCoordinates, Point aScreenCoordinates, Size aOffsetBy, System.Windows.Forms.KeyEventHandler aKeyHandler)
 {
     if (SupportsRawItemInfo)
     {
         lock (this)
         {
             PopupShowAsyncImpl(aCell, aItem, aStats, aLocalControlCoordinates, aScreenCoordinates, aOffsetBy, aKeyHandler);
         }
     }
 }
コード例 #29
0
 public abstract void PopupShowAsyncImpl(HeapCellArrayWithStatistics aCells, HeapStatistics aStats, Point aLocalControlCoordinates, Point aScreenCoordinates, Size aOffsetBy, System.Windows.Forms.KeyEventHandler aKeyHandler);
コード例 #30
0
ファイル: MusterMainFrm.cs プロジェクト: drichards2/muster
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Event handler. Called by textBox when in focus during typing. </summary>
        ///
        /// <param name="sender">   Source of the event. </param>
        /// <param name="e">        Event information. </param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        private void textBox_Enter(object sender, EventArgs e)
        {
            // Only process keystrokes in the text box, to stop also sending keypresses to Abel
            KeyDown -= new System.Windows.Forms.KeyEventHandler(this.Muster_KeyDown);
        }
コード例 #31
0
ファイル: MainWindow.cs プロジェクト: xuchuansheng/GenXSource
        public void Init(System.String LoadFN, bool StreamMode)
        {
			streamMode = StreamMode;
			
			// application
			
//			Closing += new System.ComponentModel.CancelEventHandler(this.MainWindow_Closing_DISPOSE_ON_CLOSE);
			// JFrame.setDefaultLookAndFeelDecorated(false);
			
			//UPGRADE_ISSUE: Constructor 'javax.swing.Image.Image' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingImageIconImageIcon_javanetURL'"
			//GetType();
			//UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'"
            
            mainIcon = new Bitmap(Utility.GetFullPath("images\\MainIcon.png"));
			//Icon = System.Drawing.Icon.FromHandle(((System.Drawing.Bitmap) mainIcon).GetHicon());
			//UPGRADE_ISSUE: Constructor 'javax.swing.Image.Image' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingImageIconImageIcon_javanetURL'"
			GetType();
			//UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'"
            mainLogo = new Bitmap(Utility.GetFullPath("/images/MainLogo.png"));


            templ = new Templates();
			
			// toolbar

			ImageList temp_ImageList;
			temp_ImageList = new System.Windows.Forms.ImageList();
			// temp_ToolBar = new System.Windows.Forms.ToolBar();
            toolButtons = new Button[TOOL_COUNT];
			//UPGRADE_TODO: Class 'javax.swing.Image' was converted to 'System.Drawing.Image' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingImageIcon'"
			toolIcons = new System.Drawing.Image[TOOL_COUNT];
			//UPGRADE_TODO: Class 'javax.swing.ButtonGroup' was converted to 'System.Collections.IList' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
			toolGroup = new ArrayList();
			for (int n = 0; n < TOOL_COUNT; n++)
			{
				//UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'"
				toolIcons[n] = new Bitmap(Utility.GetFullPath("/images/" + IMAGE_TOOL[n] + ".png"));
				if (ACTIVE_TOOL[n])
				{
                    toolButtons[n] = new Button();
                    toolButtons[n].Image = toolIcons[n]; 
					toolGroup.Add((System.Object) toolButtons[n]);
					System.Windows.Forms.ToolBarButton temp_ToolBarButton;
					//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
					// tools.Items.Add(toolButtons[n]);
                    SupportClass.CommandManager.CheckCommand(toolButtons[n]);
                    SupportClass.ToolTipSupport.setToolTipText(toolButtons[n], TOOL_TIPS[n]);
				}
				/*else {toolButtons[n]=new JButton(toolIcons[n]);
				tools.Add(toolButtons[n]);
				toolButtons[n].addActionListener(this);}*/
			}
			//UPGRADE_TODO: Method 'javax.swing.AbstractButton.getModel' was converted to 'ToolStripButtonBase' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
			SupportClass.ButtonGroupSupport.SetSelected(toolGroup, toolButtons[TOOL_CURSOR], true);
			
			toolButtons[TOOL_SETATOM].MouseDown += new System.Windows.Forms.MouseEventHandler(mouseDown);
			toolButtons[TOOL_SETATOM].MouseDown += new System.Windows.Forms.MouseEventHandler(this.mousePressed);
			toolButtons[TOOL_SETATOM].KeyDown += new System.Windows.Forms.KeyEventHandler(keyDown);
			toolButtons[TOOL_SETATOM].KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyPressed);
			toolButtons[TOOL_SETATOM].KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.keyTyped);
			toolButtons[TOOL_TEMPLATE].MouseDown += new System.Windows.Forms.MouseEventHandler(mouseDown);
			toolButtons[TOOL_TEMPLATE].MouseDown += new System.Windows.Forms.MouseEventHandler(this.mousePressed);
			
			SelectElement("C");
			
			// menus
			
			System.Windows.Forms.MainMenu menubar = new System.Windows.Forms.MainMenu();
			
			System.Windows.Forms.MenuItem menufile = new System.Windows.Forms.MenuItem("&File");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menufile.setMnemonic((int) System.Windows.Forms.Keys.F);
			menufile.MenuItems.Add(MenuItem("New", (int) System.Windows.Forms.Keys.N, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('N' | (int) System.Windows.Forms.Keys.Control))));
			menufile.MenuItems.Add(MenuItem("New Window", (int) System.Windows.Forms.Keys.W, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('N' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menufile.MenuItems.Add(MenuItem("Open", (int) System.Windows.Forms.Keys.O, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('O' | (int) System.Windows.Forms.Keys.Control))));
			if (!streamMode)
				menufile.MenuItems.Add(MenuItem("Save", (int) System.Windows.Forms.Keys.S, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('S' | (int) System.Windows.Forms.Keys.Control))));
			menufile.MenuItems.Add(MenuItem("Save As", (int) System.Windows.Forms.Keys.A));
			System.Windows.Forms.MenuItem menuexport = new System.Windows.Forms.MenuItem("&Export");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menuexport.setMnemonic((int) System.Windows.Forms.Keys.X);
			menuexport.MenuItems.Add(MenuItem("as MDL MOL", (int) System.Windows.Forms.Keys.M, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('M' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menuexport.MenuItems.Add(MenuItem("as CML XML", (int) System.Windows.Forms.Keys.X, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('X' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menufile.MenuItems.Add(menuexport);
			menufile.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
			if (!streamMode)
				menufile.MenuItems.Add(MenuItem("Quit", (int) System.Windows.Forms.Keys.Q, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Q' | (int) System.Windows.Forms.Keys.Control))));
			else
				menufile.MenuItems.Add(MenuItem("Save & Quit", (int) System.Windows.Forms.Keys.Q, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Q' | (int) System.Windows.Forms.Keys.Control))));
			
			System.Windows.Forms.MenuItem menuedit = new System.Windows.Forms.MenuItem("&Edit");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menuedit.setMnemonic((int) System.Windows.Forms.Keys.E);
			menuedit.MenuItems.Add(MenuItem("Edit...", (int) System.Windows.Forms.Keys.E, toolIcons[TOOL_DIALOG], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) (' ' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Undo", (int) System.Windows.Forms.Keys.U, toolIcons[TOOL_UNDO], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Z' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Redo", (int) System.Windows.Forms.Keys.R, toolIcons[TOOL_REDO], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('Z' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menuedit.MenuItems.Add(MenuItem("Cut", (int) System.Windows.Forms.Keys.X, toolIcons[TOOL_CUT], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('X' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Copy", (int) System.Windows.Forms.Keys.C, toolIcons[TOOL_COPY], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('C' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Paste", (int) System.Windows.Forms.Keys.V, toolIcons[TOOL_PASTE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('V' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
			menuedit.MenuItems.Add(MenuItem("Select All", (int) System.Windows.Forms.Keys.S, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('A' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Next Atom", (int) System.Windows.Forms.Keys.N, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('E' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Previous Atom", (int) System.Windows.Forms.Keys.P, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('E' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menuedit.MenuItems.Add(MenuItem("Next Group", (int) System.Windows.Forms.Keys.G, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('G' | (int) System.Windows.Forms.Keys.Control))));
			menuedit.MenuItems.Add(MenuItem("Previous Group", (int) System.Windows.Forms.Keys.R, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('G' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			menuedit.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
			menuedit.MenuItems.Add(MenuItem("Flip Horizontal", (int) System.Windows.Forms.Keys.H, null, null));
			menuedit.MenuItems.Add(MenuItem("Flip Vertical", (int) System.Windows.Forms.Keys.V, null, null));
			menuedit.MenuItems.Add(MenuItem("Rotate +45°", (int) System.Windows.Forms.Keys.D4, null, null));
			menuedit.MenuItems.Add(MenuItem("Rotate -45°", (int) System.Windows.Forms.Keys.D5, null, null));
			menuedit.MenuItems.Add(MenuItem("Rotate +90°", (int) System.Windows.Forms.Keys.D9, null, null));
			menuedit.MenuItems.Add(MenuItem("Rotate -90°", (int) System.Windows.Forms.Keys.D0, null, null));
			menuedit.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
			menuedit.MenuItems.Add(MenuItem("Add Temporary Template", (int) System.Windows.Forms.Keys.T, null, null));
			menuedit.MenuItems.Add(MenuItem("Normalise Bond Lengths", (int) System.Windows.Forms.Keys.N, null, null));
			
			System.Windows.Forms.MenuItem menuview = new System.Windows.Forms.MenuItem("&View");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menuview.setMnemonic((int) System.Windows.Forms.Keys.V);
			menuview.MenuItems.Add(MenuItem("Zoom Full", (int) System.Windows.Forms.Keys.F, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('0' | (int) System.Windows.Forms.Keys.Control))));
			menuview.MenuItems.Add(MenuItem("Zoom In", (int) System.Windows.Forms.Keys.I, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('=' | (int) System.Windows.Forms.Keys.Control))));
			menuview.MenuItems.Add(MenuItem("Zoom Out", (int) System.Windows.Forms.Keys.O, null, new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('-' | (int) System.Windows.Forms.Keys.Control))));
			menuview.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
			//UPGRADE_TODO: Class 'javax.swing.ButtonGroup' was converted to 'System.Collections.IList' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
			System.Collections.IList showBG = new ArrayList();
			menuview.MenuItems.Add(RadioMenuItem("Show Elements", (int) System.Windows.Forms.Keys.E, true, showBG));
			menuview.MenuItems.Add(RadioMenuItem("Show All Elements", (int) System.Windows.Forms.Keys.A, false, showBG));
			menuview.MenuItems.Add(RadioMenuItem("Show Indices", (int) System.Windows.Forms.Keys.I, false, showBG));
			menuview.MenuItems.Add(RadioMenuItem("Show Ring ID", (int) System.Windows.Forms.Keys.R, false, showBG));
			menuview.MenuItems.Add(RadioMenuItem("Show CIP Priority", (int) System.Windows.Forms.Keys.C, false, showBG));
			
			System.Windows.Forms.MenuItem menutool = new System.Windows.Forms.MenuItem("&Tool");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menutool.setMnemonic((int) System.Windows.Forms.Keys.T);
			menutool.MenuItems.Add(MenuItem("Cursor", (int) System.Windows.Forms.Keys.C, toolIcons[TOOL_CURSOR], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ((int) System.Windows.Forms.Keys.Escape | 0))));
			menutool.MenuItems.Add(MenuItem("Rotator", (int) System.Windows.Forms.Keys.R, toolIcons[TOOL_ROTATOR], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('R' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Erasor", (int) System.Windows.Forms.Keys.E, toolIcons[TOOL_ERASOR], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('D' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Edit Atom", (int) System.Windows.Forms.Keys.A, toolIcons[TOOL_EDIT], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) (',' | (int) System.Windows.Forms.Keys.Control))));
			//UPGRADE_ISSUE: Constructor 'javax.swing.Image.Image' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingImageIconImageIcon_javanetURL'"
			GetType();
			//UPGRADE_TODO: Method 'java.lang.Class.getResource' was converted to 'System.Uri' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javalangClassgetResource_javalangString'"
			menutool.MenuItems.Add(MenuItem("Set Atom", (int) System.Windows.Forms.Keys.S, new Bitmap(Utility.GetFullPath("/images/ASelMenu.png")), new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('.' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Single Bond", (int) System.Windows.Forms.Keys.D1, toolIcons[TOOL_SINGLE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('1' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Double Bond", (int) System.Windows.Forms.Keys.D2, toolIcons[TOOL_DOUBLE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('2' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Triple Bond", (int) System.Windows.Forms.Keys.D3, toolIcons[TOOL_TRIPLE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('3' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Zero Bond", (int) System.Windows.Forms.Keys.D0, toolIcons[TOOL_ZERO], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('0' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Inclined Bond", (int) System.Windows.Forms.Keys.I, toolIcons[TOOL_INCLINED]));
			menutool.MenuItems.Add(MenuItem("Declined Bond", (int) System.Windows.Forms.Keys.D, toolIcons[TOOL_DECLINED]));
			menutool.MenuItems.Add(MenuItem("Unknown Bond", (int) System.Windows.Forms.Keys.U, toolIcons[TOOL_UNKNOWN]));
			menutool.MenuItems.Add(MenuItem("Charge", (int) System.Windows.Forms.Keys.H, toolIcons[TOOL_CHARGE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('H' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Template Tool", (int) System.Windows.Forms.Keys.T, toolIcons[TOOL_TEMPLATE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('T' | (int) System.Windows.Forms.Keys.Control))));
			menutool.MenuItems.Add(MenuItem("Select Template", (int) System.Windows.Forms.Keys.T, toolIcons[TOOL_TEMPLATE], new System.Windows.Forms.KeyEventArgs((System.Windows.Forms.Keys) ('T' | (int) System.Windows.Forms.Keys.Control + (int) System.Windows.Forms.Keys.Shift))));
			System.Windows.Forms.MenuItem menuhydr = new System.Windows.Forms.MenuItem("H&ydrogen");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menuhydr.setMnemonic((int) System.Windows.Forms.Keys.Y);
			chkShowHydr = new System.Windows.Forms.MenuItem("Show H&ydrogen");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// chkShowHydr.setMnemonic((int) System.Windows.Forms.Keys.Y);
			chkShowHydr.Checked = true;
			chkShowHydr.Click += new System.EventHandler(this.actionPerformed);
			SupportClass.CommandManager.CheckCommand(chkShowHydr);
			menuhydr.MenuItems.Add(chkShowHydr);
			menuhydr.MenuItems.Add(MenuItem("Set Explicit", (int) System.Windows.Forms.Keys.E));
			menuhydr.MenuItems.Add(MenuItem("Clear Explicit", (int) System.Windows.Forms.Keys.X));
			menuhydr.MenuItems.Add(MenuItem("Zero Explicit", (int) System.Windows.Forms.Keys.Z));
			menuhydr.MenuItems.Add(MenuItem("Create Actual", (int) System.Windows.Forms.Keys.C));
			menuhydr.MenuItems.Add(MenuItem("Delete Actual", (int) System.Windows.Forms.Keys.D));
			
			System.Windows.Forms.MenuItem menuster = new System.Windows.Forms.MenuItem("&Stereochemistry");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			//menuster.setMnemonic((int) System.Windows.Forms.Keys.S);
			chkShowSter = new System.Windows.Forms.MenuItem("Show Stereo&labels");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// chkShowSter.setMnemonic((int) System.Windows.Forms.Keys.L);
			chkShowSter.Checked = false;
			chkShowSter.Click += new System.EventHandler(this.actionPerformed);
			SupportClass.CommandManager.CheckCommand(chkShowSter);
			menuster.MenuItems.Add(chkShowSter);
			menuster.MenuItems.Add(MenuItem("Invert Stereochemistry", (int) System.Windows.Forms.Keys.I));
			menuster.MenuItems.Add(MenuItem("Set R/Z", (int) System.Windows.Forms.Keys.R));
			menuster.MenuItems.Add(MenuItem("Set S/E", (int) System.Windows.Forms.Keys.S));
			menuster.MenuItems.Add(MenuItem("Cycle Wedges", (int) System.Windows.Forms.Keys.C));
			menuster.MenuItems.Add(MenuItem("Remove Wedges", (int) System.Windows.Forms.Keys.W));
			
			System.Windows.Forms.MenuItem menuhelp = new System.Windows.Forms.MenuItem("&Help");
			//UPGRADE_ISSUE: Method 'javax.swing.AbstractButton.setMnemonic' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingAbstractButtonsetMnemonic_int'"
			// menuhelp.setMnemonic((int) System.Windows.Forms.Keys.H);
			menuhelp.MenuItems.Add(MenuItem("About", (int) System.Windows.Forms.Keys.A));
			
			menubar.MenuItems.Add(menufile);
			menubar.MenuItems.Add(menuedit);
			menubar.MenuItems.Add(menuview);
			menubar.MenuItems.Add(menutool);
			menubar.MenuItems.Add(menuhydr);
			menubar.MenuItems.Add(menuster);
			//UPGRADE_ISSUE: Method 'javax.swing.Box.createHorizontalGlue' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaxswingBox'"
			//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
            // TODO: Figure out what horizontal glue is and find equiv
            //System.Windows.Forms.Control temp_Control;
            //temp_Control = Box.createHorizontalGlue();
            //menubar.Controls.Add(temp_Control);
			menubar.MenuItems.Add(menuhelp);
			
			// molecule
			
			editor = new EditorPane(this.Width, this.Height, false);
            editor.SetMolSelectListener((MolSelectListener)this); 
            
			//UPGRADE_TODO: Class 'javax.swing.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
			//UPGRADE_TODO: Constructor 'javax.swing.JScrollPane.JScrollPane' was converted to 'System.Windows.Forms.ScrollableControl.ScrollableControl' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJScrollPaneJScrollPane_javaawtComponent'"
			System.Windows.Forms.ScrollableControl temp_scrollablecontrol;
			temp_scrollablecontrol = new System.Windows.Forms.ScrollableControl();
			temp_scrollablecontrol.AutoScroll = true;
			temp_scrollablecontrol.Controls.Add(editor);
			System.Windows.Forms.ScrollableControl scroll = temp_scrollablecontrol;
			
			// overall layout
			
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			//UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtContainersetLayout_javaawtLayoutManager'"
			//UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtBorderLayout'"
			/*
			((System.Windows.Forms.ContainerControl) this).setLayout(new BorderLayout());*/
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
			((System.Windows.Forms.ContainerControl) this).Controls.Add(scroll);
			scroll.Dock = System.Windows.Forms.DockStyle.Fill;
			scroll.BringToFront();
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
			// ((System.Windows.Forms.ContainerControl) this).Controls.Add(menubar);
			// menubar.Dock = System.Windows.Forms.DockStyle.Top;
			// menubar.SendToBack();
			//UPGRADE_TODO: Method 'javax.swing.JFrame.getContentPane' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaxswingJFramegetContentPane'"
			//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent_javalangObject'"
			//UPGRADE_ISSUE: Method 'java.awt.Window.pack' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtWindowpack'"
// 			pack();
			
			editor.Focus();
			
			editor.SetToolCursor();
			
			if (LoadFN != null)
			{
				try
				{
					//UPGRADE_TODO: Constructor 'java.io.FileInputStream.FileInputStream' was converted to 'System.IO.FileStream.FileStream' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioFileInputStreamFileInputStream_javalangString'"
					System.IO.FileStream istr = new System.IO.FileStream(LoadFN, System.IO.FileMode.Open, System.IO.FileAccess.Read);
					Molecule frag = MoleculeStream.ReadUnknown(istr);
					editor.AddArbitraryFragment(frag);
					istr.Close();
				}
				catch (System.IO.IOException e)
				{
					//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Throwable.toString' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
					SupportClass.OptionPaneSupport.ShowMessageDialog(null, e.ToString(), "Open Failed", (int) System.Windows.Forms.MessageBoxIcon.Error);
					return ;
				}
				
				SetFilename(LoadFN);
				editor.NotifySaved();
			}
			if (streamMode)
				ReadStream();
			
			KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyPressed);
			KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.keyTyped);
			editor.KeyDown += new System.Windows.Forms.KeyEventHandler(this.keyPressed);
			editor.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.keyTyped);
		}
コード例 #32
0
 /// <summary>
 /// デザイナ サポートに必要なメソッドです。このメソッドの内容を
 /// コード エディタで変更しないでください。
 /// </summary>
 private void InitializeComponent()
 {
     components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormFeatureSwitchList));
     lvFeatureSwitchList        = new System.Windows.Forms.ListView();
     lvhFeatureSwitchListF      = new System.Windows.Forms.ColumnHeader();
     lvhFeatureSwitchListID     = new System.Windows.Forms.ColumnHeader();
     lvhFeatureSwitchListParam  = new System.Windows.Forms.ColumnHeader();
     lvhFeatureSwitchListDesc   = new System.Windows.Forms.ColumnHeader();
     foFeatureSWTab             = new System.Windows.Forms.TabControl();
     foFeatureSWEnableFeatures  = new System.Windows.Forms.TabPage();
     foFeatureSWDisableFeatures = new System.Windows.Forms.TabPage();
     lvDisableFeatures          = new System.Windows.Forms.ListView();
     lvhDisableFeatureListF     = new System.Windows.Forms.ColumnHeader();
     lvhDisableFeatureListDesc  = new System.Windows.Forms.ColumnHeader();
     imageList1 = new System.Windows.Forms.ImageList(components);
     foFeatureSWTab.SuspendLayout();
     foFeatureSWEnableFeatures.SuspendLayout();
     foFeatureSWDisableFeatures.SuspendLayout();
     SuspendLayout();
     //
     // lvFeatureSwitchList
     //
     lvFeatureSwitchList.BorderStyle = System.Windows.Forms.BorderStyle.None;
     lvFeatureSwitchList.CheckBoxes  = true;
     lvFeatureSwitchList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
         lvhFeatureSwitchListF,
         lvhFeatureSwitchListID,
         lvhFeatureSwitchListParam,
         lvhFeatureSwitchListDesc
     });
     lvFeatureSwitchList.Dock          = System.Windows.Forms.DockStyle.Fill;
     lvFeatureSwitchList.FullRowSelect = true;
     lvFeatureSwitchList.GridLines     = true;
     lvFeatureSwitchList.HeaderStyle   = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
     lvFeatureSwitchList.HideSelection = false;
     lvFeatureSwitchList.Location      = new System.Drawing.Point(0, 0);
     lvFeatureSwitchList.Name          = "lvFeatureSwitchList";
     lvFeatureSwitchList.Size          = new System.Drawing.Size(672, 246);
     lvFeatureSwitchList.Sorting       = System.Windows.Forms.SortOrder.Ascending;
     lvFeatureSwitchList.TabIndex      = 0;
     lvFeatureSwitchList.UseCompatibleStateImageBehavior = false;
     lvFeatureSwitchList.View       = System.Windows.Forms.View.Details;
     lvFeatureSwitchList.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(lvFeatureSwitchList_ItemCheck);
     lvFeatureSwitchList.KeyUp     += new System.Windows.Forms.KeyEventHandler(foFeatureSwitchList_KeyUp);
     //
     // lvhFeatureSwitchListF
     //
     lvhFeatureSwitchListF.Text  = "lvhFeatureSwitchListF";
     lvhFeatureSwitchListF.Width = 180;
     //
     // lvhFeatureSwitchListID
     //
     lvhFeatureSwitchListID.Text  = "lvhFeatureSwitchListID";
     lvhFeatureSwitchListID.Width = 40;
     //
     // lvhFeatureSwitchListParam
     //
     lvhFeatureSwitchListParam.Text  = "lvhFeatureSwitchListParam";
     lvhFeatureSwitchListParam.Width = 102;
     //
     // lvhFeatureSwitchListDesc
     //
     lvhFeatureSwitchListDesc.Text  = "lvhFeatureSwitchListDesc";
     lvhFeatureSwitchListDesc.Width = 322;
     //
     // foFeatureSWTab
     //
     foFeatureSWTab.Alignment = System.Windows.Forms.TabAlignment.Bottom;
     foFeatureSWTab.Controls.Add(foFeatureSWEnableFeatures);
     foFeatureSWTab.Controls.Add(foFeatureSWDisableFeatures);
     foFeatureSWTab.Dock          = System.Windows.Forms.DockStyle.Fill;
     foFeatureSWTab.ImageList     = imageList1;
     foFeatureSWTab.Location      = new System.Drawing.Point(0, 0);
     foFeatureSWTab.Name          = "foFeatureSWTab";
     foFeatureSWTab.SelectedIndex = 0;
     foFeatureSWTab.Size          = new System.Drawing.Size(680, 273);
     foFeatureSWTab.TabIndex      = 1;
     foFeatureSWTab.KeyUp        += new System.Windows.Forms.KeyEventHandler(foFeatureSwitchList_KeyUp);
     //
     // foFeatureSWEnableFeatures
     //
     foFeatureSWEnableFeatures.Controls.Add(lvFeatureSwitchList);
     foFeatureSWEnableFeatures.ImageIndex = 1;
     foFeatureSWEnableFeatures.Location   = new System.Drawing.Point(4, 4);
     foFeatureSWEnableFeatures.Name       = "foFeatureSWEnableFeatures";
     foFeatureSWEnableFeatures.Size       = new System.Drawing.Size(672, 246);
     foFeatureSWEnableFeatures.TabIndex   = 0;
     foFeatureSWEnableFeatures.Text       = "Using Features";
     foFeatureSWEnableFeatures.UseVisualStyleBackColor = true;
     //
     // foFeatureSWDisableFeatures
     //
     foFeatureSWDisableFeatures.Controls.Add(lvDisableFeatures);
     foFeatureSWDisableFeatures.ImageIndex = 0;
     foFeatureSWDisableFeatures.Location   = new System.Drawing.Point(4, 4);
     foFeatureSWDisableFeatures.Name       = "foFeatureSWDisableFeatures";
     foFeatureSWDisableFeatures.Size       = new System.Drawing.Size(672, 246);
     foFeatureSWDisableFeatures.TabIndex   = 1;
     foFeatureSWDisableFeatures.Text       = "Unused";
     foFeatureSWDisableFeatures.UseVisualStyleBackColor = true;
     //
     // lvDisableFeatures
     //
     lvDisableFeatures.BorderStyle = System.Windows.Forms.BorderStyle.None;
     lvDisableFeatures.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
         lvhDisableFeatureListF,
         lvhDisableFeatureListDesc
     });
     lvDisableFeatures.Dock          = System.Windows.Forms.DockStyle.Fill;
     lvDisableFeatures.FullRowSelect = true;
     lvDisableFeatures.GridLines     = true;
     lvDisableFeatures.HeaderStyle   = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
     lvDisableFeatures.HideSelection = false;
     lvDisableFeatures.Location      = new System.Drawing.Point(0, 0);
     lvDisableFeatures.Name          = "lvDisableFeatures";
     lvDisableFeatures.Size          = new System.Drawing.Size(672, 246);
     lvDisableFeatures.Sorting       = System.Windows.Forms.SortOrder.Ascending;
     lvDisableFeatures.TabIndex      = 1;
     lvDisableFeatures.UseCompatibleStateImageBehavior = false;
     lvDisableFeatures.View   = System.Windows.Forms.View.Details;
     lvDisableFeatures.KeyUp += new System.Windows.Forms.KeyEventHandler(foFeatureSwitchList_KeyUp);
     //
     // lvhDisableFeatureListF
     //
     lvhDisableFeatureListF.Text  = "lvhDisableFeatureListF";
     lvhDisableFeatureListF.Width = 180;
     //
     // lvhDisableFeatureListDesc
     //
     lvhDisableFeatureListDesc.Text  = "lvhDisableFeatureListDesc";
     lvhDisableFeatureListDesc.Width = 471;
     //
     // imageList1
     //
     imageList1.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
     imageList1.TransparentColor = System.Drawing.Color.Transparent;
     imageList1.Images.SetKeyName(0, "");
     imageList1.Images.SetKeyName(1, "");
     //
     // foFeatureSwitchList
     //
     AutoScaleBaseSize = new System.Drawing.Size(5, 12);
     ClientSize        = new System.Drawing.Size(680, 273);
     Controls.Add(foFeatureSWTab);
     Icon        = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     MaximizeBox = false;
     MinimizeBox = false;
     Name        = "foFeatureSwitchList";
     Text        = "Feature Switch";
     KeyUp      += new System.Windows.Forms.KeyEventHandler(foFeatureSwitchList_KeyUp);
     foFeatureSWTab.ResumeLayout(false);
     foFeatureSWEnableFeatures.ResumeLayout(false);
     foFeatureSWDisableFeatures.ResumeLayout(false);
     ResumeLayout(false);
 }