Example #1
0
        public bool PreFilterMessage(ref Message m)
        {
            Control sourceControl;

            // WM_CONTEXTMENU and WM_SETFOCUS is not capture :(
            switch (m.Msg)
            {
            case WM_LBUTTONDOWN:
                sourceControl = Control.FromHandle(m.HWnd);
                if (sourceControl != null)
                {
                    FormInfo.ChangeControl(sourceControl);
                }
                break;

            case WM_RBUTTONDOWN:
                sourceControl = Control.FromHandle(m.HWnd);

                if (((MouseParam)m.WParam).HasFlag(MouseParam.Shift | MouseParam.Control) && sourceControl != null)
                {
                    FormInfo.Show(sourceControl);
                }
                break;
            }

            return(false);
        }
Example #2
0
 private void infoToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (frmInfo != null)
     {
         if (!frmInfo.IsDisposed)
         {
             return;
         }
     }
     frmInfo = new FormInfo();
     LanguageManager.INSTANCE.AddLocalizableControls(frmInfo);
     frmInfo.Show();
 }
Example #3
0
        private void ListOrder_SelectedIndexChanged(object sender, EventArgs e)//вывод информ. о заказе
        {
            InfoOrder FormInfo = null;

            for (int i = 0; i < table.Count; i++)
            {
                if (table[i].ID == ListOrder.SelectedItem.ToString().Split(' ')[0])
                {
                    FormInfo       = new InfoOrder(table[i].ID, table[i].Date, table[i].Name, table[i].Adress, table[i].Comment, Nomber, false, DateTime.Now);
                    FormInfo.Owner = this;
                }
            }
            FormInfo.Show();
        }
Example #4
0
        private void ChildOpen(string name)
        {
            switch (name)
            {
            case "Bestellung":

                if (!_childs.ContainsKey("Bestellung") || _childs.Get("Bestellung") == null)
                {
                    var formBestellung = new FormBestellung
                    {
                        Settings    = _settings,
                        MdiParent   = this,
                        WindowState = FormWindowState.Maximized
                    };
                    formBestellung.Disposed += childForm_Disposed;
                    formBestellung.Show();
                    formBestellung.Focus();
                    formBestellung.personalIdComboBox.Focus();

                    _childs.Add("Bestellung", formBestellung);
                }
                else
                {
                    _childs.Get("Bestellung").Focus();
                    var formBestellung = (FormBestellung)_childs.Get("Bestellung");
                    formBestellung.personalIdComboBox.Focus();
                }

                break;

            case "Bestellungen History":

                if (!_childs.ContainsKey("BestellungenHistory") || _childs.Get("BestellungenHistory") == null)
                {
                    var formBestellungsHistory = new FormBestellungenHistory
                    {
                        Settings    = _settings,
                        MdiParent   = this,
                        WindowState = FormWindowState.Maximized
                    };
                    formBestellungsHistory.Disposed += childForm_Disposed;
                    formBestellungsHistory.Show();
                    formBestellungsHistory.Focus();

                    _childs.Add("BestellungenHistory", formBestellungsHistory);
                }
                else
                {
                    _childs.Get("BestellungenHistory").Focus();
                }

                break;

            case "Personal":

                if (!_childs.ContainsKey("Personal") || _childs.Get("Personal") == null)
                {
                    var formPersonal = new FormPersonal
                    {
                        Settings    = _settings,
                        MdiParent   = this,
                        WindowState = FormWindowState.Maximized
                    };
                    formPersonal.Disposed += childForm_Disposed;
                    formPersonal.Show();
                    formPersonal.Focus();

                    _childs.Add("Personal", formPersonal);
                }
                else
                {
                    _childs.Get("Personal").Focus();
                }

                break;

            case "Artikel":

                if (!_childs.ContainsKey("Artikel") || _childs.Get("Artikel") == null)
                {
                    var formArtikel = new FormArtikel
                    {
                        Settings    = _settings,
                        MdiParent   = this,
                        WindowState = FormWindowState.Maximized
                    };
                    formArtikel.Disposed += childForm_Disposed;
                    formArtikel.Show();
                    formArtikel.Focus();

                    _childs.Add("Artikel", formArtikel);
                }
                else
                {
                    _childs.Get("Artikel").Focus();
                }

                break;

            case "Ausgabestellen":

                if (!_childs.ContainsKey("Ausgabestellen") || _childs.Get("Ausgabestellen") == null)
                {
                    var formAusgabestelle = new FormAusgabestelle
                    {
                        Settings    = _settings,
                        MdiParent   = this,
                        WindowState = FormWindowState.Maximized
                    };
                    formAusgabestelle.Disposed += childForm_Disposed;
                    formAusgabestelle.Show();
                    formAusgabestelle.Focus();

                    _childs.Add("Ausgabestellen", formAusgabestelle);
                }
                else
                {
                    _childs.Get("Ausgabestellen").Focus();
                }

                break;

            /*case "Verkaufssummen":
             *
             *  if (!childs.ContainsKey("Verkaufssummen") || childs.Get("Verkaufssummen") == null)
             *  {
             *      FormAuswertungen formAuswertungen = new FormAuswertungen("Verkaufssummen");
             *      formAuswertungen.MdiParent = this;
             *      formAuswertungen.WindowState = FormWindowState.Maximized;
             *      formAuswertungen.Disposed += new EventHandler(childForm_Disposed);
             *      formAuswertungen.Show();
             *      formAuswertungen.Focus();
             *
             *      childs.Add("Verkaufssummen", formAuswertungen);
             *  }
             *  else
             *  {
             *      childs.Get("Verkaufssummen").Focus();
             *  }
             *
             *  break;*/
            case "Kellnerabrechnung":
                if (!_childs.ContainsKey("Kellnerabrechnung") || _childs.Get("Kellnerabrechnung") == null)
                {
                    var formKellnerabrechnung = new FormKellnerabrechnung
                    {
                        Settings    = _settings,
                        MdiParent   = this,
                        WindowState = FormWindowState.Maximized
                    };
                    formKellnerabrechnung.Disposed += childForm_Disposed;
                    formKellnerabrechnung.Show();
                    formKellnerabrechnung.Focus();

                    _childs.Add("Kellnerabrechnung", formKellnerabrechnung);
                }
                else
                {
                    _childs.Get("Kellnerabrechnung").Focus();
                }

                break;

            case "Offene Abrechnungen":
                if (!_childs.ContainsKey("Offene Abrechnungen") || _childs.Get("Offene Abrechnungen") == null)
                {
                    var formKellnerabrechnungOffen = new FormKellnerabrechnungOffen
                    {
                        Settings    = _settings,
                        MdiParent   = this,
                        WindowState = FormWindowState.Maximized
                    };
                    formKellnerabrechnungOffen.Disposed += childForm_Disposed;
                    formKellnerabrechnungOffen.Show();
                    formKellnerabrechnungOffen.Focus();

                    _childs.Add("Offene Abrechnungen", formKellnerabrechnungOffen);
                }
                else
                {
                    _childs.Get("Offene Abrechnungen").Focus();
                }

                break;

            case "Bestellungen":
                if (!_childs.ContainsKey("Bestellungen") || _childs.Get("Bestellungen") == null)
                {
                    var formAuswertungen = new FormAuswertungen("Bestellungen")
                    {
                        Settings    = _settings,
                        MdiParent   = this,
                        WindowState = FormWindowState.Maximized
                    };
                    formAuswertungen.Disposed += childForm_Disposed;
                    formAuswertungen.Show();
                    formAuswertungen.Focus();

                    _childs.Add("Bestellungen", formAuswertungen);
                }
                else
                {
                    _childs.Get("Bestellungen").Focus();
                }

                break;

            case "Druckeinstellungen":

                if (!_childs.ContainsKey("Druckeinstellungen") || _childs.Get("Druckeinstellungen") == null)
                {
                    var formPrinter = new FormPrinter
                    {
                        Settings    = _settings,
                        MdiParent   = this,
                        WindowState = FormWindowState.Maximized
                    };
                    formPrinter.Disposed += childForm_Disposed;
                    formPrinter.Show();
                    formPrinter.Focus();

                    _childs.Add("Druckeinstellungen", formPrinter);
                }
                else
                {
                    _childs.Get("Druckeinstellungen").Focus();
                }

                break;

            case "Manuelles Stornieren":

                if (!_childs.ContainsKey("ManualStorno") || _childs.Get("ManualStorno") == null)
                {
                    var formManualStorno = new FormManualStorno
                    {
                        Settings    = _settings,
                        MdiParent   = this,
                        WindowState = FormWindowState.Maximized
                    };
                    formManualStorno.Disposed += childForm_Disposed;
                    formManualStorno.Show();
                    formManualStorno.Focus();

                    _childs.Add("ManualStorno", formManualStorno);
                }
                else
                {
                    _childs.Get("ManualStorno").Focus();
                }

                break;

            case "Info":

                if (!_childs.ContainsKey("Info") || _childs.Get("Info") == null)
                {
                    var formInfo = new FormInfo
                    {
                        Settings    = _settings,
                        MdiParent   = this,
                        WindowState = FormWindowState.Maximized
                    };
                    formInfo.Disposed += childForm_Disposed;
                    formInfo.Show();
                    formInfo.Focus();

                    _childs.Add("Info", formInfo);
                }
                else
                {
                    _childs.Get("Info").Focus();
                }

                break;
            }
        }