private void SetupPanes() { if( ! panesSetup ) { tabLabelsPane = RootContext.CreateWidget<Pane>(); tabDisplayPane = RootContext.CreateWidget<Pane>(); tabList = RootContext.CreateWidget<HtmlElement>(); tabList.TagName = "ul"; tabLabelsPane.Id = "labels"; tabDisplayPane.Id = "display"; tabLabelsPane.ClassName = "TabLabels"; log.Debug("setting up tab panes, labelclass: ", labelClass ); if( labelClass != null ) tabLabelsPane.AppendClass(labelClass); tabDisplayPane.ClassName = "TabContent"; if ( UseClearFix ) tabDisplayPane.AppendClass("clearfix"); tabLabelsPane.Add(tabList); panesSetup = true; base.Add( tabLabelsPane ); base.Add( tabDisplayPane ); } }
public override void PostInitialize() { base.PostInitialize(); log.Debug("PostInit BEGIN"); Pane tones = this.Find <Pane>("Tones"); Pane seals = this.Find <Pane>("Seals"); Pane guides = this.Find <Pane>("Guides"); Pane allies = this.Find <Pane>("Allies"); Pane secrets = this.Find <Pane>("Secret"); Pane focus = this.Find <Pane>("Focus"); DreamFriend = (DreamFolk)this.Record; Repeater <DreamFolk> toneList = Find <Repeater <DreamFolk> >("toneList"); if (toneList != null && DreamFriend != null && DreamFriend.Tones.Count > 0) { tones.AppendClass("clearfix"); toneList.DataSource = DreamFriend.Tones; toneList.DataBind(); } else { tones.AppendClass("none"); } Repeater <DreamFolk> sealList = Find <Repeater <DreamFolk> >("sealList"); if (sealList != null && DreamFriend != null && DreamFriend.Seals.Count > 0) { seals.AppendClass("clearfix"); sealList.DataSource = DreamFriend.Seals; sealList.DataBind(); } else { seals.AppendClass("none"); } Repeater <DreamFolk> guideList = Find <Repeater <DreamFolk> >("guideList"); if (guideList != null && DreamFriend != null && DreamFriend.Guides.Count > 0) { guides.AppendClass("clearfix"); guideList.DataSource = DreamFriend.Guides; guideList.DataBind(); } else { guides.AppendClass("none"); } Repeater <DreamFolk> alliesList = Find <Repeater <DreamFolk> >("alliesList"); if (alliesList != null && DreamFriend != null && DreamFriend.Allies.Count > 0) { allies.AppendClass("clearfix"); alliesList.DataSource = DreamFriend.Allies; alliesList.DataBind(); } else { allies.AppendClass("none"); } Repeater <DreamFolk> secretList = Find <Repeater <DreamFolk> >("secretList"); if (secretList != null && DreamFriend != null && DreamFriend.Occults.Count > 0) { secrets.AppendClass("clearfix"); secretList.DataSource = DreamFriend.Occults; secretList.DataBind(); } else { secrets.AppendClass("none"); } Repeater <DreamFolk> focusList = Find <Repeater <DreamFolk> >("focusList"); if (focusList != null && DreamFriend != null && DreamFriend.FocusList.Count > 0) { focus.AppendClass("clearfix"); focusList.DataSource = DreamFriend.FocusList; focusList.DataBind(); } else { focus.AppendClass("none"); } log.Debug("PostInit END"); }
public override void PostInitialize() { Glyph glyph; GlyphLabel glyphLabel; Tone tone; ToneLabel toneLabel; int kin; Pane col; Pane row; int kinIndex = 1; int toneIndex = 1; Label columnLabel, waveSpellLabel; Pane main = this.RootContext.CreateWidget <Pane>(this); main.AppendClass("main"); main.AppendClass("clearfix"); for (int colIndex = 0; colIndex <= 13; colIndex++) { //log.Debug("colIndex is " + colIndex); col = this.RootContext.CreateWidget <Pane>(main); col.AppendClass("column"); col.AppendClass("col-" + colIndex); for (int rowIndex = 0; rowIndex <= 20; rowIndex++) { //log.Debug("rowIndex is " + rowIndex); row = this.RootContext.CreateWidget <Pane>(col); row.AppendClass("row"); row.AppendClass("row-" + colIndex); if (colIndex == 0) { if (rowIndex > 0) { glyph = new Glyph(); kin = kinIndex++; // if ( kin == Main.Current.Now.Kin ) // row.AppendClass("kin-today"); glyph.Name = "Glyph " + kin; glyph.Image = new ImageRecord(); glyph.Image.Url = "/Images/glyph" + kin + ".gif"; glyphLabel = this.RootContext.CreateWidget <GlyphLabel>(row); glyphLabel.Text = "<img src=\"" + glyph.Image.Url + "\" class=\"glyph\">"; //log.Debug("Made and added glpyh " + glyph.Name); } } else if (rowIndex == 0) { columnLabel = this.RootContext.CreateWidget <Label>(row); columnLabel.Text = "" + colIndex; columnLabel.AppendClass("column-label"); if (colIndex == 1) { kinIndex = 1; } } else { tone = new Tone(); toneIndex = NextToneNumber(); kin = kinIndex++; if (kin == Main.Current.Now.Kin) { row.AppendClass("kin-today"); } //tone.Name = "Tone " + toneIndex; tone.Image = new ImageRecord(); tone.Image.Url = "/Images/tone" + toneIndex + ".gif"; toneLabel = this.RootContext.CreateWidget <ToneLabel>(row); toneLabel.Text = "<img src=\"" + tone.Image.Url + "\" class=\"tone\">"; //log.Debug("Made and added tone " + tone.Name); waveSpellLabel = this.RootContext.CreateWidget <Label>(row); waveSpellLabel.Text = "spell: " + NextWaveSpellNumber(); waveSpellLabel.AppendClass("wavespell-label"); waveSpellLabel = this.RootContext.CreateWidget <Label>(row); waveSpellLabel.Text = "kin: " + kin; waveSpellLabel.AppendClass("kin-label"); //if ( toneIndex == Main.Current.Now.Tone.Number ) // row.AppendClass("tone-today"); if (kin == 1 || kin == 20 || kin == 22 || kin == 39 || kin == 43 || kin == 58 || kin == 64 || kin == 77 || kin == 85 || kin == 96 || (kin >= 106 && kin <= 115) || (kin == 88 || kin == 69 || kin == 50 || kin == 51 || kin == 72 || kin == 93) || (kin == 168 || kin == 189 || kin == 210 || kin == 211 || kin == 192 || kin == 173) || (kin >= 146 && kin <= 155) || kin == 165 || kin == 176 || kin == 184 || kin == 197 || kin == 203 || kin == 218 || kin == 222 || kin == 239 || kin == 241 || kin == 260) { row.AppendClass("portal"); } } } } // // // for (int i = 1; i <= 20; i++) // { // log.Debug("i is " + i); // glyph = new Glyph(); // glyph.Name = "Glyph " + i; // glyph.Image = new ImageRecord(); // glyph.Image.Url = "/Images/glyph" + i + ".gif"; // glyphLabel = this.RootContext.CreateWidget<GlyphLabel>(this); // glyphLabel.Text = "<img src=\"" + glyph.Image.Url + "\">"; // log.Debug("Made and added glpyh " + glyph.Name); // } // for (int i = 1; i <= 13; i++) // { // log.Debug("i is " + i); // tone = new Tone(); // //tone.Name = "Tone " + i; // tone.Image = new ImageRecord(); // tone.Image.Url = "/Images/tone" + i + ".gif"; // toneLabel = this.RootContext.CreateWidget<ToneLabel>(this); // toneLabel.Text = "<img src=\"" + tone.Image.Url + "\" >"; // log.Debug("Made and added tone " + tone.Name); // } }