|
// Resort Companion Mobile Edition
// Copyright (c) 2004 Wolf Logan
using System;
using System.Drawing;
using System.Windows.Forms;
using org.CircleCross.ResortCompanion.Data;
namespace org.CircleCross.ResortCompanion.Mobile {
/// <summary>
/// detail view for food records
/// </summary>
public class FoodDetail: DetailView {
private static string[] priceDetailLabels;
private Label serviceLabel;
private Label priceDetail;
private Label expenseLabel;
private ProgressBar priceBar;
private ListBox cuisineList;
private Label cuisineLabel;
public override Type TargetType {
get {
return typeof(FoodPlaceRecord);
}
}
public override string TargetLabel {
get {
return "Places to Eat";
}
}
private FoodPlaceRecord foodPlace {
get {
return (FoodPlaceRecord)place;
}
}
static FoodDetail() {
FoodDetail.priceDetailLabels = new string[] {"(<$10)", "($11-$20)", "($21-$45)", "($46+)", "()"};
}
public FoodDetail(): base() {
this.serviceLabel = new Label();
this.serviceLabel.Parent = this;
this.serviceLabel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
this.serviceLabel.Bounds = new Rectangle(4, 2, 224, 12);
this.priceDetail = new Label();
this.priceDetail.Parent = this;
this.priceDetail.Bounds = new Rectangle(120, 18, 112, 16);
this.expenseLabel = new Label();
this.expenseLabel.Parent = this;
this.expenseLabel.Bounds = new Rectangle(4, 18, 56, 16);
this.expenseLabel.Text = "Expense:";
this.priceBar = new ProgressBar();
this.priceBar.Parent = this;
this.priceBar.Bounds = new Rectangle(60, 18, 53, 16);
this.priceBar.Maximum = 5;
this.priceBar.Value = 1;
this.cuisineList = new ListBox();
this.cuisineList.Parent = this;
this.cuisineList.Bounds = new Rectangle(4, 54, 224, 86);
this.cuisineLabel = new Label();
this.cuisineLabel.Parent = this;
this.cuisineLabel.Bounds = new Rectangle(4, 38, 48, 16);
this.cuisineLabel.Text = "Cuisine:";
}
protected override void bindData() {
this.priceBar.Value = this.foodPlace.Price;
this.priceDetail.Text = FoodDetail.priceDetailLabels[this.foodPlace.Price-1];
this.serviceLabel.Text = this.foodPlace.Service;
this.cuisineList.Items.Clear();
foreach(string s in this.foodPlace.Cuisine) {
this.cuisineList.Items.Add(s);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.