예제 #1
0
파일: Dash.cs 프로젝트: sillsdev/wesay
        private static string GetToolTipDescription(IThingOnDashboard dashboardItem)
        {
            string toolTipString = "\n" + dashboardItem.Description;
            ITask  task          = dashboardItem as ITask;

            if (task != null && task.GetReferenceCount() >= 0 && task.GetRemainingCount() >= 0)
            {
                toolTipString += "\n\n" + task.GetRemainingCountText() + "\n" +
                                 task.GetReferenceCountText();
            }
            return(toolTipString);
        }
예제 #2
0
파일: Dash.cs 프로젝트: sillsdev/wesay
        public DashboardButton MakeButton(IThingOnDashboard item)
        {
            switch (item.DashboardButtonStyle)
            {
            case ButtonStyle.FixedAmount:
                return(new DashboardButton(item));

            case ButtonStyle.VariableAmount:
                return(new DashboardButton(item));

            case ButtonStyle.IconFixedWidth:
                return(new DashboardButtonWithIcon(item));

            case ButtonStyle.IconVariableWidth:
                return(new DashboardButtonWithIcon(item));

            default:
                return(new DashboardButton(item));
            }
        }
예제 #3
0
파일: Dash.cs 프로젝트: sillsdev/wesay
        private DashboardButton MakeButton(IThingOnDashboard item, ButtonGroup group)
        {
            DashboardButton button = MakeButton(item);

            button.BackColor   = Color.Transparent;
            button.Font        = (Font)StringCatalog.LabelFont.Clone();
            button.AutoSize    = false;
            button.BorderColor = group.BorderColor;
            button.DoneColor   = group.DoneColor;

            button.Size         = _bestButtonSize;
            button.SizeChanged += ButtonSizeChanged;
            button.Text         = item.LocalizedLabel;
            button.Click       += OnButtonClick;
            // if fonts or text are localized, we will need to re-measure stuff
            button.TextChanged += delegate { _smallestPossibleButtonSizes = null; };
            button.FontChanged += delegate { _smallestPossibleButtonSizes = null; };
            _toolTip.SetToolTip(button, item.LocalizedLabel + GetToolTipDescription(item));
            return(button);
        }
예제 #4
0
		public DashboardButtonWithIcon(IThingOnDashboard thingToShowOnDashboard)
				: base(thingToShowOnDashboard)
		{
			_image = thingToShowOnDashboard.DashboardButtonImage;
			InitializeComponent();
		}
예제 #5
0
파일: Dash.cs 프로젝트: bbriggs/wesay
		private static string GetToolTipDescription(IThingOnDashboard dashboardItem)
		{
			string toolTipString = "\n" + dashboardItem.Description;
			ITask task = dashboardItem as ITask;
			if (task != null && task.GetReferenceCount() >= 0 && task.GetRemainingCount() >= 0)
			{
				toolTipString += "\n\n" + task.GetRemainingCountText() + "\n" +
								 task.GetReferenceCountText();
			}
			return toolTipString;
		}
예제 #6
0
파일: Dash.cs 프로젝트: bbriggs/wesay
		public DashboardButton MakeButton(IThingOnDashboard item)
		{
			switch (item.DashboardButtonStyle)
			{
				case ButtonStyle.FixedAmount:
					return new DashboardButton(item);
				case ButtonStyle.VariableAmount:
					return new DashboardButton(item);
				case ButtonStyle.IconFixedWidth:
					return new DashboardButtonWithIcon(item);
				case ButtonStyle.IconVariableWidth:
					return new DashboardButtonWithIcon(item);
				default:
					return new DashboardButton(item);
			}
		}
예제 #7
0
파일: Dash.cs 프로젝트: bbriggs/wesay
		private Control MakeButton(IThingOnDashboard item, ButtonGroup group)
		{
			DashboardButton button = MakeButton(item);
			button.BackColor = Color.Transparent;
			button.Font = Font;
			button.AutoSize = false;
			button.BorderColor = group.BorderColor;
			button.DoneColor = group.DoneColor;

			button.Dock = DockStyle.None;
			button.Anchor = AnchorStyles.None;
			button.Size = _bestButtonSize;
			button.SizeChanged += ButtonSizeChanged;
			button.Text = item.LocalizedLabel;
			button.Click += OnButtonClick;
			// if fonts or text are localized, we will need to re-measure stuff
			button.TextChanged += delegate { _smallestPossibleButtonSizes = null; };
			button.FontChanged += delegate { _smallestPossibleButtonSizes = null; };
			_toolTip.SetToolTip(button, item.LocalizedLabel + GetToolTipDescription(item));
			return button;
		}
예제 #8
0
		public DashboardButton(IThingOnDashboard thingToShowOnDashboard)
		{
			_thingToShowOnDashboard = thingToShowOnDashboard;
			InitializeComponent();
		}
예제 #9
0
 public DashboardButtonWithIcon(IThingOnDashboard thingToShowOnDashboard)
     : base(thingToShowOnDashboard)
 {
     _image = thingToShowOnDashboard.DashboardButtonImage;
     InitializeComponent();
 }
예제 #10
0
 public DashboardButton(IThingOnDashboard thingToShowOnDashboard)
 {
     _thingToShowOnDashboard = thingToShowOnDashboard;
     InitializeComponent();
 }