protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType)
        {
            base.OnClicked(controlId, control, actionType);
            int iYear, iMonth;

            if (control == spinStartMonth)
            {
                iYear  = spinStartYear.Value;
                iMonth = spinStartMonth.Value;
                if (iMonth == 2 && DateTime.IsLeapYear(iYear))
                {
                    spinStartDay.SetRange(1, 29);
                }
                else
                {
                    spinStartDay.SetRange(1, months[iMonth]);
                }
            }
            if (control == spinEndMonth)
            {
                iYear  = spinEndYear.Value;
                iMonth = spinEndMonth.Value;
                if (iMonth == 2 && DateTime.IsLeapYear(iYear))
                {
                    spinEndDay.SetRange(1, 29);
                }
                else
                {
                    spinEndDay.SetRange(1, months[iMonth]);
                }
            }
            if (control == btnOK)
            {
                int iHour;
                iHour = spinStartHour.Value;
                int iMin;
                iMin = spinStartMinute.Value;
                int iDay;
                iDay    = spinStartDay.Value;
                iMonth  = spinStartMonth.Value;
                iYear   = spinStartYear.Value;
                channel = spinChannel.GetLabel();

                startDateTime = new DateTime(iYear, iMonth, iDay, iHour, iMin, 0, 0);
                iHour         = spinEndHour.Value;
                iMin          = spinEndMinute.Value;
                iDay          = spinEndDay.Value;
                iMonth        = spinEndMonth.Value;
                iYear         = spinEndYear.Value;
                endDateTime   = new DateTime(iYear, iMonth, iDay, iHour, iMin, 0, 0);

                _confirmed = true;
                PageDestroy();
                return;
            }
        }
        private void ResetSpinControl()
        {
            spinImages.Reset();
            spinImages.SetRange(1, coverArtUrls.Length);
            spinImages.Value = 1;

            spinImages.ShowRange  = true;
            spinImages.UpDownType = GUISpinControl.SpinType.SPIN_CONTROL_TYPE_INT;
        }
        protected override void OnPageLoad()
        {
            base.OnPageLoad();
            spinPreRecord.SetRange(0, 30);
            spinPostRecord.SetRange(0, 30);
            TvBusinessLayer layer = new TvBusinessLayer();

            spinPreRecord.Value  = Int32.Parse(layer.GetSetting("preRecordInterval", "5").Value);
            spinPostRecord.Value = Int32.Parse(layer.GetSetting("postRecordInterval", "5").Value);

            cbAutoDeleteRecordings.Selected = (layer.GetSetting("autodeletewatchedrecordings", "no").Value == "yes");
            cbCreateTagInfoXML.Selected     = (layer.GetSetting("createtaginfoxml", "yes").Value == "yes");
        }
Exemple #4
0
        public override bool OnMessage(GUIMessage message)
        {
            if (message.TargetControlId == GetID)
            {
                if (message.SenderControlId == 0)
                {
                    if (message.Message == GUIMessage.MessageType.GUI_MSG_CLICKED)
                    {
                        _offset = (_upDownControl.Value - 1) * _itemsPerPage;
                        while (_offset >= _itemList.Count)
                        {
                            _offset--;
                        }
                    }
                }
                if (message.Message == GUIMessage.MessageType.GUI_MSG_GET_ITEM)
                {
                    int iItem = message.Param1;
                    if (iItem >= 0 && iItem < _itemList.Count)
                    {
                        message.Object = _itemList[iItem];
                    }
                    else
                    {
                        message.Object = null;
                    }
                    return(true);
                }
                if (message.Message == GUIMessage.MessageType.GUI_MSG_LOSTFOCUS ||
                    message.Message == GUIMessage.MessageType.GUI_MSG_SETFOCUS)
                {
                    base.OnMessage(message);
                    _upDownControl.Focus = Focus;
                    return(true);
                }
                if (message.Message == GUIMessage.MessageType.GUI_MSG_GET_SELECTED_ITEM)
                {
                    int iItem = _offset;
                    if (iItem >= 0 && iItem < _itemList.Count)
                    {
                        message.Object = _itemList[iItem];
                    }
                    else
                    {
                        message.Object = null;
                    }
                    return(true);
                }
                if (message.Message == GUIMessage.MessageType.GUI_MSG_LABEL_ADD)
                {
                    _containsProperty = false;
                    _property         = "";
                    GUIListItem pItem = message.Object as GUIListItem;
                    if (pItem != null)
                    {
                        _itemList.Add(pItem);
                        Calculate();
                    }
                }

                if (message.Message == GUIMessage.MessageType.GUI_MSG_LABEL_RESET)
                {
                    _containsProperty = false;
                    _property         = "";
                    _offset           = 0;
                    _itemList.DisposeAndClearList();
                    _upDownControl.SetRange(1, 1);
                    _upDownControl.Value = 1;
                }
                if (message.Message == GUIMessage.MessageType.GUI_MSG_ITEMS)
                {
                    message.Param1 = _itemList.Count;
                }
                if (message.Message == GUIMessage.MessageType.GUI_MSG_LABEL2_SET)
                {
                    int iItem = message.Param1;
                    if (iItem >= 0 && iItem < _itemList.Count)
                    {
                        GUIListItem item = (GUIListItem)_itemList[iItem];
                        item.Label2 = message.Label;
                    }
                }

                if (message.Message == GUIMessage.MessageType.GUI_MSG_LABEL_SET)
                {
                    if (message.Label != null)
                    {
                        Label = message.Label;
                    }
                }

                if (message.Message == GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED)
                {
                    message.Param1 = _offset;
                }
            }

            if (base.OnMessage(message))
            {
                return(true);
            }
            return(false);
        }
        public override bool OnMessage(GUIMessage message)
        {
            switch (message.Message)
            {
            case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT:
            {
                base.OnMessage(message);
                _confirmed = false;
                spinStartHour.SetRange(0, 23);
                spinStartHour.Value = startDateTime.Hour;

                spinStartMinute.SetRange(0, 59);
                spinStartMinute.Value = startDateTime.Minute;

                if (DateTime.IsLeapYear(startDateTime.Year) && startDateTime.Month == 2)
                {
                    spinStartDay.SetRange(1, 29);
                }
                else
                {
                    spinStartDay.SetRange(1, months[startDateTime.Month]);
                }
                spinStartDay.Value = startDateTime.Day;

                spinStartMonth.SetRange(1, 12);
                spinStartMonth.Value = startDateTime.Month;

                spinStartYear.Value = startDateTime.Year;
                spinStartYear.SetRange(2004, 2010);


                spinChannel.Reset();
                int i = 0, iSel = 0;
                foreach (string strLabel in itemList)
                {
                    spinChannel.AddLabel(strLabel, 0);
                    if (channel == strLabel)
                    {
                        iSel = i;
                    }
                    i++;
                }
                if (iSel >= 0)
                {
                    SelectItemControl(GetID, spinChannel.GetID, iSel);
                }

                spinEndHour.SetRange(0, 23);
                spinEndHour.Value = endDateTime.Hour;

                spinEndMinute.SetRange(0, 59);
                spinEndMinute.Value = endDateTime.Minute;

                if (DateTime.IsLeapYear(endDateTime.Year) && endDateTime.Month == 2)
                {
                    spinEndDay.SetRange(1, 29);
                }
                else
                {
                    spinEndDay.SetRange(1, months[endDateTime.Month]);
                }
                spinEndDay.Value = endDateTime.Day;


                spinEndMonth.SetRange(1, 12);
                spinEndMonth.Value = endDateTime.Month;


                spinEndYear.Value = endDateTime.Year;
                spinEndYear.SetRange(2004, 2010);

                spinStartHour.Disabled   = !enableEditStartTime;
                spinStartMinute.Disabled = !enableEditStartTime;
                spinStartDay.Disabled    = !enableEditStartTime;
                spinStartMonth.Disabled  = !enableEditStartTime;
                spinStartYear.Disabled   = !enableEditStartTime;

                spinChannel.Disabled = !enableEditChannel;
            }
                return(true);
            }
            return(base.OnMessage(message));
        }
 public void SetSpinRange(int iStart, int iEnd)
 {
     _spinControl.SetRange(iStart, iEnd);
 }