Inheritance: System.Windows.Forms.UserControl
コード例 #1
0
        public ZoomAdaptor(PicView picView, 
            ToolStripButton plusBtn,
            ToolStripButton minusBtn,
            ToolStripComboBox combox)
        {
            this.picView = picView;
            //this.form = form;
            this.plusBtn = plusBtn;
            this.minusBtn = minusBtn;
            this.combox = combox;

            picView.ZoomChanged += new EventHandler(zoomChanged);

            plusBtn.Click += new EventHandler(btnClick);
            minusBtn.Click += new EventHandler(btnClick);

            combox.DropDownStyle = ComboBoxStyle.DropDown;
            combox.DropDownHeight = 200;
            for(int i=20; i<=100; i+=20){
                combox.Items.Add(i.ToString() + "%");
            }

            combox.SelectedIndexChanged += new EventHandler(comboxTextUpdate);
            combox.Leave += new EventHandler(comboxTextUpdate);
            combox.KeyDown += new KeyEventHandler(comboxKeyDown);

            renew();
        }
コード例 #2
0
ファイル: ZoomAdaptor.cs プロジェクト: zeroaq/LabelPlus
        public ZoomAdaptor(PicView picView,
                           ToolStripButton plusBtn,
                           ToolStripButton minusBtn,
                           ToolStripComboBox combox)
        {
            this.picView = picView;
            //this.form = form;
            this.plusBtn  = plusBtn;
            this.minusBtn = minusBtn;
            this.combox   = combox;

            picView.ZoomChanged += new EventHandler(zoomChanged);

            plusBtn.Click  += new EventHandler(btnClick);
            minusBtn.Click += new EventHandler(btnClick);

            combox.DropDownStyle  = ComboBoxStyle.DropDown;
            combox.DropDownHeight = 200;
            for (int i = 20; i <= 100; i += 20)
            {
                combox.Items.Add(i.ToString() + "%");
            }

            combox.SelectedIndexChanged += new EventHandler(comboxTextUpdate);
            combox.Leave   += new EventHandler(comboxTextUpdate);
            combox.KeyDown += new KeyEventHandler(comboxKeyDown);

            renew();
        }
コード例 #3
0
ファイル: ImageOutputFrm.cs プロジェクト: kozzzx/LabelPlus
        public ImageOutputFrm(Workspace wsp, PicView pv)
        {
            this.wsp = wsp;
            this.pv = pv;

            InitializeComponent();

            Language.InitFormLanguage(this, StringResources.GetValue("lang"));
        }
コード例 #4
0
        public ImageOutputFrm(Workspace wsp, PicView pv)
        {
            this.wsp = wsp;
            this.pv  = pv;

            InitializeComponent();

            Language.InitFormLanguage(this, StringResources.GetValue("lang"));
        }
コード例 #5
0
        public WorkspaceControlAdpter(
            ToolStripButtonGroup ModeButtons, 
            ToolStripComboBox FileSelectComboBox, 
            TextBox TranslateTextBox, 
            GroupBox TextBoxGroupBox,
            ListViewAdpter LabelListViewAPT, 
            PicView picView, 
            ContextMenuStrip contextMenuQuictText,
            ToolStrip toolStrip,
            Workspace workspace)
        {
            wsp = workspace;
            wsp.UserGroupDefineChanged += new EventHandler(userGroupChanged);

            LabelFileManager.FileListChanged += new EventHandler(fileListChanged);
            LabelFileManager.LabelItemListChanged += new EventHandler(labelItemListChanged);
            LabelFileManager.LabelItemTextChanged += new EventHandler(labelItemTextChanged);
            LabelFileManager.GroupListChanged += new EventHandler(labelItemTextChanged);
            textboxgroupbox = TextBoxGroupBox;

            picview = picView;
            picview.Image = null;
            picview.Refresh();
            picview.LabelUserAction += new PicView.UserActionEventHandler(picView_UserClickAction);
            picview.MouseMove += new MouseEventHandler(picView_MouseMove);
            picview.MouseClick += new MouseEventHandler(picView_MosueClick);
            picview.KeyDown += new KeyEventHandler(picViewKeyDown);
            picview.PreviewKeyDown += new PreviewKeyDownEventHandler(picView_PreviewKeyDown);

            combo = FileSelectComboBox;
            combo.Items.Clear();
            combo.DropDownStyle = ComboBoxStyle.DropDownList;
            combo.SelectedIndexChanged += new EventHandler(comboSelectedIndexChanged);

            textbox = TranslateTextBox;
            textbox.PreviewKeyDown += new PreviewKeyDownEventHandler(textboxPreviewKeyDown);
            textbox.KeyDown += new KeyEventHandler(textbox_KeyDown);
            textbox.TextChanged += new EventHandler(textbox_TextChanged);

            listviewapt = LabelListViewAPT;
            listviewapt.ListViewSelectedIndexChanged += new EventHandler(listViewSelectedIndexChanged);
            listviewapt.UserSetCategory += new ListViewAdpter.UserActionEventHandler(listViewUserAction);

            this.modebuttons = ModeButtons;
            this.modebuttons.IndexChanged += new EventHandler(modeButtons_IndexChanged);

            menuquicktext = contextMenuQuictText;
            foreach(GlobalVar.QuickTextItem item in GlobalVar.QuickTextItems){
                string menuItemStr = item.Text + "(&" + item.Key + ")";
                menuquicktext.Items.Add(menuItemStr).ToolTipText = item.Text;

            }
            menuquicktext.ItemClicked += new ToolStripItemClickedEventHandler(quickTextItemClicked);
            menuquicktext.Opened += new EventHandler(quickTextOpened);
            menuquicktext.Closed += new  ToolStripDropDownClosedEventHandler(quickTextClosed);

            groupbuttons = new GroupButtonAdaptor(toolStrip, wsp.GroupDefine);

            toolstrip = toolStrip;
            NewFile();
        }
コード例 #6
0
        private void picView_UserClickAction(object sender, PicView.LabelUserActionEventArgs e)
        {
            bool ctrlBePush = workMode==WorkMode.Label || Control.ModifierKeys == Keys.Control ;

            switch (e.Type) {
                case PicView.LabelUserActionEventArgs.ActionType.leftClick:
                    if (ctrlBePush)
                    {
                        //add
                        wsp.Store.AddLabelItem(FileName,
                            new LabelItem(e.X_percent, e.Y_percent, "", groupbuttons.SelectIndex + 1),
                            listviewapt.Count);

                        listviewapt.SelectedIndex = listviewapt.Count -1;
                    }
                    else
                    {
                        //normal click
                        if (e.Index == -1)
                            return;

                        listviewapt.SelectedIndex = e.Index;
                        textbox.Focus();
                    }
                    break;
                case PicView.LabelUserActionEventArgs.ActionType.rightClick:
                    if (ctrlBePush)
                    {
                        //del
                        wsp.Store.DelLabelItem(FileName, e.Index);

                        listviewapt.SelectedIndex = -1;
                    }
                    break;
                case PicView.LabelUserActionEventArgs.ActionType.mouseIndexChanged:

                    if (workMode == WorkMode.Check)
                    {
                        if (e.Index == -1)
                            return;
                        listviewapt.SelectedIndex = e.Index;
                    }
                    break;
            }
        }
コード例 #7
0
        public WorkspaceControlAdpter(
            ToolStripButtonGroup ModeButtons,
            ToolStripComboBox FileSelectComboBox,
            TextBox TranslateTextBox,
            GroupBox TextBoxGroupBox,
            ListViewAdpter LabelListViewAPT,
            PicView picView,
            ContextMenuStrip contextMenuQuictText,
            ToolStrip toolStrip,
            Workspace workspace)
        {
            wsp = workspace;
            wsp.UserGroupDefineChanged += new EventHandler(userGroupChanged);

            LabelFileManager.FileListChanged      += new EventHandler(fileListChanged);
            LabelFileManager.LabelItemListChanged += new EventHandler(labelItemListChanged);
            LabelFileManager.LabelItemTextChanged += new EventHandler(labelItemTextChanged);
            LabelFileManager.GroupListChanged     += new EventHandler(labelItemTextChanged);
            textboxgroupbox = TextBoxGroupBox;

            picview       = picView;
            picview.Image = null;
            picview.Refresh();
            picview.LabelUserAction += new PicView.UserActionEventHandler(picView_UserClickAction);
            picview.MouseMove       += new MouseEventHandler(picView_MouseMove);
            picview.MouseClick      += new MouseEventHandler(picView_MosueClick);
            picview.KeyDown         += new KeyEventHandler(picViewKeyDown);
            picview.PreviewKeyDown  += new PreviewKeyDownEventHandler(picView_PreviewKeyDown);

            combo = FileSelectComboBox;
            combo.Items.Clear();
            combo.DropDownStyle         = ComboBoxStyle.DropDownList;
            combo.SelectedIndexChanged += new EventHandler(comboSelectedIndexChanged);

            textbox = TranslateTextBox;
            textbox.PreviewKeyDown += new PreviewKeyDownEventHandler(textboxPreviewKeyDown);
            textbox.KeyDown        += new KeyEventHandler(textbox_KeyDown);
            textbox.TextChanged    += new EventHandler(textbox_TextChanged);

            listviewapt = LabelListViewAPT;
            listviewapt.ListViewSelectedIndexChanged += new EventHandler(listViewSelectedIndexChanged);
            listviewapt.UserSetCategory += new ListViewAdpter.UserActionEventHandler(listViewUserAction);

            this.modebuttons = ModeButtons;
            this.modebuttons.IndexChanged += new EventHandler(modeButtons_IndexChanged);

            menuquicktext = contextMenuQuictText;
            foreach (GlobalVar.QuickTextItem item in GlobalVar.QuickTextItems)
            {
                string menuItemStr = item.Text + "(&" + item.Key + ")";
                menuquicktext.Items.Add(menuItemStr).ToolTipText = item.Text;
            }
            menuquicktext.ItemClicked += new ToolStripItemClickedEventHandler(quickTextItemClicked);
            menuquicktext.Opened      += new EventHandler(quickTextOpened);
            menuquicktext.Closed      += new  ToolStripDropDownClosedEventHandler(quickTextClosed);

            groupbuttons = new GroupButtonAdaptor(toolStrip, wsp.GroupDefine);

            toolstrip = toolStrip;
            NewFile();
        }