예제 #1
0
        public static void OpenInputForm(XtraUserControl uc, Size size, bool isEdit)
        {
            frmOpen frm  = new frmOpen();
            string  temp = "";

            if (isEdit)
            {
                temp = (ConfigEngine.Language == "vi") ? "Cập Nhật" : "Update";
            }
            else
            {
                temp = (ConfigEngine.Language == "vi") ? "Thêm Mới" : "Add New";
            }
            frm.Text = string.Format("{0} {1}", temp, LanguageEngine.GetOpenFormText(uc.Name, ConfigEngine.Language));

            if (ConfigEngine.TouchMode)
            {
                int      width = 0, height = 0;
                string[] tmp = CaptionEngine.GetControlCaption(uc.Name, null, BaseConstant.FORM_SIZE, null).Split('|');
                width  = Convert.ToInt32(tmp[0]);
                height = Convert.ToInt32(tmp[1]);
                size   = new Size(width, height);
            }
            frm.Size        = size;
            frm.MaximumSize = size;
            frm.MinimumSize = size;

            frm.Controls.Clear();
            uc.Dock = DockStyle.Fill;
            frm.Controls.Add(uc);
            uc.Show();
            frm.ShowDialog();
        }
예제 #2
0
파일: MindMap.cs 프로젝트: LamHV155/MindMap
        private void openToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmOpen formOpen = new frmOpen();

            formOpen.mindmap = this;
            formOpen.ShowDialog();
        }
예제 #3
0
        public static void OpenInputForm(XtraUserControl uc, Size size)
        {
            frmOpen frm = new frmOpen();

            frm.Text        = LanguageEngine.GetOpenFormText(uc.Name, ConfigEngine.Language);
            frm.Size        = size;
            frm.MaximumSize = size;
            frm.MinimumSize = size;
            frm.Controls.Clear();
            uc.Dock = DockStyle.Fill;
            frm.Controls.Add(uc);
            uc.Show();
            frm.ShowDialog();
        }
예제 #4
0
        public static void OpenInputForm(XtraUserControl uc, string vnTitle, string enTitle, Size size)
        {
            string  languageID = new Configuration().Language;
            frmOpen frm        = new frmOpen();

            frm.Text        = (languageID.Equals("vi-VN")) ? vnTitle : enTitle;
            frm.Size        = size;
            frm.MaximumSize = size;
            frm.MinimumSize = size;
            frm.Controls.Clear();
            uc.Dock = DockStyle.Fill;
            frm.Controls.Add(uc);
            uc.Show();
            frm.ShowDialog();
        }
예제 #5
0
        private void LoadMap()
        {
            frmOpen      o;
            DialogResult result;
            bool         bResult;

            m_DObj.Clear();
            m_DMonstre.Clear();
            m_DItem.Clear();
            m_OBJ.Clear();
            m_li.Clear();
            m_Mons.Clear();

            o = new frmOpen();

            result         = o.ShowDialog(this);
            m_bOpen        = false;
            picMap.Visible = false;
            this.Cursor    = Cursors.WaitCursor;
            if (result == DialogResult.OK)
            {
                m_CurrentWorld = o.CurrentWorld;
                m_bOpen        = false;
                picMap.Visible = false;
                this.Cursor    = Cursors.WaitCursor;
                try
                {
                    m_Map.Load(m_CurrentWorld);
                    FillLists();
                    m_bOpen        = true;
                    m_bRefresh     = true;
                    m_bResize      = true;
                    picMap.Visible = true;
                    m_WorldOpen    = true;
                    m_worldNew     = false;
                }
                catch
                {
                    Console.WriteLine("Error Loading...");
                }
            }
            m_MenuLogic();
            this.Cursor = Cursors.Default;


            //DialogResult result;

            //dlgLoadMap.Title = "Load Map";
            //dlgLoadMap.Filter = "Map Files (*.map)|*.map|All Files (*.*)|*.*";

            //result = dlgLoadMap.ShowDialog();
            //if (result == DialogResult.OK)
            //{
            //    m_bOpen = false;
            //    picMap.Visible = false;
            //    this.Cursor = Cursors.WaitCursor;
            //    try
            //    {
            //        m_Map.Load(dlgLoadMap.FileName);
            //        m_bOpen = true;
            //        m_bRefresh = true;
            //        picMap.Visible = true;
            //    }
            //    catch
            //    {
            //        Console.WriteLine("Error Loading...");
            //    }
            //    m_MenuLogic();
            //    this.Cursor = Cursors.Default;
            //}
        }
예제 #6
0
 public static void OpenInputForm(XtraUserControl uc, string vnTitle, string enTitle, Size size)
 {
     string languageID = new Configuration().Language;
     frmOpen frm = new frmOpen();
     frm.Text = (languageID.Equals("vi-VN")) ? vnTitle : enTitle;
     frm.Size = size;
     frm.MaximumSize = size;
     frm.MinimumSize = size;
     frm.Controls.Clear();
     uc.Dock = DockStyle.Fill;
     frm.Controls.Add(uc);
     uc.Show();
     frm.ShowDialog();
 }
예제 #7
0
        /// <summary>
        /// Auteur : ???
        /// Description : Open a window allowing the user to select a *.map file to load.
        /// Update : Joëlle Boyer -> Added "m_ResizeMap()" so that the map immediately shows the changes made. 2019/11/03
        /// Date : ???
        /// </summary>
        private void LoadMap()
        {
            frmOpen f = new frmOpen();

            f.ShowDialog(this);

            if (f.DialogResult == DialogResult.OK)
            {
                DialogResult   result;
                HugoLand.Monde monde   = f.MyWorld;
                string         myWorld = monde.Id.ToString() + ".map";

                if (File.Exists(myWorld) && f.MyWorld.Id != -1)
                {
                    try
                    {
                        m_Map.Load(myWorld);
                        m_bOpen        = true;
                        m_bRefresh     = true;
                        picMap.Visible = true;
                    }
                    catch
                    {
                        Console.WriteLine("Error Loading Existing File ...");
                    }
                }

                else if (!f.NoFile)
                {
                    dlgLoadMap.Title  = "Load Map";
                    dlgLoadMap.Filter = "Map Files (*.map)|*.map|All Files (*.*)|*.*";

                    result = dlgLoadMap.ShowDialog();

                    if (result == DialogResult.OK)
                    {
                        m_bOpen        = false;
                        picMap.Visible = false;
                        this.Cursor    = Cursors.WaitCursor;
                        try
                        {
                            m_Map.Load(dlgLoadMap.FileName);
                            m_bOpen        = true;
                            m_bRefresh     = true;
                            picMap.Visible = true;
                        }
                        catch
                        {
                            Console.WriteLine("Error Loading Chosen File ...");
                        }
                    }
                }
                else if (f.NoFile && f.MyWorld.Id != -1)
                {
                    m_bOpen        = false;
                    picMap.Visible = false;
                    this.Cursor    = Cursors.WaitCursor;
                    try
                    {
                        m_Map.MapExistingWorld(f.MyWorld.Id);
                        m_bOpen        = true;
                        m_bRefresh     = true;
                        picMap.Visible = true;
                    }
                    catch
                    {
                        Console.WriteLine("Error Loading Chosen File ...");
                    }
                }

                m_ResizeMap();
                m_MenuLogic();
                world       = f.MyWorld;
                this.Cursor = Cursors.Default;
            }
            else
            {
                MessageBox.Show("You have cancelled the opening of a new world.", "Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }