コード例 #1
0
        protected void SetImageToGui(string imageFilePath)
        {
            if (string.IsNullOrEmpty(imageFilePath))
            {
                return;
            }

            string texture = GetTextureFromFile(imageFilePath);

            if (GUITextureManager.LoadFromMemory(ImageFast.FromFile(imageFilePath), texture, 0, 0, 0) > 0)
            {
                ThumbnailImage = texture;
                IconImage      = texture;
                IconImageBig   = texture;
            }

            // if selected and GUIActors is current window force an update of thumbnail
            GUIActors actorWindow = GUIWindowManager.GetWindow(GUIWindowManager.ActiveWindow) as GUIActors;

            if (actorWindow != null)
            {
                GUIListItem selectedItem = GUIControl.GetSelectedListItem(9816, 50);
                if (selectedItem == this)
                {
                    GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECT, GUIWindowManager.ActiveWindow, 0, 50, ItemId, 0, null));
                }
            }
        }
コード例 #2
0
ファイル: GUIRSSFeed.cs プロジェクト: c3333/MediaPortal-1
        private GUIListItem GetSelectedItem()
        {
            int iControl;

            iControl = (int)Controls.CONTROL_LIST;
            GUIListItem item = GUIControl.GetSelectedListItem(GetID, iControl);

            return(item);
        }
コード例 #3
0
ファイル: GUIRSSFeed.cs プロジェクト: c3333/MediaPortal-1
        private void UpdateButtons()
        {
            GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNREFRESH, GUILocalizeStrings.Get(184)); //Refresh
            GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELCHANNEL, m_strDescription);          //Channel name label
            GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(9) + @"/" + m_strSiteName);

            int posX = m_pSiteImage.XPosition;
            int posY = m_pSiteImage.YPosition;

            m_pSiteImage.SetPosition(posX, posY);
            m_pSiteImage.ColourDiffuse = 0xffffffff;
            m_pSiteImage.SetFileName(m_strSiteIcon);

            //			m_pSiteImage.Width = m_pSiteImage.TextureWidth;
            //			m_pSiteImage.Height = m_pSiteImage.TextureHeight;

            GUIControl.ClearControl(GetID, (int)Controls.CONTROL_LIST);

            int iTotalItems = 0;

            foreach (feed_details feed in m_feed_details)
            {
                if (feed.m_title == "" && feed.m_description == "")
                {
                    // Skip this empty item
                    continue;
                }

                GUIListItem item = new GUIListItem();
                item.Label          = feed.m_title;
                item.IsFolder       = false;
                item.MusicTag       = feed;
                item.ThumbnailImage = "";
                item.IconImage      = "defaultMyNews.png";

                GUIControl.AddListItemControl(GetID, (int)Controls.CONTROL_LIST, item);
                iTotalItems++;
            }

            //set object count label
            GUIPropertyManager.SetProperty("#itemcount", Util.Utils.GetObjectCountLabel(iTotalItems));

            GUIControl.FocusControl(GetID, (int)Controls.CONTROL_LIST);

            GUIListItem selecteditem = GUIControl.GetSelectedListItem(GetID, (int)Controls.CONTROL_LIST);

            if (selecteditem != null)
            {
                GUIPropertyManager.SetProperty("#selecteditem", selecteditem.Label);
            }

            GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STORYTEXT, m_feed_details[0].m_description);
        }
コード例 #4
0
        /// <summary>
        /// Sends a Thread message to select an item on a facade object. Will only send if itemid parameter is currently selected
        /// </summary>
        /// <param name="self">the list object</param>
        /// <param name="windowId">the window id containing list control</param>
        /// <param name="index">the item id in list to check if selected</param>
        /// <param name="controlId">the id of the list control, defaults to 50</param>
        public static void UpdateItemIfSelected(this GUIListItem self, int windowId, int index, int controlId = 50)
        {
            if (GUIWindowManager.ActiveWindow != windowId)
            {
                return;
            }

            GUIListItem selectedItem = GUIControl.GetSelectedListItem(windowId, controlId);

            // only send message if the current item is selected
            if (selectedItem == self)
            {
                GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECT, GUIWindowManager.ActiveWindow, 0, controlId, index, 0, null));
            }
        }
コード例 #5
0
        protected void SetImageToGui(string imageFilePath)
        {
            ThumbnailImage = imageFilePath;
            IconImage      = imageFilePath;
            IconImageBig   = imageFilePath;

            // if selected and OnlineVideos is current window force an update of #selectedthumb
            GUIOnlineVideos ovsWindow = GUIWindowManager.GetWindow(GUIWindowManager.ActiveWindow) as GUIOnlineVideos;

            if (ovsWindow != null)
            {
                int         listControlId = ovsWindow.CurrentState == GUIOnlineVideos.State.details ? 51 : 50;
                GUIListItem selectedItem  = GUIControl.GetSelectedListItem(GUIOnlineVideos.WindowId, listControlId);
                if (selectedItem == this)
                {
                    GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECT, GUIWindowManager.ActiveWindow, 0, listControlId, ItemId, 0, null));
                }
            }
        }
コード例 #6
0
        /// <summary>
        /// Sends a Thread message to select an item on a facade object. Will only send if itemid parameter is currently selected
        /// </summary>
        /// <param name="self">the list object</param>
        /// <param name="windowId">the window id containing list control</param>
        /// <param name="index">the item id in list to check if selected</param>
        /// <param name="controlId">the id of the list control, defaults to 50</param>
        public static void UpdateItemIfSelected(this GUIListItem self, int windowId, int index, int controlId = 50)
        {
            if (GUIWindowManager.ActiveWindow != windowId)
            {
                return;
            }

            try
            {
                GUIListItem selectedItem = GUIControl.GetSelectedListItem(windowId, controlId);

                // only send message if the current item is selected
                if (selectedItem == self)
                {
                    GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECT, GUIWindowManager.ActiveWindow, 0, controlId, index, 0, null));
                }
            }
            catch (Exception)
            {
                TraktLogger.Warning("Unable to update selected facade item, MediaPortal could not get a reference");
            }
        }
コード例 #7
0
ファイル: GuideSearchBase.cs プロジェクト: twemperor/ARGUS-TV
 private GUIListItem GetSelectedItem()
 {
     return(GUIControl.GetSelectedListItem(GetID, _viewsList.GetID));
 }
コード例 #8
0
ファイル: UpcomingBase.cs プロジェクト: rob-opsi/ARGUS-TV
        private GUIListItem GetSelectedItem()
        {
            int controlId = _viewsList.GetID;

            return(GUIControl.GetSelectedListItem(GetID, controlId));
        }