Exemplo n.º 1
0
    public Form1()
    {
        InitializeComponent();
        ButtonEx b1 = new ButtonEx();

        b1.OnCustomClickEvent += new ButtonEx.OnCustomClickEventHandler(b1_OnCustomClickEvent);
    }
Exemplo n.º 2
0
        private void ButtonSelection(object sender, System.EventArgs e)
        {
            ButtonEx button = sender as ButtonEx;

            UserChoice = Convert.ToInt32(button.Tag);
            this.Close();
        }
Exemplo n.º 3
0
    public static GameObject CreateButton(Resources resources)
    {
        GameObject buttonRoot = CreateUIElementRoot("Button", s_ThickElementSize);

        GameObject childText = new GameObject("Text");

        childText.AddComponent <RectTransform>();
        SetParentAndAlign(childText, buttonRoot);

        ImageEx image = buttonRoot.AddComponent <ImageEx>();

        image.sprite = resources.standard;
        image.type   = ImageEx.Type.Sliced;
        image.color  = s_DefaultSelectableColor;

        ButtonEx bt = buttonRoot.AddComponent <ButtonEx>();

        SetDefaultColorTransitionValues(bt);

        TextEx text = childText.AddComponent <TextEx>();

        text.text      = "Button";
        text.alignment = TextAnchor.MiddleCenter;
        SetDefaultTextValues(text);

        RectTransform textRectTransform = childText.GetComponent <RectTransform>();

        textRectTransform.anchorMin = Vector2.zero;
        textRectTransform.anchorMax = Vector2.one;
        textRectTransform.sizeDelta = Vector2.zero;

        return(buttonRoot);
    }
Exemplo n.º 4
0
        void cellInsert_Init(object sender, EventArgs e)
        {
            DataControlFieldCell cell = (DataControlFieldCell)sender;
            GridViewRow          row  = (GridViewRow)cell.NamingContainer;
            GridViewEx           gv   = (GridViewEx)row.NamingContainer;
            ButtonEx             btn  = new ButtonEx();

            btn.ID = "Insert";
            btn.CausesValidation = true;
            btn.Text             = this.InsertButtonText;
            btn.CausesValidation = true;
            row.CssClass        += " gvex-edit-link " + JQueryScriptManager.CssClassValidationContainer;
            btn.Action           = ButtonAction.Submit;
            //TODO: Figure out what to do
            //btn.ValdiationContainerID = row.ID;

            if (!string.IsNullOrEmpty(this.CssClassInsertButton))
            {
                btn.AddCssClass(this.CssClassInsertButton);
            }
            btn.Click += new EventHandler(btnInsert_Click);
            cell.Controls.Add(btn);

            AddCancelLink(cell, gv);
        }
        protected override void InitializeControls()
        {
            _flexChart = new FlexChart()
            {
                Dock = DockStyle.Fill
            };
            _flexPie = new FlexPie()
            {
                Dock = DockStyle.Fill
            };
            //Set the Chart to be displayed by default
            this.Chart = _flexChart;

            _cbChartType = new ComboBoxEx("Chart Type")
            {
                DataSource = new string[] { "FlexChart", "FlexPie" }
            };
            _cbChartType.SelectedIndexChanged += _cbChartType_SelectedIndexChanged;

            _bExportToFile        = new ButtonEx("Serialize To File");
            _bExportToFile.Click += _bExportToFile_Click;

            _bImportFromFile        = new ButtonEx("Deserialize From File");
            _bImportFromFile.Click += _bImportFromFile_Click;

            this.pnlControls.Controls.Add(_cbChartType);
            this.pnlControls.Controls.Add(_bExportToFile);
            this.pnlControls.Controls.Add(_bImportFromFile);
        }
Exemplo n.º 6
0
        public ComboBoxTreeView()
        {
            this.InitializeComponent();

            //---
            //jash add Object init
            this.AbsoluteChildrenSelectableOnly = true;
            this.BranchSeparator = ".";
            //---jash add Object init

            // Initializing Controls
            this.m_blnSowToggleTreeView = false;//jash add
            this.pnlBack             = new Panel();
            this.pnlBack.BorderStyle = BorderStyle.Fixed3D;
            this.pnlBack.BackColor   = Color.White;
            this.pnlBack.AutoScroll  = false;

            this.tbSelectedValue              = new TextBox();
            this.tbSelectedValue.ReadOnly     = true;                                       //jash add
            this.tbSelectedValue.BorderStyle  = System.Windows.Forms.BorderStyle.None;
            this.tbSelectedValue.TextChanged += new System.EventHandler(this.Data_Changed); //jash add

            this.btnSelect           = new ButtonEx();
            this.btnSelect.Click    += new EventHandler(ToggleTreeView);
            this.btnSelect.FlatStyle = FlatStyle.Flat;

            this.lblSizingGrip            = new LabelEx();
            this.lblSizingGrip.Size       = new Size(9, 9);
            this.lblSizingGrip.BackColor  = Color.Transparent;
            this.lblSizingGrip.Cursor     = Cursors.SizeNWSE;
            this.lblSizingGrip.MouseMove += new MouseEventHandler(SizingGripMouseMove);
            this.lblSizingGrip.MouseDown += new MouseEventHandler(SizingGripMouseDown);

            this.tvTreeView              = new TreeView();
            this.tvTreeView.BorderStyle  = BorderStyle.None;
            this.tvTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(TreeViewNodeSelect);//jash modified this.tvTreeView.DoubleClick += new EventHandler(TreeViewNodeSelect); //jash modified this.tvTreeView.Click += new EventHandler(TreeViewNodeSelect); //jash modified
            this.tvTreeView.Location     = new Point(0, 0);
            this.tvTreeView.LostFocus   += new EventHandler(TreeViewLostFocus);
            //this.tvTreeView.Scrollable = false;

            this.frmTreeView = new Form();
            this.frmTreeView.FormBorderStyle = FormBorderStyle.None;
            this.frmTreeView.StartPosition   = FormStartPosition.Manual;
            this.frmTreeView.ShowInTaskbar   = false;
            this.frmTreeView.BackColor       = System.Drawing.SystemColors.Control;

            this.pnlTree             = new Panel();
            this.pnlTree.BorderStyle = BorderStyle.FixedSingle;
            this.pnlTree.BackColor   = Color.White;

            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);

            // Adding Controls to UserControl
            this.pnlTree.Controls.Add(this.lblSizingGrip);
            this.pnlTree.Controls.Add(this.tvTreeView);
            this.frmTreeView.Controls.Add(this.pnlTree);
            this.pnlBack.Controls.AddRange(new Control[] { btnSelect, tbSelectedValue });
            this.Controls.Add(this.pnlBack);
        }
        //public void ResetWindowTitle(ActivityHarness H)
        //{
        //    //if (!this.wantFixedWindowTitle) this.Title = H.WindowTitle;
        //}

        //public void PopupHelp(string context)
        //{ }

        //public void LaunchHelp(string context)
        //{ }

        //public virtual void CloseOnLogout()
        //{
        //    //this.Close();
        //}

        //public void Focus()
        //{
        //}

        public void RegisterDirtyButton(ButtonEx b)
        {
            if (!DirtyButtons.ContainsKey(b.ModelObject))
            {
                DirtyButtons.Add(b.ModelObject, b);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 加载质检步骤
        /// </summary>
        public void loadStep()
        {
            this.splitContainer3.Panel2.Controls.Clear();
            ConnectDB db     = new ConnectDB();
            DataTable result = db.GetDataBySql("select * from GISDATA_CONFIGSTEP where SCHEME ='" + this.comboBoxScheme.Text.ToString() + "' order by STEP_NO");

            DataRow[] dr = result.Select("1=1");
            for (int i = 0; i < dr.Length; i++)
            {
                string   stepNo   = dr[i]["STEP_NO"].ToString();
                string   stepName = dr[i]["STEP_NAME"].ToString();
                string   stepType = dr[i]["STEP_TYPE"].ToString();
                string   isConfig = dr[i]["IS_CONFIG"].ToString();
                ButtonEx btn      = new ButtonEx();
                btn.Name = stepNo;
                btn.AccessibleDescription = stepType;//AccessibleDescription属性暂赋值为质检类型
                if (isConfig == "1")
                {
                    btn.Text = "第" + stepNo + "步(" + stepName + ")";
                    btn.Tag  = 1;
                }
                else
                {
                    btn.Text = "第" + stepNo + "步";
                    btn.Tag  = 0;
                }
                btn.Size         = new Size(this.splitContainer2.Panel1.Width - 5, 40);
                btn.Location     = new Point(2, 20 + (int.Parse(stepNo) - 1) * 40);
                btn.DoubleClick += new EventHandler(aBtn_DbClick);
                btn.Click       += new EventHandler(aBtn_Click);
                this.splitContainer3.Panel2.Controls.Add(btn);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 步骤按钮点击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void aBtn_Click(object sender, EventArgs e)
        {
            //ShowForm();
            ButtonEx sendButton = (ButtonEx)sender;

            this.click_NO = int.Parse(sendButton.Name);
        }
Exemplo n.º 10
0
        public MultiPagePrintControl()
        {
            InitializeComponent();

            btnMultiChart = new ButtonEx("Print Multiple Charts Per Page")
            {
                Bounds = new Rectangle(15, 19, 236, 28)
            };
            btnMultiPage = new ButtonEx("Print Multiple Charts on Multiple Pages")
            {
                Bounds = new Rectangle(275, 19, 236, 28)
            };
            btnSubCharts = new ButtonEx("Print Sub Charts With Axis")
            {
                Bounds = new Rectangle(15, 66, 236, 28)
            };
            btnStripChart = new ButtonEx("Print as Strip Chart")
            {
                Bounds = new Rectangle(275, 66, 236, 28)
            };

            btnMultiChart.Click += btnMultiChart_Click;
            btnMultiPage.Click  += btnMultiPage_Click;
            btnSubCharts.Click  += btnSubCharts_Click;
            btnStripChart.Click += btnStripChart_Click;

            this.Controls.Add(btnMultiChart);
            this.Controls.Add(btnMultiPage);
            this.Controls.Add(btnSubCharts);
            this.Controls.Add(btnStripChart);
        }
        protected override void InitializeControls()
        {
            _flexChart = new FlexChart()
            {
                Dock = DockStyle.Fill
            };
            _flexPie = new FlexPie()
            {
                Dock = DockStyle.Fill
            };
            //Set default chart to be shown
            this.Chart = _flexChart;

            _cbChartType = new ComboBoxEx("Chart Type")
            {
                DataSource = new string[] { "FlexChart", "FlexPie" }
            };
            _cbChartType.SelectedIndexChanged += _cbChartType_SelectedIndexChanged;

            _bSaveImage        = new ButtonEx("Save As Image");
            _bSaveImage.Click += _bSaveImage_Click;

            this.pnlControls.Controls.Add(_cbChartType);
            this.pnlControls.Controls.Add(_bSaveImage);
        }
Exemplo n.º 12
0
 internal void KillCoroutine(ButtonEx button)
 {
     if (null != _routine)
     {
         button.StopCoroutine(_routine);
         _routine = null;
     }
 }
Exemplo n.º 13
0
 private void AssignButtonWithCommand(ref ButtonEx button, string partId, ICommand command)
 {
     button = Template.FindName(partId, this) as ButtonEx;
     if (button != null)
     {
         button.Command = command;
     }
 }
Exemplo n.º 14
0
    private void AddEmptyCloseResponser()
    {
        var emptyClose    = UIUtil.CreateElement("InvisibleButton", "EmptyClose");
        var rectTransform = emptyClose.transform as RectTransform;

        rectTransform.MatchWhith(this.transform as RectTransform).SetAsFirstSibling();
        this.emptyCloseButton = emptyClose.GetComponent <ButtonEx>();
        this.emptyCloseButton.SetListener(() => { Close(); });
    }
Exemplo n.º 15
0
        public ComboBoxTree()
        {
            this.InitializeComponent();

            // Initializing Controls
            this.pnlBack             = new Panel();
            this.pnlBack.BorderStyle = BorderStyle.Fixed3D;
            this.pnlBack.BackColor   = Color.White;
            this.pnlBack.AutoScroll  = false;

            this.tbSelectedValue             = new TextBox();
            this.tbSelectedValue.ReadOnly    = true;
            this.tbSelectedValue.BackColor   = Color.White;
            this.tbSelectedValue.BorderStyle = System.Windows.Forms.BorderStyle.None;

            this.btnSelect           = new ButtonEx();
            this.btnSelect.Click    += new EventHandler(ToggleTreeView);
            this.btnSelect.FlatStyle = FlatStyle.Flat;

            this.lblSizingGrip            = new LabelEx();
            this.lblSizingGrip.Size       = new Size(9, 9);
            this.lblSizingGrip.BackColor  = Color.Transparent;
            this.lblSizingGrip.Cursor     = Cursors.SizeNWSE;
            this.lblSizingGrip.MouseMove += new MouseEventHandler(SizingGripMouseMove);
            this.lblSizingGrip.MouseDown += new MouseEventHandler(SizingGripMouseDown);

            this.tvTreeView              = new TreeView();
            this.tvTreeView.BorderStyle  = BorderStyle.None;// BorderStyle.Fixed3D;//
            this.tvTreeView.DoubleClick += new EventHandler(TreeViewNodeSelect);
            this.tvTreeView.Location     = new Point(0, 0);
            this.tvTreeView.LostFocus   += new EventHandler(TreeViewLostFocus);
            this.tvTreeView.Font         = new System.Drawing.Font("���ו", 10F);
            this.tvTreeView.ItemHeight   = 22;
            //this.tvTreeView.Scrollable = false;

            this.frmTreeView = new Form();
            this.frmTreeView.FormBorderStyle = FormBorderStyle.None;//FormBorderStyle.Sizable;//
            this.frmTreeView.StartPosition   = FormStartPosition.Manual;
            this.frmTreeView.ShowInTaskbar   = false;
            this.frmTreeView.BackColor       = Color.Yellow;// System.Drawing.SystemColors.Control;

            this.pnlTree             = new Panel();
            this.pnlTree.BorderStyle = BorderStyle.FixedSingle;
            this.pnlTree.BackColor   = Color.White;

            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);

            // Adding Controls to UserControl
            this.pnlTree.Controls.Add(this.lblSizingGrip);
            this.pnlTree.Controls.Add(this.tvTreeView);
            this.frmTreeView.Controls.Add(this.pnlTree);
            this.pnlBack.Controls.AddRange(new Control[] { btnSelect, tbSelectedValue });
            this.Controls.Add(this.pnlBack);
        }
Exemplo n.º 16
0
        public ComboBoxTree()
        {
            Control.CheckForIllegalCrossThreadCalls = false;//���߳������ı�����״̬
            this.InitializeComponent();

            // Initializing Controls
            this.txtBack = new TextBox();
            this.txtBack.ReadOnly = true;
            this.txtBack.Text = this.defaultText;
            this.txtBack.Tag = this.defaultValue;
            this.txtBack.BackColor = Color.White;
            this.txtBack.Cursor = System.Windows.Forms.Cursors.Default;
            //this.txtBack.Click += new EventHandler(ToggleTreeView);//���Բ�Ҫ

            this.btnSelect = new ButtonEx();
            this.btnSelect.Click += new EventHandler(ToggleTreeView);
            this.btnSelect.FlatStyle = FlatStyle.Flat;

            this.lblSizingGrip = new LabelEx();
            this.lblSizingGrip.Size = new Size(10, 10);
            this.lblSizingGrip.BackColor = Color.Transparent;
            this.lblSizingGrip.Cursor = Cursors.SizeNWSE;
            this.lblSizingGrip.MouseMove += new MouseEventHandler(SizingGripMouseMove);
            this.lblSizingGrip.MouseDown += new MouseEventHandler(SizingGripMouseDown);

            this.tvTreeView = new TreeView();
            this.tvTreeView.Dock = DockStyle.Fill;
            this.tvTreeView.BorderStyle = BorderStyle.None;
            this.tvTreeView.AfterSelect += new TreeViewEventHandler(TreeViewNodeSelect);
            this.tvTreeView.Location = new Point(0, 0);
            this.tvTreeView.LostFocus += new EventHandler(TreeViewLostFocus);

            this.frmTreeView = new Form();
            this.frmTreeView.FormBorderStyle = FormBorderStyle.None;
            this.frmTreeView.StartPosition = FormStartPosition.Manual;
            this.frmTreeView.ShowInTaskbar = false;
            this.frmTreeView.BackColor = System.Drawing.SystemColors.Control;

            this.pnlTree = new Panel();
            this.pnlTree.Dock = DockStyle.Fill;
            this.pnlTree.Padding = new Padding(0, 0, 8, 8);
            this.pnlTree.BorderStyle = BorderStyle.FixedSingle;
            this.pnlTree.BackColor = Color.White;

            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);

            // Adding Controls to UserControl
            this.pnlTree.Controls.Add(this.lblSizingGrip);
            this.pnlTree.Controls.Add(this.tvTreeView);
            this.frmTreeView.Controls.Add(this.pnlTree);
            this.txtBack.Controls.AddRange(new Control[] { btnSelect });
            this.Controls.Add(this.txtBack);
        }
Exemplo n.º 17
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            if (Template == null)
            {
                return;
            }

            ViewHost = Template.FindName("PART_ViewHost", this) as FrameworkElement;
            if (ViewHost != null)
            {
                BindingTools.SetBinding(ViewHost,
                                        FocusBahaviors.FocusBindingProperty,
                                        mainModel,
                                        nameof(mainModel.GameStatusVisible));
            }

            PanelActionButtons = Template.FindName("PART_PanelActionButtons", this) as Panel;
            if (PanelActionButtons != null)
            {
                var buttonClose = new ButtonEx();
                buttonClose.Content = ResourceProvider.GetString(LOC.CloseLabel);
                buttonClose.SetResourceReference(ButtonEx.StyleProperty, "ButtonGameStatusAction");
                buttonClose.Command = mainModel.CloseGameStatusCommand;
                PanelActionButtons.Children.Add(buttonClose);
            }

            TextStatus = Template.FindName("PART_TextStatus", this) as TextBlock;
            if (TextStatus != null)
            {
                BindingTools.SetBinding(TextStatus,
                                        TextBlock.TextProperty,
                                        mainModel,
                                        nameof(mainModel.GameStatusText));
            }

            ImageCover = Template.FindName("PART_ImageCover", this) as Image;
            if (ImageCover != null)
            {
                var sourceBinding = new PriorityBinding();
                sourceBinding.Bindings.Add(new Binding()
                {
                    Path      = new PropertyPath(nameof(GamesCollectionViewEntry.CoverImageObject)),
                    Converter = new NullToDependencyPropertyUnsetConverter()
                });
                sourceBinding.Bindings.Add(new Binding()
                {
                    Path      = new PropertyPath(nameof(GamesCollectionViewEntry.DefaultCoverImageObject)),
                    Converter = new NullToDependencyPropertyUnsetConverter()
                });

                BindingOperations.SetBinding(ImageCover, Image.SourceProperty, sourceBinding);
            }
        }
Exemplo n.º 18
0
 static public int get_onDrag(IntPtr l)
 {
     try {
         ButtonEx self = (ButtonEx)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.onDrag);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 19
0
        public ControlBar()
        {
            SuspendLayout();
            Dock = DockStyle.Bottom;

            btnPlay          = new ButtonEx(ButtonExStyle.Bitmap);
            btnPause         = new ButtonEx(ButtonExStyle.Bitmap);
            btnStop          = new ButtonEx(ButtonExStyle.Bitmap);
            btnForward       = new ButtonEx(ButtonExStyle.Bitmap);
            btnBackward      = new ButtonEx(ButtonExStyle.Bitmap);
            btnToEnd         = new ButtonEx(ButtonExStyle.Bitmap);
            btnToBegining    = new ButtonEx(ButtonExStyle.Bitmap);
            btnRepeat        = new ButtonEx(ButtonExStyle.Bitmap);
            btnMute          = new ButtonEx(ButtonExStyle.Bitmap);
            btnRepeat.Sticky = true;
            btnMute.Sticky   = true;

            seekbar   = new Dzimchuk.AUI.TrackBar(true);
            volumebar = new Dzimchuk.AUI.TrackBar(false);

            dclock = new DClock();

            Controls.AddRange(new Control[] { btnPlay, btnPause, btnStop,
                                              btnForward, btnBackward, btnToEnd,
                                              btnToBegining, btnRepeat, btnMute,
                                              seekbar, volumebar, dclock });

            tip = new ToolTip();
            UpdateToolTips();

            MouseEventHandler eh = new MouseEventHandler(OnCtrlMouseMove);

            foreach (Control c in Controls)
            {
                c.MouseMove += eh;
                c.MouseDown += eh;
                if (c is ButtonEx)
                {
                    ((ButtonEx)c).Selectable = false;
                }
                else if (c is Dzimchuk.AUI.TrackBar)
                {
                    ((Dzimchuk.AUI.TrackBar)c).Selectable = false;
                }
            }

            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint |
                     ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.Selectable, false);
            ResizeRedraw = true;

            ResumeLayout();
        }
        protected override void InitializeControls()
        {
            fpie = new FlexPie()
            {
                Dock = DockStyle.Fill
            };
            Chart = fpie;

            pnlControls.Controls.Add(new LabelEx("Inner Radius"));
            var numInnerRadius = new NumericUpDownEx()
            {
                Minimum = 0, Maximum = 0.9M, Increment = 0.1M, DecimalPlaces = 1, Value = 0
            };

            numInnerRadius.ValueChanged += (s, a) => fpie.InnerRadius = (double)numInnerRadius.Value;
            pnlControls.Controls.Add(numInnerRadius);

            pnlControls.Controls.Add(new LabelEx("Offset"));
            var numOffset = new NumericUpDownEx()
            {
                Minimum = 0, Maximum = 1, Increment = 0.1M, DecimalPlaces = 1, Value = 0
            };

            numOffset.ValueChanged += (s, a) => fpie.Offset = (double)numOffset.Value;
            pnlControls.Controls.Add(numOffset);

            var cbLabels = new CheckBoxEx("Show Labels");

            cbLabels.CheckedChanged += (s, a) => fpie.DataLabel.Position = cbLabels.Checked ? PieLabelPosition.Center : PieLabelPosition.None;
            pnlControls.SetFlowBreak(cbLabels, true);
            pnlControls.Controls.Add(cbLabels);

            var btnNew = new ButtonEx("New Data");

            btnNew.Click += (s, a) => NewData();
            pnlControls.Controls.Add(btnNew);

            var btnUpdate = new ButtonEx("Update");

            btnUpdate.Click += (s, a) => UpdateData();
            pnlControls.Controls.Add(btnUpdate);

            var btnAddPoint = new ButtonEx("+ Point");

            btnAddPoint.Click += (s, a) => AddPoint();
            pnlControls.Controls.Add(btnAddPoint);

            var btnRemovePoint = new ButtonEx("- Point");

            btnRemovePoint.Click += (s, a) => RemovePoint();
            pnlControls.Controls.Add(btnRemovePoint);
        }
Exemplo n.º 21
0
    protected override void OnEnable()
    {
        base.OnEnable();

        _onNormal      = serializedObject.FindProperty("onNormal");
        _onHighlighted = serializedObject.FindProperty("onHighlighted");
        _onPressed     = serializedObject.FindProperty("onPressed");
        _onDisabled    = serializedObject.FindProperty("onDisabled");
        _onHoverEnter  = serializedObject.FindProperty("onHoverEnter");
        _onHoverExit   = serializedObject.FindProperty("onHoverExit");

        _src = target as ButtonEx;
    }
Exemplo n.º 22
0
    // Use this for initialization
    void Start()
    {
        // 色への参照
        m_text = GetComponentInChildren <Text>();
        m_img  = GetComponent <Image>();

        // ボタンへの参照
        m_button = GetComponent <ButtonEx>();

        // 初期色の取得
        m_startTextColor = m_text.color;
        m_startImgColor  = m_img.color;
    }
Exemplo n.º 23
0
 public override bool Initialize(bool sortingEnabled, Control control)
 {
     if (!_bInitialized)
     {
         // Become invisble if security conditions are not met
         if (this.Visible)
         {
             this.Visible = ButtonEx.IsUserInAnyRole(control.Page.User, this.RolesRequired);
         }
         control.PreRender += new EventHandler(gv_PreRender);
         _bInitialized      = true;
     }
     return(base.Initialize(sortingEnabled, control));
 }
Exemplo n.º 24
0
        protected override void InitializeControls()
        {
            flexChart1 = new FlexChart();
            this.Chart = flexChart1;

            _bResetZoom        = new ButtonEx("Reset Zoom");
            _bResetZoom.Click += (s, e) =>
            {
                flexChart1.AxisX.Min = flexChart1.AxisX.Max = double.NaN;
                flexChart1.AxisY.Min = flexChart1.AxisY.Max = double.NaN;
            };

            this.pnlControls.Controls.Add(_bResetZoom);
        }
        public MaskedDatePicker()
        {
            InitializeComponent();

            _datePicker = Helpers.VisualTreeHelper.GetTemplateChild <DatePickerEx>(this, "_dtPicker");
            _button     = Helpers.VisualTreeHelper.GetTemplateChild <ButtonEx>(this, "_btnDtPicker");

            if (_datePicker != null)
            {
                _datePicker.OKClicked += (s, e) => { FireOkClicked(e); };
            }

            HandleButtonClick = new Command(() => _datePicker?.Focus());
        }
Exemplo n.º 26
0
 static public int set_dragable(IntPtr l)
 {
     try {
         ButtonEx       self = (ButtonEx)checkSelf(l);
         System.Boolean v;
         checkType(l, 2, out v);
         self.dragable = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 27
0
        public CaptionBar(Form parent)
        {
            Parent      = parent;
            this.parent = parent;

            SuspendLayout();

            Height = 26;
            Dock   = DockStyle.Top;
            Font   = new Font("Tahoma", 0.125f, FontStyle.Bold, GraphicsUnit.Inch);
            EventHandler eh = new EventHandler(OnUpdate);

            parent.Activated   += eh;
            parent.Deactivate  += eh;
            parent.TextChanged += eh;
            parent.Load        += new EventHandler(parent_Load);

            Size              size   = new Size(16, 16);
            EventHandler      ehBtn  = new EventHandler(OnCaptionBtn);
            MouseEventHandler ehBtn1 = new MouseEventHandler(OnBtnMouseMove);

            btnMin              = new ButtonEx(ButtonExStyle.Bitmap);
            btnMax              = new ButtonEx(ButtonExStyle.Bitmap);
            btnClose            = new ButtonEx(ButtonExStyle.Bitmap);
            btnMin.Size         = btnMax.Size = btnClose.Size = size;
            btnMin.Anchor       = btnMax.Anchor = btnClose.Anchor = AnchorStyles.Top | AnchorStyles.Right;
            btnMin.TabStop      = btnMax.TabStop = btnClose.TabStop = false;
            btnMin.Selectable   = btnMax.Selectable = btnClose.Selectable = false;
            btnMin.Click       += ehBtn;
            btnMax.Click       += ehBtn;
            btnClose.Click     += ehBtn;
            btnMin.MouseMove   += ehBtn1;
            btnMax.MouseMove   += ehBtn1;
            btnClose.MouseMove += ehBtn1;
            btnMin.MouseDown   += ehBtn1;
            btnMax.MouseDown   += ehBtn1;
            btnClose.MouseDown += ehBtn1;
            SetCaptionButtons(true, true, true);
            Controls.AddRange(new Control[] { btnMin, btnMax, btnClose });

            tip = new ToolTip();
            UpdateToolTips();

            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint |
                     ControlStyles.DoubleBuffer, true);
            ResizeRedraw = true;

            ResumeLayout();
        }
Exemplo n.º 28
0
    public static void Copy(ButtonEx des, Button source)
    {
        des.onClick = source.onClick;

        des.animationTriggers = source.animationTriggers;
        des.colors            = source.colors;
        des.image             = source.image;
        des.interactable      = source.interactable;
        des.navigation        = source.navigation;
        des.spriteState       = source.spriteState;
        des.targetGraphic     = source.targetGraphic;
        des.transition        = source.transition;

        des.enabled = source.enabled;
    }
Exemplo n.º 29
0
        public void SetCommand_OnButtonExWithSimpleValueNoEventName_ClickEventShouldBeUsed()
        {
            var value    = DateTime.Now.Ticks.ToString();
            var vmTarget = new TestViewModel();

            var button = new ButtonEx(Application.Context);

            button.SetCommand(
                vmTarget.SetPropertyCommand,
                value);

            Assert.IsNull(vmTarget.TargetProperty);
            button.PerformClick();
            Assert.AreEqual(value, vmTarget.TargetProperty);
        }
Exemplo n.º 30
0
        private void T1_Click(object sender, EventArgs e)
        {
            ButtonEx b = sender as ButtonEx;

            if (b != null)
            {
                int    i   = b.Flag;
                LedCmd cmd = new LedCmd();
                cmd.Buzzer         = (byte)Bs[i].SelectedIndex;
                cmd.Green          = (byte)Gs[i].SelectedIndex;
                cmd.Yellow         = (byte)Ys[i].SelectedIndex;
                cmd.Red            = (byte)Rs[i].SelectedIndex;
                Globals.LedCmd.Cmd = cmd.Cmd;
            }
        }
Exemplo n.º 31
0
        private void AssignFilter(GameField field, string bindBased, string text)
        {
            var button = new ButtonEx();

            button.Content = ResourceProvider.GetString(text);
            button.SetResourceReference(ButtonEx.StyleProperty, "FilterPanelNagivationButton");
            button.Command          = mainModel.LoadSubFilterCommand;
            button.CommandParameter = field;
            BindingTools.SetBinding(
                button,
                ButtonBase.TagProperty,
                mainModel.AppSettings.Fullscreen.FilterSettings,
                $"{bindBased}.{nameof(FilterItemProperites.IsSet)}");
            PanelItemsHost.Children.Add(button);
        }
Exemplo n.º 32
0
        public ComboBoxTree()
        {
            this.InitializeComponent();
            this.FontChanged += ComboBoxTree_FontChanged;
            // Initializing Controls
            this.pnlBack = new Panel();
            this.pnlBack.BorderStyle = BorderStyle.Fixed3D;
            this.pnlBack.BackColor = Color.White;
            this.pnlBack.AutoScroll = false;

            this.tbSelectedValue = new TextBox();
            this.tbSelectedValue.BorderStyle = System.Windows.Forms.BorderStyle.None;


            this.btnSelect = new ButtonEx();
            this.btnSelect.Click += new EventHandler(ToggleTreeView);
            this.btnSelect.FlatStyle = FlatStyle.Flat;


            this.lblSizingGrip = new LabelEx();
            this.lblSizingGrip.Size = new Size(9, 9);
            this.lblSizingGrip.BackColor = Color.Transparent;
            this.lblSizingGrip.Cursor = Cursors.SizeNWSE;
            this.lblSizingGrip.MouseMove += new MouseEventHandler(SizingGripMouseMove);
            this.lblSizingGrip.MouseDown += new MouseEventHandler(SizingGripMouseDown);

            this.tvTreeView = new TreeView();
            this.tvTreeView.BorderStyle = BorderStyle.None;
            this.tvTreeView.DoubleClick += new EventHandler(TreeViewNodeSelect);
            this.tvTreeView.Location = new Point(0, 0);
            this.tvTreeView.LostFocus += new EventHandler(TreeViewLostFocus);


            //this.tvTreeView.Scrollable = false;

            this.frmTreeView = new Form();
            this.frmTreeView.FormBorderStyle = FormBorderStyle.None;
            this.frmTreeView.StartPosition = FormStartPosition.Manual;
            this.frmTreeView.ShowInTaskbar = false;
            this.frmTreeView.BackColor = System.Drawing.SystemColors.Control;

            this.pnlTree = new Panel();
            this.pnlTree.BorderStyle = BorderStyle.FixedSingle;
            this.pnlTree.BackColor = Color.White;

            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.ResizeRedraw, true);

            // Adding Controls to UserControl
            this.pnlTree.Controls.Add(this.lblSizingGrip);
            this.pnlTree.Controls.Add(this.tvTreeView);
            this.frmTreeView.Controls.Add(this.pnlTree);
            this.pnlBack.Controls.AddRange(new Control[] { btnSelect, tbSelectedValue });
            this.Controls.Add(this.pnlBack);


        }