Exemplo n.º 1
0
 private void RemoveYearSelector(bool animate)
 {
     if (_CurrentOperation == eCurrentSingleMonthCalendarOperation.AnimatingHideYearSelector) return;
     if (animate)
     {
         _CurrentOperation = eCurrentSingleMonthCalendarOperation.AnimatingHideYearSelector;
         Rectangle targetBounds = new Rectangle(this.LeftInternal + (this.WidthInternal - 8) / 2, this.TopInternal + (this.HeightInternal - 8) / 2, 8, 8);
         DevComponents.DotNetBar.Animation.AnimationRectangle anim = new DevComponents.DotNetBar.Animation.AnimationRectangle(
             new AnimationRequest(_YearSelector, "Bounds", targetBounds),
             DevComponents.DotNetBar.Animation.AnimationEasing.EaseInOutQuad, 200);
         anim.AnimationCompleted += AnimationCompleted;
         anim.Start();
     }
     else
     {
         if (_YearSelector.Parent != null)
             _YearSelector.Parent.Controls.Remove(_YearSelector);
         _YearSelector.YearSelector.SelectedYearChanged -= YearSelectorSelectedYearChanged;
         _YearSelector.Dispose();
         _YearSelector = null;
     }
 }
Exemplo n.º 2
0
 private void SelectedCenturyChanged(object sender, EventArgs e)
 {
     this.CenturyYearStart = _CenturySelector.CenturySelector.SelectedCentury;
     Rectangle targetBounds = this.Bounds;
     DevComponents.DotNetBar.Animation.AnimationRectangle anim = new DevComponents.DotNetBar.Animation.AnimationRectangle(
         new AnimationRequest(_CenturySelector, "Bounds", new Rectangle(this.LeftInternal + (this.WidthInternal - 8) / 2, this.TopInternal + (this.HeightInternal - 8) / 2, 8, 8)),
         DevComponents.DotNetBar.Animation.AnimationEasing.EaseInOutQuad, 200);
     anim.AutoDispose = true;
     anim.AnimationCompleted += new EventHandler(AnimationCompleted);
     anim.Start();
 }
Exemplo n.º 3
0
        private void ShowYearSelection(object sender, EventArgs e)
        {
            if (!_YearSelectionEnabled || _CurrentOperation != eCurrentSingleMonthCalendarOperation.None || this.Parent is MonthCalendarItem && (((MonthCalendarItem)this.Parent).CalendarDimensions.Width > 1 || ((MonthCalendarItem)this.Parent).CalendarDimensions.Height > 1))
                return;
            _CurrentOperation = eCurrentSingleMonthCalendarOperation.AnimatingShowYearSelector;
            _YearSelector = new YearSelectorControl();
            _YearSelector.Size = new Size(8, 8);
            _YearSelector.Location = new Point(this.LeftInternal + (this.WidthInternal - 8) / 2, this.TopInternal + (this.HeightInternal - 8) / 2);
            _YearSelector.Visible = true;
            _YearSelector.Style = eDotNetBarStyle.StyleManagerControlled;

            if (BarFunctions.IsOffice2007Style(this.Style))
            {
                Office2007ColorTable table = ((Office2007Renderer)GlobalManager.Renderer).ColorTable;
                ElementStyle es = (ElementStyle)table.StyleClasses[ElementStyleClassKeys.ItemPanelKey];
                _YearSelector.BackgroundStyle.BackColor = es.BackColor;
                _YearSelector.BackgroundStyle.BackColor2 = es.BackColor2;
            }
            else
                _YearSelector.BackgroundStyle.BackColor = SystemColors.Window;
            ItemContainer nav = GetNavigationContainer();
            LabelItem label = nav.SubItems[NavMonthLabel] as LabelItem;

            if (this.EffectiveStyle != eDotNetBarStyle.Metro)
                _YearSelector.YearSelector.TextColor = label.ForeColor;

            Control cc = (Control)this.ContainerControl;
            cc.Controls.Add(_YearSelector);
            _YearSelector.YearSelector.CenturyYearStart = (this.DisplayMonth.Year / 10) * 10;
            _YearSelector.YearSelector.SelectedYear = this.DisplayMonth.Year;
            Rectangle targetBounds = this.Bounds;

            _YearSelector.YearSelector.SelectedYearChanged += YearSelectorSelectedYearChanged;

            DevComponents.DotNetBar.Animation.AnimationRectangle anim = new DevComponents.DotNetBar.Animation.AnimationRectangle(
                new AnimationRequest(_YearSelector, "Bounds", targetBounds),
                DevComponents.DotNetBar.Animation.AnimationEasing.EaseInOutQuad, 200);
            anim.AutoDispose = true;
            anim.AnimationCompleted += ShowAnimationCompleted;
            anim.Start();

        }
Exemplo n.º 4
0
        private void ShowCenturySelector(object sender, EventArgs e)
        {
            if (_CenturySelector != null) return;
            _CenturySelector = new CenturySelectorControl();
            Control parent = (Control)this.ContainerControl;

            _CenturySelector.Size = new Size(8, 8);
            _CenturySelector.Location = new Point(this.LeftInternal + (this.WidthInternal - 8) / 2, this.TopInternal + (this.HeightInternal - 8) / 2);
            _CenturySelector.Style = eDotNetBarStyle.StyleManagerControlled;
            if (BarFunctions.IsOffice2007Style(this.Style))
            {
                Office2007ColorTable table = ((Office2007Renderer)GlobalManager.Renderer).ColorTable;
                ElementStyle es = (ElementStyle)table.StyleClasses[ElementStyleClassKeys.ItemPanelKey];
                _CenturySelector.BackgroundStyle.BackColor = es.BackColor;
                _CenturySelector.BackgroundStyle.BackColor2 = es.BackColor2;
            }
            else
                _CenturySelector.BackgroundStyle.BackColor = SystemColors.Window;
            _CenturySelector.CenturySelector.TextColor = this.TextColor;
            parent.Controls.Add(_CenturySelector);

            Rectangle targetBounds = this.Bounds;
            DevComponents.DotNetBar.Animation.AnimationRectangle anim = new DevComponents.DotNetBar.Animation.AnimationRectangle(
                new AnimationRequest(_CenturySelector, "Bounds", targetBounds),
                DevComponents.DotNetBar.Animation.AnimationEasing.EaseInOutQuad, 200);
            anim.AutoDispose = true;
            anim.Start();

            _CenturySelector.CenturySelector.SelectedCenturyChanged += SelectedCenturyChanged;
        }