Example #1
0
        bool ISkinnable.ApplyTheme(DisplayTheme theme)
        {
            bool theme_ok = true;

            try
            {
                this.BackColor = theme.FormBackColor;
                if (!_app.IsOnXP)
                {
                    if (theme.FlatControls)
                    {
                        tvwAccount.BorderStyle       = BorderStyle.FixedSingle;
                        txtBillDate.BorderStyle      = BorderStyle.FixedSingle;
                        txtCAN.BorderStyle           = BorderStyle.FixedSingle;
                        txtInServiceDate.BorderStyle = BorderStyle.FixedSingle;
                        chkInFranchise.FlatStyle     = FlatStyle.Flat;
                    }
                    else
                    {
                        tvwAccount.BorderStyle       = BorderStyle.Fixed3D;
                        txtBillDate.BorderStyle      = BorderStyle.Fixed3D;
                        txtCAN.BorderStyle           = BorderStyle.Fixed3D;
                        txtInServiceDate.BorderStyle = BorderStyle.Fixed3D;
                        chkInFranchise.FlatStyle     = FlatStyle.Standard;
                    }
                }
                _theme = theme;
            }
            catch
            {
                theme_ok = false;
            }

            return(theme_ok);
        }
Example #2
0
        bool ISkinnable.ApplyTheme(DisplayTheme theme)
        {
            bool theme_ok = true;

            try
            {
                this.BackColor = theme.FormBackColor;

                if (!_app.IsOnXP)
                {
                    if (theme.FlatControls)
                    {
                        btnBack.FlatStyle = FlatStyle.Flat;
                        btnNext.FlatStyle = FlatStyle.Flat;
                    }
                    else
                    {
                        btnBack.FlatStyle = FlatStyle.Standard;
                        btnNext.FlatStyle = FlatStyle.Standard;
                    }
                }
                _theme = theme;
            }
            catch
            {
                theme_ok = false;
            }

            return(theme_ok);
        }
Example #3
0
        bool ISkinnable.ApplyTheme(DisplayTheme theme)
        {
            bool theme_ok = true;

            try
            {
                this.BackColor = theme.FormBackColor;
                if (theme.FlatControls)
                {
                    _btnFinish.FlatStyle = FlatStyle.Flat;
                    _btnBack.FlatStyle   = FlatStyle.Flat;
                    _btnCancel.FlatStyle = FlatStyle.Flat;
                }
                else
                {
                    _btnFinish.FlatStyle = FlatStyle.Standard;
                    _btnBack.FlatStyle   = FlatStyle.Standard;
                    _btnCancel.FlatStyle = FlatStyle.Standard;
                }
                _theme = theme;
            }
            catch
            {
                theme_ok = false;
            }

            return(theme_ok);
        }
Example #4
0
        bool ISkinnable.ApplyTheme(DisplayTheme theme)
        {
            try
            {
                this.BackColor                = theme.SpecialFormBackColor;
                this.lblHdr.ForeColor         = theme.SpecialFormHeaderColor;
                lnkCustSearch.ForeColor       = theme.SpecialFormFontColor;
                lnkCustSearch.LinkColor       = theme.SpecialFormFontColor;
                lnkCustSearch.ActiveLinkColor = theme.SpecialFormFontColor;
                lnkQueue.ForeColor            = theme.SpecialFormFontColor;
                lnkQueue.LinkColor            = theme.SpecialFormFontColor;
                lnkQueue.ActiveLinkColor      = theme.SpecialFormFontColor;
                if (lnkDialer.Visible)
                {
                    lnkDialer.ForeColor       = theme.SpecialFormFontColor;
                    lnkDialer.LinkColor       = theme.SpecialFormFontColor;
                    lnkDialer.ActiveLinkColor = theme.SpecialFormFontColor;
                }

                if (lnkOrderQueue.Visible)
                {
                    lnkOrderQueue.ForeColor       = theme.SpecialFormFontColor;
                    lnkOrderQueue.LinkColor       = theme.SpecialFormFontColor;
                    lnkOrderQueue.ActiveLinkColor = theme.SpecialFormFontColor;
                }
            }
            catch
            {
                return(false);
            }


            return(true);
        }
Example #5
0
        bool IForm.Refresh()
        {
            int start_x         = 8;
            int first_col_width = 0;
            int start_y         = 90;
            int end_y           = 96;
            int col             = 1;
            int row             = 0;
            int rows            = 1;

            //refresh the list box
            lstPlan.Items.Clear();
            foreach (Product product in _app.CurrentCampaign.Products)
            {
                lstPlan.Items.Add(product);
            }


            Graphics     g   = Graphics.FromHwnd(this.Handle);
            IManager     bso = new ProdTypeBSO();
            ArrayList    types;
            DisplayTheme theme = _app.Theme;

            types = (ArrayList)bso.GetAll();                            //product types
            rows  = types.Count / 2;
            foreach (ProductType type in types)
            {
                AfniLink link = new AfniLink();
                link.Text   = type.ProductTypeDescription;
                link.Height = 20;
                link.Width  = (int)g.MeasureString(link.Text, link.Font).Width + 50;
                if (link.Width > first_col_width)
                {
                    first_col_width = link.Width;
                }
                link.Tag             = type;
                link.Icon            = VLoopIcons.Next;
                link.ForeColor       = Color.Blue;
                link.LinkColor       = Color.Blue;
                link.ActiveLinkColor = Color.Blue;
                link.Font            = new Font("Tahoma", 8.25F);
                link.Left            = (col == 1 ? start_x : first_col_width + 20);
                link.Top             = start_y + (row * (link.Height + 10));
                link.LinkClicked    += new EventHandler(this.OnLinkClicked);
                this.Controls.Add(link);
                if (row == (rows - 1))
                {
                    row = 0;
                    col = 2;
                }
                else
                {
                    row++;
                }
            }

            return(true);
        }
Example #6
0
        bool IForm.Refresh()
        {
            ArrayList    campaigns;
            IManager     bso                = new CampaignBSO();
            DisplayTheme theme              = _app.Theme;
            int          row                = 1;
            int          rows               = 0;
            int          col                = 1;
            int          y_offset           = 50;
            int          first_column_width = 0;
            Graphics     g = Graphics.FromHwnd(this.Handle);

            //clear out the old links
            foreach (AfniLink link in _links)
            {
                this.Controls.Remove(link);
            }

            _links.Clear();

            campaigns = (ArrayList)bso.GetAll();
            rows      = campaigns.Count / 2;
            foreach (Campaign campaign in campaigns)
            {
                AfniLink link = new AfniLink();
                link.Text   = campaign.CampaignName;
                link.Height = 20;
                link.Width  = (int)g.MeasureString(link.Text, link.Font).Width + 50;
                if (link.Width > first_column_width)
                {
                    first_column_width = link.Width;
                }
                link.Tag             = campaign;
                link.Icon            = VLoopIcons.Next;
                link.ForeColor       = theme.SpecialFormFontColor;
                link.LinkColor       = theme.SpecialFormFontColor;
                link.ActiveLinkColor = theme.SpecialFormFontColor;
                link.Left            = (col == 1 ? 20 : first_column_width + 50);
                link.Top             = y_offset + (row * (link.Height + 10));
                link.LinkClicked    += new EventHandler(this.OnCampaignClick);
                this.Controls.Add(link);
                _links.Add(link);

                if (row == rows)
                {
                    col = 2;
                    row = 1;
                }
                else
                {
                    row++;
                }
            }


            return(true);
        }
Example #7
0
        /// <summary>
        /// Applies the theme to the Application.  This call will fire the
        /// ThemeChanged event.
        /// </summary>
        /// <param name="theme"></param>
        public void ApplyTheme(DisplayTheme theme)
        {
            //title bar
            _parent_form.VLoopTitleBar.LeftColor  = theme.TitleGradientLeftColor;
            _parent_form.VLoopTitleBar.RightColor = theme.TitleGradientRightColor;

            _theme = theme;

            if (ThemeChanged != null)
            {
                ThemeChanged(this, null);
            }
        }
Example #8
0
        bool ISkinnable.ApplyTheme(DisplayTheme theme)
        {
            bool theme_ok = true;

            try
            {
                this.BackColor = theme.FormBackColor;

                if (!_app.IsOnXP)
                {
                    if (theme.FlatControls)
                    {
                        txtInterCIC.BorderStyle         = BorderStyle.FixedSingle;
                        txtInterLataANI.BorderStyle     = BorderStyle.FixedSingle;
                        txtInterLataPIC.BorderStyle     = BorderStyle.FixedSingle;
                        txtIntlANI.BorderStyle          = BorderStyle.FixedSingle;
                        txtIntlCIC.BorderStyle          = BorderStyle.FixedSingle;
                        txtIntlPIC.BorderStyle          = BorderStyle.FixedSingle;
                        txtIntraCIC.BorderStyle         = BorderStyle.FixedSingle;
                        txtIntraLataANI.BorderStyle     = BorderStyle.FixedSingle;
                        txtIntraPIC.BorderStyle         = BorderStyle.FixedSingle;
                        txtWTN.BorderStyle              = BorderStyle.FixedSingle;
                        chkInternationalBlock.FlatStyle = FlatStyle.Flat;
                    }
                    else
                    {
                        txtInterCIC.BorderStyle         = BorderStyle.Fixed3D;
                        txtInterLataANI.BorderStyle     = BorderStyle.Fixed3D;
                        txtInterLataPIC.BorderStyle     = BorderStyle.Fixed3D;
                        txtIntlANI.BorderStyle          = BorderStyle.Fixed3D;
                        txtIntlCIC.BorderStyle          = BorderStyle.Fixed3D;
                        txtIntlPIC.BorderStyle          = BorderStyle.Fixed3D;
                        txtIntraCIC.BorderStyle         = BorderStyle.Fixed3D;
                        txtIntraLataANI.BorderStyle     = BorderStyle.Fixed3D;
                        txtIntraPIC.BorderStyle         = BorderStyle.Fixed3D;
                        txtWTN.BorderStyle              = BorderStyle.Fixed3D;
                        chkInternationalBlock.FlatStyle = FlatStyle.Standard;
                    }
                }
                _theme = theme;
            }
            catch
            {
                theme_ok = false;
            }

            return(theme_ok);
        }
Example #9
0
        bool ISkinnable.ApplyTheme(DisplayTheme theme)
        {
            bool theme_ok = true;

            try
            {
                this.BackColor = theme.FormBackColor;
                _theme         = theme;
            }
            catch
            {
                theme_ok = false;
            }

            return(theme_ok);
        }
Example #10
0
        bool ISkinnable.ApplyTheme(DisplayTheme theme)
        {
            bool theme_ok = true;

            try
            {
                this.BackColor           = theme.FormBackColor;
                afniDivider1.FirstColor  = theme.DividerDarkColor;
                afniDivider1.SecondColor = theme.DividerLightColor;

                if (!_app.IsOnXP)
                {
                    if (theme.FlatControls)
                    {
                        checkBox1.FlatStyle = FlatStyle.Flat;
                        checkBox2.FlatStyle = FlatStyle.Flat;
                        checkBox3.FlatStyle = FlatStyle.Flat;
                        checkBox4.FlatStyle = FlatStyle.Flat;
                        checkBox5.FlatStyle = FlatStyle.Flat;
                        checkBox6.FlatStyle = FlatStyle.Flat;
                        checkBox7.FlatStyle = FlatStyle.Flat;
                        btnOK.FlatStyle     = FlatStyle.Flat;
                        btnCancel.FlatStyle = FlatStyle.Flat;
                    }
                    else
                    {
                        checkBox1.FlatStyle = FlatStyle.Standard;
                        checkBox2.FlatStyle = FlatStyle.Standard;
                        checkBox3.FlatStyle = FlatStyle.Standard;
                        checkBox4.FlatStyle = FlatStyle.Standard;
                        checkBox5.FlatStyle = FlatStyle.Standard;
                        checkBox6.FlatStyle = FlatStyle.Standard;
                        checkBox7.FlatStyle = FlatStyle.Standard;
                        btnOK.FlatStyle     = FlatStyle.Standard;
                        btnCancel.FlatStyle = FlatStyle.Standard;
                    }
                }
                _theme = theme;
            }
            catch
            {
                theme_ok = false;
            }

            return(theme_ok);
        }
Example #11
0
        bool ISkinnable.ApplyTheme(DisplayTheme theme)
        {
            bool theme_ok = true;

            try
            {
                this.BackColor = theme.FormBackColor;
                if (!_app.IsOnXP)
                {
                    if (theme.FlatControls)
                    {
                        txtBTN.BorderStyle       = BorderStyle.FixedSingle;
                        txtCity.BorderStyle      = BorderStyle.FixedSingle;
                        txtCompany.BorderStyle   = BorderStyle.FixedSingle;
                        txtFirstName.BorderStyle = BorderStyle.FixedSingle;
                        txtLastName.BorderStyle  = BorderStyle.FixedSingle;
                        txtZip.BorderStyle       = BorderStyle.FixedSingle;
                        lvwResults.BorderStyle   = BorderStyle.FixedSingle;
                    }
                    else
                    {
                        txtBTN.BorderStyle       = BorderStyle.Fixed3D;
                        txtCity.BorderStyle      = BorderStyle.Fixed3D;
                        txtCompany.BorderStyle   = BorderStyle.Fixed3D;
                        txtFirstName.BorderStyle = BorderStyle.Fixed3D;
                        txtLastName.BorderStyle  = BorderStyle.Fixed3D;
                        txtZip.BorderStyle       = BorderStyle.Fixed3D;
                        lvwResults.BorderStyle   = BorderStyle.Fixed3D;
                    }
                }
                _theme = theme;
            }
            catch
            {
                theme_ok = false;
            }

            return(theme_ok);
        }
Example #12
0
        public static DisplayTheme ThemeByName(string theme_name, Afni.Applications.VLoop.Application app)
        {
            string path;

            System.Xml.XmlDocument doc;
            System.Xml.XmlNodeList themes;
            System.Xml.XmlNode     root;
            XmlNode      item_node;
            DisplayTheme theme = null;

            try
            {
                path = Path.GetDirectoryName(Assembly.GetCallingAssembly().Location);

                path += @"\Def.xml";
                doc   = new XmlDocument();
                doc.Load(path);
                root   = doc.ChildNodes[1];
                themes = root.ChildNodes;

                foreach (XmlNode theme_node in themes)
                {
                    if (theme_node.Attributes["id"].Value == theme_name)
                    {
                        theme = ThemeManager.ThemeFromNode(theme_node, app);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to retrieve theme: " + System.Environment.NewLine + ex.Message.ToString(), "VLoop Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(theme);
        }
Example #13
0
        bool ISkinnable.ApplyTheme(DisplayTheme theme)
        {
            bool theme_ok = true;

            label1.ForeColor = theme.SpecialFormHeaderColor;
            try
            {
                this.BackColor = theme.SpecialFormBackColor;
                foreach (AfniLink link in _links)
                {
                    link.ForeColor       = theme.SpecialFormFontColor;
                    link.LinkColor       = theme.SpecialFormFontColor;
                    link.ActiveLinkColor = theme.SpecialFormFontColor;
                }

                _theme = theme;
            }
            catch
            {
                theme_ok = false;
            }

            return(theme_ok);
        }
Example #14
0
        public static DisplayTheme ThemeFromNode(XmlNode theme_node, Afni.Applications.VLoop.Application app)
        {
            DisplayTheme theme;
            XmlNode      item_node;

            theme = new DisplayTheme();

            //name
            theme.Name = theme_node.Attributes["name"].Value;
            theme.ID   = theme_node.Attributes["id"].Value;
            switch (theme.ID)
            {
            case "xpblue":
                theme.TaskBoxChevronDown      = VLoopIcons.ChevronDown_XPBlue;
                theme.TaskBoxChevronDownHover = VLoopIcons.ChevronDownHover_XPBlue;
                theme.TaskBoxChevronUp        = VLoopIcons.ChevronUp_XPBlue;
                theme.TaskBoxChevronUpHover   = VLoopIcons.ChevronUpHover_XPBlue;
                break;

            case "win2k":
                theme.TaskBoxChevronDown      = VLoopIcons.ChevronDown_Win2K;
                theme.TaskBoxChevronDownHover = VLoopIcons.ChevronDownHover_Win2K;
                theme.TaskBoxChevronUp        = VLoopIcons.ChevronUp_Win2K;
                theme.TaskBoxChevronUpHover   = VLoopIcons.ChevronUpHover_Win2K;
                break;
            }

            //title gradient
            item_node = theme_node.SelectSingleNode(".//titlebar_gradient/left");
            theme.TitleGradientLeftColor = ColorFromNode(item_node);
            item_node = theme_node.SelectSingleNode(".//titlebar_gradient/right");
            theme.TitleGradientRightColor = ColorFromNode(item_node);

            //navbar top gradient
            item_node = theme_node.SelectSingleNode(".//navbar_gradient/top");
            theme.NavBarTopGradient = ColorFromNode(item_node);

            //navbar bottom gradient
            item_node = theme_node.SelectSingleNode(".//navbar_gradient/bottom");
            theme.NavBarBottomGradient = ColorFromNode(item_node);

            //taskbox header gradient
            item_node = theme_node.SelectSingleNode(".//taskbox/header_gradient/left");
            theme.TaskBoxHeaderLeftGradient = ColorFromNode(item_node);
            item_node = theme_node.SelectSingleNode(".//taskbox/header_gradient/right");
            theme.TaskBoxHeaderRightGradient = ColorFromNode(item_node);

            //taskbox base
            item_node = theme_node.SelectSingleNode(".//taskbox/base_color");
            theme.TaskBoxInnerColor = ColorFromNode(item_node);

            //taskbox border
            item_node = theme_node.SelectSingleNode(".//taskbox/border_color");
            theme.TaskBoxBorderColor = ColorFromNode(item_node);

            //taskbox link color
            item_node             = theme_node.SelectSingleNode(".//taskbox/link_color");
            theme.TaskNormalColor = ColorFromNode(item_node);

            //taskbox active link color
            item_node             = theme_node.SelectSingleNode(".//taskbox/alink_color");
            theme.TaskActiveColor = ColorFromNode(item_node);

            //taskbox header text colors
            item_node = theme_node.SelectSingleNode(".//taskbox/header_font_color");
            theme.TaskBoxHeaderFontColor = ColorFromNode(item_node);
            item_node = theme_node.SelectSingleNode(".//taskbox/aheader_font_color");
            theme.TaskBoxHeaderActiveFontColor = ColorFromNode(item_node);

            //form
            item_node = theme_node.SelectSingleNode(".//form/back_color");
            if (item_node.Attributes["red"].Value != "sys_frm")
            {
                theme.FormBackColor = ColorFromNode(item_node);
            }
            else
            {
                theme.FormBackColor = SystemColors.Control;
            }

            item_node          = theme_node.SelectSingleNode(".//form/controls");
            theme.FlatControls =
                (Convert.ToString(item_node.Attributes["style"].Value) == "flat" ? true : false);

            //divider colors
            item_node = theme_node.SelectSingleNode(".//div_gradient/bright");
            theme.DividerLightColor = ColorFromNode(item_node);
            item_node = theme_node.SelectSingleNode(".//div_gradient/dark");
            theme.DividerDarkColor = ColorFromNode(item_node);

            //special page bg colors
            item_node = theme_node.SelectSingleNode(".//form/specialpage_back_color");
            theme.SpecialFormBackColor = ColorFromNode(item_node);

            //special page font color
            item_node = theme_node.SelectSingleNode(".//form/specialpage_link_color");
            theme.SpecialFormFontColor = ColorFromNode(item_node);

            item_node = theme_node.SelectSingleNode(".//form/specialpage_font_color");
            theme.SpecialFormHeaderColor = ColorFromNode(item_node);

            return(theme);
        }
Example #15
0
        bool ISkinnable.ApplyTheme(DisplayTheme theme)
        {
            bool theme_ok = true;

            try
            {
                this.BackColor           = theme.FormBackColor;
                afniDivider1.FirstColor  = theme.DividerDarkColor;
                afniDivider1.SecondColor = theme.DividerLightColor;
                afniDivider2.FirstColor  = theme.DividerDarkColor;
                afniDivider2.SecondColor = theme.DividerLightColor;

                //apply flat control properties only if we're not
                //on win xp
                if (!_app.IsOnXP)
                {
                    if (theme.FlatControls)
                    {
                        txtAltPhone.BorderStyle  = BorderStyle.FixedSingle;
                        txtBillCity.BorderStyle  = BorderStyle.FixedSingle;
                        txtBilling1.BorderStyle  = BorderStyle.FixedSingle;
                        txtBilling2.BorderStyle  = BorderStyle.FixedSingle;
                        txtBillZip.BorderStyle   = BorderStyle.FixedSingle;
                        txtCompany.BorderStyle   = BorderStyle.FixedSingle;
                        txtEmail.BorderStyle     = BorderStyle.FixedSingle;
                        txtFirstName.BorderStyle = BorderStyle.FixedSingle;
                        txtFormerTDM.BorderStyle = BorderStyle.FixedSingle;
                        txtLastName.BorderStyle  = BorderStyle.FixedSingle;
                        txtServCity.BorderStyle  = BorderStyle.FixedSingle;
                        txtService1.BorderStyle  = BorderStyle.FixedSingle;
                        txtService2.BorderStyle  = BorderStyle.FixedSingle;
                        txtServZip.BorderStyle   = BorderStyle.FixedSingle;
                        chkDoNotCall.FlatStyle   = FlatStyle.Flat;
                        chkCopyBilling.FlatStyle = FlatStyle.Flat;
                    }
                    else
                    {
                        txtAltPhone.BorderStyle  = BorderStyle.Fixed3D;
                        txtBillCity.BorderStyle  = BorderStyle.Fixed3D;
                        txtBilling1.BorderStyle  = BorderStyle.Fixed3D;
                        txtBilling2.BorderStyle  = BorderStyle.Fixed3D;
                        txtBillZip.BorderStyle   = BorderStyle.Fixed3D;
                        txtCompany.BorderStyle   = BorderStyle.Fixed3D;
                        txtEmail.BorderStyle     = BorderStyle.Fixed3D;
                        txtFirstName.BorderStyle = BorderStyle.Fixed3D;
                        txtFormerTDM.BorderStyle = BorderStyle.Fixed3D;
                        txtLastName.BorderStyle  = BorderStyle.Fixed3D;
                        txtServCity.BorderStyle  = BorderStyle.Fixed3D;
                        txtService1.BorderStyle  = BorderStyle.Fixed3D;
                        txtService2.BorderStyle  = BorderStyle.Fixed3D;
                        txtServZip.BorderStyle   = BorderStyle.Fixed3D;
                        chkDoNotCall.FlatStyle   = FlatStyle.Standard;
                        chkCopyBilling.FlatStyle = FlatStyle.Standard;
                    }
                }
                _theme = theme;
            }
            catch
            {
                theme_ok = false;
            }

            return(theme_ok);
        }