Example #1
0
        public SlideTaskbar(SlideTaskbarView view, MyGUIViewHost viewHost)
            : base("Lecture.GUI.SlideTaskbar.SlideTaskbar.layout", viewHost)
        {
            this.view = view;
            view.GetDesiredSizeOverride = getDesiredSize;
            this.currentFile            = view.DisplayName;
            view.DisplayNameChanged    += view_NameChanged;

            idLabel         = (TextBox)widget.findWidget("IdLabel");
            idLabel.Caption = view.DisplayName;

            int left = 1;
            int top  = TaskButtonTop;

            foreach (Task task in view.Tasks)
            {
                SlideTaskbarItem taskButton = new SlideTaskbarItem(task, widget, new IntRect(left, top, TaskButtonWidth, TaskButtonHeight));
                left += TaskButtonWidth + TaskButtonPadding;
                taskbarItems.AddLast(taskButton);
                if (left > widget.Width)
                {
                    left = 1;
                    top += TaskButtonHeight + TaskButtonPadding;
                }
                lastWidth = widget.Width;
                widget.setSize(lastWidth, top + TaskButtonHeight + TaskButtonPadding);
            }
        }
Example #2
0
 void view_NameChanged(SlideTaskbarView obj)
 {
     idLabel.Caption = view.DisplayName;
 }