Esempio n. 1
0
        public override void Initialize(ContentManager content, GraphicsDevice graphics)
        {
            // TODO: load your content here
            textbox.Font   = this.Font;
            textbox.Owner  = this.Owner;
            textbox.Locked = true;
            textbox.Initialize(content, graphics);

            button         = new Button("btOpen", Position + new Vector2(Width - 16, 0f), @"textures\controls\combobox\button", 1f, Color.White);
            button.Font    = this.Font;
            button.Owner   = this.Owner;
            button.OnPress = Button_OnPress;
            button.Initialize(content, graphics);

            listbox                   = new Listbox("combolist", Position + new Vector2(0, 19), (int)Width, 8 * Font.LineSpacing, items);
            listbox.Font              = this.Font;
            listbox.Owner             = this.Owner;
            listbox.Visible           = false;
            listbox.OnChangeSelection = Listbox_OnChangeSelection;
            listbox.OnPress           = Listbox_OnPress;
            listbox.Initialize(content, graphics);

            base.Initialize(content, graphics);
        }
Esempio n. 2
0
        public override void Initialize(ContentManager content, GraphicsDevice graphics)
        {
            // TODO: load your content here
            textbox = new Textbox("combotext", Position, (int)Width);
            textbox.Font = this.Font;
            textbox.Owner = this.Owner;
            textbox.Locked = true;
            textbox.Initialize(content, graphics);

            button = new Button("btOpen", Position + new Vector2(Width - 16, 0f), @"textures\controls\combobox\button", 1f, Color.White);
            button.Font = this.Font;
            button.Owner = this.Owner;
            button.OnPress = Button_OnPress;
            button.Initialize(content, graphics);

            listbox = new Listbox("combolist", Position + new Vector2(0, 19), (int)Width, 8 * Font.LineSpacing, items);
            listbox.Font = this.Font;
            listbox.Owner = this.Owner;
            listbox.Visible = false;
            listbox.OnChangeSelection = Listbox_OnChangeSelection;
            listbox.OnPress = Listbox_OnPress;
            listbox.Initialize(content, graphics);

            base.Initialize(content, graphics);
        }