Inheritance: System.Windows.Forms.Form, IDockContent
Ejemplo n.º 1
3
        public DockPanel()
        {
            ShowAutoHideContentOnHover = true;

            m_focusManager = new FocusManagerImpl(this);
            m_extender = new DockPanelExtender(this);
            m_panes = new DockPaneCollection();
            m_floatWindows = new FloatWindowCollection();

            SuspendLayout();

            m_autoHideWindow = Extender.AutoHideWindowFactory.CreateAutoHideWindow(this);
            m_autoHideWindow.Visible = false;
            m_autoHideWindow.ActiveContentChanged += m_autoHideWindow_ActiveContentChanged; 
            SetAutoHideWindowParent();

            m_dummyControl = new DummyControl();
            m_dummyControl.Bounds = new Rectangle(0, 0, 1, 1);
            Controls.Add(m_dummyControl);

            LoadDockWindows();

            m_dummyContent = new DockContent();
            ResumeLayout();
        }
Ejemplo n.º 2
1
        public static DockContent BuildDockContent(Control control, bool allowclose = true)
        {
            DockContent content = new DockContent();
            control.Dock = DockStyle.Fill;
            content.Text = control.Name;
            content.Controls.Add(control);
            content.Tag = control;
            content.CloseButton = allowclose;
            content.CloseButtonVisible = allowclose;

            return content;
        }
 public ActiveDirectoryImportWindow(DockContent panel)
 {
     InitializeComponent();
     Runtime.FontOverride(this);
     WindowType = WindowType.ActiveDirectoryImport;
     DockPnl = panel;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 打开卡片
        /// </summary>
        private void tvProcessProcedure_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            TreeNode node = e.Node;

            if (node.ImageKey != "planning")
            {
                return;
            }

            WeifenLuo.WinFormsUI.Docking.DockContent content = MainFrm.mainFrm.CheckContentIsOpened(e.Node.Tag.ToString());
            if (content != null)
            {
                MainFrm.mainFrm.OpenModule(content);
                return;
            }

            Guid planningId = new Guid(e.Node.Tag.ToString());
            List <ProcessCard> listProcessCard
                = PlanningCardRelationBLL.GetProcessCardListByProcessPlanningId(planningId);

            if (listProcessCard.Count > 0)
            {
                ProcessPlanningDetailFrm form = new ProcessPlanningDetailFrm();
                form.FormText             = string.Format("{0}-{1}", e.Node.Text, e.Node.Tag.ToString());
                form.ProcessPlanningCards = listProcessCard;
                MainFrm.mainFrm.OpenPlanningModule(form);
            }
        }
Ejemplo n.º 5
0
 public FormSpriteViewer(Image resim, WeifenLuo.WinFormsUI.Docking.DockContent reshow)
 {
     InitializeComponent();
     show            = reshow;
     this.ClientSize = resim.Size;
     drawBox.Image   = resim;
 }
Ejemplo n.º 6
0
        public ExternalToolsWindow(DockContent panel)
        {
            InitializeComponent();

            WindowType = WindowType.ExternalApps;
            DockPnl = panel;
        }
Ejemplo n.º 7
0
        void Ajouter_Objectif()
        {
            ctrlFicheObjectif f = new ctrlFicheObjectif();

            f.Acces    = Acces;
            f.Creation = true;
            f.Console  = Console;

            f.objectif       = new Objectif();
            f.objectif.Code  = "OBJ_PA" + ((lblRecherche.Text.Length > 0) ? lblRecherche.Text : "");
            f.objectif.Actif = true;
            f.objectifParent = null;
            n_obj++;
            f.Tag              = Acces.type_OBJECTIF.id + n_obj;
            f.EVT_Enregistrer += Handler_evt_Modifier;

            f.Initialiser();

            var D = new WeifenLuo.WinFormsUI.Docking.DockContent();

            D.TabText = "Objectif (Nouveau)";

            f.Dock = DockStyle.Fill;
            D.Controls.Add(f);

            D.Show(DP, WeifenLuo.WinFormsUI.Docking.DockState.Document);
        }
Ejemplo n.º 8
0
		public PortScanWindow(DockContent panel)
		{
			InitializeComponent();
					
			WindowType = WindowType.PortScan;
			DockPnl = panel;
		}
Ejemplo n.º 9
0
 private void UpdateMenuItemChecked(ToolStripMenuItem menuItem, DockContent dockContent)
 {
     if (menuItem != null)
     {
         menuItem.Checked = (dockContent.DockState != DockState.Hidden);
     }
 }
Ejemplo n.º 10
0
 public UpdateWindow(DockContent panel)
 {
     WindowType = WindowType.Update;
     DockPnl = panel;
     InitializeComponent();
     Runtime.FontOverride(this);
 }
Ejemplo n.º 11
0
        public PanelsHelper(PluginMain pluginMain, Image pluginImage)
        {
            localsUI = new LocalsUI(pluginMain);
            localsUI.Text = TextHelper.GetString("Title.LocalVariables");
            localsPanel = PluginBase.MainForm.CreateDockablePanel(localsUI, localsGuid, pluginImage, DockState.DockLeft);
            localsPanel.Hide();
            
            stackframeUI = new StackframeUI(pluginMain, MenusHelper.imageList);
            stackframeUI.Text = TextHelper.GetString("Title.StackTrace");
            stackframePanel = PluginBase.MainForm.CreateDockablePanel(stackframeUI, stackframeGuid, pluginImage, DockState.DockLeft);
            stackframePanel.Hide();

            watchUI = new WatchUI();
            watchUI.Text = TextHelper.GetString("Title.Watch");
            watchPanel = PluginBase.MainForm.CreateDockablePanel(watchUI, watchGuid, pluginImage, DockState.DockLeft);
            watchPanel.Hide();

            breakPointUI = new BreakPointUI(pluginMain, PluginMain.breakPointManager);
            breakPointUI.Text = TextHelper.GetString("Title.Breakpoints");
            breakPointPanel = PluginBase.MainForm.CreateDockablePanel(breakPointUI, breakPointGuid, pluginImage, DockState.DockLeft);
            breakPointPanel.Hide();

            immediateUI = new ImmediateUI();
            immediateUI.Text = TextHelper.GetString("Title.Immediate");
            immediatePanel = PluginBase.MainForm.CreateDockablePanel(immediateUI, immediateGuid, pluginImage, DockState.DockLeft);
            immediatePanel.Hide();

            threadsUI = new ThreadsUI(pluginMain, MenusHelper.imageList);
            threadsUI.Text = TextHelper.GetString("Title.Threads");
            threadsPanel = PluginBase.MainForm.CreateDockablePanel(threadsUI, threadsGuid, pluginImage, DockState.DockLeft);
            threadsPanel.Hide();
        }
Ejemplo n.º 12
0
		public DockPanel()
		{
            m_focusManager = new FocusManagerImpl(this);
			m_extender = new DockPanelExtender(this);
			m_panes = new DockPaneCollection();
			m_floatWindows = new FloatWindowCollection();

			SetStyle(ControlStyles.ResizeRedraw |
				ControlStyles.UserPaint |
				ControlStyles.AllPaintingInWmPaint, true);

            SuspendLayout();
            Font = PluginCore.PluginBase.Settings.DefaultFont;

			m_autoHideWindow = new AutoHideWindowControl(this);
			m_autoHideWindow.Visible = false;
            SetAutoHideWindowParent();

			m_dummyControl = new DummyControl();
			m_dummyControl.Bounds = new Rectangle(0, 0, 1, 1);
			Controls.Add(m_dummyControl);

			m_dockWindows = new DockWindowCollection(this);
			Controls.AddRange(new Control[]	{
				DockWindows[DockState.Document],
				DockWindows[DockState.DockLeft],
				DockWindows[DockState.DockRight],
				DockWindows[DockState.DockTop],
				DockWindows[DockState.DockBottom]
				});

			m_dummyContent = new DockContent();
            ResumeLayout();
        }
Ejemplo n.º 13
0
 public AboutWindow(DockContent Panel)
 {
     WindowType = WindowType.About;
     DockPnl = Panel;
     InitializeComponent();
     Runtime.FontOverride(this);
 }
Ejemplo n.º 14
0
		public DockPanel()
		{
            m_focusManager = new FocusManagerImpl(this);
			m_extender = new DockPanelExtender(this);
			m_panes = new DockPaneCollection();
			m_floatWindows = new FloatWindowCollection();

            SuspendLayout();

			m_autoHideWindow = new AutoHideWindowControl(this);
			m_autoHideWindow.Visible = false;
            SetAutoHideWindowParent();

			m_dummyControl = new DummyControl();
			m_dummyControl.Bounds = new Rectangle(0, 0, 1, 1);
			Controls.Add(m_dummyControl);

			m_dockWindows = new DockWindowCollection(this);
			Controls.AddRange(new Control[]	{
				DockWindows[DockState.Document],
				DockWindows[DockState.DockLeft],
				DockWindows[DockState.DockRight],
				DockWindows[DockState.DockTop],
				DockWindows[DockState.DockBottom]
				});

			m_dummyContent = new DockContent();
            ResumeLayout();
        }
Ejemplo n.º 15
0
        public FrmMain()
        {
            InitializeComponent();

            var v = Assembly.GetEntryAssembly().GetName().Version;
            this.Version = string.Format("v{0}.{1}", v.Major, v.Minor);
            string title = string.Format("编程辅助工具{0}", this.Version);
            this.Text = title;

            BackgroundWorker worker = new BackgroundWorker();
            worker.DoWork += new DoWorkEventHandler(worker_DoWork);
            worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
            worker.RunWorkerAsync();

            this.IsMdiContainer = true;
            this.dockPanel.DocumentStyle = DocumentStyle.DockingMdi;

            //详细信息
            DockContent dc = new DockContent();
            dc.CloseButtonVisible = false;
            dc.Text = "详细信息";
            DetailTabPage dtpage = new DetailTabPage();
            dtpage.Dock = DockStyle.Fill;
            dc.Controls.Add(dtpage);
            dc.Show(this.dockPanel, DockState.Document);

            //数据
            DockContent dc2 = new DockContent();
            dc2.CloseButtonVisible = false;
            dc2.Text = "数据";
            SchemaTreeView stpage = new SchemaTreeView();
            stpage.Dock = DockStyle.Fill;
            dc2.Controls.Add(stpage);
            dc2.Show(this.dockPanel, DockState.DockLeft);
        }
Ejemplo n.º 16
0
        public void RegisterOpenFile(DockContent content, ContentCategory category)
        {
            if (!IsHidden && !ChildForms.ContainsKey(content))
            {
                content.FormClosed += new FormClosedEventHandler(ChildForms_FormClosed);

                ListViewItem item = new ListViewItem(content.Text);
                item.ToolTipText = content.ToolTipText;
                item.Tag = content;

                ColumnHeader hdr = null;
                switch (category)
                {
                case ContentCategory.Archives:
                    hdr = archiveListHeader;
                    break;
                case ContentCategory.Meshes:
                    hdr = meshListHeader;
                    break;
                case ContentCategory.Animations:
                    hdr = animationListHeader;
                    break;
                case ContentCategory.Others:
                    hdr = otherListHeader;
                    break;
                }
                hdr.ListView.Items.Add(item);
                hdr.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
                tabControlQuickAccess.SelectTabWithoutLoosingFocus((TabPage)hdr.ListView.Parent);
                ChildForms.Add(content, item);
            }
        }
Ejemplo n.º 17
0
 private void ToggleDocked(DockContent dockContent)
 {
     if (dockContent.Visible)
         dockContent.Hide();
     else
         ShowDocked(dockContent);
 }
Ejemplo n.º 18
0
        void Handler_evt_Modifier(object sender, ctrlFicheObjectif.evt_Enregistrer e)
        {
            Afficher_ListeObjectif();

            //Actualise le titre de l'onglet
            WeifenLuo.WinFormsUI.Docking.DockContent d = (WeifenLuo.WinFormsUI.Docking.DockContent)DP.ActiveDocument;
            ctrlFicheObjectif f;

            try { f = (ctrlFicheObjectif)d.Controls[0]; } catch { f = null; }
            if (f != null)
            {
                if (f.Tag.ToString() == e.ID.ToString())
                {
                    d.TabText = f.objectif.Code;
                    this.Tag  = e.ID.ToString();
                }
            }

            try
            {
                TreeNode[] nd = lstObjectif.Nodes.Find(f.objectif.ID.ToString(), true);
                if (nd.Length > 0)
                {
                    nd[0].Parent.Expand(); lstObjectif.SelectedNode = nd[0].Parent;
                }
            } catch { }
            //Active l'événement our une remontée avec des éléments de hiérarchie plus haute
            OnRaise_Evt_Modifier(new evt_Modifier(n_obj.ToString()));
        }
Ejemplo n.º 19
0
 public ErrorAndInfoWindow(DockContent Panel)
 {
     this.WindowType = WindowType.ErrorsAndInfos;
     this.DockPnl = Panel;
     this.InitializeComponent();
     this.LayoutVertical();
     this.FillImageList();
 }
 /// <summary>
 /// Setup constructor
 /// </summary>
 /// <param name="panel">Docking panel used to host this frame</param>
 public DockingFrame( DockPanel panel )
 {
     Arguments.CheckNotNull( panel, "panel" );
     m_Panel = panel;
     m_Content = new DockContent( );
     m_Content.AutoScroll = true;
     m_Content.Closing += OnContentClosing;
 }
Ejemplo n.º 21
0
 public void CreateContent()
 {
     this.Text = "DockPanelSuite TestApp";
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(800, 600);
     //
     var dockPanel = new DockPanel();
     dockPanel.AllowDrop = true;
     dockPanel.TabIndex = 1;
     dockPanel.DocumentStyle = DocumentStyle.DockingWindow;
     dockPanel.AllowEndUserDocking = true;
     dockPanel.AllowEndUserNestedDocking = true;
     dockPanel.Dock = DockStyle.Fill;
     this.Controls.Add(dockPanel);
     //
     var dc = new DockContent();
     dc.TabText = "Hello Doc!";
     dc.DockPanel = dockPanel;
     dc.DockAreas = DockAreas.Document;
     var rtb = new RichTextBox();
     rtb.Dock = DockStyle.Fill;
     dc.Controls.Add(rtb);
     dc.Show();
     //
     DockContent dc2 = new DockContent();
     dc2.TabText = "Hello Doc!";
     dc2.DockPanel = dockPanel;
     dc2.DockAreas = DockAreas.Document;
     var rtb2 = new RichTextBox();
     rtb2.Dock = DockStyle.Fill;
     dc2.Controls.Add(rtb2);
     dc2.Show();
     //
     DockContent dc3 = new DockContent();
     dc3.AllowEndUserDocking = true;
     dc3.AllowDrop = true;
     dc3.TabText = "Hello Tab!";
     dc3.DockPanel = dockPanel;
     dc3.DockAreas = DockAreas.DockBottom | DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop;
     dc3.DockState = DockState.DockRight;
     var rtb3 = new RichTextBox();
     rtb3.Dock = DockStyle.Fill;
     dc3.Controls.Add(rtb3);
     dc3.Show();
     //
     DockContent dc4 = new DockContent();
     dc4.AllowEndUserDocking = true;
     dc4.AllowDrop = true;
     dc4.TabText = "Hello Tab!";
     dc4.DockPanel = dockPanel;
     dc4.DockAreas = DockAreas.DockBottom | DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop | DockAreas.Float;
     dc4.DockState = DockState.DockBottomAutoHide;
     var rtb4 = new RichTextBox();
     rtb4.Dock = DockStyle.Fill;
     dc4.Controls.Add(rtb4);
     dc4.Show();
 }
Ejemplo n.º 22
0
 public static void SendPanelToScreen(DockContent Panel, Screen Screen)
 {
     Panel.DockState = DockState.Float;
     if (Panel.ParentForm != null)
     {
         Panel.ParentForm.Left = Screen.Bounds.Location.X;
         Panel.ParentForm.Top = Screen.Bounds.Location.Y;
     }
 }
Ejemplo n.º 23
0
 public void AddForm(DockContent dc, DockState ds)
 {
     if (dc == null)
         return;
     //FIXME: set 'dc.ShowHint = ds' without failing from no active content
     dc.ShowHint = DockState.Document;
     dc.MdiParent = this;
     dc.Show(dockPanel1);
 }
Ejemplo n.º 24
0
        public HelpWindow(DockContent Panel)
        {
            WindowType = WindowType.Help;
            DockPnl = Panel;
            InitializeComponent();

            FillImageList();
            tvIndex.ImageList = imgListHelp;
            SetImages(tvIndex.Nodes[0]);
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Adds a dockable form to the dockable forms dictionary. Optionally enables that form.
        /// </summary>
        /// <param name="name">The unique name key for the form.</param>
        /// <param name="panel">A new instance of a dockable form.</param>
        /// <param name="defaultActivate">Optional: Add the form to the panel at startup.</param>
        /// <returns></returns>
        public bool AddDockableForm(string name, DockContent panel, bool defaultActivate = false)
        {
            if (DockableForms.ContainsKey(name)) return false;

            if (!(panel is IDockableForm)) throw new InvalidCastException("The form does not implement IDockableForm");

            DockableForms.Add(name, panel);
            if (defaultActivate)
                ActivatePanel(name, ((IDockableForm)panel).DefaultState);
            return true;
        }
Ejemplo n.º 26
0
 private ToolStripMenuItem GetMenuItem(DockContent dockContent)
 {
     foreach (ToolStripItem item in _windowsMenu.DropDownItems)
     {
         if (item.Tag == dockContent)
         {
             return item as ToolStripMenuItem;
         }
     }
     return null;
 }
Ejemplo n.º 27
0
        public ConnectionTreeWindow(DockContent panel)
        {
            WindowType = WindowType.Tree;
            DockPnl = panel;
            InitializeComponent();

            FillImageList();
            LinkModelToView();
            SetupDropSink();
            SetEventHandlers();
        }
 public void Dispose()
 {
     //Put any cleanup code in here for when the program is stopped
     this.user_id         = -1;
     this.role_set_id     = new int[0];
     this.login_number    = -1;
     this.org_id          = -1;
     this.Host            = null;
     this.myMainInterface = null;
     Global.myProj        = null;
     Global.mnFrm         = null;
 }
Ejemplo n.º 29
0
 //-------------------------------------------------------------------------------------------------------------------------------
 public static string GetDockContentPersistString(DockContent content, object Object_Descriptor)
 {
     var desc = new SaveLoadDescriptor()
     {
         Type = content.GetType(),
         Text = content.Text,
         Object_Descriptor = Object_Descriptor,
     };
     var buffer = Serialization_Master.Serializer.Serialize_Object_To_ByteArray(desc, Compress: true);
     var base64 = System.Convert.ToBase64String(buffer);
     return base64;
 }
Ejemplo n.º 30
0
        public SSHTransferWindow(DockContent Panel)
        {
            WindowType = WindowType.SSHTransfer;
            DockPnl = Panel;
            InitializeComponent();

            oDlg = new OpenFileDialog
            {
                Filter = @"All Files (*.*)|*.*",
                CheckFileExists = true
            };
        }
Ejemplo n.º 31
0
        public PanelsHelper(PluginMain pluginMain, Image pluginImage)
        {
            pluginUI = new PluginUI(pluginMain);
            pluginUI.Text = TextHelper.GetString("Title.LocalVariables");
            pluginPanel = PluginBase.MainForm.CreateDockablePanel(pluginUI, pluginGuid, pluginImage, DockState.Hidden);

            breakPointUI = new BreakPointUI(pluginMain, PluginMain.breakPointManager);
            breakPointUI.Text = TextHelper.GetString("Title.Breakpoints");
            breakPointPanel = PluginBase.MainForm.CreateDockablePanel(breakPointUI, breakPointGuid, pluginImage, DockState.Hidden);

            stackframeUI = new StackframeUI(pluginMain, MenusHelper.imageList);
            stackframeUI.Text = TextHelper.GetString("Title.StackTrace");
            stackframePanel = PluginBase.MainForm.CreateDockablePanel(stackframeUI, stackframeGuid, pluginImage, DockState.Hidden);
        }
Ejemplo n.º 32
0
 private void newDocumentToolStripMenuItem_Click(object sender, EventArgs e)
 {
     DockContent dc = new DockContent();
     dc.Text = "Testing";
     ScriptEditorControl sec = new ScriptEditorControl();
     sec.Dock = DockStyle.Fill;
     dc.Controls.Add(sec);
     if (dockMain.DocumentStyle == DocumentStyle.SystemMdi)
     {
         dc.MdiParent = this;
         dc.Show();
     }
     else
         dc.Show(dockMain);
 }
Ejemplo n.º 33
0
        public ConnectionWindow(DockContent panel, string formText = "")
        {
            if (formText == "")
            {
                formText = Language.strNewPanel;
            }

            WindowType = WindowType.Connection;
            DockPnl = panel;
            InitializeComponent();
            SetEventHandlers();
            // ReSharper disable once VirtualMemberCallInConstructor
            Text = formText;
            TabText = formText;
        }
Ejemplo n.º 34
0
        public D3D11PipelineStateViewer(Core core, DockContent c)
        {
            InitializeComponent();

            m_DockContent = c;

            pipeFlow.SetStages(new KeyValuePair<string, string>[] {
                new KeyValuePair<string,string>("IA", "Input Assembler"),
                new KeyValuePair<string,string>("VS", "Vertex Shader"),
                new KeyValuePair<string,string>("HS", "Hull Shader"),
                new KeyValuePair<string,string>("DS", "Domain Shader"),
                new KeyValuePair<string,string>("GS", "Geometry Shader"),
                new KeyValuePair<string,string>("RS", "Rasterizer"),
                new KeyValuePair<string,string>("PS", "Pixel Shader"),
                new KeyValuePair<string,string>("OM", "Output Merger"),
                new KeyValuePair<string,string>("CS", "Compute Shader"),
            });

            pipeFlow.IsolateStage(8); // compute shader isolated

            pipeFlow.SetStagesEnabled(new bool[] { true, true, true, true, true, true, true, true, true });

            //Icon = global::renderdocui.Properties.Resources.icon;

            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            iaBytecodeMismatch.Text = "";
            iaBytecodeMismatch.Visible = false;

            toolTip.SetToolTip(vsShaderCog, "Open Shader Source");
            toolTip.SetToolTip(dsShaderCog, "Open Shader Source");
            toolTip.SetToolTip(hsShaderCog, "Open Shader Source");
            toolTip.SetToolTip(gsShaderCog, "Open Shader Source");
            toolTip.SetToolTip(psShaderCog, "Open Shader Source");
            toolTip.SetToolTip(csShaderCog, "Open Shader Source");

            toolTip.SetToolTip(vsShader, "Open Shader Source");
            toolTip.SetToolTip(dsShader, "Open Shader Source");
            toolTip.SetToolTip(hsShader, "Open Shader Source");
            toolTip.SetToolTip(gsShader, "Open Shader Source");
            toolTip.SetToolTip(psShader, "Open Shader Source");
            toolTip.SetToolTip(csShader, "Open Shader Source");

            OnLogfileClosed();

            m_Core = core;
        }
Ejemplo n.º 35
0
        /// <summary>
        /// Création d'une action par l'intermédiaire de la fiche action
        /// </summary>
        void Ajouter_Action()
        {
            string code = CodeRef;
            var    D    = new WeifenLuo.WinFormsUI.Docking.DockContent();

            D.TabText = "Action (nouvelle)";

            Console.Ajouter("[AJOUT ACTION]");
            ctrlFicheAction f = new ctrlFicheAction();

            f.Acces    = Acces;
            f.Creation = true;

            f.action       = new PATIO.CAPA.Classes.Action();
            f.action.Code  = "ACT-";
            f.action._type = "ACT";
            if (plan._ref1 != null)
            {
                f.action._codeplan = plan._ref1;
            }
            if (plan._ref2 != null)
            {
                f.action._axe = plan._ref2;
            }
            if (plan._os != null)
            {
                f.action._os = plan._os;
            }
            if (plan._og != null)
            {
                f.action._og = plan._og;
            }
            f.action.Actif = true;
            f.actionParent = null;
            Console.Ajouter("Code plan : " + f.action._codeplan);

            n_action++;
            f.Tag              = Acces.type_ACTION.ID + n_action;
            f.EVT_Enregistrer += Handler_evt_Modifier;

            f.Initialiser();

            f.Dock = DockStyle.Fill;
            D.Controls.Add(f);

            D.Show(DP, WeifenLuo.WinFormsUI.Docking.DockState.Document);
        }
Ejemplo n.º 36
0
        private void Ouvrir_Indicateur()
        {
            var D = new WeifenLuo.WinFormsUI.Docking.DockContent();

            D.TabText = "Indicateur " + lstIndicateur.SelectedNode.Name;

            var ctrl = new ctrlIndicateur();

            ctrl.Acces        = Acces;
            ctrl.IndicateurId = lstIndicateur.SelectedNode.Name;
            ctrl.Affiche();

            ctrl.Dock = DockStyle.Fill;
            D.Controls.Add(ctrl);

            D.Show(DP, WeifenLuo.WinFormsUI.Docking.DockState.Document);
        }
Ejemplo n.º 37
0
        public void ShowMapWindow(Situation situation, WarPresentationModel model)
        {
            // �Ƃ肠�����S�ẴE�B���h�E��\������
            // MapWindow �C���X�^���X�̐���
            var mapWindow = new MapWindow(model);
            mainDock = mapWindow;
            mainDock.AllowEndUserDocking = false;
            mainDock.Show(dockPanel, DockState.Document);

            var commandWindow = new CommandWindow(model);
            commandWindow.Show(mapWindow.Pane, DockAlignment.Top, 0.12);

            var mapChipInfoWindow = new MapChipInfoWindow(model);
            mapChipInfoWindow.Show(commandWindow.Pane, DockAlignment.Right, 0.5);

            // UnitMiniInfoWindow�\���p
            Action<Point2> showUnitMiniInfoWindow = delegate(Point2 p) {
                var unit = model.WarMap[p].Unit;
                if (unit != null)
                {
                    MiniUnitInfoWindow.ShowWindow(this, unit);
                }
                else
                {
                    MiniUnitInfoWindow.HideWindow();
                }
            };

            // MapChip�N���b�N�ɂ��UnitInfoWindow�̕\���̃f���Q�[�g��lj�
            model.SelectMapChipEvent += p => {
                var unit = model.WarMap[p].Unit;
                if (unit != null && model.Scope == null)
                    UnitInfoWindow.ShowWindow(this, unit);
                else
                    UnitInfoWindow.HideWindow();
            };

            model.CursorChipPointChangedEvent += showUnitMiniInfoWindow;
            model.CursorEnterEvent += showUnitMiniInfoWindow;
            model.CursorLeaveEvent += delegate {
                if (MiniUnitInfoWindow.IsInitialized && !MiniUnitInfoWindow.IsOnCursor)
                    MiniUnitInfoWindow.HideWindow();
            };
        }
Ejemplo n.º 38
0
        public void Modifier_Objectif()
        {
            if (obj == null)
            {
                return;
            }

            ctrlFicheObjectif f = new ctrlFicheObjectif();

            f.Acces    = Acces;
            f.Creation = false;
            f.Console  = Console;

            var Id = obj.ID;

            Objectif P = (Objectif)Acces.Trouver_Element(Acces.type_OBJECTIF.id, Id);

            f.objectif = P;
            n_obj++;
            f.Tag              = Acces.type_OBJECTIF.id + n_obj;
            f.EVT_Enregistrer += Handler_evt_Modifier;

            f.Initialiser();
            f.Dock = DockStyle.Fill;

            var D = new WeifenLuo.WinFormsUI.Docking.DockContent();

            D.TabText = "Objectif " + P.Code;

            f.Dock = DockStyle.Fill;
            D.Controls.Add(f);
            D.Tag = obj.Code;

            //Recherche si la fiche élément n'est pas ouverte
            foreach (DockContent d in DP.Documents)
            {
                if (d.Tag == D.Tag)
                {
                    d.Show(); return;
                }
            }
            D.Show(DP, DockState.Document);
        }
Ejemplo n.º 39
0
        /// <summary>
        /// Modiication d'une action ou sous-action par l'intermédiaire de la fiche action
        /// </summary>
        public void Modifier_Action()
        {
            if (action == null)
            {
                return;
            }

            Console.Ajouter("[MODIFICATION ACTION]");

            var D = new WeifenLuo.WinFormsUI.Docking.DockContent();

            D.TabText = "Action " + action.Code;

            ctrlFicheAction f = new ctrlFicheAction();

            f.Acces    = Acces;
            f.Creation = false;
            f.plan     = plan;

            n_action++;
            f.Tag              = Acces.type_ACTION.ID + n_action;
            f.EVT_Enregistrer += Handler_evt_Modifier;

            f.action = action;
            f.Initialiser();

            f.Dock = DockStyle.Fill;
            D.Controls.Add(f);
            D.Tag = action.Code;

            //Recherche si la fiche élément n'est pas ouverte
            foreach (DockContent d in DP.Documents)
            {
                if (d.Tag == D.Tag)
                {
                    d.Show(); return;
                }
            }
            D.Show(DP, DockState.Document);
        }
Ejemplo n.º 40
0
        public void Ouvrir_Plan()
        {
            if (plan == null)
            {
                return;
            }
            //if ((lstPlan.SelectedNode is null) && (plan is null)) { return; }

            //Plan plan = (Plan)Acces.Trouver_Element(Acces.type_PLAN, int.Parse(lstPlan.SelectedNode.Name));

            var D = new WeifenLuo.WinFormsUI.Docking.DockContent();

            D.TabText = "Plan " + plan.Code;
            //MessageBox.Show(int.Parse(lstPlan.SelectedNode.Name).ToString());

            var ctrl = new ctrlPlan();

            ctrl.Acces   = Acces;
            ctrl.plan    = plan;
            ctrl.DP      = DP;
            ctrl.Console = Console;
            ctrl.Chemin  = Chemin;
            ctrl.Afficher();

            ctrl.Dock = DockStyle.Fill;
            D.Controls.Add(ctrl);
            D.Tag = plan.Code;

            //Recherche si la fiche élément n'est pas ouverte
            foreach (DockContent d in DP.Documents)
            {
                if (d.Tag == D.Tag)
                {
                    d.Show(); return;
                }
            }

            D.Show(DP, DockState.Document);
        }
Ejemplo n.º 41
0
        void Ajouter_SousObjectif()
        {
            string code = CodeRef;

            if (lstObjectif.SelectedNode is null)
            {
                MessageBox.Show("Vous devez choisir un objectif parent");
                return;
            }

            int      id  = int.Parse(lstObjectif.SelectedNode.Name);
            Objectif obj = (Objectif)Acces.Trouver_Element(Acces.type_OBJECTIF.id, id);

            code = obj.Code;

            ctrlFicheObjectif f = new ctrlFicheObjectif();

            f.Acces          = Acces;
            f.Creation       = true;
            f.objectif       = new Objectif();
            f.objectif.Code  = code;
            f.objectif.Actif = true;
            f.objectifParent = (Objectif)Acces.Trouver_Element(Acces.type_OBJECTIF.id, int.Parse(lstObjectif.SelectedNode.Name));;

            n_obj++;
            f.Tag              = Acces.type_OBJECTIF.code + n_obj;
            f.EVT_Enregistrer += Handler_evt_Modifier;

            f.Initialiser();

            var D = new WeifenLuo.WinFormsUI.Docking.DockContent();

            D.TabText = "Objectif (Nouveau)";

            f.Dock = DockStyle.Fill;
            D.Controls.Add(f);

            D.Show(DP, WeifenLuo.WinFormsUI.Docking.DockState.Document);
        }
Ejemplo n.º 42
0
        /// <summary>
        /// Création d'une sous-action par l'intermédiaire de la fiche action
        /// </summary>
        void Ajouter_SousAction()
        {
            string code = CodeRef;

            Console.Ajouter("[AJOUT SOUS-ACTION");
            //Recherche du code du parent pour optimiser le codage des actions
            if (lstAction.SelectedNode is null)
            {
                MessageBox.Show("Vous devez sélectionner une action.", "Erreur");
                return;
            }

            ctrlFicheAction f = new ctrlFicheAction();

            f.Acces    = Acces;
            f.Creation = true;
            n_action++;
            f.Tag              = Acces.type_ACTION.Code + n_action;
            f.EVT_Enregistrer += Handler_evt_Modifier;

            f.action = new PATIO.CAPA.Classes.Action();
            //f.action.Code = "ACT-" + code;
            f.action.Actif = true;

            f.actionParent = (PATIO.CAPA.Classes.Action)Acces.Trouver_Element(Acces.type_ACTION, int.Parse(lstAction.SelectedNode.Name));
            Console.Ajouter("Action parent : " + f.actionParent.Code);

            f.Initialiser();

            var D = new WeifenLuo.WinFormsUI.Docking.DockContent();

            D.TabText = "Action (nouvelle)";

            f.Dock = DockStyle.Fill;
            D.Controls.Add(f);

            D.Show(DP, WeifenLuo.WinFormsUI.Docking.DockState.Document);
        }
Ejemplo n.º 43
0
 private void WinFrmLifecycleEvent_ViewTableFrmHandler(WeifenLuo.WinFormsUI.Docking.DockContent content)
 {
     AddFrmView(content);
     content.FormClosed += new FormClosedEventHandler(content_FormClosed);
     MainContent         = content;
 }
Ejemplo n.º 44
0
 void WinFrmLifecycleEvent_ViewCodeFrmEvent(WeifenLuo.WinFormsUI.Docking.DockContent content)
 {
     AddFrmView(content);
 }
Ejemplo n.º 45
0
 /// <summary>
 /// 在异步调用中,设置当前线程的控件状态,只能通过ISynchronizeInvoke接口设置
 /// </summary>
 /// <param name="IAsyncObject">IAsyncResult异步状态对象</param>
 private void SetControlCallBackMethod(IAsyncResult IAsyncObject, object IAsyncResultObject)
 {
     WeifenLuo.WinFormsUI.Docking.DockContent context =
         (IAsyncResultObject as PlugEventArgs).GetArgs() as WeifenLuo.WinFormsUI.Docking.DockContent;
 }
Ejemplo n.º 46
0
 /// <summary>
 /// 添加视图对象到主容器
 /// </summary>
 /// <param name="content">视图窗口对象</param>
 public void AddFrmView(WeifenLuo.WinFormsUI.Docking.DockContent content)
 {
     content.Show(dockPanel1, WeifenLuo.WinFormsUI.Docking.DockState.Document);
 }
Ejemplo n.º 47
0
        public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex)
        {
            if (dockStyle == DockStyle.Fill)
            {
                bool samePane = (Pane == pane);
                if (!samePane)
                {
                    Pane = pane;
                }

                int visiblePanes   = 0;
                int convertedIndex = 0;
                while (visiblePanes <= contentIndex && convertedIndex < Pane.Contents.Count)
                {
                    DockContent window = Pane.Contents[convertedIndex] as DockContent;
                    if (window != null && !window.IsHidden)
                    {
                        ++visiblePanes;
                    }

                    ++convertedIndex;
                }

                contentIndex = Math.Min(Math.Max(0, convertedIndex - 1), Pane.Contents.Count - 1);

                if (contentIndex == -1 || !samePane)
                {
                    pane.SetContentIndex(Content, contentIndex);
                }
                else
                {
                    DockContentCollection contents = pane.Contents;
                    int oldIndex = contents.IndexOf(Content);
                    int newIndex = contentIndex;
                    if (oldIndex < newIndex)
                    {
                        newIndex += 1;
                        if (newIndex > contents.Count - 1)
                        {
                            newIndex = -1;
                        }
                    }
                    pane.SetContentIndex(Content, newIndex);
                }
            }
            else
            {
                DockPane paneFrom = DockPanel.DockPaneFactory.CreateDockPane(Content, pane.DockState, true);
                INestedPanesContainer container = pane.NestedPanesContainer;
                if (dockStyle == DockStyle.Left)
                {
                    paneFrom.DockTo(container, pane, DockAlignment.Left, 0.5);
                }
                else if (dockStyle == DockStyle.Right)
                {
                    paneFrom.DockTo(container, pane, DockAlignment.Right, 0.5);
                }
                else if (dockStyle == DockStyle.Top)
                {
                    paneFrom.DockTo(container, pane, DockAlignment.Top, 0.5);
                }
                else if (dockStyle == DockStyle.Bottom)
                {
                    paneFrom.DockTo(container, pane, DockAlignment.Bottom, 0.5);
                }

                paneFrom.DockState = pane.DockState;
            }
        }