コード例 #1
0
 /// <summary>
 /// Creates an instance of <see cref="SmartMenuPresenter"/>
 /// </summary>
 /// <param name="view">
 /// <see cref="ISmartMenuView"/> implementation to use as the actual view
 /// </param>
 public SmartMenuPresenter(ISmartMenuView view)
     : base(view)
 {
     View = view;
     AttachView();
     Load();
 }
コード例 #2
0
        public SmartMenuLayout(ISmartMenuView view, string layoutName)
        {
            this.view = view;
            Layout currentLayout;

            try
            {
                currentLayout = ( Layout )Enum.Parse(typeof(Layout), layoutName, true);
            }
            catch (ArgumentException)
            {
                currentLayout = Layout.rect8;
            }

            switch (currentLayout)
            {
            case Layout.hex7:
                Create7HexButtons();
                break;

            case Layout.rect8:
                break;

            default:
                break;
            }
        }
コード例 #3
0
        public SmartMenuButton(ISmartMenuView view, IShape shape)
        {
            borderWidth        = 1;
            pressedBorderWidth = 2;
            this.view          = view;
            this.shape         = shape;

            hotspot            = new SmartMenuButtonHotspot();
            hotspot.Location   = shape.InteractiveRegion.Location;
            hotspot.Size       = shape.InteractiveRegion.Size;
            hotspot.MouseDown += new MouseEventHandler(Hotspot_MouseDown);
            hotspot.MouseUp   += new MouseEventHandler(Hotspot_MouseUp);
            ////hotspot.Click += new EventHandler( Hotspot_Click );
            view.Controls.Add(hotspot);

            ////labelControl = new LabelEx();
            ////labelControl.Font = new Font( labelControl.Font.Name, 7, FontStyle.Regular );
            ////labelControl.Transparent = true;
            ////this.Controls.Add( labelControl );

            this.BorderColor        = Color.WhiteSmoke;
            this.PressedBorderColor = Color.WhiteSmoke;
            this.FillColor          = Color.SlateGray;
        }