Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            #region add command
            this.CommandBindings.Add(new CommandBinding(SystemCommands.CloseWindowCommand, this.OnCloseWindow));
            this.CommandBindings.Add(new CommandBinding(SystemCommands.MaximizeWindowCommand, this.OnMaximizeWindow, this.OnCanResizeWindow));
            this.CommandBindings.Add(new CommandBinding(SystemCommands.MinimizeWindowCommand, this.OnMinimizeWindow, this.OnCanMinimizeWindow));
            this.CommandBindings.Add(new CommandBinding(SystemCommands.RestoreWindowCommand, this.OnRestoreWindow, this.OnCanResizeWindow));
            #endregion

            this.SizeChanged += MainWindow_SizeChanged;
            info.onHidden    += (type) =>
            {
                if (type == LMD_GUI.LMD_BottomPanel.STATE_VISIBLY.hide)
                {
                    mainGrid.RowDefinitions[2].Height = new GridLength(20);
                }
                else if (type == LMD_GUI.LMD_BottomPanel.STATE_VISIBLY.show)
                {
                    mainGrid.RowDefinitions[2].Height = new GridLength(220);
                }
            };

            blockPanel.clickButtons      += blockPanel_clickButtons;
            workspace.clickItemsExpander += workspace_clickItemsExpander;
            workspace.createNewLine      += workspace_createNewLine;
            workspace.RemoveLine         += workspace_RemoveLine;
            workspace.onMouseBlock       += Workspace_onMouseBlock;
            workspace.MouseDown          += workspace_MouseDown;
            workspace.MouseUp            += workspace_MouseUp;
            workspace.MouseMove          += Workspace_MouseMove;
            topPanel.run += topPanel_run;

            mCompiling = new LMD_Compiling.CompilingManager();

            this.Visibility = Visibility.Hidden;
            LMD_GUI.LMD_StartWindow sw = new LMD_GUI.LMD_StartWindow(this);
            sw.Show();
        }
Exemplo n.º 2
0
 public void StartWindowEnable()
 {
     this.Visibility = System.Windows.Visibility.Hidden;
     LMD_GUI.LMD_StartWindow sw = new LMD_GUI.LMD_StartWindow(this);
     sw.Show();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Начало компиляции
        /// </summary>
        private void topPanel_run(String cmd)
        {
            switch (cmd)
            {
                #region СОЗДАТЬ
            case "СОЗДАТЬ":
                //	LMD_GUI.LMD_WindowCreateProject wcp = new LMD_GUI.LMD_WindowCreateProject();
                //	wcp.ShowDialog();
                break;

                #endregion
                #region ОТКРЫТЬ
            case "ОТКРЫТЬ": break;

                #endregion
                #region СОХРАНИТЬ
            case "СОХРАНИТЬ":                     //FileManager.ManagerProjects.SaveProject(mCompiling, workspace.blocks, info, fastInfo);
                break;

                #endregion
                #region НАСТРОЙКИ
            case "НАСТРОЙКИ":
                //	LMD_GUI.LMD_WindowSetting ws = new LMD_GUI.LMD_WindowSetting();
                //	ws.Show();
                break;

                #endregion
                #region ПРОЕКТ
            case "ПРОЕКТ":
                LMD_GUI.LMD_WindowPropertiesProject wpp = new LMD_GUI.LMD_WindowPropertiesProject();
                wpp.Show();
                break;

                #endregion
                #region ЗАПУСТИТЬ
            case "ЗАПУСТИТЬ": mCompiling.Run(workspace.blocks, info, fastInfo); break;

                #endregion
                #region ГЛАВНАЯ
            case "ГЛАВНАЯ":
                LMD_GUI.LMD_StartWindow sw = new LMD_GUI.LMD_StartWindow(this);
                sw.Show();
                break;

                #endregion
                #region ПЕРЕМЕННЫЕ
            case "ПЕРЕМЕННЫЕ":
                LMD_GUI.LMD_WindowManagerVariables wmv = new LMD_GUI.LMD_WindowManagerVariables();
                wmv.Show();
                break;

                #endregion
                #region КОД
            case "КОД":
                LMD_GUI.LMD_WindowCode wc = new LMD_GUI.LMD_WindowCode();
                wc.SetText(mCompiling.PrevTextCode);
                wc.Show(); break;

                #endregion
                #region СПРАВКА
            case "СПРАВКА":  break;

                #endregion
                #region ВЫХОД
            case "ВЫХОД":
                LMD_GUI.LMD_WindowClose wcc = new LMD_GUI.LMD_WindowClose();
                wcc.Height = 130;
                Canvas.SetLeft(wcc, this.Width / 2 - wcc.Width / 2);
                Canvas.SetTop(wcc, this.Height / 2 - wcc.Height / 2);
                wcc.ShowDialog();
                //Environment.Exit(0);
                break;
                #endregion
            }
        }