Example #1
1
 public StatisticsForm(MainForm main)
 {
     Location = new Point(600, 100);
     StartPosition = new FormStartPosition();
     InitializeComponent();
     //Location = new Point(600, 100);
     mainForm = main;
 }
Example #2
0
        public void activateForm(Form f, FormWindowState ws, FormStartPosition fs)
        {
            demandBackup = true;
            foreach (Form each in MdiChildren)
            {
                if ((string)each.Tag != "1")
                {
                    each.Close();
                }
            }

            if (fs == FormStartPosition.Manual)
            {
                f.StartPosition = FormStartPosition.Manual;
                int w = this.Width;
                int h = this.Height;
                f.Left = (w - f.Width) / 4;
                f.Top = (h - f.Height) / 6;
            }
            else
            {
                f.StartPosition = fs;
            }
            f.WindowState = ws;
            f.MdiParent = this;
            f.ControlBox = false;
            f.Show();
        }
 public bool ShowComboDialog(string caption, List<object> items, out object selected, out string inputText,
                             FormStartPosition startPosition, bool listStyle)
 {
     selected = items.FirstOrDefault();
     inputText = selected == null ? string.Empty : selected.ToString();
     return true;
 }
Example #4
0
 private void DisplayChild(Form frm, DockStyle style, FormStartPosition startPos, bool canShow)
 {
     if (canShow)
     {
         frm.MdiParent = this;
         frm.Dock = style;
         frm.StartPosition = startPos;
         frm.Show();
     }
 }
Example #5
0
 public static Form OpenShowForm(Control pControl, FormBorderStyle pFormBorderStyle, FormStartPosition pFormStartPosition)
 {
     var frm = new Form();
     frm.Width = pControl.Width;
     frm.Height = pControl.Height;
     frm.FormBorderStyle = pFormBorderStyle;
     frm.StartPosition = pFormStartPosition;
     frm.Controls.Add(pControl);
     frm.ShowDialog();
     return frm;
 }
        public RenderForm CreateWindow(int PWindowHeight, int PWindowLength, FormStartPosition PScreenPosition)
        {
            this._WindowHeight = PWindowHeight;
            this._WindowLength = PWindowLength;
            this._FormPosition = PScreenPosition;

            RenderWindowInstance = new RenderForm();
            RenderWindowInstance.ClientSize = new System.Drawing.Size(_WindowLength, _WindowHeight);
            RenderWindowInstance.StartPosition = FormStartPosition.CenterScreen;
            return RenderWindowInstance;
        }
Example #7
0
            /// <summary>
            /// Objeto Estático que muestra un pequeño diálogo para introducir datos
            /// </summary>
            /// <param name="title">Título del diálogo</param>
            /// <param name="prompt">Texto de información</param>
            /// <param name="posicion">Posición de inicio</param>
            /// <returns>Devuelve la escrito en la caja de texto como string</returns>
            public static string Show(string title, string prompt, FormStartPosition posicion)
            {

                f = new Form();
                f.Text = title;
                f.ShowIcon = false;
                f.Icon = null;
                f.KeyPreview=true;
                f.ShowInTaskbar = false;
                f.MaximizeBox = false;
                f.MinimizeBox = false;
                f.Width = 200;
                f.FormBorderStyle = FormBorderStyle.FixedDialog;
                f.Height = 120;
                f.StartPosition = posicion;
                f.KeyPress += new KeyPressEventHandler(f_KeyPress);
                
                l = new Label();
                l.AutoSize = true;
                l.Text = prompt;


                t = new TextBox();
                t.Width = 182;
                t.Top = 40;

                b1 = new Button();
                b1.Text = "Aceptar";
                b1.Click += new EventHandler(b1_Click);


                b2 = new Button();
                b2.Text = "Cancelar";
                b2.Click += new EventHandler(b2_Click);

                f.Controls.Add(l);
                f.Controls.Add(t);
                f.Controls.Add(b1);
                f.Controls.Add(b2);

                l.Top = 10;
                t.Left = 5;
                t.Top = 30;

                b1.Left = 5;
                b1.Top = 60;

                b2.Left = 112;
                b2.Top = 60;

                f.ShowDialog();
                return (Valor);
            }
Example #8
0
	// Constructor.
	public Form()
			{
				visible = false;
				autoScale = true;
				topLevel = true;
				loaded=false;
				borderStyle = FormBorderStyle.Sizable;
				mdiChildren = new Form [0];
				ownedForms = new Form [0];
				opacity = 1.0;
				windowFlags = ToolkitWindowFlags.Default;
				formStartPosition = FormStartPosition.WindowsDefaultLocation;
				windowState = FormWindowState.Normal;
			}
Example #9
0
 public static bool ShowComboDialog(string caption, List<object> items, out object selected, out string inputText, 
     FormStartPosition startPosition, bool listStyle)
 {
     selected = null;
     inputText = null;
     var ddd = new DropDownDialog(caption, items, listStyle) { StartPosition = startPosition };
     if (ddd.ShowDialog() == DialogResult.OK)
     {
         selected = ddd.SelectedItem;
         inputText = ddd.SelectedText;
         return true;
     }
     return false;
 }
Example #10
0
        public static DialogResult ShowDialog(this CommonDialog dialog, IWin32Window owner, FormStartPosition position)
        {
            if (owner == null)
                return dialog.ShowDialog();
            if (position != FormStartPosition.CenterParent && position != FormStartPosition.CenterScreen)
                return dialog.ShowDialog(owner);

            // TODO: implement
            //using (Form form = new Form())
            //{
            //    form.Owner = owner as Form;
            //    form.StartPosition = position;
            //    return dialog.ShowDialog(form);
            //}
            return dialog.ShowDialog(owner);
        }
        /// <summary>
        /// shows the form after initializing it's look and the time it will stay around..
        /// </summary>
        /// <param name="p_intSeconds"></param>
        /// <param name="p_strMessage"></param>
        public static void ShowForm(int p_intSeconds, string p_strHeaderMessage, string p_strMessage, string p_strLinkTitle, string p_strLinkRef, int intPosX, int intPosY,bool blnShowIcon,FormStartPosition p_enmStartPostion,bool blnInformationIcon )
        {
            FRMVanishingAlert frmAlert = new FRMVanishingAlert();
            frmAlert.lblHeader.Text = p_strHeaderMessage;
            frmAlert.lblMessage.Text = p_strMessage;
            frmAlert.lnkHelp.Text = p_strLinkTitle;
            frmAlert.m_linkRef = p_strLinkRef;
            frmAlert.Bounds = new Rectangle(intPosX, intPosY, 290, 140);
            frmAlert.pictureBox1.Visible = blnShowIcon;
            frmAlert.StartPosition = p_enmStartPostion;

            if (blnInformationIcon)
            {
                //frmAlert.pictureBox1.Image = Resources.THInformation.ToBitmap();
            }

            new Thread((ThreadStart)delegate {

                frmAlert.m_Timer.Interval = p_intSeconds * 1000;
                frmAlert.m_Timer.Tick += new EventHandler(frmAlert.t_Tick);
                frmAlert.m_Timer.Start();
                Application.Run(frmAlert);
            }).Start();
        }
 public static DialogResult Show(string text, string title, RemindMeBoxReason buttons, bool showDontRemindOption = false, FormStartPosition position = FormStartPosition.CenterParent)
 {
     newMessageBox = new MaterialRemindMeBox(text, title, buttons, showDontRemindOption);
     newMessageBox.StartPosition = position;
     MaterialSkin.MaterialSkinManager.Instance.AddFormToManage(newMessageBox);
     newMessageBox.ShowDialog();
     BLIO.Log("Closing RemindMeBox with result " + result);
     return(result);
 }
Example #13
0
        public void setStartPosition(FormStartPosition position)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new FormStartPositionDelegate(setStartPosition), new object[] { position });
                return;
            }

            this.StartPosition = position;
        }
Example #14
0
 /// <summary>Shows the specified owner.</summary>
 /// <param name="owner">The owner.</param>
 /// <param name="title">The title.</param>
 /// <param name="message">The message.</param>
 /// <param name="prompt">The prompt.</param>
 /// <param name="okText">The ok text.</param>
 /// <param name="cancelText">The cancel text.</param>
 /// <param name="passwordEnabled">if set to <c>true</c> [password enabled].</param>
 /// <param name="startPosition">The start position.</param>
 /// <returns></returns>
 public static string Show(IWin32Window owner, string title, string message, string prompt = "", string okText = "O&k", string cancelText = "&Cancel", bool passwordEnabled = false, FormStartPosition startPosition = FormStartPosition.WindowsDefaultLocation) => InternalShow(owner, title, message, prompt, okText, cancelText, passwordEnabled, startPosition);
Example #15
0
 private void InitializeComponent()
 {
     this.SuspendLayout();
     //
     // SvnUIForm
     //
     this.ClientSize = new System.Drawing.Size(284, 264);
     this.MaximizeBox = false;
     this.MinimizeBox = false;
     this.Name = "SvnUIForm";
     this.ShowIcon = false;
     this.ShowInTaskbar = false;
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.ResumeLayout(false);
 }
Example #16
0
 private void SetStartPosition(FormStartPosition startPosition) => StartPosition = startPosition;
 /// <summary>
 /// Shows the UI information.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="startpos">The startpos.</param>
 public static void ShowUIInformation(this string message, FormStartPosition startpos = FormStartPosition.CenterParent)
 {
     using (AdvancedMessageBox advBox = new AdvancedMessageBox(message, ReportStatus.Information))
     {
         advBox.StartPosition = startpos;
         advBox.TopMost = true;
         advBox.ShowDialog();
     }
 }
Example #18
0
 public static void SetFormStartPosition(UIElement element, FormStartPosition value)
 {
     element.SetValue(FormStartPositionProperty, value);
 }
Example #19
0
 private Point PointToScreen(FormStartPosition StartPosition)
 {
     throw new NotImplementedException();
 }
Example #20
0
 public DialogResult AddDialog(Form form, FormStartPosition position)
 {
     return(form.ShowDialog(this));
 }
Example #21
0
 public FrmMessageRead ShowMessageRead(string receiverId, IWin32Window owner, FormStartPosition formStartPosition)
 {
     FrmMessageRead frmMessageRead = null;
     if (!this.ReceiveUserList.Contains(receiverId))
     {
         this.ReceiveUserList.Add(receiverId);
         frmMessageRead = new FrmMessageRead(receiverId);
         frmMessageRead.FrmMessageOwner = this;
         frmMessageRead.Owner = this;
         frmMessageRead.StartPosition = formStartPosition;
         // Pcsky 2012.05.02 未使用的功能,禁用
         // this.OnReceiveMessage += frmMessageRead.OnReceiveMessage;
         frmMessageRead.Show();
     }
     else
     {
         for (int i = 0; i < this.OwnedForms.Length; i++)
         {
             if (this.OwnedForms[i] is FrmMessageRead)
             {
                 if (((FrmMessageRead)this.OwnedForms[i]).ReceiverId.Equals(receiverId))
                 {
                     frmMessageRead = (FrmMessageRead)this.OwnedForms[i];
                     frmMessageRead.FrmMessageOwner = this;
                     frmMessageRead.Activate();
                 }
             }
         }
     }
     return frmMessageRead;
 }
Example #22
0
 public ProgressBarForm(Color meow, FormStartPosition startscreen)
 {
     StartPosition = startscreen;
     BackColor     = meow;
     InitializeComponent();
 }
Example #23
0
 public static DialogResult Show(IWin32Window owner, string text, string title = null, string caption = null, FormStartPosition startPosition = FormStartPosition.WindowsDefaultLocation)
 {
     using (CustomMessageBox customMessageBox = new CustomMessageBox(text, title, caption, MessageBoxIcon.None, MessageBoxButtons.OK, MessageBoxDefaultButton.Button1)
     {
         StartPosition = startPosition
     })
         return(customMessageBox.ShowDialog(owner));
 }
Example #24
0
 public abstract bool InvokeConfigureDataSource(IWin32Window parentWindow, FormStartPosition startPosition, DataSourceDescriptor dataSourceDescriptor);
Example #25
0
 public static CustomButtonResult Show(IWin32Window owner, string text, string title, string caption, Bitmap icon, CustomMessageBoxButton[] buttons, int defaultButtonNo = 0, FormStartPosition startPosition = FormStartPosition.WindowsDefaultLocation)
 {
     using (CustomMessageBox customMessageBox = new CustomMessageBox(text, title, caption, icon, buttons, defaultButtonNo)
     {
         StartPosition = startPosition
     })
     {
         customMessageBox.ShowDialog(owner);
         return(customMessageBox.CustomResult);
     }
 }
 public InitData(FolderBrowserDialogEx dlg, IntPtr hParent)
 {
     // We need to make copies of these values from the dialog.
     // I tried passing the dlg obj itself in this struct, but Windows will barf after repeated invocations.
     this.Title = dlg.Title;
     this.InitialPath = dlg.SelectedPath;
     this.ShowNewFolderButton = dlg.ShowNewFolderButton;
     this.ShowEditbox = dlg.ShowEditbox;
     this.StartPosition = dlg.StartPosition;
     this.hParent = hParent;
 }
Example #27
0
 public FormPosition(int x, int y)
 {
     this.x        = x;
     this.y        = y;
     StartPosition = FormStartPosition.WindowsDefaultLocation;
 }
 public abstract DataSourceGroup InvokeAddNewDataSource(IWin32Window parentWindow, FormStartPosition startPosition);
Example #29
0
 public uiWndAdmin(FormStartPosition startPos)
     : this()
 {
     this.StartPosition = startPos;
 }
 public abstract bool InvokeConfigureDataSource(IWin32Window parentWindow, FormStartPosition startPosition, DataSourceDescriptor dataSourceDescriptor);
Example #31
0
 /// <summary>
 /// Метод загрузки формы.
 /// </summary>
 /// <param name="form">Загрущаемая форма.</param>
 /// <param name="formStartPosition">Положение формы после загрузки.</param>
 private DialogResult ShowNewForm(Form form, FormStartPosition formStartPosition)
 {
     form.StartPosition = formStartPosition;
     form.ShowDialog(this);
     return(form.DialogResult);
 }
        public static DialogResult ShowDialog(this CommonDialog dialog, IWin32Window owner, FormStartPosition position)
        {
            if (owner == null)
            {
                return(dialog.ShowDialog());
            }
            if (position != FormStartPosition.CenterParent && position != FormStartPosition.CenterScreen)
            {
                return(dialog.ShowDialog(owner));
            }

            // TODO: implement
            //using (Form form = new Form())
            //{
            //    form.Owner = owner as Form;
            //    form.StartPosition = position;
            //    return dialog.ShowDialog(form);
            //}
            return(dialog.ShowDialog(owner));
        }
Example #33
0
        private static string InternalShow(IWin32Window owner, string title, string message, string prompt = "", string okText = "O&k", string cancelText = "&Cancel", bool passwordEnabled = false, FormStartPosition startPosition = FormStartPosition.WindowsDefaultLocation)
        {
            IWin32Window showOwner = owner ?? FromHandle(PI.GetActiveWindow());

            using (KryptonInputBox kib = new KryptonInputBox(title, message, prompt, okText, cancelText, passwordEnabled, startPosition))
            {
                kib.StartPosition = showOwner == null ? startPosition : startPosition;

                return(kib.ShowDialog(showOwner) == DialogResult.OK ? kib.GetUserResponse() : string.Empty);
            }
        }
        static void Main(string[] args)
        {
            string szDir = Environment.CurrentDirectory; // get current directory

            // try to find processs directory where they are cef ressource
            var szProcess = Process.GetCurrentProcess();
            // get the directory name of the process fullpath filename
            string szProcessusFullPath = Path.GetDirectoryName(szProcess.MainModule.FileName);

            // check if libcef.dll are in this directory
            if (File.Exists(szProcessusFullPath + "\\libcef.dll"))
            {
                szDir = szProcessusFullPath;
                Directory.SetCurrentDirectory(szDir);
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);


            CefSettings settings = new CefSettings()
            {
                //By default CefSharp will use an in-memory cache, you need to     specify a Cache Folder to persist data
                CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache"),
                // configure ressource path with screensave process directory path
                ResourcesDirPath = szDir,
                // configure browsersubprocess path based on screensaver directory
                BrowserSubprocessPath = szDir + "\\CefSharp.BrowserSubprocess.exe",
                // configure locales path based on screensaver directory
                LocalesDirPath = szDir + "\\Locales\\",
            };

            //Perform dependency check to make sure all relevant resources are in our output directory.
            Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);

            if (args.Length > 0 && args[0].ToLower().Contains("/p"))
            {
                return;
            }

            if (args.Length > 0 && args[0].ToLower().Contains("/c"))
            {
                Application.Run(new PreferencesForm());
            }
            else
            {
                var formsList = new List <Form>();
                var screens   = (new PreferencesManager()).EffectiveScreensList;
                foreach (var screen in screens)
                {
                    var screensaverForm = new ScreensaverForm(screen.ScreenNum)
                    {
                        Location = new Point(screen.Bounds.Left, screen.Bounds.Top),
                        Size     = new Size(screen.Bounds.Width, screen.Bounds.Height)
                    };

                    FormStartPosition x = screensaverForm.StartPosition;

                    formsList.Add(screensaverForm);
                }

                Application.Run(new MultiFormContext(formsList));
            }

            Cef.Shutdown();
        }
Example #35
0
        void Login(FormStartPosition p)
        {
            Util.XmppServices.XmppCon = new XmppClientConnection();
            CreateEvents();
            using (frmAuthenticate frm = new frmAuthenticate(rosterControl))
            {
                frm.OnLog += new OnLogHandler(frm_OnLog);
                frm.StartPosition = p;
                if (frm.ShowDialog() == DialogResult.OK)
                {
                 
                    btnLogIn.Enabled = false;
                    btnLogOut.Enabled = true;
                    btnRegister.Enabled = false;

                }
                else
                {
                    btnLogOut.Enabled = false;
                    btnLogIn.Enabled = true;
                    btnRegister.Enabled = true;
                }

            }
        }
Example #36
0
        private void LoadFile(StreamReader sr)
        {
            Data_Games game;

            string[] tmp;
            int      tmpenum;
            float    tmpfl;

            //Form style
            //Text
            title = sr.ReadLine();
            //Bounds
            tmp = sr.ReadLine().Split(CHR_DELIM);
            int.TryParse(tmp[0], out x);
            int.TryParse(tmp[1], out y);
            int.TryParse(tmp[2], out width);
            int.TryParse(tmp[3], out height);
            //Background
            tmp = sr.ReadLine().Split(CHR_DELIM);
            bool.TryParse(tmp[0], out background);
            backg_col = HexToColor(tmp[1]);
            bool.TryParse(tmp[2], out background_img);
            backg_img = tmp[3];
            //Transparency
            tmp = sr.ReadLine().Split(CHR_DELIM);
            if (!int.TryParse(tmp[0], out opacity))
            {
                opacity = 100;
            }
            bool.TryParse(tmp[1], out transkey);
            trank_col = HexToColor(tmp[2]);
            //Start pos, border style, bacground image layout
            tmp = sr.ReadLine().Split(CHR_DELIM);
            if (int.TryParse(tmp[0], out tmpenum))
            {
                startpos = (FormStartPosition)tmpenum;
            }
            if (int.TryParse(tmp[1], out tmpenum))
            {
                border = (FormBorderStyle)tmpenum;
            }
            if (int.TryParse(tmp[2], out tmpenum))
            {
                backg_lay = (ImageLayout)tmpenum;
            }
            //Game style
            //Alignment
            tmp = sr.ReadLine().Split(CHR_DELIM);
            if (int.TryParse(tmp[0], out tmpenum))
            {
                gm_text_align = (ContentAlignment)tmpenum;
            }
            if (int.TryParse(tmp[1], out tmpenum))
            {
                gm_img_align = (ContentAlignment)tmpenum;
            }
            //Bounds, margin
            tmp = sr.ReadLine().Split(CHR_DELIM);
            int.TryParse(tmp[0], out gm_x);
            int.TryParse(tmp[1], out gm_y);
            int.TryParse(tmp[2], out gm_width);
            int.TryParse(tmp[3], out gm_height);
            int.TryParse(tmp[4], out gm_right);
            int.TryParse(tmp[5], out gm_bottom);
            //Column or row, how many elements
            bool.TryParse(tmp[6], out gm_gen_mode);
            if (!int.TryParse(tmp[7], out gm_gen_elem))
            {
                gm_gen_elem = 1;
            }
            //Icon size, close on launch
            tmp = sr.ReadLine().Split(CHR_DELIM);
            int.TryParse(tmp[0], out gm_ic_w);
            int.TryParse(tmp[1], out gm_ic_h);
            bool.TryParse(tmp[2], out gm_close);
            int.TryParse(tmp[3], out gm_snd_wait);
            //Font
            tmp = sr.ReadLine().Split(CHR_DELIM);
            if (!float.TryParse(tmp[1], out tmpfl))
            {
                tmpfl = 10;
            }
            if (!int.TryParse(tmp[2], out tmpenum))
            {
                tmpenum = 0;
            }
            gm_font = new Font(tmp[0], tmpfl, (FontStyle)tmpenum);
            //Text
            tmp          = sr.ReadLine().Split(CHR_DELIM);
            gm_foreg_col = Data_Form.HexToColor(tmp[0]);
            bool.TryParse(tmp[1], out gm_foreg_dyn);
            bool.TryParse(tmp[2], out gm_foreg_h);
            gm_foreg_col_h = Data_Form.HexToColor(tmp[3]);
            bool.TryParse(tmp[4], out gm_foreg_c);
            gm_foreg_col_c = Data_Form.HexToColor(tmp[5]);
            //Background
            tmp = sr.ReadLine().Split(CHR_DELIM);
            bool.TryParse(tmp[0], out gm_backg);
            gm_backg_col = Data_Form.HexToColor(tmp[1]);
            bool.TryParse(tmp[2], out gm_backg_dyn);
            bool.TryParse(tmp[3], out gm_backg_h);
            gm_backg_col_h = Data_Form.HexToColor(tmp[4]);
            bool.TryParse(tmp[5], out gm_backg_c);
            gm_backg_col_c = Data_Form.HexToColor(tmp[6]);
            //Border
            tmp = sr.ReadLine().Split(CHR_DELIM);
            bool.TryParse(tmp[0], out gm_border);
            gm_border_col = Data_Form.HexToColor(tmp[1]);
            bool.TryParse(tmp[2], out gm_border_dyn);
            bool.TryParse(tmp[3], out gm_border_h);
            gm_border_col_h = Data_Form.HexToColor(tmp[4]);
            bool.TryParse(tmp[5], out gm_border_c);
            gm_border_col_c = Data_Form.HexToColor(tmp[6]);
            //Sounds
            tmp = sr.ReadLine().Split(CHR_DELIM);
            bool.TryParse(tmp[0], out gm_snd_hover);
            gm_snd_h = tmp[1];
            tmp      = sr.ReadLine().Split(CHR_DELIM);
            bool.TryParse(tmp[0], out gm_snd_click);
            gm_snd_c = tmp[1];
            //Game list
            game_list.Clear();
            while (sr.Peek() > -1)
            {
                game = new Data_Games();
                sr.ReadLine();
                game.name        = sr.ReadLine();
                game.target      = sr.ReadLine();
                game.launch_pars = sr.ReadLine();
                game.icon        = sr.ReadLine();
                game.work_dir    = sr.ReadLine();
                game_list.Add(game);
            }
        }
Example #37
0
	// Token: 0x0600039E RID: 926 RVA: 0x0000366A File Offset: 0x0000186A
	static void smethod_9(Form form_0, FormStartPosition formStartPosition_0)
	{
		form_0.StartPosition = formStartPosition_0;
	}
    /// <summary>
    /// 建立窗体
    /// </summary>
    /// <param name="_panelScrollObj">窗体内设置带滚动条panel</param>
    /// <param name="_formName">窗体名称</param>
    /// <param name="_startPosition">初次打开位置</param>
    /// <param name="_formSize">大小</param>
    /// <param name="_formPoint">位置</param>
    /// <param name="_formBackColor">背景色</param>
    /// <param name="_formOpenMode">打开方式</param>
    /// <param name="_formTop">置顶</param>
    /// <param name="_fromCloseed">关闭事件</param>
    public void Create_Form(
        PanelEx _panelScrollObj,
        string _formName,
        FormStartPosition _startPosition,
        Size _formSize,
        Point _formPoint,
        Color _formBackColor,
        int _formOpenMode,
        bool _formTop,
        FormClosedEventHandler _fromClosed,
        EventHandler _formResize
        )
    {
        panelScroll                 = _panelScrollObj;
        _formObject.Name            = _formName;
        _formObject.FormBorderStyle = FormBorderStyle.None;
        _formObject.StartPosition   = _startPosition;
        _formObject.Size            = _formSize;
        _formObject.Location        = _formPoint;
        _formObject.BackColor       = _formBackColor;
        _formObject.Resize         += _formResize;
        _formObject.TopMost         = _formTop;

        panel_Title.Dock                  = DockStyle.Top;
        panel_Title.Height                = 60;
        panel_Title.BackgroundImage       = EzRBuild.EzResource.background;
        panel_Title.Cursor                = Cursors.Default;
        panel_Title.BackgroundImageLayout = ImageLayout.Stretch;
        panel_Title.MouseDown            += formMove;
        _formObject.Controls.Add(panel_Title);

        PanelEx panel_formContro = new PanelEx()
        {
            Dock      = DockStyle.Right,
            Width     = 100,
            BackColor = Color.Transparent
        };

        panel_formContro.MouseDown += formMove;
        panel_Title.Controls.Add(panel_formContro);

        for (int i = 0; i < 3; i++)
        {
            picture_formControl[i] = new PictureBoxEx()
            {
                Size      = new Size(25, 25),
                Location  = new Point(i * 35, 4),
                Image     = Icon_formControl[i],
                Cursor    = Cursors.Hand,
                BackColor = Color.Transparent,
                Tag       = i
            };
            picture_formControl[i].MouseEnter += new EventHandler(formControl_MouseEnter);
            picture_formControl[i].MouseLeave += new EventHandler(formControl_MouseLeave);
            picture_formControl[i].Click      += new EventHandler(formControl_Click);
            toolTip.SetToolTip(picture_formControl[i], tips_formControl[i]);
            panel_formContro.Controls.Add(picture_formControl[i]);
        }
        _formObject.FormClosed += _fromClosed;
        if (_formOpenMode == 0)
        {
            _formObject.Show();
        }
        else
        {
            _formObject.ShowDialog();
        }
    }
Example #39
0
 public static DialogResult Show(string text, string title, string caption, Bitmap icon, FormStartPosition startPosition = FormStartPosition.WindowsDefaultLocation)
 {
     using (CustomMessageBox customMessageBox = new CustomMessageBox(text, title, caption, icon, MessageBoxButtons.OK, MessageBoxDefaultButton.Button1)
     {
         StartPosition = startPosition
     })
         return(customMessageBox.ShowDialog());
 }
Example #40
0
 public SimpleGraphForm(Color meow, FormStartPosition startscreen)
 {
     StartPosition = startscreen;
     BackColor     = meow;
     InitializeComponent();
 }
Example #41
0
 public static DialogResult Show(IWin32Window owner, string text, string title, string caption, Bitmap icon, MessageBoxButtons buttons, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Button1, FormStartPosition startPosition = FormStartPosition.WindowsDefaultLocation)
 {
     using (CustomMessageBox customMessageBox = new CustomMessageBox(text, title, caption, icon, buttons, defaultButton)
     {
         StartPosition = startPosition
     })
         return(customMessageBox.ShowDialog(owner));
 }
Example #42
0
        private void CreateInternalPlayerWindow(FormStartPosition? startPosition)
        {
            int? formWidth = null;
            int? formHeight = null;
            int? formLeft = null;
            int? formTop = null;

            try
            {
                formWidth = Convert.ToInt32(_mainWindow.Width);
                formHeight = Convert.ToInt32(_mainWindow.Height);
            }
            catch (OverflowException)
            {
                formWidth = null;
                formHeight = null;
            }
            try
            {
                formTop = Convert.ToInt32(_mainWindow.Top);
                formLeft = Convert.ToInt32(_mainWindow.Left);
            }
            catch (OverflowException)
            {
                formLeft = null;
                formTop = null;
            }

            var state = GetWindowsFormState(_mainWindow.WindowState);

            var internalPlayerWindowThread = new Thread(() => ShowHiddenWindow(formWidth, formHeight, formTop, formLeft, startPosition, state));
            internalPlayerWindowThread.Name = "Internal Player Window";
            internalPlayerWindowThread.SetApartmentState(ApartmentState.STA);
            internalPlayerWindowThread.IsBackground = true;
            internalPlayerWindowThread.Start();
        }
Example #43
0
 /// <summary>
 /// Sets FormStartPosition of form
 /// </summary>
 /// <param name="startPosition"></param>
 /// <returns></returns>
 public DialogContextConfigureOptionsBuilder <TContext> HasStartPosition(FormStartPosition startPosition)
 {
     Base.Data.StartPosition = startPosition;
     return(this);
 }
Example #44
0
		public Form ()
		{
			SizeF current_scale = GetAutoScaleSize (Font);

			autoscale = true;
			autoscale_base_size = new Size ((int)Math.Round (current_scale.Width), (int)Math.Round(current_scale.Height));
			allow_transparency = false;
			closing = false;
			is_modal = false;
			dialog_result = DialogResult.None;
			start_position = FormStartPosition.WindowsDefaultLocation;
			form_border_style = FormBorderStyle.Sizable;
			window_state = FormWindowState.Normal;
			key_preview = false;
			opacity = 1D;
			menu = null;
			icon = default_icon;
			minimum_size = Size.Empty;
			maximum_size = Size.Empty;
			clientsize_set = Size.Empty;
			control_box = true;
			minimize_box = true;
			maximize_box = true;
			help_button = false;
			show_in_taskbar = true;
			is_visible = false;
			is_toplevel = true;
			size_grip_style = SizeGripStyle.Auto;
			maximized_bounds = Rectangle.Empty;
			default_maximized_bounds = Rectangle.Empty;
			owned_forms = new Form.ControlCollection(this);
			transparency_key = Color.Empty;
			CreateDockPadding ();
			InternalClientSize = new Size (this.Width - (SystemInformation.FrameBorderSize.Width * 2), this.Height - (SystemInformation.FrameBorderSize.Height * 2) - SystemInformation.CaptionHeight);
			restore_bounds = Bounds;
		}
Example #45
0
 public static CustomButtonResult Show(IWin32Window owner, string caption, string title, ref string textValue, CustomMessageBoxButton[] buttons = null, int defaultButtonNo = 0, FormStartPosition startPosition = FormStartPosition.WindowsDefaultLocation)
 {
     using (InputTextBox inputTextBox = new InputTextBox(textValue, title, caption, buttons, defaultButtonNo)
     {
         StartPosition = startPosition
     })
     {
         inputTextBox.ShowDialog(owner);
         textValue = inputTextBox.TextValue;
         return(inputTextBox.CustomResult);
     }
 }
 public bool ShowComboDialog(string caption, List<object> items, out object selected, out string inputText,
                             FormStartPosition startPosition, bool listStyle)
 {
     return Dialogs.ShowComboDialog(caption, items, out selected, out inputText,
                                    startPosition, listStyle);
 }
Example #47
0
        /// <summary>Initializes a new instance of the <see cref="KryptonInputBox"/> class.</summary>
        /// <param name="title">The title.</param>
        /// <param name="message">The message.</param>
        /// <param name="prompt">The prompt.</param>
        /// <param name="okText">The ok text.</param>
        /// <param name="cancelText">The cancel text.</param>
        /// <param name="passwordEnabled">if set to <c>true</c> [password enabled].</param>
        /// <param name="startPosition">The start position.</param>
        public KryptonInputBoxNew(string title, string message, string prompt = "", string okText = "O&k", string cancelText = "&Cancel", bool passwordEnabled = false, FormStartPosition startPosition = FormStartPosition.Manual)
        {
            InitializeComponent();

            SetMessage(message);

            SetPrompt(prompt);

            SetOkText(okText);

            SetCancelText(cancelText);

            SetPasswordEnabled(passwordEnabled);

            SetTitle(title);

            SetStartPosition(startPosition);
        }
Example #48
0
 /// <summary>Initializes a new instance of the <see cref="VisualForm" /> class.</summary>
 /// <param name="text">The text associated with this control.</param>
 /// <param name="startPosition">The form start position.</param>
 public VisualForm(string text, FormStartPosition startPosition = FormStartPosition.WindowsDefaultLocation) : this()
 {
     InitializeText(text);
     StartPosition = startPosition;
 }
 public abstract DataSourceGroup InvokeAddNewDataSource(IWin32Window parentWindow, FormStartPosition startPosition);
Example #50
0
        private void PlaceAtStartPosition(FormStartPosition formStartPosition)
        {
            var workingArea = Screen.PrimaryScreen.WorkingArea;

            switch (formStartPosition)
            {
            case FormStartPosition.CenterParent:
            {
                if (owner != null)
                {
                    var ex = owner.Location.X + (owner.Width - Width) / 2;
                    var ey = owner.Location.Y + (owner.Height - Height) / 2;

                    Location = new Point(ex, ey);
                }
                else
                {
                    // Use default position.
                    PlaceAtStartPosition(FormStartPosition.WindowsDefaultLocation);
                }
            }
            break;

            case FormStartPosition.CenterScreen:
            {
                var ex = (workingArea.Width - Width) / 2;
                var ey = (workingArea.Height - Height) / 2;

                Location = new Point(ex, ey);
            }
            break;

#pragma warning disable 618
            case FormStartPosition.WindowsDefaultBounds:     // TODO: Need size calculation algorithm.
#pragma warning restore 618
            case FormStartPosition.WindowsDefaultLocation:
            {
                var ex = nextLocation.X;
                var ey = nextLocation.Y;

                if (ex + Width > workingArea.Width)
                {
                    ex = workingArea.Width - Width;
                }
                if (ey + Height > workingArea.Height)
                {
                    ey = workingArea.Height - Height;
                }

                Location = new Point(ex, ey);

                nextLocation = new Point(nextLocation.X + 26, nextLocation.Y + 26);
                if (nextLocation.X >= 260)
                {
                    nextLocation = new Point(26, nextLocation.Y);
                }
                if (nextLocation.Y >= 260)
                {
                    nextLocation = new Point(nextLocation.X, 26);
                }
            }
            break;
            }
        }
Example #51
0
 public FormCapNhatNhanVien(string st)
 {
     InitializeComponent();
     MaNV = st;
     FormStartPosition = FormStartPosition.CenterScreen;
 }
Example #52
0
        /// <summary>Запуск диалогового окна</summary>
        private void Start(FormStartPosition pos)
        {
            FW_Form = new Form_Working();
            FW_Form.param_Operation_Text = Text;
            FW_Form.val_max = val_max;
            FW_Form.val_min = val_cur;
            FW_Form.StartPosition = pos;

            if (FW_Thread != null && FW_Thread.ThreadState != System.Threading.ThreadState.Aborted)
                FW_Thread.Abort();
            FW_Thread = new Thread(new ThreadStart(FW_ShowDialog));
            FW_Thread.Start();
        }
Example #53
0
        private void ShowHiddenWindow(int? width, int? height, int? top, int? left, FormStartPosition? startPosition, FormWindowState windowState)
        {
            var playerWindow = new InternalPlayerWindow();
            playerWindow.Load += HiddenWindow_Load;
            playerWindow.Activated += HiddenWindow_Activated;

            if (width.HasValue) {
                playerWindow.Width = width.Value;
            }
            if (height.HasValue) {
                playerWindow.Height = height.Value;
            }
            if (top.HasValue) {
                playerWindow.Top = top.Value;
            }
            if (left.HasValue) {
                playerWindow.Left = left.Value;
            }

            playerWindow.WindowState = windowState;

            if (startPosition.HasValue) {
                playerWindow.StartPosition = startPosition.Value;
            }

            _mainWindow.LocationChanged += (s, e) => MovePlayerWindow(playerWindow);
            _mainWindow.StateChanged += (s, e) => UpdatePlayerWindowState(playerWindow);
            _mainWindow.SizeChanged += (s, e) => UpdatePlayerWindowSize(playerWindow);
            _mainWindow.Closing += (s, e) => ClosePlayerWindow(playerWindow);

            _internalPlayerWindowManager.Window = playerWindow;

            playerWindow.Show();

            System.Windows.Threading.Dispatcher.Run();
        }
Example #54
0
        public KryptonFileBrowser(bool useKryptonControls = false, bool usePromptBox = false, FormStartPosition startPosition = FormStartPosition.CenterScreen)
        {
            InitializeComponent();

            StartPosition = startPosition;

            PopulateFileSystem();

            UseKryptonControls(useKryptonControls);

            UsePromptBox(usePromptBox);
        }
Example #55
0
        // 初期設定ファイルの読み込み
        public bool loadSettingFile(String path)
        {
            XmlDocument doc = new XmlDocument();

            try
            {
                doc.Load(path);
            }
            catch (Exception e)
            {
                MessageBox.Show("初期設定ファイルを読み込めませんでした.");
                return(false);
            }

            // formatType&Version
            string fileType    = getInnerText("fileFormatType", doc.SelectNodes("/document/head/fileFormatType"));
            string fileVersion = getInnerText("fileFormatVersion", doc.SelectNodes("/document/head/fileFormatVersion"));

            if (fileType != "AEIOU Preference Format")
            {
                return(false);
            }
            if (fileVersion != "1.0")
            {
                return(false);
            }

            // window pos, size, stayOnTop, autoAdjust
            XmlNodeList windowPos        = doc.SelectNodes("/document/pref/window/position");
            XmlNodeList windowSize       = doc.SelectNodes("/document/pref/window/size");
            string      windowStayOnTop  = getInnerText("stayOnTop", doc.SelectNodes("/document/pref/window/stayOnTop"));
            string      windowAutoadjust = getInnerText("autoAdjust", doc.SelectNodes("/document/pref/window/autoAdjust"));

            int x, y, w, h;

            try
            {
                x = int.Parse(windowPos[0].Attributes["x"].Value);
                y = int.Parse(windowPos[0].Attributes["y"].Value);
                w = int.Parse(windowSize[0].Attributes["w"].Value);
                h = int.Parse(windowSize[0].Attributes["h"].Value);
                // ウィンドウ位置の初期設定
                this.StartPosition = FormStartPosition.Manual;
                this.Location      = new Point(x, y);
                this.Size          = new Size(w, h);
            }
            catch (Exception e)
            {
                MessageBox.Show("windows position,size に指定される文字列を数値に変換できませんでした.");
                // 初期設定ファイルがない場合のウィンドウ位置の初期設定
                this.StartPosition = FormStartPosition.Manual;
                this.Location      = new Point(0, 0);
            }
            if (windowStayOnTop == "1")
            {
                this.TopMost = true;
            }
            else
            {
                this.TopMost = false;
            }
            if (windowAutoadjust == "1")
            {
                IsAutoadjust = true;
            }
            else
            {
                IsAutoadjust = false;
            }

            // setting: fps, sheetSec, firstFrame, sheetDivide
            string fps      = getInnerText("fps", doc.SelectNodes("/document/pref/setting/fps"));
            string sheetSec = getInnerText("sheetSec", doc.SelectNodes("/document/pref/setting/sheetSec"));
            string firstFrm = getInnerText("firstFrame", doc.SelectNodes("/document/pref/setting/firstFrame"));
            string sheetDiv = getInnerText("sheetDivide", doc.SelectNodes("/document/pref/setting/sheetDivide"));

            try
            {
                Fps = int.Parse(fps);
            }
            catch (Exception e)
            {
                MessageBox.Show("fps に指定される文字列を数値に変換できませんでした.");
            }
            try
            {
                SheetSec = int.Parse(sheetSec);
            }
            catch (Exception e)
            {
                MessageBox.Show("sheetSec に指定される文字列を数値に変換できませんでした.");
            }
            try
            {
                FirstFrame = int.Parse(firstFrm);
            }
            catch (Exception e)
            {
                MessageBox.Show("firstFrame に指定される文字列を数値に変換できませんでした.");
            }
            try
            {
                SheetDivide = int.Parse(sheetDiv);
            }
            catch (Exception e)
            {
                MessageBox.Show("sheetDivide に指定される文字列を数値に変換できませんでした.");
            }

            // setting: colLength, rowLength, cellCountLimit
            string colLen    = getInnerText("colLength", doc.SelectNodes("/document/pref/setting/colLength"));
            string rowLen    = getInnerText("rowLength", doc.SelectNodes("/document/pref/setting/rowLength"));
            string cellLimit = getInnerText("cellCountLimit", doc.SelectNodes("/document/pref/setting/cellCountLimit"));

            try
            {
                ColLength = int.Parse(colLen);
            }
            catch (Exception e)
            {
                MessageBox.Show("colLength に指定される文字列を数値に変換できませんでした.");
            }
            try
            {
                RowLength = int.Parse(rowLen);
            }
            catch (Exception e)
            {
                MessageBox.Show("rowLength に指定される文字列を数値に変換できませんでした.");
            }
            try
            {
                CellCountLimit = int.Parse(cellLimit);
            }
            catch (Exception e)
            {
                MessageBox.Show("cellCountLimit に指定される文字列を数値に変換できませんでした.");
            }

            // setting: karaCell(value, noMove)
            string karaValue = getInnerText("value", doc.SelectNodes("/document/pref/setting/karaCell/value"));
            string karaMove  = getInnerText("noMove", doc.SelectNodes("/document/pref/setting/karaCell/noMove"));

            KaraCell = karaValue;
            if (karaMove == "1")
            {
                IsKaraNoMove = true;
            }
            else
            {
                IsKaraNoMove = false;
            }

            // setting: undoLimit, IsDisplayFrameNumber
            string undoLimit            = getInnerText("undoLimit", doc.SelectNodes("/document/pref/setting/undoLimit"));
            string isDisplayFrameNumber = getInnerText("isDisplayFrameNum", doc.SelectNodes("/document/pref/setting/isDisplayFrameNum"));

            try
            {
                UndoLimitCount = int.Parse(undoLimit);
            }
            catch (Exception e)
            {
                MessageBox.Show("undoLimit に指定される文字列を数値に変換できませんでした.");
            }
            if (isDisplayFrameNumber == "1")
            {
                IsDisplayFrameNumber = true;
            }
            else
            {
                IsDisplayFrameNumber = false;
            }

            // setting: AfterFX(path, option, outputMode)
            string Path   = getInnerText("path", doc.SelectNodes("/document/pref/setting/afterFX/path"));
            string Option = getInnerText("option", doc.SelectNodes("/document/pref/setting/afterFX/option"));
            string Mode   = getInnerText("outputMode", doc.SelectNodes("/document/pref/setting/afterFX/outputMode"));

            AfterPath   = Path;
            AfterOption = Option;
            try
            {
                switch (Mode)
                {
                case "None":
                    AfterOutputMode = RemapOutputMode.None;
                    break;

                case "AERemap":
                    AfterOutputMode = RemapOutputMode.AERemap;
                    break;

                case "DirectRemap":
                    AfterOutputMode = RemapOutputMode.DirectRemap;
                    break;

                case "JSDirectRemap":
                    AfterOutputMode = RemapOutputMode.JSDirectRemap;
                    break;

                case "JSRemap":
                    AfterOutputMode = RemapOutputMode.JSRemap;
                    break;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("afterFX/outputMode に指定される文字列を数値に変換できませんでした.");
            }

            // setting: IsAlwaysAppend
            string isAlwaysAppend = getInnerText("isAlwaysAppend", doc.SelectNodes("/document/pref/setting/isAlwaysAppend"));

            if (isAlwaysAppend == "1")
            {
                IsAlwaysAppend = true;
            }
            else
            {
                IsAlwaysAppend = false;
            }


            //ショートカットキー定義の読み込み
            keys.loadShortcutsSetting(doc);

            //キーバインド定義の読み込み
            keys.loadKeybindsSetting(doc);

            return(true);
        }
Example #56
0
        IniFile MyIni = new IniFile("Settings.ini"); //creates / loads the settings file
        public Path(int currGame, FormStartPosition pos)
        {
            this.StartPosition = pos;
            intGame = currGame;
            Boolean worked = false;
            if (MyIni.KeyExists("Path" + intGame)) //Path contains the pathes of the GTA folders.
            {
                var GamePath = MyIni.Read("Path" + intGame);
                if (Directory.Exists(GamePath))
                {
                    if (Directory.GetFiles(GamePath, gameEXE(intGame), SearchOption.TopDirectoryOnly).Count() > 0 || Directory.GetFiles(GamePath, "gta-sa.exe", SearchOption.TopDirectoryOnly).Count() == 1)
                    {
                        worked = true;
                        Explorer explorerForm = new Explorer(intGame, GamePath);
                        explorerForm.Closed += (s, args) => Application.Exit();
                        explorerForm.Show(); //Opens the explorer form, if the path was found and exists. Parameters: int of the current game and path of the current game.
                    }
                }
            }
            if (!(worked))
            {
                this.Show();
            }
            //Following lines search in the registry for game pathes
            InitializeComponent();
            label1.Text = label1.Text + " " + gameString(currGame) + OpenRW.Resources._internal.ResourceManager.GetString("lblATR") + "!";
            RegistryKey rk = Registry.LocalMachine;
            RegistryKey sk1 = rk.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 12100"); // III Steam
            RegistryKey sk2 = rk.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 12110"); // Vice City Steam
            RegistryKey sk3 = rk.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 12120"); // San Andreas Steam

            if (intGame == 0)
            {
                if (sk1 != null)
                {
                    if (sk1.GetValueNames().Contains("InstallLocation") && sk1.GetValue("InstallLocation").ToString() != "")
                    {
                        textBox1.Text = sk1.GetValue("InstallLocation").ToString();
                    }
                }
            }
            else if (intGame == 1)
            {
                if (sk2 != null)
                {
                    if (sk2.GetValueNames().Contains("InstallLocation") && sk2.GetValue("InstallLocation").ToString() != "")
                    {
                        textBox1.Text = sk2.GetValue("InstallLocation").ToString();
                    }
                }
            }
            else if (intGame == 2)
            {
                if (sk3 != null)
                {
                    if (sk3.GetValueNames().Contains("InstallLocation") && sk3.GetValue("InstallLocation").ToString() != "")
                    {
                        textBox1.Text = sk3.GetValue("InstallLocation").ToString();
                    }
                }
            }




        }