public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { DataListViewCell cell = (DataListViewCell)tableView.DequeueReusableCell("CurrentFeatsViewCell"); if (cell == null) { cell = new DataListViewCell(UITableViewCellStyle.Default, "CurrentFeatsViewCell"); } Spell.SpellAdjuster.LevelAdjusterInfo info = state._spell.Adjuster.Levels[indexPath.Row]; cell.TextLabel.Text = info.Class; cell.TextLabel.Font = UIFont.SystemFontOfSize(15); GradientButton b = new GradientButton(); b.Frame = new CGRect(0, 3, 160, 22); b.TitleLabel.Font = UIFont.SystemFontOfSize(15); CMStyles.TextFieldStyle(b); b.SetText(info.Class); b.TouchUpInside += (sender, e) => state.SpellLevelClicked(info); UIView view = new UIView(); UIButton x = new UIButton(); UIImage redx = UIImage.FromFile("Images/External/redx.png"); x.SetImage(redx, UIControlState.Normal); x.Frame = new CGRect(165, 0, redx.Size.Width, redx.Size.Height); x.TouchUpInside += (sender, e) => state.DeleteLevelClicked(info); view.Bounds = new CGRect(0, 0, x.Frame.Right, x.Frame.Bottom); view.Add(b); view.Add(x); cell.AccessoryView = view; return(cell); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { DataListViewCell cell = (DataListViewCell)tableView.DequeueReusableCell("ImportExportDialogCell"); if (cell == null) { cell = new DataListViewCell(UITableViewCellStyle.Default, "ImportExportDialogCell"); } cell.ImageView.Image = SelectedList[indexPath.Row].IsChecked?checkedImage:uncheckedImage; cell.Data = SelectedList[indexPath.Row]; cell.TextLabel.Text = SelectedList[indexPath.Row].Text; return(cell); }
void UpdateCell(Character ch, DataListViewCell cell) { cell.Data = ch; cell.TextLabel.Text = ch.Name; if (ch == _CombatState.CurrentCharacter) { cell.TextLabel.Font = _FontBold; } else { cell.TextLabel.Font = _Font; } cell.TextLabel.AdjustsFontSizeToFitWidth = true; if (ch.HasCondition("dead")) { cell.TextLabel.TextColor = UIColor.Red; } else if (ch.HasCondition("dying")) { cell.TextLabel.TextColor = UIColor.Brown; } }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { DataListViewCell cell = (DataListViewCell)tableView.DequeueReusableCell("CombatListViewCell"); if (cell == null) { cell = new DataListViewCell(UITableViewCellStyle.Default, "CombatListViewCell"); } Character ch = state.CombatState.CombatList[indexPath.Row]; ch.PropertyChanged += state.HandleChPropertyChanged; ch.Monster.ActiveConditions.CollectionChanged += delegate { state.UpdateCharacter(ch); }; state.UpdateCell(ch, cell); float accHeight = 30f; UIView buttonView = new UIView(new CGRect(0, 0, 79, accHeight)); float xPos = 0; GradientButton b = new GradientButton(); if (ch.IsReadying || ch.IsDelaying) { UIImageView view = new UIImageView(); view.Image = ch.IsReadying?state._ReadyingImage:state._DelayingImage; view.Frame = new CGRect(new CGPoint(xPos, (accHeight - 16f) / 2.0f), new CGSize(16, 16)); buttonView.Add(view); xPos += 18; } if (ch.HasFollowers) { UIImageView view = new UIImageView(); view.Image = state._LinkImage; view.Frame = new CGRect(new CGPoint(xPos, (accHeight - 16f) / 2.0f), new CGSize(16, 16)); buttonView.Add(view); xPos += 18; } b.SetTitle(ch.CurrentInitiative.ToString(), UIControlState.Normal); b.CornerRadius = 0; b.Frame = new CGRect(xPos, 0, 40, accHeight); b.TouchUpInside += state.InitButtonTouchUpInside; b.Data = ch; buttonView.AddSubview(b); xPos += (float)(b.Frame.Width - 1); b = new GradientButton(); b.SetImage(UIExtensions.GetSmallIcon("lightning"), UIControlState.Normal); b.CornerRadius = 0; b.Frame = new CGRect(xPos, 0, 40, accHeight); buttonView.AddSubview(b); b.Data = ch; xPos += (float)(b.Frame.Width - 1); buttonView.SetWidth(xPos); ButtonStringPopover actionsPopover = new ButtonStringPopover(b); actionsPopover.WillShowPopover += state.WillShowActionsPopover; actionsPopover.Data = ch; actionsPopover.ItemClicked += HandleActionsPopoverItemClicked; cell.AccessoryView = buttonView; return(cell); }