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();
        }
Exemplo n.º 2
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();
        }