Esempio n. 1
0
 public void InitAutofire(int period, int duetime)
 {
     if (Timer == null)
     {
         Timer = new TaskTimer(period > 0 ? period : 50, OnFire, duetime > 0 ? duetime : 500);
     }
 }
Esempio n. 2
0
        protected void StartOutOfBoundsSelection(int direction)
        {
            if (VScrollBar == null || !VScrollBar.Visible)
            {
                return;
            }

            OutOfBondsDirection = direction;
            if (OutOfBoundsSelectionTimer == null)
            {
                OutOfBoundsSelectionTimer = new TaskTimer(50, () => {
                    if (OutOfBondsDirection < 0)
                    {
                        RowManager.SetCursorPosition(0, 0 - ScrollOffsetY - Padding.Top - RowManager.LineHeight);
                        SetSelection();
                    }
                    else if (OutOfBondsDirection > 0)
                    {
                        RowManager.SetCursorPosition(0, Height - ScrollOffsetY + Padding.Height + RowManager.LineHeight + RowManager.LineHeight);
                        SetSelection();
                    }

                    EnsureCurrentRowVisible();
                    VScrollBar.Value += OutOfBondsDirection * VScrollBar.SmallChange;
                }, 500);
                OutOfBoundsSelectionTimer.Start();
            }
            else if (!OutOfBoundsSelectionTimer.Enabled)
            {
                OutOfBoundsSelectionTimer.Start();
            }
        }
Esempio n. 3
0
        public RootContainer(IGUIContext ctx, string name)
            : base(name, Docking.Fill, new EmptyWidgetStyle())
        {
            CTX      = ctx;
            Overlays = new BinarySortedList <Widget> ();
            if (ctx != null)
            {
                this.SetSize(ctx.Width, ctx.Height);
            }

            m_Tooltip         = new TooltipWidget("root");
            m_Tooltip.MaxSize = new SizeF(320, 600);
            m_Tooltip.ZIndex  = this.ZIndex + 10000;
            AddChild(m_Tooltip);
            CanFocus           = false;
            TabIndex           = -1;
            TooltipDelayAction = new DelayedAction(500, TooltipAction);
            HeartbeatTimer     = new TaskTimer(500, Heartbeat);
            HeartbeatTimer.Start();
            HeartbeatSubscriptions = new HashSet <Widget> ();
            Tooltip  = null;
            Messages = new MessageQueue <EventMessage> (true);
        }
Esempio n. 4
0
        public MonthCalendar(string name, IGUIFont dayFont, IGUIFont titleFont)
            : base(name, Docking.Fill, new MonthCalendarStyle())
        {
            m_Weekdays = new string[7];
            for (int i = 0; i < 7; i++)
            {
                m_Weekdays [i] = CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedDayName((DayOfWeek)i);
            }

            DayFont   = dayFont;
            TitleFont = titleFont;
            this.SetIconFontByTag(CommonFontTags.SmallIcons);

            Format = new FontFormat(Alignment.Center, Alignment.Center, FontFormatFlags.Elipsis);

            this.Padding = new Padding(8);
            Timer        = new TaskTimer(150, TimerAction, 500);

            MinCircleRadius = DayFont.Measure("0").Height * 0.75f;
            MaxCircleRadius = MinCircleRadius * 1.5f;

            ShowDate();
        }