Esempio n. 1
0
 public void NotifyMainWindowUnloaded(MainWindow w)
 {
     IMainWindowEventHandler[] hs = (IMainWindowEventHandler[])_poderosaWorld.PluginManager.FindExtensionPoint(WindowManagerConstants.MAINWINDOWEVENTHANDLER_ID).GetExtensions();
     foreach (IMainWindowEventHandler h in hs) {
         if (_windows.Count == 0)
             h.OnLastMainWindowUnloaded(w);
         else
             h.OnMainWindowUnloaded(w);
     }
 }
Esempio n. 2
0
 private MainWindow CreateMainWindow(MainWindowArgument arg)
 {
     MainWindow w = new MainWindow(arg, _menu);
     w.Text = "Poderosa";
     w.FormClosed += new FormClosedEventHandler(WindowClosedHandler);
     w.Activated += delegate(object sender, EventArgs args) {
         _activeWindow = (MainWindow)sender; //最後にアクティブになったものを指定する
     };
     w.Show();
     return w;
 }
Esempio n. 3
0
        public void ApplyToLoadedWindow(MainWindow f)
        {
            const int MARGIN = 3;
            Rectangle titlebarRect =
                new Rectangle(_location.X + MARGIN, _location.Y + MARGIN,
                                Math.Max(_location.Width - MARGIN * 2, 1),
                                Math.Max(SystemInformation.CaptionHeight - MARGIN * 2, 1));
            bool visible = false;
            foreach (Screen s in Screen.AllScreens) {
                if (s.WorkingArea.IntersectsWith(titlebarRect))
                    visible = true;
            }

            if (!visible) {
                Screen baseScreen = null;
                foreach (Screen s in Screen.AllScreens) {
                    if (s.Bounds.IntersectsWith(_location)) {
                        baseScreen = s;
                        break;
                    }
                }
                if (baseScreen == null)
                    baseScreen = Screen.PrimaryScreen;

                Rectangle sb = baseScreen.WorkingArea;
                if (_location.Width > sb.Width)
                    _location.Width = sb.Width;
                if (_location.Height > sb.Height)
                    _location.Height = sb.Height;
                _location.X = sb.X + (sb.Width - _location.Width) / 2;
                _location.Y = sb.Y + (sb.Height - _location.Height) / 2;
            }

            //DesktopBoundsの設定はOnLoadの中じゃないといかんらしい
            f.DesktopBounds = _location;
            f.WindowState = _windowState;

            //頑張ればOnLoad以前にSplitInfoを適用できるかも
            if (_splitInfo.Length > 0) {
                ISplittableViewManager vm = (ISplittableViewManager)f.ViewManager.GetAdapter(typeof(ISplittableViewManager));
                if (vm != null)
                    vm.ApplySplitInfo(_splitInfo);
            }

            //ToolBarのコンポーネント位置調整
            f.ToolBarInternal.RestoreLayout();
        }
Esempio n. 4
0
 //フォームへの適用は、OnLoadの前と後で分ける
 public void ApplyToUnloadedWindow(MainWindow f)
 {
 }
 public FixedShortcutKeyHandler(MainWindow window)
 {
     _window = window;
 }
Esempio n. 6
0
        public void FormatWindowPreference(MainWindow f) {
            IPreferenceFolder element = _windowArrayPreference.CreateNewFolder();

            FormWindowState st = f.WindowState;
            Rectangle rc = st == FormWindowState.Normal ? f.DesktopBounds : f.RestoreBounds; //Normal時にはRestoreBound取得できない、注意
            _windowArrayPreference.ConvertItem(element, _windowPositionPreference).AsString().Value = String.Format("({0}{1},{2},{3},{4})",
                st == FormWindowState.Maximized ? "Max," : "",
                rc.Left, rc.Top, rc.Width, rc.Height);
            //TODO PreferenceItemのテンプレートをViewManager側に移動したほうが汎用的
            ISplittableViewManager vm = (ISplittableViewManager)f.ViewManager.GetAdapter(typeof(ISplittableViewManager));
            if (vm != null)
                _windowArrayPreference.ConvertItem(element, _windowSplitFormatPreference).AsString().Value = vm.FormatSplitInfo();
            _windowArrayPreference.ConvertItem(element, _toolBarFormatPreference).AsString().Value = f.ToolBar.FormatLocations();
            _windowArrayPreference.ConvertItem(element, _tabRowCountPreference).AsInt().Value = f.DocumentTabFeature.TabRowCount;
        }
Esempio n. 7
0
 private MainWindow CreateMainWindow(MainWindowArgument arg)
 {
     MainWindow w = new MainWindow(arg, _menu);
     w.Text = "Poderosa";
     w.FormClosed += new FormClosedEventHandler(WindowClosedHandler);
     w.Activated += delegate(object sender, EventArgs args) {
         _activeWindow = (MainWindow)sender; //�Ō�ɃA�N�e�B�u�ɂȂ�����̂�w�肷��
     };
     w.Show();
     return w;
 }
 public MainWindow CreateLibraryMainWindow()
 {
     MainWindowArgument arg = MainWindowArgument.Parse(_preferences)[0];
     MainWindow w = new MainWindow(arg, _menu);
     w.Text = "Poderosa";
     w.FormClosed += new FormClosedEventHandler(WindowClosedHandler);
     w.Activated += delegate(object sender, EventArgs args)
     {
         _activeWindow = (MainWindow)sender; //�Ō�ɃA�N�e�B�u�ɂȂ�����̂�w�肷��
     };
     _windows.Add(w);
     //w.Show();
     return w;
 }
        public void ApplyToLoadedWindow(MainWindow f)
        {
            //DesktopBounds�̐ݒ��OnLoad�̒�����Ȃ��Ƃ�����炵��
            f.DesktopBounds = _location;
            f.WindowState = _windowState;

            //�撣���OnLoad�ȑO��SplitInfo��K�p�ł��邩��
            if(_splitInfo.Length>0) {
                ISplittableViewManager vm = (ISplittableViewManager)f.ViewManager.GetAdapter(typeof(ISplittableViewManager));
                if(vm!=null) vm.ApplySplitInfo(_splitInfo);
            }

            //ToolBar�̃R���|�[�l���g�ʒu����
            f.ToolBarInternal.RestoreLayout();
        }
        public InternalTerminalInstance(ProtocolType protocol, InternalPoderosaInstance _internalPoderosaWorld, ITerminalParameter _IterminalParameter)
        {
            _basePoderosaInstance=_internalPoderosaWorld;
            _window = _basePoderosaInstance.WindowManagerPlugin.CreateLibraryMainWindow();

            _protocol = protocol;

            _terminalSettings = new TerminalSettings();
            _terminalParameter = _IterminalParameter;
            _terminalView = _window.ViewManager.GetCandidateViewForNewDocument();
        }
        private MainWindow CreateMainWindow(MainWindowArgument arg)
        {
            if (InvisibleMode) {
                arg = new MainWindowArgument(arg.Location, FormWindowState.Minimized, arg.SplitInfo, arg.ToolBarInfo, arg.TabRowCount);
            }

            MainWindow w = new MainWindow(arg, _menu);
            w.Text = "Poderosa";
            w.FormClosed += new FormClosedEventHandler(WindowClosedHandler);
            w.Activated += delegate(object sender, EventArgs args) {
                _activeWindow = (MainWindow)sender; //�Ō�ɃA�N�e�B�u�ɂȂ�����̂�w�肷��
            };

            if (InvisibleMode) {
            #if TERMCONTROL
                w.Opacity = 0;
            #endif
                w.WindowState = FormWindowState.Minimized;
                w.ShowInTaskbar = false;
            }

            w.Show();

            return w;
        }