예제 #1
0
        public override void UpdateTrackingAreas()
        {
            this.SendMessageSuper(ThisClass, "updateTrackingAreas");

            TrackerHelper.Destroy(this, iTrackingArea);
            iTrackingArea = TrackerHelper.Create(this, this.Bounds, false);
        }
예제 #2
0
        public void Initialise(NSImage aImageNoHover, NSImage aImageHover, NSImage aImagePush)
        {
            // button initialised as a type 1 non-toggle button with internal mouse tracking
            iTrackingArea = TrackerHelper.Create(this, this.Bounds, false);

            // create and initialise the cell
            Initialise(new ButtonHoverCellType1(aImageNoHover, aImageHover, aImagePush));
        }
예제 #3
0
        public override Id InitWithFrame(NSRect aFrameRect)
        {
            this.NativePointer = this.SendMessageSuper <IntPtr>(ThisClass, "initWithFrame:", aFrameRect);

            NSRect wheelRect = new NSRect(0, 0, aFrameRect.Width, aFrameRect.Height);

            if (iViewWheel == null)
            {
                // create subviews
                iViewWheel = new ViewRotaryImage();
                iViewMute  = new NSImageView();
                iViewBar   = new ViewRotaryBar();
                iViewGrip  = new ViewRotaryGrip();

                // add views to the parent in back to front order
                this.AddSubview(iViewWheel);
                iViewWheel.AddSubview(iViewGrip);
                iViewGrip.AddSubview(iViewBar);
                iViewBar.AddSubview(iViewMute);
            }


            // initialise the views
            iViewWheel.InitWithFrame(wheelRect);
            iViewWheel.SetImages(Properties.Resources.ImageWheel, NSImageAlignment.NSImageAlignCenter,
                                 Properties.Resources.ImageWheelOver, NSImageAlignment.NSImageAlignCenter);

            iViewGrip.InitWithFrame(wheelRect);

            iViewBar.InitWithFrame(wheelRect);

            iViewMute.InitWithFrame(wheelRect);
            iViewMute.Image           = Properties.Resources.ImageWheelMute;
            iViewMute.ImageAlignment  = NSImageAlignment.NSImageAlignCenter;
            iViewMute.ImageFrameStyle = NSImageFrameStyle.NSImageFrameNone;
            iViewMute.ImageScaling    = NSImageScaling.NSImageScaleNone;


            // initialise angle for the control knob
            iKnobAngle      = 270.0f;
            iViewGrip.Angle = iKnobAngle;

            // initialise state of the widget
            iEnabled    = false;
            iMouseState = EMouse.eUp;
            iMouseOver  = false;
            iDimmed     = false;
            UpdateState();


            // create tracking area
            iTrackingArea = TrackerHelper.Create(this, wheelRect, false);

            return(this);
        }
예제 #4
0
        public IButtonHoverType2 Initialise(ButtonType2Drawer aDrawer)
        {
            // button initialised as a type 2 non-toggle button with internal mouse tracking
            iTrackingArea = TrackerHelper.Create(this, this.Bounds, false);

            // create and initialise the cell
            ButtonHoverCellType2 cell = new ButtonHoverCellType2(aDrawer);

            Initialise(cell);

            return(cell);
        }
예제 #5
0
        public override void UpdateTrackingAreas()
        {
            this.SendMessageSuper(ThisClass, "updateTrackingAreas");

            // only do stuff if this button has been configured to use internal mouse
            // tracking i.e. tracking using its own NSView
            if (iTrackingArea != null)
            {
                TrackerHelper.Destroy(this, iTrackingArea);
                iTrackingArea = TrackerHelper.Create(this, this.Bounds, false);
            }
        }
예제 #6
0
        public IButtonHoverType2 Initialise(NSImage aImage)
        {
            // button initialised as a type 2 non-toggle button with internal mouse tracking
            iTrackingArea = TrackerHelper.Create(this, this.Bounds, false);

            // create and initialise the cell
            ButtonHoverCellType2 cell = new ButtonHoverCellType2();

            cell.ImageOff = aImage;
            Initialise(cell);

            return(cell);
        }
예제 #7
0
        public override Id InitWithFrame(NSRect aFrameRect)
        {
            this.NativePointer = this.SendMessageSuper <IntPtr>(ThisClass, "initWithFrame:", aFrameRect);

            NSRect wheelRect = new NSRect(0, 0, aFrameRect.Width, aFrameRect.Height);

            if (iViewBar == null)
            {
                // create subviews
                iViewBar   = new ViewRotaryBar();
                iViewBkgd  = new NSImageView();
                iViewLeft  = new NSImageView();
                iViewRight = new NSImageView();
                iViewMute  = new NSImageView();

                // create subview hierarchy
                this.AddSubview(iViewBkgd);
                iViewBkgd.AddSubview(iViewBar);
                iViewBar.AddSubview(iViewLeft);
                iViewBar.AddSubview(iViewRight);
                iViewBar.AddSubview(iViewMute);
            }

            // initialise the views
            iViewBar.InitWithFrame(wheelRect);

            iViewBkgd.InitWithFrame(wheelRect);
            iViewBkgd.Image           = Properties.Resources.ImageRocker;
            iViewBkgd.ImageAlignment  = NSImageAlignment.NSImageAlignCenter;
            iViewBkgd.ImageFrameStyle = NSImageFrameStyle.NSImageFrameNone;
            iViewBkgd.ImageScaling    = NSImageScaling.NSImageScaleNone;

            iViewLeft.InitWithFrame(wheelRect);
            iViewLeft.Image           = Properties.Resources.ImageRockerLeftOver;
            iViewLeft.ImageAlignment  = NSImageAlignment.NSImageAlignCenter;
            iViewLeft.ImageFrameStyle = NSImageFrameStyle.NSImageFrameNone;
            iViewLeft.ImageScaling    = NSImageScaling.NSImageScaleNone;

            iViewRight.InitWithFrame(wheelRect);
            iViewRight.Image           = Properties.Resources.ImageRockerRightOver;
            iViewRight.ImageAlignment  = NSImageAlignment.NSImageAlignCenter;
            iViewRight.ImageFrameStyle = NSImageFrameStyle.NSImageFrameNone;
            iViewRight.ImageScaling    = NSImageScaling.NSImageScaleNone;

            iViewMute.InitWithFrame(wheelRect);
            iViewMute.Image           = Properties.Resources.ImageWheelMute;
            iViewMute.ImageAlignment  = NSImageAlignment.NSImageAlignCenter;
            iViewMute.ImageFrameStyle = NSImageFrameStyle.NSImageFrameNone;
            iViewMute.ImageScaling    = NSImageScaling.NSImageScaleNone;


            // initialise state of the widget
            iEnabled   = false;
            iDimmed    = false;
            iMouseDown = EMouse.eNot;
            iMouseOver = EMouse.eNot;
            UpdateState();

            // create tracking area
            iTrackingArea = TrackerHelper.Create(this, wheelRect, true);

            return(this);
        }