Example #1
0
        private void buttonimg_MouseDown(object sender, EventArgs e)
        {
            PageImg pageimg = (PageImg)sender;

            if (dpageimg != 0xffff)
            {
                PageImages[dpageimg].RefreshPageImg(false);
            }

            pageimg.RefreshPageImg(true);
            dpageimg = pageimg.No;
            SelectEnter(dpageimg, e);
        }
Example #2
0
        public void RefreshObject(int select)
        {
            panel1.Controls.Clear();
            dpageimg      = 0xffff;
            MovePageImage = null;
            if (m_app.HmiPages.Count > 0)
            {
                PageImages = new PageImg[m_app.HmiPages.Count];
                for (int i = 0; i < m_app.HmiPages.Count; i++)
                {
                    PageImages[i]      = new PageImg();
                    PageImages[i].App  = m_app;
                    PageImages[i].No   = i;
                    PageImages[i].Page = m_app.HmiPages[i];
                    if (i == 0)
                    {
                        PageImages[i].Location = new Point(5, 0);
                    }
                    else
                    {
                        PageImages[i].Location = new Point(5, (PageImages[i - 1].Location.Y + PageImages[i - 1].Height) + 1);
                    }

                    PageImages[i].Size = new Size(panel1.Width - 0x19, 0x16);
                    panel1.Controls.Add(PageImages[i]);
                    PageImages[i].Visible     = true;
                    PageImages[i].MouseClick += new MouseEventHandler(buttonimg_MouseDown);
                    PageImages[i].PageUpdate += new EventHandler(pageupdate_p);
                    PageImages[i].RefreshPageImg(false);
                }
                if (select < PageImages.Length)
                {
                    dpageimg = select;
                    PageImages[dpageimg].RefreshPageImg(true);
                    SelectEnter(dpageimg, null);
                }
            }
            label1.Text = m_app.HmiPages.Count.ToString();
        }