コード例 #1
0
ファイル: MainForm.cs プロジェクト: staherianYMCA/test
        private void Form_Load(object sender, EventArgs e)
        {
            customDateNavigator1.CellStyleProvider = new CustomCellStyleProvider(customDateNavigator1);
            schedulerControl1.BeginUpdate();
            schedulerControl1.OptionsView.FirstDayOfWeek = FirstDayOfWeek.Sunday;
            schedulerControl1.WorkDays.Clear();
            // Specify working days of a week. Friday and Saturday are weekend holidays.
            schedulerControl1.WorkDays.Add(WeekDays.Sunday | WeekDays.Monday
                                           | WeekDays.Tuesday | WeekDays.Wednesday
                                           | WeekDays.Thursday);
            GenerateHolidaysFor2015();
            schedulerControl1.EndUpdate();
            schedulerControl1.ActiveViewType       = SchedulerViewType.Day;
            customDateNavigator1.HighlightHolidays = true;
            customDateNavigator1.DateTime          = new DateTime(2015, 02, 26);

            customDateNavigator2.CellStyleProvider = new CustomCellStyleProviderII();
            var cb = new ContextButton()
            {
                Alignment  = ContextItemAlignment.TopNear,
                Visibility = ContextItemVisibility.Hidden
            };

            customDateNavigator2.CellSize = new Size(50, 50);
            customDateNavigator2.ContextButtons.Add(cb);
            customDateNavigator2.ContextButtonCustomize  += customDateNavigator2_ContextButtonCustomize;
            customDateNavigator2.CustomDrawDayNumberCell += customDateNavigator2_CustomDrawDayNumberCell;
        }
コード例 #2
0
        void RefreshContextState()
        {
            ContextButton.RemoveFromClassList("pressed");
            ImmediateWindow.CurrentWindow.SetSideViewVisibility(ShowContext);

            if (ShowContext)
            {
                ContextButton.AddToClassList("pressed");
            }
        }
コード例 #3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            dateEdit1.DateTime = calendarControl1.DateTime = new DateTime(2016, 12, 31);
            dateEdit1.Properties.CellStyleProvider = calendarControl1.CellStyleProvider = new CustomCellStyleProvider();

            ContextButton cb = new ContextButton()
            {
                Alignment = ContextItemAlignment.TopNear, Visibility = ContextItemVisibility.Hidden
            };

            calendarControl1.CellSize = new Size(50, 50);
            calendarControl1.ContextButtons.Add(cb);
            calendarControl1.ContextButtonCustomize += CalendarControl1_ContextButtonCustomize;
        }
コード例 #4
0
    public void Open(Selectable selectable)
    {
        ProcessSlider.gameObject.SetActive(false);
        ProcessText.gameObject.SetActive(false);
        currentSelectable = selectable;
        Overlay.SetActive(true);
        foreach (var contextButtonObject in ContextButtonObjects)
        {
            Destroy(contextButtonObject);
        }
        ContextButtonObjects.Clear();
        HeaderText.text = selectable.Name + " lvl " + selectable.Level;

        foreach (var action in selectable.Actions)
        {
            Debug.Log(action.Name);
            GameObject contextButtonObject = Instantiate(ContextButtonPrefab) as GameObject;

            ContextButton contextButton = contextButtonObject.GetComponent <ContextButton> ();
            contextButton.ActionText.text = action.Name;
            contextButton.CostText.text   = "" + action.Cost;
            if (action.Cost == 0)
            {
                contextButton.CostText.gameObject.SetActive(false);
            }

            contextButton.MyButton.onClick.AddListener(delegate {
                action.Execute();
            });
            contextButton.ActionIcon.sprite = action.Icon;
            contextButtonObject.transform.SetParent(ButtonsContainer.transform);
            contextButtonObject.transform.localScale = Vector3.one;
            ContextButtonObjects.Add(contextButtonObject);
        }

        if (selectable.Process != null && selectable.InProcess)
        {
            ProcessSlider.gameObject.SetActive(true);
            ProcessText.gameObject.SetActive(true);

            ProcessSlider.value    = selectable.InitialProcessSeconds - selectable.GetProcessSeconds();
            ProcessSlider.maxValue = selectable.InitialProcessSeconds;

            ProcessText.text = string.Format("{0}: {1:D2}:{2:D2}:{3:D2}", selectable.Process, 0, 0, (int)selectable.GetProcessSeconds());
        }
    }
コード例 #5
0
        private void dateEdit1_Popup(object sender, EventArgs e)
        {
            PopupDateEditForm popupForm = ((sender as IPopupControl).PopupWindow as PopupDateEditForm);

            if (popupForm.Calendar.ContextButtons.Count > 0)
            {
                popupForm.Calendar.ContextButtons.Clear();
            }
            ContextButton contextButton1 = new ContextButton();

            contextButton1.Alignment  = ContextItemAlignment.Center;
            contextButton1.Name       = "ContextButton";
            contextButton1.Visibility = ContextItemVisibility.Visible;
            popupForm.Calendar.ContextButtons.Add(contextButton1);
            popupForm.Calendar.ContextButtonClick     += Calendar_ContextButtonClick;
            popupForm.Calendar.ContextButtonCustomize += Calendar_ContextButtonCustomize;
        }
コード例 #6
0
        private void AddCustomImage(Image image, string imageName)
        {
            _message.IconName = imageName;
            pictureIcon.Image = image;

            pictureIcon.Properties.ContextButtons.Clear();
            ContextButton contextButton1 = new ContextButton();
            ContextButton contextButton2 = new ContextButton();

            contextButton1.ImageOptionsCollection.ItemNormal.Image = Resources.info_16;
            contextButton1.Name    = "cbPictureInfo";
            contextButton1.ToolTip = imageName;
            contextButton2.AlignmentOptions.Position = ContextItemPosition.Far;
            contextButton2.ImageOptionsCollection.ItemNormal.Image = Resources.remove_16;
            contextButton2.Name   = "cbPictureRemove";
            contextButton2.Click += ClearCustomImage;

            pictureIcon.Properties.ContextButtons.Add(contextButton1);
            pictureIcon.Properties.ContextButtons.Add(contextButton2);
            pictureIcon.Click -= PictureIcon_Click;
        }
コード例 #7
0
        public ConsoleToolbar()
        {
            root = Resources.GetTemplate("ConsoleToolbar.uxml");
            Add(root);
            root.StretchToParentSize();

            ClearButton.RegisterCallback <MouseDownEvent>(ClearClick);
            ClearButton.RegisterCallback <MouseUpEvent>(ClearStopClick);
            MultilineButton.RegisterCallback <MouseDownEvent>(ConsoleExpandToggle);
            ContextButton.RegisterCallback <MouseDownEvent>(ContextExpandToggle);
            RunButton.RegisterCallback <MouseDownEvent>(RunClick);
            RunButton.RegisterCallback <MouseUpEvent>(ClearRunClick);
            ResetButton.RegisterCallback <MouseUpEvent>(ResetClick);
            TemplatesDropdown.RegisterCallback <MouseUpEvent>(TemplatesClick);
            PrivateToggle.RegisterValueChangedCallback(OnPrivateToggle);

            PrivateToggle.value = State.Instance.ShowPrivate;

            OnPrivateToggle(null);
            RefreshConsoleState();
            RefreshContextState();
        }
コード例 #8
0
 public void SetupUnselectedAllButton(Action OnSelected)
 {
     this.UnselectAllButton = new ContextButton(this, "U_All", OnSelected);
 }
コード例 #9
0
 public void SetupRefreshButton(Action OnSelected)
 {
     this.RefreshButton = new ContextButton(this, "Refresh", OnSelected);
 }