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); }
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)); } }
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); }
public DashboardButtonWithIcon(IThingOnDashboard thingToShowOnDashboard) : base(thingToShowOnDashboard) { _image = thingToShowOnDashboard.DashboardButtonImage; InitializeComponent(); }
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; }
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); } }
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; }
public DashboardButton(IThingOnDashboard thingToShowOnDashboard) { _thingToShowOnDashboard = thingToShowOnDashboard; InitializeComponent(); }