Exemple #1
0
 public Team(TeamData td, SetDataTriggerHandler dataHandler, bool canFocus)
 {
     this.Build();
     teamData = td;
     MiscHelpers.SetIsShown(vboxInfos, false);
     MiscHelpers.SetIsShown(lblFullTeamName, false);
     if (teamData == null)
     {
         Label lbl = new Label();
         lbl.Markup = "<i>No Team</i>";
         alBtn.Add(lbl);
         alBtn.ShowAll();
         return;
     }
     td.Sort();
     btnExpand          = new MyButton(this, teamData.TeamName, "go-down", "go-next");
     btnExpand.CanFocus = canFocus;
     btnExpand.Clicked += OnBtnExpandClicked;
     alBtn.Add(btnExpand);
     alBtn.ShowAll();
     // conflict...not shown by default
     btnConflict = new MyConflictButton();
     alConflictBtn.Add(btnConflict);
     // when members are draggable, team is also draggable.
     if (dataHandler != null)
     {
         SetDataTrigger += dataHandler;
     }
     SetupTeamMembers(dataHandler);
 }
Exemple #2
0
        public DebaterWidget(RoundDebater rd, bool canFocus, bool showDebaterName)
        {
            this.Build();
            roundDebater = rd;
            debater      = null;
            debaterValid = false;
            infoWidgets  = new Dictionary <string, Widget>();

            if (roundDebater == null)
            {
                Label lbl = new Label();
                lbl.Markup = "<i>No Debater</i>";
                lbl.Xalign = 0f;
                alBtn.Add(lbl);
                alBtn.ShowAll();
                MiscHelpers.SetIsShown(hboxInfo, false);
                return;
            }

            // btnExpand Setup
            btnExpand = new MyButton(this, rd.Name.ToString(),
                                     "weather-clear", "weather-clear-night");
            btnExpand.CanFocus = canFocus;
            btnExpand.Clicked += OnBtnExpandClicked;
            alBtn.Add(btnExpand);
            alBtn.ShowAll();

            // infoLabels Setup
            SetupInfo(showDebaterName);

            // conflict notifications
            btnConflict = new MyConflictButton();
            alConflictBtn.Add(btnConflict);

            //  (default not shown,
            // activated by ShowJudgeAvail from DebaterPool)
            btnJudgeState = new MyJudgeStateButton(roundDebater);
            btnExpand.SetStrikeThrough(!rd.JudgeAvail);
            btnJudgeState.Changed += delegate {
                btnExpand.SetStrikeThrough(!rd.JudgeAvail);
                if (JudgeStateChanged != null)
                {
                    JudgeStateChanged(this, EventArgs.Empty);
                }
            };
            alJudgeState.Add(btnJudgeState);
            alJudgeState.NoShowAll = true;

            // SetIsShown in Realized so that everything is counted correctly by triggered events
            Realized += delegate(object sender, EventArgs e) {
                MiscHelpers.SetIsShown(this, roundDebater.IsShown);
                MiscHelpers.SetIsShown(hboxInfo, false);
            };
        }