RemObjects
                        Software Gears code

Plateau

Sign in or create your account | Project List | Help

Plateau Commit Details

Date:2009-11-09 08:00:37 (8 months 21 days ago)
Author:R. Brian Lindahl
Commit:7
Message:
Files: trunk/Source/PlateauTest.sln (1 diff)
trunk/Source/Plateau/PTPickerModel.pas (1 diff)
trunk/Source/Plateau/PTComboCell.pas (1 diff)
trunk/Source/Plateau/PTTableViewListSource.pas (1 diff)
trunk/Source/Plateau/PTSwitchCell.pas (1 diff)
trunk/Source/Plateau/PTTableViewSectionedSource.pas (1 diff)
trunk/Source/Plateau/PTPickerModelComponent.cs (1 diff)
trunk/Source/Plateau/PTTableViewSource.pas (1 diff)
trunk/Source/Plateau/PTSegmentedCell.pas (1 diff)
trunk/Source/Plateau/PTUtilities.pas (1 diff)
trunk/Source/Plateau/PTPicker.pas (1 diff)
trunk/Source/Plateau/Images/Button_Arrow_Down.png (1 diff)
trunk/Source/Plateau/Images/Button_Background_Black.png (1 diff)
trunk/Source/Plateau/PTLabelCell.pas (1 diff)
trunk/Source/Plateau/PTPickerModelComponent.pas (1 diff)
trunk/Source/Plateau/PlateauCellBase.pas (1 diff)
trunk/Source/Plateau/Plateau.oxygene (1 diff)
trunk/Source/Plateau/PTPickerItemSelectedEventArgs.pas (1 diff)
trunk/Source/Plateau/PlateauCell.pas (1 diff)
trunk/Source/Plateau/PTTextFieldCell.pas (1 diff)
trunk/Source/PlateauTest/MainWindow.xib.designer.cs (1 diff)
trunk/Source/PlateauTest/PickerCellModel.cs (1 diff)
trunk/Source/PlateauTest/Main.cs (1 diff)
trunk/Source/PlateauTest/PlateauTest.csproj (1 diff)
trunk/Source/PlateauTest/PlateauTestTableController.cs (1 diff)
trunk/Source/PlateauTest/MainWindow.xib (1 diff)

Change Details

trunk/Source/PlateauTest.sln
1
2Microsoft Visual Studio Solution File, Format Version 10.00
3# Visual Studio 2008
4Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlateauTest", "PlateauTest\PlateauTest.csproj", "{104EDA82-639E-4C49-B26A-959096774AE7}"
5EndProject
6Project("{656346D9-4656-40DA-A068-22D5425D4639}") = "Plateau", "Plateau\Plateau.oxygene", "{D8A18549-76AD-48B2-9337-6A617ADCC10D}"
7EndProject
8Global
9    GlobalSection(SolutionConfigurationPlatforms) = preSolution
10        Debug|iPhoneSimulator = Debug|iPhoneSimulator
11        Release|iPhoneSimulator = Release|iPhoneSimulator
12        Debug|iPhone = Debug|iPhone
13        Release|iPhone = Release|iPhone
14    EndGlobalSection
15    GlobalSection(ProjectConfigurationPlatforms) = postSolution
16        {104EDA82-639E-4C49-B26A-959096774AE7}.Debug|iPhone.ActiveCfg = Debug|iPhone
17        {104EDA82-639E-4C49-B26A-959096774AE7}.Debug|iPhone.Build.0 = Debug|iPhone
18        {104EDA82-639E-4C49-B26A-959096774AE7}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
19        {104EDA82-639E-4C49-B26A-959096774AE7}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
20        {104EDA82-639E-4C49-B26A-959096774AE7}.Release|iPhone.ActiveCfg = Release|iPhone
21        {104EDA82-639E-4C49-B26A-959096774AE7}.Release|iPhone.Build.0 = Release|iPhone
22        {104EDA82-639E-4C49-B26A-959096774AE7}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
23        {104EDA82-639E-4C49-B26A-959096774AE7}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
24        {D8A18549-76AD-48B2-9337-6A617ADCC10D}.Debug|iPhone.ActiveCfg = Debug|iPhone
25        {D8A18549-76AD-48B2-9337-6A617ADCC10D}.Debug|iPhone.Build.0 = Debug|iPhone
26        {D8A18549-76AD-48B2-9337-6A617ADCC10D}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
27        {D8A18549-76AD-48B2-9337-6A617ADCC10D}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
28        {D8A18549-76AD-48B2-9337-6A617ADCC10D}.Release|iPhone.ActiveCfg = Release|iPhone
29        {D8A18549-76AD-48B2-9337-6A617ADCC10D}.Release|iPhone.Build.0 = Release|iPhone
30        {D8A18549-76AD-48B2-9337-6A617ADCC10D}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
31        {D8A18549-76AD-48B2-9337-6A617ADCC10D}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
32    EndGlobalSection
33    GlobalSection(MonoDevelopProperties) = preSolution
34        StartupItem = PlateauTest\PlateauTest.csproj
35    EndGlobalSection
36EndGlobal
trunk/Source/Plateau/PTPickerModel.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  MonoTouch.UIKit,
8  System.Collections.Generic;
9
10type
11  PTPickerModel = public class(UIPickerViewModel)
12    fModelData: List<PTPickerModelComponent> := new List<PTPickerModelComponent>();
13  protected
14  public
15    constructor ();
16    constructor (modelData: List<PTPickerModelComponent>);
17
18    method GetComponentCount(pickerView: UIPickerView): Integer;override;
19    method GetRowsInComponent(pickerView: UIPickerView; componentIndex: Integer): Integer;override;
20    method GetTitle(picker: UIPickerView; rowIndex: Integer; componentIndex: Integer): String;override;
21    method Selected(pickerView: UIPickerView; rowIndex: Integer; componentIndex: Integer);override;
22    method GetComponentWidth(pickerView: UIPickerView; componentIndex: Integer): Single;override;
23    method GetRowHeight(pickerView: UIPickerView; componentIndex: Integer): Single;override;
24    method SelectItem(componentIndex: Integer; rowIndex: Integer);
25
26    /// <summary>
27    /// Components have rows
28    /// </summary>
29    
30    property ModelData: List<PTPickerModelComponent> read fModelData;
31
32    /// <summary>
33    /// Shortcut to ModelData.Count
34    /// </summary>
35    property NumberOfComponents: Integer read fModelData.Count;
36    property SelectedItem: String read get_SelectedItem;
37    method get_SelectedItem: String;
38    property SelectedComponentIndex: Integer;
39    property SelectedRowIndex: Integer;
40    
41    event ItemSelected: EventHandler<PTPickerItemSelectedEventArgs>;
42  end;
43
44
45implementation
46
47method PTPickerModel.GetComponentCount(pickerView: UIPickerView): Integer;
48begin
49  exit self.NumberOfComponents
50end;
51
52method PTPickerModel.GetRowsInComponent(pickerView: UIPickerView; componentIndex: Integer): Integer;
53begin
54  exit self.fModelData[componentIndex].Rows.Count
55end;
56
57method PTPickerModel.GetTitle(picker: UIPickerView; rowIndex: Integer; componentIndex: Integer): String;
58begin
59  exit self.fModelData[componentIndex].Rows[rowIndex].ToString()
60end;
61
62method PTPickerModel.Selected(pickerView: UIPickerView; rowIndex: Integer; componentIndex: Integer);
63begin
64  Console.WriteLine('Item selected: [' + componentIndex.ToString() + '][' + rowIndex.ToString() + ']');
65  self.selectedComponentIndex := componentIndex;
66  self.selectedRowIndex := rowIndex;
67  if self.ItemSelected <> nil then
68  begin
69    self.ItemSelected(self, new PTPickerItemSelectedEventArgs('', self.SelectedItem))
70  end
71end;
72
73method PTPickerModel.GetComponentWidth(pickerView: UIPickerView; componentIndex: Integer): Single;
74begin
75  if self.fModelData[componentIndex] <> nil then
76  begin
77    exit self.fModelData[componentIndex].Width
78  end
79  else
80  begin
81    exit 300;
82  end;
83end;
84
85method PTPickerModel.GetRowHeight(pickerView: UIPickerView; componentIndex: Integer): Single;
86begin
87  if self.modelData[componentIndex] <> nil then
88  begin
89    exit self.modelData[componentIndex].RowHeight;
90  end
91  else
92  begin
93    exit 40;
94  end
95end;
96
97method PTPickerModel.SelectItem(componentIndex: Integer; rowIndex: Integer);
98begin
99  self.selectedComponentIndex := componentIndex;
100  self.SelectedRowIndex := rowIndex;
101end;
102
103constructor PTPickerModel();
104begin
105
106end;
107
108constructor PTPickerModel(modelData: List<PTPickerModelComponent>);
109begin
110  constructor ();
111  self.fModelData := modelData;
112end;
113
114method PTPickerModel.get_SelectedItem: String;
115begin
116  Console.WriteLine('component: ' + self.selectedComponentIndex.ToString() + ' row: ' + self.selectedRowIndex.ToString());
117  if self.modelData[self.selectedComponentIndex] <> nil then
118  begin
119    if self.modelData[self.selectedComponentIndex].Rows[self.selectedRowIndex] <> nil then
120    begin
121      exit self.modelData[self.selectedComponentIndex].Rows[self.selectedRowIndex];
122    end
123    else
124    begin
125      exit '';
126    end;
127  end
128  else
129  begin
130    exit '';
131  end
132end;
133
134end.
0135
1136  + *
2137
trunk/Source/Plateau/PTComboCell.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  System.Collections.Generic,
8  System.Drawing,
9  MonoTouch.Foundation,
10  MonoTouch.UIKit;
11
12type
13  PTComboCell = public class(PTLabelCell)
14  private
15    fPicker: PTPicker;
16    fButton : UIButton;
17  protected
18    method Initialize();override;
19  public
20    [Export('init')]
21    constructor (); empty;
22    [Export('initWithCoder:')]
23    constructor (coder: NSCoder); empty;
24    constructor (t: NSObjectFlag); empty;
25    constructor (handle: IntPtr); empty;
26    constructor (reuseIdentifier: String); empty;
27    method Layout(); override;
28    method EditOnSelect(); override;
29    //property CanEditOnSelect: Boolean read true; override;
30    property Values: List<String> := new List<String>();
31  end;
32
33implementation
34
35method PTComboCell.Initialize();
36begin
37  inherited Initialize();
38  fButton := UIButton.FromType(UIButtonType.RoundedRect);
39  fButton.SetImage(PTUtilities.LoadUIImageFromResource('.Users.Brian.Projects.Plateau.Source.Plateau.Images.Button_Arrow_Down.png'),
40    UIControlState.Normal);
41  self.AddSubView(fButton);
42  fButton.TouchUpInside += method (sender: Object; e: EventArgs); begin
43    EditOnSelect;
44  end;
45end;
46
47method PTComboCell.Layout();
48begin
49  inherited Layout();
50
51  if fButton = nil then Console.WriteLine('Button is nil');
52  
53  var lControlFrame := Control.Frame;
54  var lButtonFrame := Control.Frame;
55  
56  lButtonFrame.Location := new PointF(lButtonFrame.Right - lButtonFrame.Height, lButtonFrame.Top);
57  lButtonFrame.Size := new SizeF(lButtonFrame.Height, lButtonFrame.Height);
58  lControlFrame.Size := new SizeF(lControlFrame.Width - lButtonFrame.Width - self.CenterSpace, lControlFrame.Height);
59  
60  Control.Frame := lControlFrame;
61  fButton.Frame := lButtonFrame;
62end;
63
64method PTComboCell.EditOnSelect();
65begin
66  if fPicker = nil then begin
67    fPicker := new PTPicker(self.Superview);
68    var lComp: PTPickerModelComponent := new PTPickerModelComponent(values);
69    var lModel: PTPickerModel := new PTPickerModel();
70    lModel.ModelData.&Add(lComp);
71    fPicker.DataSource := lModel;
72    fPicker.ItemSelected += method (sender: Object; e: PTPickerItemSelectedEventArgs) begin
73      self.Control.Text := e.SelectedItem;
74      self.Layout()
75    end;
76  end;
77  fPicker.DataSource.SelectItem(0, values.IndexOf(Control.Text));
78  fPicker.ShowPicker();
79end;
80
81end.
082
183  + *
284
trunk/Source/Plateau/PTTableViewListSource.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  System.Collections.Generic,
8  Monotouch.UIKit;
9    
10type
11  PTTableViewListSource = public class(PTTableViewSource)
12  public
13    constructor;
14    public Cells : List<UITableViewCell> := new List<UITableViewCell>;
15    
16    method GetCell(tableView : UITableView; aIndexPath : MonoTouch.Foundation.NSIndexPath) : UITableViewCell; override;
17    method RowsInSection(tableView : UITableView; aSection : integer) : integer; override;
18  end;
19    
20implementation
21
22constructor PTTableViewListSource;
23begin
24end;
25
26method PTTableViewListSource.RowsInSection(tableView : UITableView; aSection : integer) : integer;
27begin
28  result := Cells.Count;
29end;
30
31method PTTableViewListSource.GetCell(tableView: UITableView; aIndexPath: MonoTouch.Foundation.NSIndexPath): UITableViewCell;
32begin
33  result := Cells[aIndexPath.Row];
34end;
35
36end.
trunk/Source/Plateau/PTSwitchCell.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  Monotouch.Foundation,
8  Monotouch.UIKit;
9  
10type
11  Plateau.PTSwitchCell = public class(PlateauCell<UISwitch>)
12  public
13    [Export('init')]
14    constructor (); empty;
15    [Export('initWithCoder:')]
16    constructor (coder: NSCoder); empty;
17    constructor (t: NSObjectFlag); empty;
18    constructor (handle: IntPtr); empty;
19    constructor (reuseIdentifier: String); empty;
20
21    method Initialize; override;
22  end;
23    
24implementation
25
26method PTSwitchCell.Initialize;
27begin
28  inherited Initialize;
29  
30  Control.ValueChanged += method (sender: Object; e: EventArgs);
31    begin
32      FireDeselectSiblings;
33    end;
34end;
35
36end.
trunk/Source/Plateau/PTTableViewSectionedSource.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  System.Collections.Generic,
8  Monotouch.UIKit;
9    
10type
11  PTTableViewSectionedSource = public class(PTTableViewSource)
12  protected
13    fSectionList : List<string> := new List<String>;
14    fSections : Dictionary<String, List<UITableViewCell>> := new Dictionary<String,List<UITableViewCell>>;
15  public
16    method AddSection(aSection : String);
17    method AddCell(aSection : string; aCell : UITableViewCell);
18        
19    method GetCell(tableView : UITableView; aIndexPath : MonoTouch.Foundation.NSIndexPath) : UITableViewCell; override;
20    method RowsInSection(tableView : UITableView; aSection : integer) : integer; override;
21    method NumberOfSections(tableView: UITableView): Int32; override;
22    method TitleForHeader(tableView: UITableView; section: Int32): String; override;
23  end;
24    
25implementation
26
27method PTTableViewSectionedSource.AddSection(aSection : String);
28begin
29  fSectionList.Add(aSection);
30  fSections[aSection] := new List<UITableViewCell>;
31end;
32
33method PTTableViewSectionedSource.AddCell(aSection : string; aCell : UITableViewCell);
34begin
35  fSections[aSection].Add(aCell);
36end;
37
38method PTTableViewSectionedSource.NumberOfSections(tableView: UITableView): Int32;
39begin
40  result := fSectionList.Count;
41end;
42
43method PTTableViewSectionedSource.TitleForHeader(tableView: UITableView; section: Int32): String;
44begin
45  result := fSectionList[section];
46end;
47
48method PTTableViewSectionedSource.RowsInSection(tableView : UITableView; aSection : integer) : integer;
49begin
50  var lSection := fSectionList[aSection];
51  result := fSections[lSection].Count;
52end;
53
54method PTTableViewSectionedSource.GetCell(tableView: UITableView; aIndexPath: MonoTouch.Foundation.NSIndexPath): UITableViewCell;
55begin
56  var lSection := fSectionList[aIndexPath.Section];
57  result := fSections[lSection][aIndexPath.Row];
58end;
59
60end.
trunk/Source/Plateau/PTPickerModelComponent.cs
1
2using System;
3using System.Collections.Generic;
4
5namespace Plateau
6{
7    public class PTPickerModelComponent
8    {
9        #region -= declarations =-
10
11        /// <summary>
12        ///
13        /// </summary>
14        public List<string> Rows
15        {
16            get { return this.rows; }
17            set { this.rows = value; }
18        }
19        protected List<string> rows = new List<string>();
20        
21        /// <summary>
22        /// The width of the component
23        /// </summary>
24        public float Width
25        {
26            get { return this.width; }
27            set { this.width = value; }
28        }
29        protected float width = 300;
30        
31        /// <summary>
32        /// The height of each row in the component
33        /// </summary>
34        public float RowHeight
35        {
36            get { return this.rowHeight; }
37            set { this.rowHeight = value; }
38        }
39        protected float rowHeight = 40;
40
41        #endregion
42    
43        public PTPickerModelComponent ()
44        {
45        }
46        
47        public PTPickerModelComponent (float width, float rowHeight) : this()
48        {
49            this.width = width;
50            this.rowHeight = rowHeight;
51        }
52
53        public PTPickerModelComponent (List<string> rows) : this()
54        {
55            this.rows = rows;
56        }
57
58        public PTPickerModelComponent (List<string> rows, float width, float rowHeight) : this(width, rowHeight)
59        {
60            this.rows = rows;
61        }
62    }
63}
trunk/Source/Plateau/PTTableViewSource.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  Monotouch.UIKit;
8
9type
10  PTTableViewSource = public abstract class(UITableViewSource)
11  protected
12    fLastSelected : PlateauCellBase;
13  public
14    method GetHeightForRow(tableView: UITableView; indexPath: MonoTouch.Foundation.NSIndexPath): Single; override;
15    method RowDeselected(tableView: UITableView; indexPath: MonoTouch.Foundation.NSIndexPath); override;
16    method RowSelected(tableView: UITableView; indexPath: MonoTouch.Foundation.NSIndexPath); override;
17  end;
18    
19implementation
20
21{ Plateau.PTTableViewSource }
22
23method PTTableViewSource.GetHeightForRow(tableView: UITableView; indexPath: MonoTouch.Foundation.NSIndexPath): Single;
24begin
25  result := 44; // inherited GetHeightForRow(tableView, indexPath);
26  
27  // the following is here because it's a convenient place to assign it... every cell will be touched by
28  // GetHeightForRow
29  var lCell := PlateauCellBase(self.GetCell(tableView, indexPath));
30  if lCell <> nil then begin
31    lCell.SelectCurrent += method (aCell: PlateauCellBase);
32      begin
33        fLastSelected := aCell;
34      end;
35      lCell.DeselectSiblings += method (aCell: PlateauCellBase);
36      begin
37        if fLastSelected <> nil then begin
38          fLastSelected.CancelOnDeselect;
39          fLastSelected := nil;
40        end;
41      end;
42    exit Math.Max(lCell.ContentHeight, 44);
43  end;
44end;
45
46method PTTableViewSource.RowDeselected(tableView: UITableView; indexPath: MonoTouch.Foundation.NSIndexPath);
47begin
48  var lCell := PlateauCellBase(self.GetCell(tableView, indexPath));
49  if (lCell <> nil) and (lCell.CanEditOnSelect) then
50    lCell.CancelOnDeselect;
51end;
52
53method PTTableViewSource.RowSelected(tableView: UITableView; indexPath: MonoTouch.Foundation.NSIndexPath);
54begin
55  fLastSelected := nil;
56  var lCell := PlateauCellBase(self.GetCell(tableView, indexPath));
57  if (lCell <> nil) and (lCell.CanEditOnSelect) then begin
58    fLastSelected := lCell;
59    lCell.EditOnSelect;
60  end;
61end;
62    
63end.
trunk/Source/Plateau/PTSegmentedCell.pas
1
2{$HIDE CW3}
3{$HIDE PW12}
4
5namespace Plateau;
6
7interface
8
9uses
10  System,
11  System.Collections.Generic,
12  MonoTouch.Foundation,
13  MonoTouch.UIKit;
14
15type
16  PTSegmentedCell = public class(PlateauCell<UISegmentedControl>)
17  protected
18  public
19    [Export('init')]
20    constructor (); empty;
21    [Export('initWithCoder:')]
22    constructor (coder: NSCoder); empty;
23    constructor (t: NSObjectFlag); empty;
24    constructor (handle: IntPtr); empty;
25    constructor (reuseIdentifier: String); empty;
26    
27    method Initialize; override;
28  end;
29    
30implementation
31
32method PTSegmentedCell.Initialize;
33begin
34  inherited Initialize;
35  
36  Control.ValueChanged += method (sender: Object; e: EventArgs);
37    begin
38      FireDeselectSiblings;
39    end;
40end;
41
42end.
trunk/Source/Plateau/PTUtilities.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  System.Drawing,
8  System.Reflection,
9  MonoTouch.Foundation,
10  MonoTouch.UIKit;
11
12type
13  PTUtilities = public static class
14  public
15    class method LoadUIImageFromResource(aResourceName: String): UIImage;
16    class method WriteFrame(aString : string; aFrame : RectangleF);
17  end;
18
19implementation
20
21class method PTUtilities.WriteFrame(aString : string; aFrame : RectangleF);
22begin
23  Console.WriteLine(String.Format('{0}: {1},{2} - {3},{4}',aString, aFrame.Left, aFrame.Top, aFrame.Right, aFrame.Bottom));
24end;
25
26class method PTUtilities.LoadUIImageFromResource(aResourceName: String): UIImage;
27begin
28  var lStream := &Assembly.GetExecutingAssembly().GetManifestResourceStream(aResourceName);
29  var lData := NSData.FromStream(lStream);
30  exit UIImage.LoadFromData(lData);
31end;
32
33end.
034
135  + *
236
trunk/Source/Plateau/PTPicker.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  MonoTouch.UIKit,
8  System.Drawing;
9  
10type
11  PTPicker = public class
12  protected
13    picker: UIPickerView;
14    fDataSource: PTPickerModel;
15    ownerView: UIView;
16    
17    method Handle_dataSourceItemSelected(sender: Object; e: PTPickerItemSelectedEventArgs);
18    method set_DataSource(value: PTPickerModel);
19  public
20  protected
21    method ShowActionSheetPicker();
22  public
23    constructor (view: UIView);
24    property DataSource: PTPickerModel read fDataSource write set_DataSource;
25    property Title: String;
26    
27    event ItemSelected: EventHandler<PTPickerItemSelectedEventArgs>;
28    
29    method ShowPicker();
30  end;
31
32implementation
33
34method PTPicker.Handle_dataSourceItemSelected(sender: Object; e: PTPickerItemSelectedEventArgs);
35begin
36  if self.ItemSelected <> nil then
37  begin
38    self.ItemSelected(sender, e)
39  end
40end;
41
42method PTPicker.ShowPicker();
43begin
44  self.ShowActionSheetPicker()
45end;
46
47method PTPicker.ShowActionSheetPicker();
48begin
49  //---- declare vars
50  var actionSheet: UIActionSheet;
51  var btnDone: UIButton := UIButton.FromType(UIButtonType.RoundedRect);
52  var lblActionSheetTitle: UILabel := new UILabel();
53  var titleFont: UIFont := UIFont.BoldSystemFontOfSize(18);
54  var actionSheetWidth: Single := self.ownerView.Frame.Width;
55  var actionSheetHeight: Single := 257;
56  var btnDoneWidth: Single := 71;
57  var btnDoneHeight: Single := 30;
58  //UIFont.FromName ("helvetica", 18);
59
60  //---- setup our picker view
61  // it autosizes, so empty is fine
62  self.picker := new UIPickerView(RectangleF.&Empty);
63  self.picker.ShowSelectionIndicator := true;
64  self.picker.Model := self.dataSource;
65
66  //---- configure our label
67  lblActionSheetTitle.Text := self.title;
68  lblActionSheetTitle.BackgroundColor := UIColor.Clear;
69  lblActionSheetTitle.TextColor := UIColor.White;
70  lblActionSheetTitle.Font := titleFont;
71  
72  //---- create + configure the action sheet
73  actionSheet := new UIActionSheet('', nil, nil, nil);
74  actionSheet.Style := UIActionSheetStyle.BlackTranslucent;
75  actionSheet.Clicked += method (sender: Object; args: UIButtonEventArgs)
76    begin
77      Console.WriteLine('Clicked on item {0}', args.ButtonIndex)
78    end;
79    
80  //---- configure our "done" button
81  btnDone.SetTitle('done', UIControlState.Normal);
82  btnDone.SetTitleColor(UIColor.White, UIControlState.Normal);
83  var btnImage: UIImage := PTUtilities.LoadUIImageFromResource('.Users.Brian.Projects.Plateau.Source.Plateau.Images.Button_Background_Black.png');//'Plateau.Images.Button_Background_Black.png');
84  btnDone.SetBackgroundImage(btnImage, UIControlState.Normal);
85  
86  //---- add the delegate to dismiss the action sheet
87  btnDone.TouchDown += method (sender: Object; e: EventArgs) begin
88    //this._dataSource.Selected (this._lstPicker, 0, 0);
89    actionSheet.DismissWithClickedButtonIndex(0, true)
90  end;
91    
92  //---- show the action sheet and add the controls to it
93  actionSheet.ShowInView(self.ownerView);
94  actionSheet.AddSubview(self.picker);
95  actionSheet.AddSubview(lblActionSheetTitle);
96  actionSheet.AddSubview(btnDone);
97  
98  //---- if something is already selected
99  if self.dataSource.SelectedItem <> '' then
100  begin
101    Console.WriteLine('this._dataSource.SelectedItem = ' + self.dataSource.SelectedItem);
102    Console.WriteLine('this._dataSource.SelectedComponentIndex, this._dataSource.SelectedRowIndex,' + self.dataSource.SelectedComponentIndex.ToString() + ',' + self.dataSource.SelectedRowIndex.ToString())
103    //this._lstPicker.Select (this._dataSource.SelectedComponentIndex, this._dataSource.SelectedRowIndex, true);
104  end;
105  
106  //---- resize the action sheet to fit our other stuff
107  actionSheet.Frame := new System.Drawing.RectangleF(0, UIScreen.MainScreen.Bounds.Height - actionSheetHeight, actionSheetWidth, actionSheetHeight);
108  
109  //---- move our picker to be at the bottom of the actionsheet
110  var pickerY: Single := actionSheetHeight - self.picker.Frame.Height;
111  self.picker.Frame := new RectangleF(self.picker.Frame.X, pickerY, self.picker.Frame.Width, self.picker.Frame.Height);
112  
113  //---- move our label to the top of the action sheet
114  lblActionSheetTitle.Frame := new RectangleF(10, 5, self.ownerView.Frame.Width - 100, 35);
115  
116  //---- move our button
117  btnDone.Frame := new RectangleF(actionSheetWidth - btnDoneWidth - 10, 7, btnDoneWidth, btnDoneHeight)
118end;
119
120constructor PTPicker(view: UIView);
121begin
122  self.ownerView := view;
123end;
124
125method PTPicker.set_DataSource(value: PTPickerModel);
126begin
127  if self.fDataSource <> nil then
128    self.DataSource.ItemSelected -= Handle_dataSourceItemSelected;
129  self.fDataSource := value;
130  self.fDataSource.ItemSelected += Handle_dataSourceItemSelected;
131end;
132
133end.
0134
1135  + *
2136
trunk/Source/Plateau/Images/Button_Arrow_Down.png
3137
4138  + application/octet-stream
5139
trunk/Source/Plateau/Images/Button_Background_Black.png
6140
7141  + application/octet-stream
8142
trunk/Source/Plateau/PTLabelCell.pas
1
2// RemObjects CS to Pascal 0.2
3
4namespace Plateau;
5
6interface
7uses
8  System,
9  System.Drawing,
10  MonoTouch.Foundation,
11  MonoTouch.UIKit;
12type
13  PTLabelCell = public class(PlateauCell<UILabel>)
14  protected
15    method Initialize();override;
16  public
17    method Layout();override;
18  protected
19    method ChangeFontColors(aNeedInvert: Boolean);override;
20  public
21    [Export('init')]
22    constructor (); empty;
23    [Export('initWithCoder:')]
24    constructor (coder: NSCoder); empty;
25    constructor (t: NSObjectFlag); empty;
26    constructor (handle: IntPtr); empty;
27    constructor (reuseIdentifier: String); empty;
28  end;
29
30implementation
31
32method PTLabelCell.Initialize();
33begin
34  inherited Initialize();
35  self.ViewAlignment := PlateauCellAlignment.Baseline;
36  Control.Font := UIFont.BoldSystemFontOfSize(16)
37end;
38
39method PTLabelCell.Layout();
40begin
41  inherited Layout();
42  if self.ViewAlignment = PlateauCellAlignment.Baseline then
43  begin
44    var lFrame: RectangleF := Label.Frame;
45    lFrame.Location := new PointF(lFrame.Left, Control.Frame.Top + Control.Font.Ascender - Label.Font.Ascender);
46    Label.Frame := lFrame
47  end
48end;
49
50method PTLabelCell.ChangeFontColors(aNeedInvert: Boolean);
51begin
52  inherited ChangeFontColors(aNeedInvert);
53  if aNeedInvert then
54  begin
55    Control.TextColor := ControlInverseColor
56  end
57  else
58  begin
59    Control.TextColor := ControlNormalColor
60  end
61end;
62
63end.
064
165  + *
266
trunk/Source/Plateau/PTPickerModelComponent.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  System.Collections.Generic;
8
9type
10  PTPickerModelComponent = public class
11  protected
12    fRows: List<String> := new List<String>();
13  public
14    constructor ();
15    constructor (width: Single; rowHeight: Single);
16    constructor (aRows: List<String>);
17    constructor (aRows: List<String>; width: Single; rowHeight: Single);
18    
19    /// <summary>
20    ///
21    /// </summary>
22    property Rows: List<String> read fRows;
23    
24    /// <summary>
25    /// The width of the component
26    /// </summary>
27    property Width: Single := 300;
28    
29    /// <summary>
30    /// The height of each row in the component
31    /// </summary>
32    property RowHeight: Single := 40;
33  end;
34
35implementation
36
37constructor PTPickerModelComponent();
38begin
39end;
40
41constructor PTPickerModelComponent(width: Single; rowHeight: Single);
42begin
43  self.width := width;
44  self.rowHeight := rowHeight;
45end;
46
47constructor PTPickerModelComponent(aRows: List<String>);
48begin
49  self.fRows := aRows;
50end;
51
52constructor PTPickerModelComponent(aRows: List<String>; width: Single; rowHeight: Single);
53begin
54  constructor (width, rowHeight);
55  self.fRows := aRows;
56end;
57
58end.
059
160  + *
261
trunk/Source/Plateau/PlateauCellBase.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  System.Drawing,
8  MonoTouch.CoreFoundation,
9  MonoTouch.CoreGraphics,
10  MonoTouch.Foundation,
11  MonoTouch.UIKit;
12  
13type
14  PlateauSelectionHandler = public delegate(aCell : PlateauCellBase);
15    
16  PlateauCellBase = public class(UITableViewCell)
17  private
18    fHoldLayout: Boolean := false;
19
20    method Startup();
21    method set_HoldLayout(value: Boolean);
22  protected
23      fInInitialize : boolean := false;
24    method DoLayout();
25    method Initialize();virtual;
26  public
27    [Export('init')]
28    constructor ();
29    [Export('initWithCoder:')]
30    constructor (coder: NSCoder);
31    constructor (t: NSObjectFlag);
32    constructor (handle: IntPtr);
33    constructor (reuseIdentifier: String);
34    
35    method Layout(); virtual;
36    property HoldLayout: Boolean read fHoldLayout write set_HoldLayout;
37    
38    /// <summary>
39    /// Height that subviews need to draw properly - includes top & bottom margin, if any
40    /// </summary>
41    property ContentHeight: Single;
42    
43    event SelectCurrent : PlateauSelectionHandler;
44    method FireSelectCurrent;
45    event DeselectSiblings : PlateauSelectionHandler;
46    method FireDeselectSiblings;
47    
48    property CanEditOnSelect: Boolean read false; virtual;
49    method EditOnSelect(); virtual;
50    method CancelOnDeselect(); virtual;
51  end;
52
53implementation
54
55method PlateauCellBase.Startup();
56begin
57  fHoldLayout := true;
58  try
59    Initialize();
60  finally
61    fHoldLayout := false;
62  end;
63  DoLayout()
64end;
65
66method PlateauCellBase.DoLayout();
67begin
68  if not fHoldLayout then
69    Layout();
70end;
71
72method PlateauCellBase.Initialize();
73begin
74  ContentHeight := 44;
75  self.SelectionStyle := UITableViewCellSelectionStyle.None;
76end;
77
78method PlateauCellBase.Layout();
79begin
80end;
81
82method PlateauCellBase.EditOnSelect();
83begin
84end;
85
86method PlateauCellBase.CancelOnDeselect();
87begin
88end;
89
90constructor PlateauCellBase();
91begin
92  inherited constructor();
93  Startup();
94end;
95
96constructor PlateauCellBase(coder: NSCoder);
97begin
98  inherited constructor(coder);
99  Startup();
100end;
101
102constructor PlateauCellBase(t: NSObjectFlag);
103begin
104  inherited constructor(t);
105  Startup();
106end;
107
108constructor PlateauCellBase(handle: IntPtr);
109begin
110  inherited constructor(handle);
111  Startup();
112end;
113
114constructor PlateauCellBase(reuseIdentifier: String);
115begin
116  inherited constructor(UITableViewCellStyle.&Default, reuseIdentifier);
117  Startup();
118end;
119
120method PlateauCellBase.set_HoldLayout(value: Boolean);
121begin
122  fHoldLayout := value;
123  DoLayout();
124end;
125
126method PlateauCellBase.FireSelectCurrent;
127begin
128  if SelectCurrent <> nil then
129    SelectCurrent(self);
130end;
131
132method PlateauCellBase.FireDeselectSiblings;
133begin
134  if DeselectSiblings <> nil then
135    DeselectSiblings(self);
136end;
137
138end.
0139
1140  + *
2141
trunk/Source/Plateau/Plateau.oxygene
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
3  <PropertyGroup>
4    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5    <Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
6    <ProductVersion>9.0.21022</ProductVersion>
7    <SchemaVersion>2.0</SchemaVersion>
8    <ProjectGuid>{D8A18549-76AD-48B2-9337-6A617ADCC10D}</ProjectGuid>
9    <ProjectTypeGuids>{E613F3A2-FE9C-494F-B74E-F63BCB86FEA6};{656346D9-4656-40DA-A068-22D5425D4639}</ProjectTypeGuids>
10    <OutputType>Library</OutputType>
11    <RootNamespace>Plateau</RootNamespace>
12    <AssemblyName>Plateau</AssemblyName>
13    <StartPage />
14    <EnableDefaultClasses>false</EnableDefaultClasses>
15    <AssemblyKeyName />
16    <ServerPath />
17    <SCCAuxPath />
18    <SCCProjectName />
19    <SCCProvider />
20    <SCCLocalPath />
21    <PreBuildEvent />
22    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
23    <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
24    <PostBuildEvent />
25    <ManifestKeyFile />
26    <AssemblyDelaySign>false</AssemblyDelaySign>
27    <TargetFramework>131072</TargetFramework>
28    <ManifestCertificateThumbprint />
29    <ApplicationIcon />
30    <AssemblyFileVersion />
31    <DefaultClassName />
32    <ProjectType>Library</ProjectType>
33    <Name />
34    <DelphiDivide>false</DelphiDivide>
35    <AllowLegacyCreate>true</AllowLegacyCreate>
36    <DefaultNamespace />
37    <DelphiCompatibility>false</DelphiCompatibility>
38    <ProjectID />
39    <AllowInlineVars>false</AllowInlineVars>
40    <UnsafeCode>false</UnsafeCode>
41    <DefaultUses />
42    <InternalAssemblyName />
43    <AllowGlobals>true</AllowGlobals>
44    <OwnerKey />
45    <NoRequireOutParam>true</NoRequireOutParam>
46    <AllowLegacyWith>false</AllowLegacyWith>
47    <MtouchSdkVersion>3.0</MtouchSdkVersion>
48  </PropertyGroup>
49  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
50    <DebugSymbols>true</DebugSymbols>
51    <DebugType>full</DebugType>
52    <Optimize>true</Optimize>
53    <OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
54    <ErrorReport>prompt</ErrorReport>
55    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
56    <XmlDocWarning>WarningOnPublicMembers</XmlDocWarning>
57    <CpuType>anycpu</CpuType>
58    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
59    <RuntimeVersion>v25</RuntimeVersion>
60    <DebugClass />
61    <UseXmlDoc>false</UseXmlDoc>
62    <DebugMethodName />
63    <SuppressWarnings />
64    <RunCodeAnalysis>false</RunCodeAnalysis>
65    <WarnOnCaseMismatch>false</WarnOnCaseMismatch>
66    <RemoteDebugEnabled>false</RemoteDebugEnabled>
67    <RemoteDebugMachine />
68    <CodeFlowAnalysis>true</CodeFlowAnalysis>
69    <WebLaunchBrowser>false</WebLaunchBrowser>
70    <WebDebugTarget>Cassini</WebDebugTarget>
71    <RequireExplicitLocalInitialization>false</RequireExplicitLocalInitialization>
72    <XmlAllMembers>false</XmlAllMembers>
73    <ConditionalDefines />
74    <Name />
75    <FutureHelperClassName />
76    <FrameworkFolder />
77    <MtouchLink>None</MtouchLink>
78    <MtouchDebug>True</MtouchDebug>
79    <GeneratePDB>false</GeneratePDB>
80    <StartAppParams />
81    <StartApplication />
82    <RegisterComInterop>false</RegisterComInterop>
83    <WorkingDir />
84    <EnableAssert>true</EnableAssert>
85    <GenerateMDB>false</GenerateMDB>
86    <StartMode>Project</StartMode>
87    <CaptureConsoleOutput>false</CaptureConsoleOutput>
88  </PropertyGroup>
89  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
90    <DebugType>none</DebugType>
91    <Optimize>true</Optimize>
92    <OutputPath>bin\iPhoneSimulator\Release</OutputPath>
93    <ErrorReport>prompt</ErrorReport>
94    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
95    <XmlDocWarning>WarningOnPublicMembers</XmlDocWarning>
96    <CpuType>anycpu</CpuType>
97    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
98    <RuntimeVersion>v25</RuntimeVersion>
99    <DebugClass />
100    <UseXmlDoc>false</UseXmlDoc>
101    <DebugMethodName />
102    <SuppressWarnings />
103    <RunCodeAnalysis>false</RunCodeAnalysis>
104    <WarnOnCaseMismatch>false</WarnOnCaseMismatch>
105    <RemoteDebugEnabled>false</RemoteDebugEnabled>
106    <RemoteDebugMachine />
107    <CodeFlowAnalysis>true</CodeFlowAnalysis>
108    <WebLaunchBrowser>false</WebLaunchBrowser>
109    <WebDebugTarget>Cassini</WebDebugTarget>
110    <RequireExplicitLocalInitialization>false</RequireExplicitLocalInitialization>
111    <XmlAllMembers>false</XmlAllMembers>
112    <ConditionalDefines />
113    <Name />
114    <FutureHelperClassName />
115    <FrameworkFolder />
116    <MtouchLink>None</MtouchLink>
117    <MtouchDebug>False</MtouchDebug>
118    <GeneratePDB>false</GeneratePDB>
119    <StartAppParams />
120    <StartApplication />
121    <RegisterComInterop>false</RegisterComInterop>
122    <WorkingDir />
123    <EnableAssert>true</EnableAssert>
124    <GenerateMDB>false</GenerateMDB>
125    <StartMode>Project</StartMode>
126    <CaptureConsoleOutput>false</CaptureConsoleOutput>
127  </PropertyGroup>
128  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
129    <DebugSymbols>true</DebugSymbols>
130    <DebugType>full</DebugType>
131    <Optimize>true</Optimize>
132    <OutputPath>bin\iPhone\Debug</OutputPath>
133    <ErrorReport>prompt</ErrorReport>
134    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
135    <XmlDocWarning>WarningOnPublicMembers</XmlDocWarning>
136    <CpuType>anycpu</CpuType>
137    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
138    <RuntimeVersion>v25</RuntimeVersion>
139    <DebugClass />
140    <UseXmlDoc>false</UseXmlDoc>
141    <DebugMethodName />
142    <SuppressWarnings />
143    <RunCodeAnalysis>false</RunCodeAnalysis>
144    <WarnOnCaseMismatch>false</WarnOnCaseMismatch>
145    <RemoteDebugEnabled>false</RemoteDebugEnabled>
146    <RemoteDebugMachine />
147    <CodeFlowAnalysis>true</CodeFlowAnalysis>
148    <WebLaunchBrowser>false</WebLaunchBrowser>
149    <WebDebugTarget>Cassini</WebDebugTarget>
150    <RequireExplicitLocalInitialization>false</RequireExplicitLocalInitialization>
151    <XmlAllMembers>false</XmlAllMembers>
152    <ConditionalDefines />
153    <Name />
154    <FutureHelperClassName />
155    <FrameworkFolder />
156    <MtouchDebug>True</MtouchDebug>
157    <CodesignKey>iPhone Developer</CodesignKey>
158    <GeneratePDB>false</GeneratePDB>
159    <StartAppParams />
160    <StartApplication />
161    <RegisterComInterop>false</RegisterComInterop>
162    <WorkingDir />
163    <EnableAssert>true</EnableAssert>
164    <GenerateMDB>false</GenerateMDB>
165    <StartMode>Project</StartMode>
166    <CaptureConsoleOutput>false</CaptureConsoleOutput>
167  </PropertyGroup>
168  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
169    <DebugType>none</DebugType>
170    <Optimize>true</Optimize>
171    <OutputPath>bin\iPhone\Release</OutputPath>
172    <ErrorReport>prompt</ErrorReport>
173    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
174    <XmlDocWarning>WarningOnPublicMembers</XmlDocWarning>
175    <CpuType>anycpu</CpuType>
176    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
177    <RuntimeVersion>v25</RuntimeVersion>
178    <DebugClass />
179    <UseXmlDoc>false</UseXmlDoc>
180    <DebugMethodName />
181    <SuppressWarnings />
182    <RunCodeAnalysis>false</RunCodeAnalysis>
183    <WarnOnCaseMismatch>false</WarnOnCaseMismatch>
184    <RemoteDebugEnabled>false</RemoteDebugEnabled>
185    <RemoteDebugMachine />
186    <CodeFlowAnalysis>true</CodeFlowAnalysis>
187    <WebLaunchBrowser>false</WebLaunchBrowser>
188    <WebDebugTarget>Cassini</WebDebugTarget>
189    <RequireExplicitLocalInitialization>false</RequireExplicitLocalInitialization>
190    <XmlAllMembers>false</XmlAllMembers>
191    <ConditionalDefines />
192    <Name />
193    <FutureHelperClassName />
194    <FrameworkFolder />
195    <MtouchDebug>False</MtouchDebug>
196    <CodesignKey>iPhone Developer</CodesignKey>
197    <GeneratePDB>false</GeneratePDB>
198    <StartAppParams />
199    <StartApplication />
200    <RegisterComInterop>false</RegisterComInterop>
201    <WorkingDir />
202    <EnableAssert>true</EnableAssert>
203    <GenerateMDB>false</GenerateMDB>
204    <StartMode>Project</StartMode>
205    <CaptureConsoleOutput>false</CaptureConsoleOutput>
206  </PropertyGroup>
207  <ItemGroup>
208    <Reference Include="System" />
209    <Reference Include="System.Xml" />
210    <Reference Include="System.Core" />
211    <Reference Include="monotouch" />
212  </ItemGroup>
213  <Import Project="$(MSBuildExtensionsPath)\RemObjects Software\Oxygene\RemObjects.Oxygene.targets" />
214  <ProjectExtensions>
215    <MonoDevelop>
216      <Properties InternalTargetFrameworkVersion="IPhone" />
217    </MonoDevelop>
218  </ProjectExtensions>
219  <ItemGroup>
220    <Compile Include="PlateauCell.pas" />
221    <Compile Include="PlateauCellBase.pas" />
222    <Compile Include="PTComboCell.pas" />
223    <Compile Include="PTLabelCell.pas" />
224    <Compile Include="PTPicker.pas" />
225    <Compile Include="PTPickerItemSelectedEventArgs.pas" />
226    <Compile Include="PTPickerModel.pas" />
227    <Compile Include="PTPickerModelComponent.pas" />
228    <Compile Include="PTTextFieldCell.pas" />
229    <Compile Include="PTUtilities.pas" />
230    <Compile Include="PTSegmentedCell.pas" />
231    <Compile Include="PTTableViewSource.pas" />
232    <Compile Include="PTSwitchCell.pas" />
233    <Compile Include="PTTableViewListSource.pas" />
234    <Compile Include="PTTableViewSectionedSource.pas" />
235  </ItemGroup>
236  <ItemGroup>
237    <EmbeddedResource Include="Images\Button_Arrow_Down.png" />
238    <EmbeddedResource Include="Images\Button_Background_Black.png" />
239  </ItemGroup>
240</Project>
trunk/Source/Plateau/PTPickerItemSelectedEventArgs.pas
1namespace Plateau;
2
3interface
4
5uses
6  System;
7
8type
9  PTPickerItemSelectedEventArgs = public class(EventArgs)
10  public
11    constructor (message: String; selectedItem: String);
12    property SelectedItem: String;
13    property Message: String;
14  end;
15
16implementation
17
18constructor PTPickerItemSelectedEventArgs(message: String; selectedItem: String);
19begin
20  self.message := message;
21  self.selectedItem := selectedItem
22end;
23
24end.
025
126  + *
227
trunk/Source/Plateau/PlateauCell.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  System.Drawing,
8  MonoTouch.CoreFoundation,
9  MonoTouch.CoreGraphics,
10  MonoTouch.Foundation,
11  MonoTouch.UIKit;
12
13type
14  PlateauCellAlignment = public enum( Top,
15    Bottom,
16    Center,
17    Baseline);
18    
19  PlateauCell<T> = public class(PlateauCellBase)
20     where T is UIView, T has constructor;
21  private
22    fLabelWidth: Single := 72;
23    fLabelNormalColor: MonoTouch.UIKit.UIColor := UIColor.DarkGray;
24    fLabelInverseColor: MonoTouch.UIKit.UIColor := UIColor.White;
25    fControlNormalColor: MonoTouch.UIKit.UIColor := UIColor.Black;
26    fControlInverseColor: MonoTouch.UIKit.UIColor := UIColor.White;
27    fTopInset: Single := 8;
28    fBottomInset: Single := 8;
29    fLeftInset: Single := 16;
30    fRightInset: Single := 16;
31    fCenterSpace: Single := 8;
32    fViewAlignment: Plateau.PlateauCellAlignment := PlateauCellAlignment.Center;
33  protected
34    method Initialize();override;
35  public
36    method Layout(); override;
37    
38    method SetSelected(selected: Boolean; animated: Boolean);override;
39    method SetHighlighted(highlighted: Boolean; animated: Boolean);override;
40
41    method set_LabelWidth(value: Single);
42    method set_LabelNormalColor(value: UIColor);
43    method set_LabelInverseColor(value: UIColor);
44    method set_ControlNormalColor(value: UIColor);
45    method set_ControlInverseColor(value: UIColor);
46    method set_TopInset(value: Single);
47    method set_BottomInset(value: Single);
48    method set_LeftInset(value: Single);
49    method set_RightInset(value: Single);
50    method set_CenterSpace(value: Single);
51    method set_ViewAlignment(value: PlateauCellAlignment);
52  protected
53    method ChangeFontColors(aNeedInvert: Boolean);virtual;
54  private
55    method FireOnFontColorChange(aNeedInvert: Boolean);
56  public
57    [Export('init')]
58    constructor (); empty;
59    [Export('initWithCoder:')]
60    constructor (coder: NSCoder); empty;
61    constructor (t: NSObjectFlag); empty;
62    constructor (handle: IntPtr); empty;
63    constructor (reuseIdentifier: String); empty;
64
65    property Label: UILabel read write ;
66    property Control: T read write ;
67    property LabelWidth: Single read fLabelWidth write set_LabelWidth;
68    property LabelNormalColor: UIColor read fLabelNormalColor write set_LabelNormalColor;
69    property LabelInverseColor: UIColor read fLabelInverseColor write set_LabelInverseColor;
70    property ControlNormalColor: UIColor read fControlNormalColor write set_ControlNormalColor;
71    property ControlInverseColor: UIColor read fControlInverseColor write set_ControlInverseColor;
72    property TopInset: Single read fTopInset write set_TopInset;
73    property BottomInset: Single read fBottomInset write set_BottomInset;
74    property LeftInset: Single read fLeftInset write set_LeftInset;
75    property RightInset: Single read fRightInset write set_RightInset;
76    property CenterSpace: Single read fCenterSpace write set_CenterSpace;
77    property ViewAlignment: PlateauCellAlignment read fViewAlignment write set_ViewAlignment;
78
79    event OnFontColorChange: EventHandler<FontColorChangeArgs>;
80  end;
81
82  FontColorChangeArgs = public class(EventArgs)
83  public
84    constructor (aInverse: Boolean);
85    property Inverse: Boolean read write ;
86  end;
87
88implementation
89
90method PlateauCell<T>.Initialize();
91begin
92  inherited Initialize;
93
94  self.AutosizesSubviews := false;
95  Label := new UILabel(RectangleF.&Empty);
96  Label.TextAlignment := UITextAlignment.Right;
97  Label.TextColor := UIColor.DarkGray;
98  Label.Font := UIFont.BoldSystemFontOfSize(12);
99  Label.BaselineAdjustment := UIBaselineAdjustment.AlignBaselines;
100  self.AddSubview(Label);
101  Label.AdjustsFontSizeToFitWidth := true;
102  Label.Lines := 1;
103  Control := new T();
104  self.AddSubview(Control)
105end;
106
107method PlateauCell<T>.Layout();
108begin
109  var inset: Single := LeftInset;
110  if self.Editing then
111    inset := inset + 30;
112  var BigSize: SizeF := new SizeF(LabelWidth, 5000);
113  var lLabelSize: SizeF := Label.SizeThatFits(BigSize);
114  lLabelSize.Width := LabelWidth;
115  var lLabelLocation: PointF := new PointF(inset, TopInset);
116  var controlWidth: Single := self.Bounds.Width - inset - CenterSpace - RightInset - LabelWidth;
117  BigSize.Width := controlWidth;
118  var lControlSize: SizeF := Control.SizeThatFits(BigSize);
119  lControlSize.Width := controlWidth;
120  var lControlLocation: PointF := new PointF(LabelWidth + inset + CenterSpace, TopInset);
121  case ViewAlignment of
122    PlateauCellAlignment.Top: ; // already set that way
123    
124    PlateauCellAlignment.Center: begin
125      if lControlSize.Height > lLabelSize.Height then
126        lLabelLocation.Y := lLabelLocation.Y + ((lControlSize.Height - lLabelSize.Height) / 2)
127      else
128        lControlLocation.Y := lControlLocation.Y + ((lLabelSize.Height - lControlSize.Height) / 2);
129    end;
130
131    PlateauCellAlignment.Bottom: begin
132      if lControlSize.Height > lLabelSize.Height then
133        lLabelLocation.Y := lLabelLocation.Y + (lControlSize.Height - lLabelSize.Height)
134      else
135        lControlLocation.Y := lControlLocation.Y + (lLabelSize.Height - lControlSize.Height);
136    end;
137  end; // case
138  
139  var maxHeight: Single := Math.Max(lLabelSize.Height, lControlSize.Height);
140  Control.Frame := new RectangleF(lControlLocation, lControlSize);
141  Label.Frame := new RectangleF(lLabelLocation, lLabelSize);
142  var lLabelHeight := lLabelSize.Height + Label.Frame.Top + self.BottomInset;
143  var lControlHeight := lControlSize.Height + Control.Frame.Top + self.BottomInset;
144  Console.WriteLine('Label Height='+lLabelHeight.ToString);
145  Console.WriteLine('Control Height='+lControlHeight.ToString);
146  if ((lLabelHeight > self.ContentHeight)) or ((lControlHeight > self.ContentHeight)) then
147    self.ContentHeight := Integer((Math.Max(lLabelHeight, lControlHeight)))
148end;
149
150method PlateauCell<T>.SetSelected(selected: Boolean; animated: Boolean);
151begin
152  inherited SetSelected(selected, animated);
153  FireOnFontColorChange(selected)
154end;
155
156method PlateauCell<T>.SetHighlighted(highlighted: Boolean; animated: Boolean);
157begin
158  inherited SetHighlighted(highlighted, animated);
159  FireOnFontColorChange(highlighted)
160end;
161
162method PlateauCell<T>.ChangeFontColors(aNeedInvert: Boolean);
163begin
164  if aNeedInvert then
165  begin
166    Label.TextColor := LabelInverseColor
167  end
168  else
169  begin
170    Label.TextColor := LabelNormalColor
171  end
172end;
173
174method PlateauCell<T>.FireOnFontColorChange(aNeedInvert: Boolean);
175begin
176  aNeedInvert := (aNeedInvert) and (self.SelectionStyle <> UITableViewCellSelectionStyle.None);
177  ChangeFontColors(aNeedInvert);
178  if OnFontColorChange <> nil then
179    OnFontColorChange(self, new FontColorChangeArgs(aNeedInvert));
180end;
181
182method PlateauCell<T>.set_LabelWidth(value: Single);
183begin
184  fLabelWidth := value;
185  Layout();
186end;
187
188method PlateauCell<T>.set_LabelNormalColor(value: UIColor);
189begin
190  fLabelNormalColor := value;
191  FireOnFontColorChange((self.Selected) or (self.Highlighted));
192end;
193
194method PlateauCell<T>.set_LabelInverseColor(value: UIColor);
195begin
196  fLabelInverseColor := value;
197  FireOnFontColorChange((self.Selected) or (self.Highlighted));
198end;
199
200method PlateauCell<T>.set_ControlNormalColor(value: UIColor);
201begin
202  fControlNormalColor := value;
203  FireOnFontColorChange((self.Selected) or (self.Highlighted));
204end;
205
206method PlateauCell<T>.set_ControlInverseColor(value: UIColor);
207begin
208  fControlInverseColor := value;
209  FireOnFontColorChange((self.Selected) or (self.Highlighted));
210end;
211
212method PlateauCell<T>.set_TopInset(value: Single);
213begin
214  fTopInset := value;
215  DoLayout();
216end;
217
218method PlateauCell<T>.set_BottomInset(value: Single);
219begin
220  fBottomInset := value;
221  DoLayout();
222end;
223
224method PlateauCell<T>.set_LeftInset(value: Single);
225begin
226  fLeftInset := value;
227  DoLayout();
228end;
229
230method PlateauCell<T>.set_RightInset(value: Single);
231begin
232  fRightInset := value;
233  DoLayout();
234end;
235
236method PlateauCell<T>.set_CenterSpace(value: Single);
237begin
238  fCenterSpace := value;
239  DoLayout();
240end;
241
242method PlateauCell<T>.set_ViewAlignment(value: PlateauCellAlignment);
243begin
244  fViewAlignment := value;
245  DoLayout();
246end;
247
248constructor FontColorChangeArgs(aInverse: Boolean);
249begin
250  Inverse := aInverse;
251end;
252
253end.
0254
1255  + *
2256
trunk/Source/Plateau/PTTextFieldCell.pas
1namespace Plateau;
2
3interface
4
5uses
6  System,
7  System.Drawing,
8  MonoTouch.Foundation,
9  MonoTouch.UIKit;
10
11type
12  PTTextFieldCell = public class(PlateauCell<UITextField>)
13  protected
14    method Initialize();override;
15  public
16    method Layout();override;
17    method EditOnSelect();override;
18    method CancelOnDeselect();override;
19  protected
20    method ChangeFontColors(aNeedInvert: Boolean);override;
21  public
22    [Export('init')]
23    constructor (); empty;
24    [Export('initWithCoder:')]
25    constructor (coder: NSCoder); empty;
26    constructor (t: NSObjectFlag); empty;
27    constructor (handle: IntPtr); empty;
28    constructor (reuseIdentifier: String); empty;
29    property CanEditOnSelect: Boolean read true; override;
30  end;
31
32implementation
33
34method PTTextFieldCell.Initialize();
35begin
36  inherited Initialize();
37  self.ViewAlignment := PlateauCellAlignment.Baseline;
38  self.Control.ReturnKeyType := UIReturnKeyType.Done;
39  self.Control.EnablesReturnKeyAutomatically := true;
40  self.Control.ShouldReturn := method (sender: UITextField) : boolean begin
41    self.Control.ResignFirstResponder();
42    exit true;
43  end;
44  self.Control.EditingDidBegin += method (sender: Object; e: EventArgs);
45    begin
46      Console.WriteLine("foo");
47      FireSelectCurrent;
48    end;
49  self.Control.BorderStyle := UITextBorderStyle.None
50end;
51
52method PTTextFieldCell.Layout();
53begin
54  inherited Layout();
55  if self.ViewAlignment = PlateauCellAlignment.Baseline then begin
56    var lFrame: RectangleF := Label.Frame;
57    lFrame.Location := new PointF(lFrame.Left, Control.Frame.Top + Control.Font.Ascender - Label.Font.Ascender);
58    Label.Frame := lFrame
59  end
60end;
61
62method PTTextFieldCell.EditOnSelect();
63begin
64  self.Control.BecomeFirstResponder()
65end;
66
67method PTTextFieldCell.CancelOnDeselect();
68begin
69  self.Control.ResignFirstResponder()
70end;
71
72method PTTextFieldCell.ChangeFontColors(aNeedInvert: Boolean);
73begin
74  inherited ChangeFontColors(aNeedInvert);
75  if aNeedInvert then
76  begin
77    Control.TextColor := ControlInverseColor
78  end
79  else
80  begin
81    Control.TextColor := ControlNormalColor
82  end
83end;
84
85end.
086
187  + *
288
389
490  + PlateauCell copy.pas
591
692
trunk/Source/PlateauTest/MainWindow.xib.designer.cs
1// ------------------------------------------------------------------------------
2// <autogenerated>
3// This code was generated by a tool.
4// Mono Runtime Version: 2.0.50727.1433
5//
6// Changes to this file may cause incorrect behavior and will be lost if
7// the code is regenerated.
8// </autogenerated>
9// ------------------------------------------------------------------------------
10
11namespace PlateauTest {
12    
13    // Base type probably should be MonoTouch.Foundation.NSObject or subclass
14    [MonoTouch.Foundation.Register("AppDelegate")]
15    public partial class AppDelegate {
16        
17        #pragma warning disable 0169
18        [MonoTouch.Foundation.Connect("window")]
19        private MonoTouch.UIKit.UIWindow window {
20            get {
21                return ((MonoTouch.UIKit.UIWindow)(this.GetNativeField("window")));
22            }
23            set {
24                this.SetNativeField("window", value);
25            }
26        }
27        
28        [MonoTouch.Foundation.Connect("tableView")]
29        private MonoTouch.UIKit.UITableView tableView {
30            get {
31                return ((MonoTouch.UIKit.UITableView)(this.GetNativeField("tableView")));
32            }
33            set {
34                this.SetNativeField("tableView", value);
35            }
36        }
37    }
38}
trunk/Source/PlateauTest/PickerCellModel.cs
1
2using System;
3using System.Collections.Generic;
4using MonoTouch.UIKit;
5
6namespace PlateauTest
7{
8
9    public class PickerCellModel : UIPickerViewModel
10    {
11        public PickerCellModel()
12        {
13            fData.Add("Barbecue");
14            fData.Add("Italian");
15            fData.Add("Thai");
16            fData.Add("Sushi");
17            fData.Add("Diner");
18            fData.Add("Drive-in");
19            fData.Add("Dive");
20        }
21
22        private List<string> fData = new List<string>();
23        
24        public override int GetComponentCount (UIPickerView picker)
25        {
26            return 1;
27        }
28
29        public override int GetRowsInComponent (UIPickerView picker, int component)
30        {
31            return fData.Count;
32        }
33
34        public override string GetTitle (UIPickerView picker, int row, int component)
35        {
36            return fData[row];
37        }
38    }
39}
trunk/Source/PlateauTest/Main.cs
1
2using System;
3using System.Collections.Generic;
4using System.Linq;
5using MonoTouch.Foundation;
6using MonoTouch.UIKit;
7
8namespace PlateauTest
9{
10    public class Application
11    {
12        static void Main(string[] args)
13        {
14            UIApplication.Main(args);
15        }
16    }
17
18    // The name AppDelegate is referenced in the MainWindow.xib file.
19    public partial class AppDelegate : UIApplicationDelegate
20    {
21        // This method is invoked when the application has loaded its UI and its ready to run
22        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
23        {
24            // If you have defined a view, add it here:
25            window.AddSubview (tableView);
26            
27            window.MakeKeyAndVisible();
28            
29            return true;
30        }
31
32        // This method is required in iPhoneOS 3.0
33        public override void OnActivated(UIApplication application)
34        {
35        }
36    }
37}
trunk/Source/PlateauTest/PlateauTest.csproj
1<?xml version="1.0" encoding="utf-8"?>
2<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
3  <PropertyGroup>
4    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5    <Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
6    <ProductVersion>9.0.21022</ProductVersion>
7    <SchemaVersion>2.0</SchemaVersion>
8    <ProjectGuid>{104EDA82-639E-4C49-B26A-959096774AE7}</ProjectGuid>
9    <ProjectTypeGuids>{E613F3A2-FE9C-494F-B74E-F63BCB86FEA6};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
10    <OutputType>Exe</OutputType>
11    <RootNamespace>PlateauTest</RootNamespace>
12    <MainNibFile>MainWindow.xib</MainNibFile>
13    <AssemblyName>PlateauTest</AssemblyName>
14    <MtouchSdkVersion>3.0</MtouchSdkVersion>
15    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
16  </PropertyGroup>
17  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
18    <DebugSymbols>true</DebugSymbols>
19    <DebugType>full</DebugType>
20    <Optimize>false</Optimize>
21    <OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
22    <DefineConstants>DEBUG</DefineConstants>
23    <ErrorReport>prompt</ErrorReport>
24    <WarningLevel>4</WarningLevel>
25    <PlatformTarget>x86</PlatformTarget>
26    <MtouchLink>None</MtouchLink>
27    <MtouchDebug>True</MtouchDebug>
28  </PropertyGroup>
29  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
30    <DebugType>none</DebugType>
31    <Optimize>false</Optimize>
32    <OutputPath>bin\iPhoneSimulator\Release</OutputPath>
33    <ErrorReport>prompt</ErrorReport>
34    <WarningLevel>4</WarningLevel>
35    <PlatformTarget>x86</PlatformTarget>
36    <MtouchLink>None</MtouchLink>
37    <MtouchDebug>False</MtouchDebug>
38  </PropertyGroup>
39  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
40    <DebugSymbols>true</DebugSymbols>
41    <DebugType>full</DebugType>
42    <Optimize>false</Optimize>
43    <OutputPath>bin\iPhone\Debug</OutputPath>
44    <DefineConstants>DEBUG</DefineConstants>
45    <ErrorReport>prompt</ErrorReport>
46    <WarningLevel>4</WarningLevel>
47    <PlatformTarget>x86</PlatformTarget>
48    <MtouchDebug>True</MtouchDebug>
49    <CodesignKey>iPhone Developer</CodesignKey>
50    <MtouchLink>None</MtouchLink>
51  </PropertyGroup>
52  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
53    <DebugType>none</DebugType>
54    <Optimize>false</Optimize>
55    <OutputPath>bin\iPhone\Release</OutputPath>
56    <ErrorReport>prompt</ErrorReport>
57    <WarningLevel>4</WarningLevel>
58    <PlatformTarget>x86</PlatformTarget>
59    <CodesignKey>iPhone Developer</CodesignKey>
60    <MtouchDebug>False</MtouchDebug>
61  </PropertyGroup>
62  <ItemGroup>
63    <Reference Include="System" />
64    <Reference Include="System.Xml" />
65    <Reference Include="System.Core" />
66    <Reference Include="monotouch" />
67  </ItemGroup>
68  <ItemGroup>
69    <Compile Include="MainWindow.xib.designer.cs">
70      <DependentUpon>MainWindow.xib</DependentUpon>
71    </Compile>
72    <Compile Include="Main.cs" />
73    <Compile Include="PlateauTestTableController.cs" />
74    <Compile Include="PickerCellModel.cs" />
75  </ItemGroup>
76  <ItemGroup>
77    <Page Include="MainWindow.xib" />
78  </ItemGroup>
79  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
80  <ProjectExtensions>
81    <MonoDevelop>
82      <Properties InternalTargetFrameworkVersion="IPhone" />
83    </MonoDevelop>
84  </ProjectExtensions>
85  <ItemGroup>
86    <ProjectReference Include="..\Plateau\Plateau.oxygene">
87      <Project>{D8A18549-76AD-48B2-9337-6A617ADCC10D}</Project>
88      <Name>Plateau</Name>
89    </ProjectReference>
90  </ItemGroup>
91</Project>
trunk/Source/PlateauTest/PlateauTestTableController.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using MonoTouch.Foundation;
5using MonoTouch.UIKit;
6using Plateau;
7
8namespace PlateauTest
9{
10    [MonoTouch.Foundation.Register("PlateauTestTableController")]
11    public partial class PlateauTestTableController : UITableViewController
12    {
13        //
14        // Constructor invoked from the NIB loader
15        //
16        public PlateauTestTableController(IntPtr p) : base(p)
17        {
18        }
19
20        public override void ViewDidLoad()
21        {
22            base.ViewDidLoad();
23            
24            Title = "Title";
25            
26            var lSource = new PTTableViewSectionedSource();
27            TableView.Source = lSource;
28            
29            lSource.AddSection("First");
30            lSource.AddSection("Second");
31            
32            PTLabelCell lCell = new PTLabelCell();
33            lCell.Label.Text = "MetaV";
34            lCell.Control.Text = "FOO!!!!!";
35            lCell.Layout();
36            lSource.AddCell("First", lCell);
37            
38            PTTextFieldCell lCell2 = new PTTextFieldCell();
39            lCell2.Label.Text = "Boogey";
40            lCell2.Control.Text = "Sample setting";
41            lCell2.Layout();
42            lSource.AddCell("First", lCell2);
43
44            PTSwitchCell lCell3 = new PTSwitchCell();
45            lCell3.Label.Text = "Switch me";
46            lCell3.Layout();
47            lSource.AddCell("First", lCell3);
48            
49            PTComboCell lCell4 = new PTComboCell();
50            lCell4.Label.Text = "Combo me";
51            lCell4.Control.Text = "Foo";
52            lCell4.Layout();
53            lCell4.Values.Add("Foo");
54            lCell4.Values.Add("Bar");
55            lCell4.Values.Add("Bax");
56            lCell4.Values.Add("Quux");
57            lCell4.Values.Add("Xyxyz");
58            lSource.AddCell("Second", lCell4);
59            
60            PTSegmentedCell lCell5 = new PTSegmentedCell();
61            lCell5.Label.Text = "SegMe";
62            lCell5.Control.InsertSegment("Foo",0,false);
63            lCell5.Control.InsertSegment("Bar",1,false);
64            lCell5.Control.InsertSegment("Bax",2,false);
65            lCell5.Control.SelectedSegment = 1;
66            lCell5.Layout();
67            lSource.AddCell("Second", lCell5);
68            
69            UITableViewCell lCellx = new UITableViewCell(UITableViewCellStyle.Default, "foo");
70            lCellx.TextLabel.Text = "blablabla";
71            lSource.AddCell("Second", lCellx);
72        }
73    }
74}
trunk/Source/PlateauTest/MainWindow.xib
1<?xml version="1.0" encoding="UTF-8"?>
2<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
3    <data>
4        <int key="IBDocument.SystemTarget">768</int>
5        <string key="IBDocument.SystemVersion">10B504</string>
6        <string key="IBDocument.InterfaceBuilderVersion">740</string>
7        <string key="IBDocument.AppKitVersion">1038.2</string>
8        <string key="IBDocument.HIToolboxVersion">437.00</string>
9        <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
10            <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
11            <string key="NS.object.0">62</string>
12        </object>
13        <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
14            <bool key="EncodedWithXMLCoder">YES</bool>
15            <integer value="8"/>
16            <integer value="2"/>
17        </object>
18        <object class="NSArray" key="IBDocument.PluginDependencies">
19            <bool key="EncodedWithXMLCoder">YES</bool>
20            <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
21        </object>
22        <object class="NSMutableDictionary" key="IBDocument.Metadata">
23            <bool key="EncodedWithXMLCoder">YES</bool>
24            <object class="NSArray" key="dict.sortedKeys" id="0">
25                <bool key="EncodedWithXMLCoder">YES</bool>
26            </object>
27            <object class="NSMutableArray" key="dict.values">
28                <bool key="EncodedWithXMLCoder">YES</bool>
29            </object>
30        </object>
31        <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
32            <bool key="EncodedWithXMLCoder">YES</bool>
33            <object class="IBProxyObject" id="841351856">
34                <string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
35            </object>
36            <object class="IBProxyObject" id="587066532">
37                <string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
38            </object>
39            <object class="IBUICustomObject" id="987256611"/>
40            <object class="IBUIWindow" id="380026005">
41                <reference key="NSNextResponder"/>
42                <int key="NSvFlags">1316</int>
43                <object class="NSPSMatrix" key="NSFrameMatrix"/>
44                <string key="NSFrameSize">{320, 480}</string>
45                <reference key="NSSuperview"/>
46                <object class="NSColor" key="IBUIBackgroundColor">
47                    <int key="NSColorSpace">1</int>
48                    <bytes key="NSRGB">MSAxIDEAA</bytes>
49                </object>
50                <bool key="IBUIOpaque">NO</bool>
51                <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
52                <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
53            </object>
54            <object class="IBUITableViewController" id="672844878">
55                <object class="IBUITableView" key="IBUIView" id="357289906">
56                    <reference key="NSNextResponder"/>
57                    <int key="NSvFlags">274</int>
58                    <string key="NSFrameSize">{320, 460}</string>
59                    <reference key="NSSuperview"/>
60                    <bool key="IBUIOpaque">NO</bool>
61                    <bool key="IBUIClipsSubviews">YES</bool>
62                    <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
63                    <int key="IBUIStyle">1</int>
64                    <int key="IBUISeparatorStyle">1</int>
65                    <int key="IBUISectionIndexMinimumDisplayRowCount">0</int>
66                    <bool key="IBUIShowsSelectionImmediatelyOnTouchBegin">YES</bool>
67                    <float key="IBUIRowHeight">44</float>
68                    <float key="IBUISectionHeaderHeight">10</float>
69                    <float key="IBUISectionFooterHeight">10</float>
70                </object>
71                <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
72            </object>
73        </object>
74        <object class="IBObjectContainer" key="IBDocument.Objects">
75            <object class="NSMutableArray" key="connectionRecords">
76                <bool key="EncodedWithXMLCoder">YES</bool>
77                <object class="IBConnectionRecord">
78                    <object class="IBCocoaTouchOutletConnection" key="connection">
79                        <string key="label">delegate</string>
80                        <reference key="source" ref="841351856"/>
81                        <reference key="destination" ref="987256611"/>
82                    </object>
83                    <int key="connectionID">5</int>
84                </object>
85                <object class="IBConnectionRecord">
86                    <object class="IBCocoaTouchOutletConnection" key="connection">
87                        <string key="label">window</string>
88                        <reference key="source" ref="987256611"/>
89                        <reference key="destination" ref="380026005"/>
90                    </object>
91                    <int key="connectionID">7</int>
92                </object>
93                <object class="IBConnectionRecord">
94                    <object class="IBCocoaTouchOutletConnection" key="connection">
95                        <string key="label">delegate</string>
96                        <reference key="source" ref="357289906"/>
97                        <reference key="destination" ref="672844878"/>
98                    </object>
99                    <int key="connectionID">10</int>
100                </object>
101                <object class="IBConnectionRecord">
102                    <object class="IBCocoaTouchOutletConnection" key="connection">
103                        <string key="label">dataSource</string>
104                        <reference key="source" ref="357289906"/>
105                        <reference key="destination" ref="672844878"/>
106                    </object>
107                    <int key="connectionID">11</int>
108                </object>
109                <object class="IBConnectionRecord">
110                    <object class="IBCocoaTouchOutletConnection" key="connection">
111                        <string key="label">tableView</string>
112                        <reference key="source" ref="987256611"/>
113                        <reference key="destination" ref="357289906"/>
114                    </object>
115                    <int key="connectionID">12</int>
116                </object>
117            </object>
118            <object class="IBMutableOrderedSet" key="objectRecords">
119                <object class="NSArray" key="orderedObjects">
120                    <bool key="EncodedWithXMLCoder">YES</bool>
121                    <object class="IBObjectRecord">
122                        <int key="objectID">0</int>
123                        <reference key="object" ref="0"/>
124                        <reference key="children" ref="1000"/>
125                        <nil key="parent"/>
126                    </object>
127                    <object class="IBObjectRecord">
128                        <int key="objectID">2</int>
129                        <reference key="object" ref="380026005"/>
130                        <object class="NSMutableArray" key="children">
131                            <bool key="EncodedWithXMLCoder">YES</bool>
132                        </object>
133                        <reference key="parent" ref="0"/>
134                    </object>
135                    <object class="IBObjectRecord">
136                        <int key="objectID">-1</int>
137                        <reference key="object" ref="841351856"/>
138                        <reference key="parent" ref="0"/>
139                        <string key="objectName">File's Owner</string>
140                    </object>
141                    <object class="IBObjectRecord">
142                        <int key="objectID">4</int>
143                        <reference key="object" ref="987256611"/>
144                        <reference key="parent" ref="0"/>
145                        <string key="objectName">App Delegate</string>
146                    </object>
147                    <object class="IBObjectRecord">
148                        <int key="objectID">-2</int>
149                        <reference key="object" ref="587066532"/>
150                        <reference key="parent" ref="0"/>
151                    </object>
152                    <object class="IBObjectRecord">
153                        <int key="objectID">8</int>
154                        <reference key="object" ref="672844878"/>
155                        <object class="NSMutableArray" key="children">
156                            <bool key="EncodedWithXMLCoder">YES</bool>
157                            <reference ref="357289906"/>
158                        </object>
159                        <reference key="parent" ref="0"/>
160                    </object>
161                    <object class="IBObjectRecord">
162                        <int key="objectID">9</int>
163                        <reference key="object" ref="357289906"/>
164                        <reference key="parent" ref="672844878"/>
165                    </object>
166                </object>
167            </object>
168            <object class="NSMutableDictionary" key="flattenedProperties">
169                <bool key="EncodedWithXMLCoder">YES</bool>
170                <object class="NSArray" key="dict.sortedKeys">
171                    <bool key="EncodedWithXMLCoder">YES</bool>
172                    <string>-1.CustomClassName</string>
173                    <string>-2.CustomClassName</string>
174                    <string>2.IBAttributePlaceholdersKey</string>
175                    <string>2.IBEditorWindowLastContentRect</string>
176                    <string>2.IBPluginDependency</string>
177                    <string>2.UIWindow.visibleAtLaunch</string>
178                    <string>4.CustomClassName</string>
179                    <string>4.IBPluginDependency</string>
180                    <string>8.CustomClassName</string>
181                    <string>8.IBEditorWindowLastContentRect</string>
182                    <string>8.IBPluginDependency</string>
183                    <string>9.IBPluginDependency</string>
184                </object>
185                <object class="NSMutableArray" key="dict.values">
186                    <bool key="EncodedWithXMLCoder">YES</bool>
187                    <string>UIApplication</string>
188                    <string>UIResponder</string>
189                    <object class="NSMutableDictionary">
190                        <bool key="EncodedWithXMLCoder">YES</bool>
191                        <reference key="dict.sortedKeys" ref="0"/>
192                        <object class="NSMutableArray" key="dict.values">
193                            <bool key="EncodedWithXMLCoder">YES</bool>
194                        </object>
195                    </object>
196                    <string>{{642, 250}, {320, 480}}</string>
197                    <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
198                    <integer value="1"/>
199                    <string>AppDelegate</string>
200                    <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
201                    <string>PlateauTestTableController</string>
202                    <string>{{329, 265}, {320, 480}}</string>
203                    <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
204                    <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
205                </object>
206            </object>
207            <object class="NSMutableDictionary" key="unlocalizedProperties">
208                <bool key="EncodedWithXMLCoder">YES</bool>
209                <reference key="dict.sortedKeys" ref="0"/>
210                <object class="NSMutableArray" key="dict.values">
211                    <bool key="EncodedWithXMLCoder">YES</bool>
212                </object>
213            </object>
214            <nil key="activeLocalization"/>
215            <object class="NSMutableDictionary" key="localizations">
216                <bool key="EncodedWithXMLCoder">YES</bool>
217                <reference key="dict.sortedKeys" ref="0"/>
218                <object class="NSMutableArray" key="dict.values">
219                    <bool key="EncodedWithXMLCoder">YES</bool>
220                </object>
221            </object>
222            <nil key="sourceID"/>
223            <int key="maxID">13</int>
224        </object>
225        <object class="IBClassDescriber" key="IBDocument.Classes">
226            <object class="NSMutableArray" key="referencedPartialClassDescriptions">
227                <bool key="EncodedWithXMLCoder">YES</bool>
228                <object class="IBPartialClassDescription">
229                    <string key="className">AppDelegate</string>
230                    <object class="NSMutableDictionary" key="outlets">
231                        <bool key="EncodedWithXMLCoder">YES</bool>
232                        <object class="NSArray" key="dict.sortedKeys">
233                            <bool key="EncodedWithXMLCoder">YES</bool>
234                            <string>tableView</string>
235                            <string>window</string>
236                        </object>
237                        <object class="NSMutableArray" key="dict.values">
238                            <bool key="EncodedWithXMLCoder">YES</bool>
239                            <string>id</string>
240                            <string>id</string>
241                        </object>
242                    </object>
243                    <object class="IBClassDescriptionSource" key="sourceIdentifier">
244                        <string key="majorKey">IBUserSource</string>
245                        <string key="minorKey"/>
246                    </object>
247                </object>
248            </object>
249        </object>
250        <int key="IBDocument.localizationMode">0</int>
251        <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
252            <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
253            <integer value="768" key="NS.object.0"/>
254        </object>
255        <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
256            <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
257            <integer value="3000" key="NS.object.0"/>
258        </object>
259        <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
260        <nil key="IBDocument.LastKnownRelativeProjectPath"/>
261        <int key="IBDocument.defaultPropertyAccessControl">3</int>
262        <string key="IBCocoaTouchPluginVersion">3.1</string>
263    </data>
264</archive>
0265
1266  + Plateau CS
2267
3268
4269

Archive Download the corresponding diff file

Revision: 7