[Mediaportal-svn] SF.net SVN: mediaportal: [9261] trunk/mediaportal/WindowPlugins/home
Turn your PC into a very advanced MediaCenter/HTPC
Brought to you by:
gereonheitmann,
morpheus_xx
From: <rt...@us...> - 2006-06-27 16:25:10
|
Revision: 9261 Author: rtv_sf Date: 2006-06-27 09:25:01 -0700 (Tue, 27 Jun 2006) ViewCVS: http://svn.sourceforge.net/mediaportal/?rev=9261&view=rev Log Message: ----------- home.cs: added #regions for better reading, fixed on message switch/case Modified Paths: -------------- trunk/mediaportal/WindowPlugins/GUITV/GUIFullScreenTV.cs trunk/mediaportal/WindowPlugins/home/home.cs Modified: trunk/mediaportal/WindowPlugins/GUITV/GUIFullScreenTV.cs =================================================================== --- trunk/mediaportal/WindowPlugins/GUITV/GUIFullScreenTV.cs 2006-06-27 15:59:39 UTC (rev 9260) +++ trunk/mediaportal/WindowPlugins/GUITV/GUIFullScreenTV.cs 2006-06-27 16:25:01 UTC (rev 9261) @@ -206,7 +206,7 @@ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) { _useVMR9Zap = xmlreader.GetValueAsBool("general", "useVMR9ZapOSD", false); - _notifyTVTimeout = xmlreader.GetValueAsInt("movieplayer", "notifyTVTimeout", 10); + _notifyTVTimeout = xmlreader.GetValueAsInt("movieplayer", "notifyTVTimeout", 15); _playNotifyBeep = xmlreader.GetValueAsBool("movieplayer", "notifybeep", true); } return Load(GUIGraphicsContext.Skin + @"\mytvFullScreen.xml"); Modified: trunk/mediaportal/WindowPlugins/home/home.cs =================================================================== --- trunk/mediaportal/WindowPlugins/home/home.cs 2006-06-27 15:59:39 UTC (rev 9260) +++ trunk/mediaportal/WindowPlugins/home/home.cs 2006-06-27 16:25:01 UTC (rev 9261) @@ -674,6 +674,7 @@ switch (message.Message) { // Initialization of the window + #region case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: { base.OnMessage(message); @@ -710,9 +711,11 @@ m_bSkipFirstMouseMove = true; return true; } - + #endregion + // Sets the focus for the controls that are on the window. // if the focus changed, then show the correct sub-picture + #region case GUIMessage.MessageType.GUI_MSG_SETFOCUS case GUIMessage.MessageType.GUI_MSG_SETFOCUS: { int iControl = message.TargetControlId; @@ -729,53 +732,156 @@ } } break; + #endregion + + #region case GUIMessage.MessageType.GUI_MSG_CLICKED case GUIMessage.MessageType.GUI_MSG_CLICKED: // Handle Menu tags - //get sender control - Log.Write(" OnMessage : MessageType.GUI_MSG_CLICKED"); - base.OnMessage(message); - int bControl = message.SenderControlId; - if (bControl > 1 && bControl < 60) { - GUIControl cntl = GetControl(bControl) as GUIControl; - if (cntl != null) - { // Call SubMenu - if (useMyPlugins == true) - { - bool isplugin = false; - for (int i = 0; i < myPluginsCount; i++) + //get sender control + Log.Write(" OnMessage : MessageType.GUI_MSG_CLICKED"); + base.OnMessage(message); + int bControl = message.SenderControlId; + if ( bControl > 1 && bControl < 60 ) + { + GUIControl cntl = GetControl(bControl) as GUIControl; + if ( cntl != null ) + { // Call SubMenu + if ( useMyPlugins == true ) { - if (bControl == myPlugins[i]) + bool isplugin = false; + for ( int i = 0; i < myPluginsCount; i++ ) { - isplugin = true; + if ( bControl == myPlugins[i] ) + { + isplugin = true; + } } + if ( isplugin == true ) + { + for ( int i = 102; i < 160; i++ ) + { + GUIControl.HideControl(GetID, i); + } + m_iButtons = 0; + inMyPlugins = true; + if ( useTopBarSub == true ) + { + topBar.UseTopBarSub = true; + topBarHome.UseTopBarSub = true; + } + + for ( int iButt = 2; iButt < 60; iButt++ ) + { + m_iButtonIds[iButt] = 0; + GUIControl bCntl = GetControl(iButt) as GUIControl; + if ( bCntl != null ) + { + Remove(iButt); + } + } + for ( int iButt = 102; iButt < 160; iButt++ ) + { + GUIControl bCntl = GetControl(iButt) as GUIControl; + if ( bCntl != null ) + { + Remove(iButt); + } + } + ResetButtons(); + ArrayList plugins = PluginManager.SetupForms; + ProcessPlugins(ref plugins); + if ( m_iButtons > 0 ) + { + while ( m_iButtons < 10 ) + ProcessPlugins(ref plugins); + } + m_aryPreControlList.Clear(); + m_aryPostControlList.Clear(); + plugins = null; + m_iCurrentButton = m_iButtons / 2; + VerifyButtonIndex(ref m_iCurrentButton); + LayoutButtons(0); + if ( m_iOffset != 0 ) + { + FocusControl(GetID, m_iButtonIds[m_iOffset + m_iMiddle]); + } + else + { + int buttonIndex = m_iCurrentButton; + + // + // Verify the button index + // + VerifyButtonIndex(ref buttonIndex); + + // + // Focus the currently selected control + // + FocusControl(GetID, buttonIndex + 2); + } + } } - if (isplugin == true) + if ( useMenus == true ) // Call submenu new style { - for (int i = 102; i < 160; i++) + GUIButtonControl button = GetControl(bControl) as GUIButtonControl; + if ( button.HyperLink == -2 ) { - GUIControl.HideControl(GetID, i); + break; } - m_iButtons = 0; - inMyPlugins = true; - if (useTopBarSub == true) + if ( button.HyperLink == -3 ) { + GoBackMenu(); + break; + } + if ( button.HyperLink == -500 ) + { + gScript.SetGlobalVar("insubmenu", inSubMenu); + gScript.StartScript(button.Label); + break; + } + if ( inSecondMenu == true ) + { + break; + } + if ( inSubMenu == true ) + { + inSecondMenu = true; + } + else + { + inSubMenu = true; + } + if ( useTopBarSub == true ) + { topBar.UseTopBarSub = true; topBarHome.UseTopBarSub = true; } + if ( noTopBar == true ) + { + topBar.UseTopBarSub = false; + topBarHome.UseTopBarSub = true; + } - for (int iButt = 2; iButt < 60; iButt++) + GUIButtonControl cButt = GetControl(bControl) as GUIButtonControl; + selectedButton = cButt.Label; + for ( int i = 102; i < 160; i++ ) { + GUIControl.HideControl(GetID, i); + } + m_iButtons = 0; + for ( int iButt = 2; iButt < 60; iButt++ ) + { m_iButtonIds[iButt] = 0; GUIControl bCntl = GetControl(iButt) as GUIControl; - if (bCntl != null) + if ( bCntl != null ) { Remove(iButt); } } - for (int iButt = 102; iButt < 160; iButt++) + for ( int iButt = 102; iButt < 160; iButt++ ) { GUIControl bCntl = GetControl(iButt) as GUIControl; - if (bCntl != null) + if ( bCntl != null ) { Remove(iButt); } @@ -783,18 +889,54 @@ ResetButtons(); ArrayList plugins = PluginManager.SetupForms; ProcessPlugins(ref plugins); - if (m_iButtons > 0) + if ( menuView > m_iButtons && noScrollSubs == true ) { - while (m_iButtons < 10) - ProcessPlugins(ref plugins); + int xm = ( menuView - m_iButtons ) / 2; + for ( int iButt = 2; iButt < 60; iButt++ ) + { + m_iButtonIds[iButt] = 0; + GUIControl bCntl = GetControl(iButt) as GUIControl; + if ( bCntl != null ) + { + Remove(iButt); + } + } + for ( int iButt = 102; iButt < 160; iButt++ ) + { + GUIControl bCntl = GetControl(iButt) as GUIControl; + if ( bCntl != null ) + { + Remove(iButt); + } + } + m_iButtons = 0; + for ( int i = 0; i < xm - 1; i++ ) AddPluginButton(-2, " ", "", "", ""); + ProcessPlugins(ref plugins); + for ( int i = 0; i < xm + 1; i++ ) AddPluginButton(-2, " ", "", "", ""); + ProcessPlugins(ref plugins); + for ( int i = 0; i < xm + 1; i++ ) AddPluginButton(-2, " ", "", "", ""); + ProcessPlugins(ref plugins); + AddPluginButton(-2, " ", "", "", ""); } + else + { + if ( m_iButtons > 0 ) + { + while ( m_iButtons < 10 ) + ProcessPlugins(ref plugins); + } + } m_aryPreControlList.Clear(); m_aryPostControlList.Clear(); plugins = null; m_iCurrentButton = m_iButtons / 2; + for ( int i = 102; i < 160; i++ ) + { + GUIControl.HideControl(GetID, i); + } VerifyButtonIndex(ref m_iCurrentButton); LayoutButtons(0); - if (m_iOffset != 0) + if ( m_iOffset != 0 ) { FocusControl(GetID, m_iButtonIds[m_iOffset + m_iMiddle]); } @@ -814,144 +956,11 @@ } } } - if (useMenus == true) // Call submenu new style - { - GUIButtonControl button = GetControl(bControl) as GUIButtonControl; - if (button.HyperLink == -2) - { - break; - } - if (button.HyperLink == -3) - { - GoBackMenu(); - break; - } - if (button.HyperLink == -500) - { - gScript.SetGlobalVar("insubmenu", inSubMenu); - gScript.StartScript(button.Label); - break; - } - if (inSecondMenu == true) - { - break; - } - if (inSubMenu == true) - { - inSecondMenu = true; - } - else - { - inSubMenu = true; - } - if (useTopBarSub == true) - { - topBar.UseTopBarSub = true; - topBarHome.UseTopBarSub = true; - } - if (noTopBar == true) - { - topBar.UseTopBarSub = false; - topBarHome.UseTopBarSub = true; - } - - GUIButtonControl cButt = GetControl(bControl) as GUIButtonControl; - selectedButton = cButt.Label; - for (int i = 102; i < 160; i++) - { - GUIControl.HideControl(GetID, i); - } - m_iButtons = 0; - for (int iButt = 2; iButt < 60; iButt++) - { - m_iButtonIds[iButt] = 0; - GUIControl bCntl = GetControl(iButt) as GUIControl; - if (bCntl != null) - { - Remove(iButt); - } - } - for (int iButt = 102; iButt < 160; iButt++) - { - GUIControl bCntl = GetControl(iButt) as GUIControl; - if (bCntl != null) - { - Remove(iButt); - } - } - ResetButtons(); - ArrayList plugins = PluginManager.SetupForms; - ProcessPlugins(ref plugins); - if (menuView > m_iButtons && noScrollSubs == true) - { - int xm = (menuView - m_iButtons) / 2; - for (int iButt = 2; iButt < 60; iButt++) - { - m_iButtonIds[iButt] = 0; - GUIControl bCntl = GetControl(iButt) as GUIControl; - if (bCntl != null) - { - Remove(iButt); - } - } - for (int iButt = 102; iButt < 160; iButt++) - { - GUIControl bCntl = GetControl(iButt) as GUIControl; - if (bCntl != null) - { - Remove(iButt); - } - } - m_iButtons = 0; - for (int i = 0; i < xm - 1; i++) AddPluginButton(-2, " ", "", "", ""); - ProcessPlugins(ref plugins); - for (int i = 0; i < xm + 1; i++) AddPluginButton(-2, " ", "", "", ""); - ProcessPlugins(ref plugins); - for (int i = 0; i < xm + 1; i++) AddPluginButton(-2, " ", "", "", ""); - ProcessPlugins(ref plugins); - AddPluginButton(-2, " ", "", "", ""); - } - else - { - if (m_iButtons > 0) - { - while (m_iButtons < 10) - ProcessPlugins(ref plugins); - } - } - m_aryPreControlList.Clear(); - m_aryPostControlList.Clear(); - plugins = null; - m_iCurrentButton = m_iButtons / 2; - for (int i = 102; i < 160; i++) - { - GUIControl.HideControl(GetID, i); - } - VerifyButtonIndex(ref m_iCurrentButton); - LayoutButtons(0); - if (m_iOffset != 0) - { - FocusControl(GetID, m_iButtonIds[m_iOffset + m_iMiddle]); - } - else - { - int buttonIndex = m_iCurrentButton; - - // - // Verify the button index - // - VerifyButtonIndex(ref buttonIndex); - - // - // Focus the currently selected control - // - FocusControl(GetID, buttonIndex + 2); - } - } - } + } } break; } + return base.OnMessage(message); } #endregion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |