| trunk/Source/Plateau/PTPickerModel.pas |
| 1 | namespace Plateau; |
| 2 | |
| 3 | interface |
| 4 | |
| 5 | uses |
| 6 | System, |
| 7 | MonoTouch.UIKit, |
| 8 | System.Collections.Generic; |
| 9 | |
| 10 | type |
| 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 | |
| 45 | implementation |
| 46 | |
| 47 | method PTPickerModel.GetComponentCount(pickerView: UIPickerView): Integer; |
| 48 | begin |
| 49 | exit self.NumberOfComponents |
| 50 | end; |
| 51 | |
| 52 | method PTPickerModel.GetRowsInComponent(pickerView: UIPickerView; componentIndex: Integer): Integer; |
| 53 | begin |
| 54 | exit self.fModelData[componentIndex].Rows.Count |
| 55 | end; |
| 56 | |
| 57 | method PTPickerModel.GetTitle(picker: UIPickerView; rowIndex: Integer; componentIndex: Integer): String; |
| 58 | begin |
| 59 | exit self.fModelData[componentIndex].Rows[rowIndex].ToString() |
| 60 | end; |
| 61 | |
| 62 | method PTPickerModel.Selected(pickerView: UIPickerView; rowIndex: Integer; componentIndex: Integer); |
| 63 | begin |
| 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 |
| 71 | end; |
| 72 | |
| 73 | method PTPickerModel.GetComponentWidth(pickerView: UIPickerView; componentIndex: Integer): Single; |
| 74 | begin |
| 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; |
| 83 | end; |
| 84 | |
| 85 | method PTPickerModel.GetRowHeight(pickerView: UIPickerView; componentIndex: Integer): Single; |
| 86 | begin |
| 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 |
| 95 | end; |
| 96 | |
| 97 | method PTPickerModel.SelectItem(componentIndex: Integer; rowIndex: Integer); |
| 98 | begin |
| 99 | self.selectedComponentIndex := componentIndex; |
| 100 | self.SelectedRowIndex := rowIndex; |
| 101 | end; |
| 102 | |
| 103 | constructor PTPickerModel(); |
| 104 | begin |
| 105 | |
| 106 | end; |
| 107 | |
| 108 | constructor PTPickerModel(modelData: List<PTPickerModelComponent>); |
| 109 | begin |
| 110 | constructor (); |
| 111 | self.fModelData := modelData; |
| 112 | end; |
| 113 | |
| 114 | method PTPickerModel.get_SelectedItem: String; |
| 115 | begin |
| 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 |
| 132 | end; |
| 133 | |
| 134 | end. |
| 0 | 135 | |
| 1 | 136 | + * |
| 2 | 137 | |
| trunk/Source/Plateau/PTPicker.pas |
| 1 | namespace Plateau; |
| 2 | |
| 3 | interface |
| 4 | |
| 5 | uses |
| 6 | System, |
| 7 | MonoTouch.UIKit, |
| 8 | System.Drawing; |
| 9 | |
| 10 | type |
| 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 | |
| 32 | implementation |
| 33 | |
| 34 | method PTPicker.Handle_dataSourceItemSelected(sender: Object; e: PTPickerItemSelectedEventArgs); |
| 35 | begin |
| 36 | if self.ItemSelected <> nil then |
| 37 | begin |
| 38 | self.ItemSelected(sender, e) |
| 39 | end |
| 40 | end; |
| 41 | |
| 42 | method PTPicker.ShowPicker(); |
| 43 | begin |
| 44 | self.ShowActionSheetPicker() |
| 45 | end; |
| 46 | |
| 47 | method PTPicker.ShowActionSheetPicker(); |
| 48 | begin |
| 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) |
| 118 | end; |
| 119 | |
| 120 | constructor PTPicker(view: UIView); |
| 121 | begin |
| 122 | self.ownerView := view; |
| 123 | end; |
| 124 | |
| 125 | method PTPicker.set_DataSource(value: PTPickerModel); |
| 126 | begin |
| 127 | if self.fDataSource <> nil then |
| 128 | self.DataSource.ItemSelected -= Handle_dataSourceItemSelected; |
| 129 | self.fDataSource := value; |
| 130 | self.fDataSource.ItemSelected += Handle_dataSourceItemSelected; |
| 131 | end; |
| 132 | |
| 133 | end. |
| 0 | 134 | |
| 1 | 135 | + * |
| 2 | 136 | |
| trunk/Source/Plateau/PlateauCellBase.pas |
| 1 | namespace Plateau; |
| 2 | |
| 3 | interface |
| 4 | |
| 5 | uses |
| 6 | System, |
| 7 | System.Drawing, |
| 8 | MonoTouch.CoreFoundation, |
| 9 | MonoTouch.CoreGraphics, |
| 10 | MonoTouch.Foundation, |
| 11 | MonoTouch.UIKit; |
| 12 | |
| 13 | type |
| 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 | |
| 53 | implementation |
| 54 | |
| 55 | method PlateauCellBase.Startup(); |
| 56 | begin |
| 57 | fHoldLayout := true; |
| 58 | try |
| 59 | Initialize(); |
| 60 | finally |
| 61 | fHoldLayout := false; |
| 62 | end; |
| 63 | DoLayout() |
| 64 | end; |
| 65 | |
| 66 | method PlateauCellBase.DoLayout(); |
| 67 | begin |
| 68 | if not fHoldLayout then |
| 69 | Layout(); |
| 70 | end; |
| 71 | |
| 72 | method PlateauCellBase.Initialize(); |
| 73 | begin |
| 74 | ContentHeight := 44; |
| 75 | self.SelectionStyle := UITableViewCellSelectionStyle.None; |
| 76 | end; |
| 77 | |
| 78 | method PlateauCellBase.Layout(); |
| 79 | begin |
| 80 | end; |
| 81 | |
| 82 | method PlateauCellBase.EditOnSelect(); |
| 83 | begin |
| 84 | end; |
| 85 | |
| 86 | method PlateauCellBase.CancelOnDeselect(); |
| 87 | begin |
| 88 | end; |
| 89 | |
| 90 | constructor PlateauCellBase(); |
| 91 | begin |
| 92 | inherited constructor(); |
| 93 | Startup(); |
| 94 | end; |
| 95 | |
| 96 | constructor PlateauCellBase(coder: NSCoder); |
| 97 | begin |
| 98 | inherited constructor(coder); |
| 99 | Startup(); |
| 100 | end; |
| 101 | |
| 102 | constructor PlateauCellBase(t: NSObjectFlag); |
| 103 | begin |
| 104 | inherited constructor(t); |
| 105 | Startup(); |
| 106 | end; |
| 107 | |
| 108 | constructor PlateauCellBase(handle: IntPtr); |
| 109 | begin |
| 110 | inherited constructor(handle); |
| 111 | Startup(); |
| 112 | end; |
| 113 | |
| 114 | constructor PlateauCellBase(reuseIdentifier: String); |
| 115 | begin |
| 116 | inherited constructor(UITableViewCellStyle.&Default, reuseIdentifier); |
| 117 | Startup(); |
| 118 | end; |
| 119 | |
| 120 | method PlateauCellBase.set_HoldLayout(value: Boolean); |
| 121 | begin |
| 122 | fHoldLayout := value; |
| 123 | DoLayout(); |
| 124 | end; |
| 125 | |
| 126 | method PlateauCellBase.FireSelectCurrent; |
| 127 | begin |
| 128 | if SelectCurrent <> nil then |
| 129 | SelectCurrent(self); |
| 130 | end; |
| 131 | |
| 132 | method PlateauCellBase.FireDeselectSiblings; |
| 133 | begin |
| 134 | if DeselectSiblings <> nil then |
| 135 | DeselectSiblings(self); |
| 136 | end; |
| 137 | |
| 138 | end. |
| 0 | 139 | |
| 1 | 140 | + * |
| 2 | 141 | |
| 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/PlateauCell.pas |
| 1 | namespace Plateau; |
| 2 | |
| 3 | interface |
| 4 | |
| 5 | uses |
| 6 | System, |
| 7 | System.Drawing, |
| 8 | MonoTouch.CoreFoundation, |
| 9 | MonoTouch.CoreGraphics, |
| 10 | MonoTouch.Foundation, |
| 11 | MonoTouch.UIKit; |
| 12 | |
| 13 | type |
| 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 | |
| 88 | implementation |
| 89 | |
| 90 | method PlateauCell<T>.Initialize(); |
| 91 | begin |
| 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) |
| 105 | end; |
| 106 | |
| 107 | method PlateauCell<T>.Layout(); |
| 108 | begin |
| 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))) |
| 148 | end; |
| 149 | |
| 150 | method PlateauCell<T>.SetSelected(selected: Boolean; animated: Boolean); |
| 151 | begin |
| 152 | inherited SetSelected(selected, animated); |
| 153 | FireOnFontColorChange(selected) |
| 154 | end; |
| 155 | |
| 156 | method PlateauCell<T>.SetHighlighted(highlighted: Boolean; animated: Boolean); |
| 157 | begin |
| 158 | inherited SetHighlighted(highlighted, animated); |
| 159 | FireOnFontColorChange(highlighted) |
| 160 | end; |
| 161 | |
| 162 | method PlateauCell<T>.ChangeFontColors(aNeedInvert: Boolean); |
| 163 | begin |
| 164 | if aNeedInvert then |
| 165 | begin |
| 166 | Label.TextColor := LabelInverseColor |
| 167 | end |
| 168 | else |
| 169 | begin |
| 170 | Label.TextColor := LabelNormalColor |
| 171 | end |
| 172 | end; |
| 173 | |
| 174 | method PlateauCell<T>.FireOnFontColorChange(aNeedInvert: Boolean); |
| 175 | begin |
| 176 | aNeedInvert := (aNeedInvert) and (self.SelectionStyle <> UITableViewCellSelectionStyle.None); |
| 177 | ChangeFontColors(aNeedInvert); |
| 178 | if OnFontColorChange <> nil then |
| 179 | OnFontColorChange(self, new FontColorChangeArgs(aNeedInvert)); |
| 180 | end; |
| 181 | |
| 182 | method PlateauCell<T>.set_LabelWidth(value: Single); |
| 183 | begin |
| 184 | fLabelWidth := value; |
| 185 | Layout(); |
| 186 | end; |
| 187 | |
| 188 | method PlateauCell<T>.set_LabelNormalColor(value: UIColor); |
| 189 | begin |
| 190 | fLabelNormalColor := value; |
| 191 | FireOnFontColorChange((self.Selected) or (self.Highlighted)); |
| 192 | end; |
| 193 | |
| 194 | method PlateauCell<T>.set_LabelInverseColor(value: UIColor); |
| 195 | begin |
| 196 | fLabelInverseColor := value; |
| 197 | FireOnFontColorChange((self.Selected) or (self.Highlighted)); |
| 198 | end; |
| 199 | |
| 200 | method PlateauCell<T>.set_ControlNormalColor(value: UIColor); |
| 201 | begin |
| 202 | fControlNormalColor := value; |
| 203 | FireOnFontColorChange((self.Selected) or (self.Highlighted)); |
| 204 | end; |
| 205 | |
| 206 | method PlateauCell<T>.set_ControlInverseColor(value: UIColor); |
| 207 | begin |
| 208 | fControlInverseColor := value; |
| 209 | FireOnFontColorChange((self.Selected) or (self.Highlighted)); |
| 210 | end; |
| 211 | |
| 212 | method PlateauCell<T>.set_TopInset(value: Single); |
| 213 | begin |
| 214 | fTopInset := value; |
| 215 | DoLayout(); |
| 216 | end; |
| 217 | |
| 218 | method PlateauCell<T>.set_BottomInset(value: Single); |
| 219 | begin |
| 220 | fBottomInset := value; |
| 221 | DoLayout(); |
| 222 | end; |
| 223 | |
| 224 | method PlateauCell<T>.set_LeftInset(value: Single); |
| 225 | begin |
| 226 | fLeftInset := value; |
| 227 | DoLayout(); |
| 228 | end; |
| 229 | |
| 230 | method PlateauCell<T>.set_RightInset(value: Single); |
| 231 | begin |
| 232 | fRightInset := value; |
| 233 | DoLayout(); |
| 234 | end; |
| 235 | |
| 236 | method PlateauCell<T>.set_CenterSpace(value: Single); |
| 237 | begin |
| 238 | fCenterSpace := value; |
| 239 | DoLayout(); |
| 240 | end; |
| 241 | |
| 242 | method PlateauCell<T>.set_ViewAlignment(value: PlateauCellAlignment); |
| 243 | begin |
| 244 | fViewAlignment := value; |
| 245 | DoLayout(); |
| 246 | end; |
| 247 | |
| 248 | constructor FontColorChangeArgs(aInverse: Boolean); |
| 249 | begin |
| 250 | Inverse := aInverse; |
| 251 | end; |
| 252 | |
| 253 | end. |
| 0 | 254 | |
| 1 | 255 | + * |
| 2 | 256 | |
| 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 |
| 1 | using System; |
| 2 | using System.Collections.Generic; |
| 3 | using System.Linq; |
| 4 | using MonoTouch.Foundation; |
| 5 | using MonoTouch.UIKit; |
| 6 | using Plateau; |
| 7 | |
| 8 | namespace 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> |
| 0 | 265 | |
| 1 | 266 | + Plateau CS |
| 2 | 267 | |
| 3 | 268 | |
| 4 | 269 | |