Beispiel #1
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Copy constructor
        /// </summary>
        ///
        /// <param name="copy">Instance to copy</param>
        ///
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public ComboBox(ComboBox copy)
            : base(copy)
        {
            ItemSelectedCallback = copy.ItemSelectedCallback;

            m_LoadedConfigFile   = copy.m_LoadedConfigFile;
            m_SeparateHoverImage = copy.m_SeparateHoverImage;
            m_NrOfItemsToDisplay = copy.m_NrOfItemsToDisplay;
            m_Borders            = copy.m_Borders;

            Global.TextureManager.CopyTexture(copy.m_TextureArrowUpNormal, m_TextureArrowUpNormal);
            Global.TextureManager.CopyTexture(copy.m_TextureArrowUpHover, m_TextureArrowUpHover);
            Global.TextureManager.CopyTexture(copy.m_TextureArrowDownNormal, m_TextureArrowDownNormal);
            Global.TextureManager.CopyTexture(copy.m_TextureArrowDownHover, m_TextureArrowDownHover);

            // Copy the list box
            m_ListBox = new ListBox(copy.m_ListBox);

            m_ListBox.Visible = false;
            m_ListBox.ItemSelectedCallback -= copy.NewItemSelectedCallbackFunction;
            m_ListBox.UnfocusedCallback -= copy.ListBoxUnfocusedCallbackFunction;
            m_ListBox.ItemSelectedCallback += NewItemSelectedCallbackFunction;
            m_ListBox.UnfocusedCallback += ListBoxUnfocusedCallbackFunction;
        }
Beispiel #2
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Copy constructor
        /// </summary>
        ///
        /// <param name="copy">Instance to copy</param>
        ///
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public ListBox(ListBox copy)
            : base(copy)
        {
            ItemSelectedCallback = copy.ItemSelectedCallback;

            m_LoadedConfigFile        = copy.m_LoadedConfigFile;
            m_Items                   = new List<string>(copy.m_Items);
            m_SelectedItem            = copy.m_SelectedItem;
            m_Size                    = copy.m_Size;
            m_ItemHeight              = copy.m_ItemHeight;
            m_TextSize                = copy.m_TextSize;
            m_MaxItems                = copy.m_MaxItems;
            m_BackgroundColor         = copy.m_BackgroundColor;
            m_TextColor               = copy.m_TextColor;
            m_SelectedBackgroundColor = copy.m_SelectedBackgroundColor;
            m_SelectedTextColor       = copy.m_SelectedTextColor;
            m_BorderColor             = copy.m_BorderColor;
            m_TextFont                = copy.m_TextFont;
            m_Borders                 = copy.m_Borders;

            // If there is a scrollbar then copy it
            if (copy.m_Scroll != null)
                m_Scroll = new Scrollbar(copy.m_Scroll);
        }