"Calendar" plugin (1 Viewer)

carreno

Moderateur
  • Premium Supporter
  • July 31, 2005
    251
    25
    35
    France
    Home Country
    France France
    Hello,
    I am French, thus sorry for my English.
    I begin in the programming. Can you me help, please.
    I seek the means of associating the buttons has part of the file skin(XML).
    Can you indicate the code to do that.

    ac4gj.png


    Download:
    http://perso.wanadoo.fr/actupc/alpha_calendar_plugin.zip

    Thank you for your help. :wink:
     

    Smirnuff

    Portal Pro
    December 7, 2004
    630
    3
    United Kingdom
    Hi -

    I seek the means of associating the buttons has part of the file skin

    I'm not sure what it is that you are asking?

    If its how do you link a control (such as a GUILabelControl) to an element described in the markup then you have one of two ways, the first and most verbose would be to do something like:

    Code:
    		[SkinControlAttribute(2)]
    		GUIButtonControl _pauseButton;

    Alternatively you could bind an instance in markup to field in a class using the following code:

    Code:
    			_tetris = GetControl((int)Controls.Tetris) as MyTetrisControl;

    If this doesn't answer your question please expand on your previous request and we shall do our best to help you out.

    Cheers,
    Smirnuff.
     

    carreno

    Moderateur
  • Premium Supporter
  • July 31, 2005
    251
    25
    35
    France
    Home Country
    France France
    Smirnuff

    My code
    Code:
    using System;
    using System.Windows.Forms;
    using MediaPortal.GUI.Library;
    namespace Calendrier
    {
    	/// <summary>
    	/// Summary description for Class1.
    	/// </summary>
    	public class Class1 : GUIWindow, ISetupForm
    	{
    		public Class1()
    		{
    			//
    			// TODO: Add constructor logic here
    			//
    		}
    		#region ISetupForm Members
    
    		// Returns the name of the plugin which is shown in the plugin menu
    		public string PluginName()
    		{
    			return "Calendrier";
    		}
    
    		// Returns the description of the plugin is shown in the plugin menu
    		public string Description()
    		{
    			return "Calendrier pour MEDIAPORTAL";
    		}
    
    		// Returns the author of the plugin which is shown in the plugin menu
    		public string Author()      
    		{
    			return "Carreno";
    		}	
    		
    		// show the setup dialog
    		public void   ShowPlugin()  
    		{
    			MessageBox.Show("Rien");
    		}	
    
    		// Indicates whether plugin can be enabled/disabled
    		public bool   CanEnable()   
    		{
    			return true;
    		}	
    
    		// get ID of windowplugin belonging to this setup
    		public int    GetWindowId() 
    		{
    			return 5678;
    		}	
    		
    		// Indicates if plugin is enabled by default;
    		public bool   DefaultEnabled()
    		{
    			return true;
    		}	
    		
    
    
    		// indicates if a plugin has its own setup screen
    		public bool   HasSetup()    
    		{
    			return true;
    		}    
    	
    		/// <summary>
    		/// If the plugin should have its own button on the main menu of Media Portal then it
    		/// should return true to this method, otherwise if it should not be on home
    		/// it should return false
    		/// </summary>
    		/// <param name="strButtonText">text the button should have</param>
    		/// <param name="strButtonImage">image for the button, or empty for default</param>
    		/// <param name="strButtonImageFocus">image for the button, or empty for default</param>
    		/// <param name="strPictureImage">subpicture for the button or empty for none</param>
    		/// <returns>true  : plugin needs its own button on home
    		///          false : plugin does not need its own button on home</returns>
    		public bool   GetHome(out string strButtonText, out string strButtonImage, 
    			out string strButtonImageFocus, out string strPictureImage) 
    		{
    			strButtonText=PluginName();
    			strButtonImage=String.Empty;
    			strButtonImageFocus=String.Empty;
    			strPictureImage=String.Empty;
    			return true;
    		}
    		#endregion
    	
    		public override int GetID
    		{
    			get
    			{
    				return 5678;
    			}
    			set
    			{
    			}
    		}
    
    		public override bool Init()
    		{
    			return Load(GUIGraphicsContext.Skin+@"\Calendrier.xml");
    		}
    		[SkinControlAttribute(2)]			protected GUIButtonControl nov=null;
    		[SkinControlAttribute(3)]			protected GUIButtonControl sept=null;
    		[SkinControlAttribute(4)]			protected GUIButtonControl dece=null;
    		[SkinControlAttribute(5)]			protected GUIButtonControl octo=null;
    		[SkinControlAttribute(6)]			protected GUIButtonControl aout=null;
    		[SkinControlAttribute(7)]			protected GUIButtonControl juil=null;
    		[SkinControlAttribute(8)]			protected GUIButtonControl juin=null;
    		[SkinControlAttribute(9)]			protected GUIButtonControl mai=null;
    		[SkinControlAttribute(10)]			protected GUIButtonControl avri=null;
    		[SkinControlAttribute(11)]			protected GUIButtonControl mars=null;
    		[SkinControlAttribute(12)]			protected GUIButtonControl fevr=null;
    		[SkinControlAttribute(13)]			protected GUIButtonControl janv=null;

    can you make me the first for example. I would like that when one clic on the button "OCTOBER", the calendar of October appears. (by indicating the complete code.)

    thank you.
    :wink:
     

    mzemina

    Retired Team Member
  • Premium Supporter
  • February 23, 2005
    2,065
    14
    Tulsa, OK
    Home Country
    United States of America United States of America
    smirnuff - Please post your answer. I (I'm sure others also) would like to see what you come up with.

    Mike
     

    ByteFrenzy

    New Member
    February 20, 2005
    2
    0
    Antwerpen (Belgium)
    Hello Carreno,

    Probably I am way too early with this - you probably still have a ton of development planned.. But I think this is such a good idea that I want to give some feedback already! This is one of the things that can improve the WAF (wife says: "hey, you mean it can actualy do something USEFUL?')...

    - depending on screen size the columns in the actual calender are out of alignment

    - I did not expect it, but it actually already handles languages very nicely. The only exception are the weekday letters at the top of the calendar. I think you could get the weekday strings just like you do for the months and trim them to the first letter.

    - the user has to be able to change the year. By Christmas I will want to know what January 2006 is going to look like...

    - to be really useful, in addition to displaying the calendar, how about the possibility to add events and highlight them in the calendar? Maybe add little icons for scheduled recordings (from the planner) .

    - how about getting one of those trivia of the day from the internet? "Today, in 1836, Dr. Bellcaire from Paris built the first working computer but it was lost in the mail and everybody eventually forgot all about it"...

    I'm really looking forward to the beta of this plugin!

    Cheers and keep up the good work,

    René
     

    Users who are viewing this thread

    Top Bottom