public CommandResult UnifyAll(out IContentReplaceableView next) { PaneDivision.IPane nextfocus = null; UnifyAll(out nextfocus); next = (IContentReplaceableView)nextfocus; return(CommandResult.Succeeded); }
//PaneDivision.IUIActionHandler public void RequestUnify(PaneDivision.IPane unify_target) { IPoderosaView view = (IPoderosaView)unify_target; ICommandManager cmg = CommandManagerPlugin.Instance; cmg.Execute(cmg.Find("org.poderosa.core.window.splitunify"), view); }
public CommandResult Unify(IContentReplaceableView view, out IContentReplaceableView next) { PaneDivision.IPane nextfocus = null; bool r = Unify((PaneDivision.IPane)view.GetAdapter(typeof(PaneDivision.IPane)), out nextfocus); next = r? (IContentReplaceableView)nextfocus : null; //TODO ちょいまず return(r? CommandResult.Succeeded : CommandResult.Failed); }
public void ApplySplitInfo(string format) { try { //現状を獲得 IPoderosaView[] previous_views = GetAllViews(); IPoderosaDocument[] documents = new IPoderosaDocument[previous_views.Length]; //分割適用後アクティブになるやつ for (int i = 0; i < previous_views.Length; i++) { documents[i] = previous_views[i].Document; } IPoderosaView[] new_views; SessionManagerPlugin sm = SessionManagerPlugin.Instance; if (format.Length > 0) { Form container = _parent.AsForm(); container.SuspendLayout(); Control old_root = this.RootControl; _paneDivision.ApplySplitInfo(old_root.Parent, old_root, format, delegate(string label) { return(CreateNewPane(_defaultViewFactory, DockStyle.Fill)); }); //とりあえずデフォルトファクトリで作成 container.ResumeLayout(true); _singlePane = null; //成功裏に終わったときのみ new_views = GetAllViews(); //新しいのを取得 } else { IContentReplaceableView view; UnifyAll(out view); new_views = new IPoderosaView[] { view }; } //既存ドキュメントに再適用 foreach (DocumentHost dh in sm.GetAllDocumentHosts()) { int index = CollectionUtil.ArrayIndexOf(previous_views, dh.LastAttachedView); if (index != -1) { IPoderosaView new_view = index < new_views.Length ? new_views[index] : new_views[0]; //個数が減ったら先頭に dh.AlternateView(new_view); } } //もともとActiveだったやつを再適用 for (int i = 0; i < documents.Length; i++) { if (documents[i] != null) { sm.AttachDocumentAndView(documents[i], sm.FindDocumentHost(documents[i]).LastAttachedView); //LastAttachedViewはこの上のループで適用済み } } } catch (Exception ex) { RuntimeUtil.ReportException(ex); } }
public void UnifyAll(out PaneDivision.IPane nextfocus) { Form form = _parent.AsForm(); form.SuspendLayout(); _singlePane = _paneDivision.UnifyAll(); form.ResumeLayout(true); FireOnUnify(); nextfocus = _singlePane; }
private void InternalSplit(PaneDivision.IPane view, IViewFactory factory, PaneDivision.Direction direction) { PaneDivision.IPane t = CreateNewPane(factory, direction == PaneDivision.Direction.LR? DockStyle.Left : DockStyle.Top); Form form = _parent.AsForm(); form.SuspendLayout(); _paneDivision.SplitPane(view, t, direction); _singlePane = null; FireOnSplit(); form.ResumeLayout(true); view.AsDotNet().Focus(); }
public SplittableViewManager(IPoderosaMainWindow parent, IViewFactory defaultviewfactory) { _parent = parent; _defaultViewFactory = defaultviewfactory; Debug.Assert(_paneDivision == null); _singlePane = CreateNewPane(_defaultViewFactory, DockStyle.Fill); //先頭のFactoryで作ってしまうというのはどうかな _paneDivision = new PaneDivision(); _paneDivision.CountLimit = WindowManagerPlugin.Instance.WindowPreference.OriginalPreference.SplitLimitCount; _paneDivision.UIActionHandler = this; }
public bool Unify(PaneDivision.IPane view, out PaneDivision.IPane nextfocus) { Form form = _parent.AsForm(); form.SuspendLayout(); PaneDivision.SplitResult r = _paneDivision.UnifyPane(view, out nextfocus); if (r == PaneDivision.SplitResult.Success) { view.AsDotNet().Dispose(); } if (_paneDivision.IsEmpty) { _singlePane = nextfocus; } form.ResumeLayout(true); FireOnUnify(); return(r == PaneDivision.SplitResult.Success); }
private PaneDivision.IPane _singlePane; //�������Ă��Ȃ��Ƃ��ɂ̂ݔ�null #endregion Fields #region Constructors public SplittableViewManager(IPoderosaMainWindow parent, IViewFactory defaultviewfactory) { _parent = parent; _defaultViewFactory = defaultviewfactory; Debug.Assert(_paneDivision == null); _singlePane = CreateNewPane(_defaultViewFactory, DockStyle.Fill); //�擪��Factory�ō���Ă��܂��Ƃ����̂͂ǂ����� _paneDivision = new PaneDivision(); _paneDivision.CountLimit = WindowManagerPlugin.Instance.WindowPreference.OriginalPreference.SplitLimitCount; _paneDivision.UIActionHandler = this; }
private void InternalSplit(PaneDivision.IPane view, IViewFactory factory, PaneDivision.Direction direction) { PaneDivision.IPane t = CreateNewPane(factory, direction == PaneDivision.Direction.LR ? DockStyle.Left : DockStyle.Top); Form form = _parent.AsForm(); form.SuspendLayout(); _paneDivision.SplitPane(view, t, direction); _singlePane = null; FireOnSplit(); form.ResumeLayout(true); view.AsDotNet().Focus(); }
public void UnifyAll(out PaneDivision.IPane nextfocus) { Form form = _parent.AsForm(); form.SuspendLayout(); _singlePane = _paneDivision.UnifyAll(); form.ResumeLayout(true); FireOnUnify(); nextfocus = _singlePane; }
public bool Unify(PaneDivision.IPane view, out PaneDivision.IPane nextfocus) { Form form = _parent.AsForm(); form.SuspendLayout(); PaneDivision.SplitResult r = _paneDivision.UnifyPane(view, out nextfocus); if (r == PaneDivision.SplitResult.Success) view.AsDotNet().Dispose(); if (_paneDivision.IsEmpty) _singlePane = nextfocus; form.ResumeLayout(true); FireOnUnify(); return r == PaneDivision.SplitResult.Success; }
public void ApplySplitInfo(string format) { try { //�����l�� IPoderosaView[] previous_views = GetAllViews(); IPoderosaDocument[] documents = new IPoderosaDocument[previous_views.Length]; //�����K�p��A�N�e�B�u�ɂȂ��� for (int i = 0; i < previous_views.Length; i++) documents[i] = previous_views[i].Document; IPoderosaView[] new_views; SessionManagerPlugin sm = SessionManagerPlugin.Instance; if (format.Length > 0) { Form container = _parent.AsForm(); container.SuspendLayout(); Control old_root = this.RootControl; _paneDivision.ApplySplitInfo(old_root.Parent, old_root, format, delegate(string label) { return CreateNewPane(_defaultViewFactory, DockStyle.Fill); }); //�Ƃ肠�����f�t�H���g�t�@�N�g���ō쐬 container.ResumeLayout(true); _singlePane = null; //�������ɏI������Ƃ��̂� new_views = GetAllViews(); //�V�����̂�擾 } else { IContentReplaceableView view; UnifyAll(out view); new_views = new IPoderosaView[] { view }; } //�����h�L�������g�ɍēK�p foreach (DocumentHost dh in sm.GetAllDocumentHosts()) { int index = CollectionUtil.ArrayIndexOf(previous_views, dh.LastAttachedView); if (index != -1) { IPoderosaView new_view = index < new_views.Length ? new_views[index] : new_views[0]; //������������擪�� dh.AlternateView(new_view); } } //��Ƃ��Active���������ēK�p for (int i = 0; i < documents.Length; i++) { if (documents[i] != null) sm.AttachDocumentAndView(documents[i], sm.FindDocumentHost(documents[i]).LastAttachedView); //LastAttachedView�͂��̏�̃��[�v�œK�p�ς� } } catch (Exception ex) { RuntimeUtil.ReportException(ex); } }
public void SplitVertical(PaneDivision.IPane view, IViewFactory factory) { InternalSplit(view, factory, PaneDivision.Direction.LR); }
//分割・結合メソッド public void SplitHorizontal(PaneDivision.IPane view, IViewFactory factory) { InternalSplit(view, factory, PaneDivision.Direction.TB); }
public void ApplySplitInfo(string format) { try { //現状を獲得 IPoderosaView[] previous_views = GetAllViews(); IPoderosaDocument[] documents = new IPoderosaDocument[previous_views.Length]; //分割適用後アクティブになるやつ for (int i = 0; i < previous_views.Length; i++) documents[i] = previous_views[i].Document; IPoderosaView[] new_views; SessionManagerPlugin sm = SessionManagerPlugin.Instance; if (format.Length > 0) { Form container = _parent.AsForm(); container.SuspendLayout(); Control old_root = this.RootControl; _paneDivision.ApplySplitInfo(old_root.Parent, old_root, format, delegate(string label) { return CreateNewPane(_defaultViewFactory, DockStyle.Fill); }); //とりあえずデフォルトファクトリで作成 container.ResumeLayout(true); _singlePane = null; //成功裏に終わったときのみ new_views = GetAllViews(); //新しいのを取得 } else { IContentReplaceableView view; UnifyAll(out view); new_views = new IPoderosaView[] { view }; } //既存ドキュメントに再適用 foreach (DocumentHost dh in sm.GetAllDocumentHosts()) { int index = CollectionUtil.ArrayIndexOf(previous_views, dh.LastAttachedView); if (index != -1) { IPoderosaView new_view = index < new_views.Length ? new_views[index] : new_views[0]; //個数が減ったら先頭に dh.AlternateView(new_view); } } //もともとActiveだったやつを再適用 for (int i = 0; i < documents.Length; i++) { if (documents[i] != null) sm.AttachDocumentAndView(documents[i], sm.FindDocumentHost(documents[i]).LastAttachedView); //LastAttachedViewはこの上のループで適用済み } } catch (Exception ex) { RuntimeUtil.ReportException(ex); } }