コード例 #1
0
 public Application(IUIToolsFactory toolsFactory)
 {
     this.toolsFactory = toolsFactory;
     this.toolButton   = toolsFactory.createToolButton("TOOL_1");
     this.shape        = toolsFactory.createShape("CIRCLE");
     this.menuList     = toolsFactory.createMenuList("FILE");
 }
コード例 #2
0
 public void Show(IMenuList menu)
 {
     if ((mode & Target.Cashier) == Target.Cashier)
     {
         touchForm.ShowMenu(menu);
     }
 }
コード例 #3
0
 private void HideForm()
 {
     lblTitle.Text = "";
     this.pnlMenuItems.Controls.Clear();
     lastList     = null;
     this.Opacity = 0;
 }
コード例 #4
0
 public void Show(IMenuList menu)
 {
     primaryDisplay.Show(menu);
     foreach (IDisplay d in auxilaryDisplays)
     {
         d.Show(menu);
     }
 }
コード例 #5
0
 private void HideForm()
 {
     //this.Visible = false;
     this.Hide();
     lastList      = null;
     lblTitle.Text = "";
     opacity       = 0;
     this.pnlMenuItems.Controls.Clear();
 }
コード例 #6
0
 public void Show(IMenuList menu)
 {
     if ((mode & Target.Cashier) == Target.Cashier)
     {
         cashierDisplay.Show(menu);
     }
     if ((mode & Target.Customer) == Target.Customer)
     {
         customerDisplay.Show(menu);
     }
 }
コード例 #7
0
ファイル: CustomerForm-V2.cs プロジェクト: serhatmorkoc/cepos
 private void ShowListForm(IMenuList menuList)
 {
     if (listForm.InvokeRequired)
     {
         listForm.Invoke(new ShowListFormDelegate(ShowListForm), menuList);
     }
     else
     {
         listForm.SetList(menuList);
     }
 }
コード例 #8
0
ファイル: GuiDisplay.cs プロジェクト: serhatmorkoc/cepos
 public void Show(IMenuList menu)
 {
     try
     {
         ShowMenu(menu);
     }
     catch (FormatException fex)
     {
         EZLogger.Log.Error("FormatException occured. {0}", fex.Message);
     }
 }
コード例 #9
0
        public void SetList(IMenuList menuList)
        {
            if (menuList == null)
            {
                this.Hide();
                lastList = null;
                ClearImages();
                return;
            }

            ide           = menuList as IDoubleEnumerator;
            menuItemCount = ((System.Collections.ArrayList)menuList).Count;

            for (int i = 0; i < menuItemCount; i++)
            {
                if (((ArrayList)menuList)[i] == ide.Current)
                {
                    Image image = null;
                    if (menuItemCount > 1)
                    {
                        image = GetProductImage(((ArrayList)menuList)[PreviousIndex(i)]);
                        SetPreviousImage(image);
                    }
                    if (menuItemCount > 2)
                    {
                        image = GetProductImage(((ArrayList)menuList)[NextIndex(i)]);
                        SetNextImage(image);
                    }
                    image = GetProductImage(((ArrayList)menuList)[i]);
                    SetCurrentImage(image);

                    if (ide.Current is IProduct)
                    {
                        Show((IProduct)ide.Current);
                    }
                    else
                    {
                        Show((IFiscalItem)ide.Current);
                    }
                }
            }
            if (lastList != menuList)
            {
                this.Show();
            }
            lastList = menuList;
        }
コード例 #10
0
ファイル: CustomerForm-V2.cs プロジェクト: serhatmorkoc/cepos
 private void ShowMenuForm(IMenuList menuList)
 {
     if (menuForm.InvokeRequired)
     {
         menuForm.Invoke(new ShowMenuFormDelegate(ShowMenuForm), menuList);
     }
     else
     {
         menuForm.ShowList(menuList);
         if (menuForm.Opacity > 0)
         {
             menuForm.Show();
         }
         else
         {
             this.BringToFront();
         }
     }
 }
コード例 #11
0
ファイル: CustomerForm-V2.cs プロジェクト: serhatmorkoc/cepos
        public void ShowMenu(IMenuList menuList)
        {
            if (menuList == null)
            {
                ShowMenuForm(menuList);
                ShowListForm(menuList);
                return;
            }

            IDoubleEnumerator ide = menuList as IDoubleEnumerator;

            if ((ide.Current is IFiscalItem || ide.Current is IProduct))
            {
                ShowListForm(menuList);
            }
            else
            {
                ShowMenuForm(menuList);
            }
        }
コード例 #12
0
ファイル: AdminBll.cs プロジェクト: zspnetorweb/zsp
        /// <summary>
        /// 获取菜单列表
        /// </summary>
        /// <returns></returns>
        public static List <IMenuList> GetMenuList()
        {
            var             db       = AuctionSystemContext.Instance;
            List <MenuList> menuList = null;

            if (Cache.Get <List <MenuList> >("MenuList") == null)
            {
                menuList = db.Queryable <MenuList>().ToList();
                Cache.Insert("MenuList", menuList);
            }
            else
            {
                menuList = Cache.Get <List <MenuList> >("MenuList");
            }
            var listFirstMenu = menuList.Where(l => l.ParentId == 0);
            var iMenuList     = new List <IMenuList>();

            foreach (var item in listFirstMenu)
            {
                var iModel = new IMenuList()
                {
                    Name      = item.Name,
                    CodeUrl   = item.CodeUrl,
                    ParentId  = item.ParentId,
                    MenuLists = menuList.Where(l => l.ParentId == item.Id).ToList()
                };

                iMenuList.Add(iModel);
            }
            foreach (var item in iMenuList)
            {
                foreach (var itemList in item.MenuLists)
                {
                    itemList.CodeUrl = string.Format("/{0}/{1}", itemList.CodeUrl.Split('_')[0], itemList.CodeUrl.Split('_')[1]);
                }
            }
            return(iMenuList);
        }
コード例 #13
0
ファイル: ListFormCF.cs プロジェクト: serhatmorkoc/cepos
 internal void SetList(IMenuList menuList)
 {
     opacity = 1;
 }
コード例 #14
0
ファイル: GuiDisplay.cs プロジェクト: serhatmorkoc/cepos
 public void ShowMenu(IMenuList menuList)
 {
 }
コード例 #15
0
 public void Show(IMenuList menu)
 {
     //do nothing
 }
コード例 #16
0
        public void ShowList(IMenuList menuList)
        {
            if (menuList == null)
            {
                this.HideForm();
                return;
            }
            this.BringToFront();
            IDoubleEnumerator ide = menuList as IDoubleEnumerator;
            int menuCount         = ((System.Collections.ArrayList)menuList).Count;

            if (lastList == menuList)
            {
                int indx = 0;
                foreach (object ml in menuList)
                {
                    if (ml == ide.Current)
                    {
                        pnlMenuItems.Controls[indx].BackColor = Color.Gray;
                        this.pnlMenuItems.AutoScrollPosition  = new Point(0, indx * height / 2);
                    }
                    else
                    {
                        pnlMenuItems.Controls[indx].BackColor = Color.LightGray;
                    }
                }
                return;
            }
            lastList = menuList;
            opacity  = 1;

            this.pnlMenuItems.Controls.Clear();

            string title = ide.Current.ToString();

            if (title.IndexOf("\n") >= 0)
            {
                title = title.Substring(0, title.IndexOf("\n")).Trim();
            }

            if (title.IndexOf("\t") >= 0)
            {
                title = title.Substring(0, title.IndexOf("\t")).Trim();
            }

            lblTitle.Text = title;

            int yPosition = 0;

            this.pnlMenuItems.Size = new Size(width, Math.Min(menuCount * height, maxHeight));
            this.Size = new Size(width, pnlMenuItems.Height + lblTitle.Height);
            int i = 0;

            foreach (object ml in menuList)
            {
                System.Windows.Forms.Label lbl = new System.Windows.Forms.Label();
                lbl.Tag       = i;
                lbl.TextAlign = ContentAlignment.TopCenter;

                if (ml == ide.Current)
                {
                    lbl.BackColor = Color.Gray;
                    yPosition     = i * height;
                }
                else
                {
                    lbl.BackColor = Color.LightGray;
                }

                lbl.Font = new System.Drawing.Font("Tahoma", 30F, System.Drawing.FontStyle.Regular);
                lbl.Size = new Size(width, height);
                string strItem = ml.ToString();

                lbl.Text = strItem;
                if (strItem.IndexOf("\n") >= 0)
                {
                    lbl.Text = strItem.Substring(strItem.IndexOf("\n")).Trim();
                }
                this.pnlMenuItems.Controls.Add(lbl);
                lbl.Location = new Point(0, i * height);
            }

            this.pnlMenuItems.AutoScrollPosition = new Point(0, yPosition / 2);
            this.Location = new Point(20, 20);
        }
コード例 #17
0
        public void ShowList(IMenuList menuList)
        {
            if (menuList == null)
            {
                this.HideForm();
                return;
            }
            this.BringToFront();
            IDoubleEnumerator ide = menuList as IDoubleEnumerator;
            int menuCount         = ((System.Collections.ArrayList)menuList).Count;

            if (lastList == menuList)
            {
                for (int i = 0; i < menuCount; i++)
                {
                    if (((System.Collections.ArrayList)menuList)[i] == ide.Current)
                    {
                        pnlMenuItems.Controls[i].BackColor = Color.DarkGreen;
                        pnlMenuItems.Controls[i].Font      = new System.Drawing.Font("Tahoma", 30F, System.Drawing.FontStyle.Bold);
                        pnlMenuItems.Controls[i].ForeColor = Color.White;

                        if (pnlMenuItems.Controls[i].Top >= maxHeight)
                        {
                            int value = (i + 1) * height - maxHeight;
                            this.pnlMenuItems.AutoScrollPosition = new Point(0, value);
                        }
                        else if (pnlMenuItems.Controls[i].Top < 0)
                        {
                            int value = i * height;
                            this.pnlMenuItems.AutoScrollPosition = new Point(0, value);
                        }
                    }
                    else
                    {
                        pnlMenuItems.Controls[i].BackColor = Color.LightGray;
                        pnlMenuItems.Controls[i].Font      = new System.Drawing.Font("Tahoma", 30F, System.Drawing.FontStyle.Regular);
                        pnlMenuItems.Controls[i].ForeColor = Color.Black;
                    }
                }
                return;
            }
            lastList = menuList;

            this.Opacity = 0.8;
            this.pnlMenuItems.Controls.Clear();
            this.pnlMenuItems.AutoScroll = true;
            string title = ide.Current.ToString();

            if (title.IndexOf("\n") >= 0)
            {
                title = title.Substring(0, title.IndexOf("\n")).Trim();
            }

            if (title.IndexOf("\t") >= 0)
            {
                title = title.Substring(0, title.IndexOf("\t")).Trim();
            }

            lblTitle.Text = title;

            int yPosition = 0;

            this.pnlMenuItems.Size = new Size(width, Math.Min(menuCount * height, maxHeight));
            this.Size = new Size(width, pnlMenuItems.Height + lblTitle.Height);
            for (int i = 0; i < ((System.Collections.ArrayList)menuList).Count; i++)
            {
                System.Windows.Forms.Label lbl = new System.Windows.Forms.Label();
                lbl.Tag         = i;
                lbl.TextAlign   = ContentAlignment.MiddleLeft;
                lbl.BorderStyle = BorderStyle.Fixed3D;
                if (((System.Collections.ArrayList)menuList)[i] == ide.Current)
                {
                    lbl.BackColor = Color.DarkGreen;
                    lbl.Font      = new System.Drawing.Font("Tahoma", 30F, System.Drawing.FontStyle.Bold);
                    lbl.ForeColor = Color.White;
                    yPosition     = i * height;
                }
                else
                {
                    lbl.BackColor = Color.LightGray;
                    lbl.Font      = new System.Drawing.Font("Tahoma", 30F, System.Drawing.FontStyle.Regular);
                    lbl.ForeColor = Color.Black;
                }

                lbl.Size = new Size(width, height);
                string strItem = ((System.Collections.ArrayList)menuList)[i].ToString();

                lbl.Text = strItem;
                if (strItem.IndexOf("\n") >= 0)
                {
                    lbl.Text = (i + 1) + "- " + strItem.Substring(strItem.IndexOf("\n")).Trim();
                }
                lbl.Location = new Point(0, i * height);
                this.pnlMenuItems.Controls.Add(lbl);
                lbl.Click += new EventHandler(btn_Click);
            }

            this.pnlMenuItems.AutoScrollPosition = new Point(0, yPosition / 2);
            if (this.pnlMenuItems.VerticalScroll.Visible)
            {
                pnlMenuItems.Width = width + 50;
            }
            else
            {
                pnlMenuItems.Width = width;
            }
            this.Location = new Point(SystemInformation.PrimaryMonitorSize.Width / 2 - this.Width / 2,
                                      SystemInformation.PrimaryMonitorSize.Height / 2 - this.Height / 2);
        }