A button made up of images for each state.
To derive explicit image-button inherit directly from [ImageButtonBase].
Inheritance: ImageButtonBase
 private static void InitFlatDark(ImageButton button, string prefix)
 {
     button.BasePath = PathFlatDark;
     button.DefaultUrls.Normal = prefix + ".15x15.png";
     button.DefaultUrls.Over = prefix + ".Over.15x15.png";
     button.DefaultUrls.Down = prefix + ".Down.15x15.png";
     button.SetSize(15, 15);
 }
 private static void InitRemove(ImageButton button)
 {
     button.BasePath = PathFlatDark;
     button.DefaultUrls.Normal = "Remove.14x14.png";
     button.DefaultUrls.Down = "Remove.Down.14x14.png";
     button.SetSize(14, 14);
     button.BackgroundHighlighting = false;
 }
 public void Normal_Over_Default_URLs_Only()
 {
     Reset();
     ImageButton mock = new ImageButton();
     InitializeSampleButton(mock);
     button.BasePath = mock.BasePath;
     button.DefaultUrls.Normal = mock.DefaultUrls.Normal;
     button.DefaultUrls.Over = mock.DefaultUrls.Over;
 }
 private static void InitPushPin(ImageButton button)
 {
     button.BasePath = PathSundry;
     button.DefaultUrls.Normal = "Pin.Unpushed.png";
     button.DefaultUrls.Pressed = "Pin.Pushed.png";
     button.CanToggle = true;
     button.CanFocus = false;
     button.BackgroundHighlighting = false;
     button.SetSize(15, 15);
 }
        public void ClassInitialize()
        {
            // Setup initial conditions.
            button = new ImageButton();
            ResetUrls();
            TestHarness.AddControl(button.CreateView() as IView);

            // Wire up events.
            ButtonTest.WireClickEvents(button);
        }
        /// <summary>Factory method for creating an pre-canned image button.</summary>
        /// <param name="type">Flag indicating the type of button to create.</param>
        public static ImageButton Create(ImageButtons type)
        {
            // Setup initial conditions.
            ImageButton button = new ImageButton();
            button.CanFocus = false;

            // Configure image URL's.
            switch (type)
            {
                case ImageButtons.PlusDark: InitFlatDark(button, "Plus"); break;
                case ImageButtons.PlayDark: InitFlatDark(button, "Play"); break;
                case ImageButtons.RefreshDark: InitFlatDark(button, "Refresh"); break;
                case ImageButtons.SearchDark: InitFlatDark(button, "Search"); break;
                case ImageButtons.PushPin: InitPushPin(button); break;
                case ImageButtons.Remove: InitRemove(button); break;

                default: throw new Exception("ImageButton not supported: " + type.ToString());
            }

            // Finish up.
            return button;
        }
        public PinPanel(jQueryObject container) : base(container)
        {
            // Setup initial conditions.
            hideDelay = new DelayedAction(DefaultHideDelay, OnHideDelayElapsed);

            // Insert the pin button.
            pin = ImageButtonFactory.Create(ImageButtons.PushPin);
            IButtonView view = pin.CreateView();
            view.Container.AddClass(ButtonCssClass);
            Container.Append(view.Container);

            // Wire up events.
            pin.IsPressedChanged += delegate
                                        {
                                            IsPinned = pin.IsPressed;
                                        };
            Container.MouseEnter(delegate { hideDelay.Stop(); });
            Container.MouseLeave(delegate { hideDelay.Start(); });

            // Finish up.
            SyncButton();
        }
        public static void InitializeSampleButton(ImageButton button)
        {
            // Setup initial conditions.
            button.SetSize(550, 220);
            button.BackgroundHighlighting = true;

            // Set image URLs.
            button.BasePath = "/Content/Images/ImageButton.Sample/";

            button.DefaultUrls.Normal = "Normal.png";
            button.DefaultUrls.Over = "Over.png";
            button.DefaultUrls.Down = "Down.png";
            button.DefaultUrls.Pressed = "Pressed.png";

            button.DisabledUrls.Normal = "Normal.Disabled.png";
            button.DisabledUrls.Over = "Over.Disabled.png";
            button.DisabledUrls.Down = "Down.Disabled.png";
            button.DisabledUrls.Pressed = "Pressed.Disabled.png";

            button.FocusedUrls.Normal = "Normal.Focused.png";
            button.FocusedUrls.Over = "Over.Focused.png";
            button.FocusedUrls.Down = "Down.Focused.png";
            button.FocusedUrls.Pressed = "Pressed.Focused.png";

            button.Preload();
        }