[MonoTouch] Using Portable Library Projects in MonoDevelop/MonoTouch

2012-05-25 Thread slodge
Hi All

I'm still plugging away at trying to get Portable Library projects to work
fully across wp7, winrt, droid and touch.

I'm especially trying this as it will deliver lots of benefits in terms of
refactoring and csproj project management to me as a cross platform
developer.

I've previously managed to:

- get all projects to build in VS2010 - using VSMonoTouch with a fair amount
of hacking -
http://slodge.blogspot.co.uk/2012/04/using-portable-library-tools-for.html

- get all projects to run in wp7, winrt and monodroid from the PC

- get MonoTouch/MonoDevelop on the Mac to load Portable Library Project
files - but this seems only to work if I force the Profile type to
Profile1

- get MonoTouch projects to use Portable Class Libraries if I add them as
compiled references rather than as project references.

However, there are still a few gaps I'm trying to fill - all of them on
MonoDevelop on the Mac:

1. I don't seem to be able to find any way to load PLPs project files in
MonoDevelop outside of Profile1 - if the .csproj file contains anything
other than Profile1 in
`TargetProfileFrameworkProfile1/TargetProfileFramework` then it won't
load. 

2. I can't work out how to edit the installed profiles. Ideally I'd like to
go even further than Profile 4 - ideally I'd like to extend this all the way
up to Profile 104 as I can then link in my own type redirection/substitution
stubs for the limited required System.Net and System.Windows assemblies.

3. I can't work out how to reference portable library projects from
MonoTouch projects - I can add the references, but as soon as I select a
configuration like Debug|iPhoneSimulator then the PLP is greyed out and
not build in active configuration appears.

I appreciate that much of what I'm trying here is on the edge of what has
currently been tried, and I realise that some of the features I'm trying to
use are only available in Beta from Microsoft, but I really strongly believe
in this as the way forwards - so that's why I'm trying so hard to get it
working :)

Has anyone got any ideas about what I could try to move this forwards? I am
toying with the monodevelop source code right now, but haven't really gotten
very far into it yet. If anyone has any ideas or suggestions I'd love to
hear them.

Thanks - and sorry for such a long post on a Friday!

Stuart

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/Using-Portable-Library-Projects-in-MonoDevelop-MonoTouch-tp4654346.html
Sent from the MonoTouch mailing list archive at Nabble.com.
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


[MonoTouch] Working with Dialog

2012-05-25 Thread appli
Hi, I've just started working with MT and Dialog and work has been rapid and
painless up until now.

Basically I'm working with two SQLite tables. Lets call them Heads and Rows
with a one to many relation. 

I'm building the “Rows view” using an inherited DVC-class.
In LoadView I'm loading one section with a custom element, a
ScannerEntryElement, followed by a section with SQLite table row elements.
Every element in the last section holds a database object that I use for
cell rendering and database operations.

The ScannerEntryElement scans a barcode and looks up the corresponding
element from the section below and increments a counter in the db object.
Works perfectly...the first time the view is loaded!

Here's the problem. The second time,  if I'm loading the  view with rows
from another head, the ScannerEntryElement still thinks the rows in the
section below are the same as the first time(same root and section) , even
though I visually can confirm that the correct rows have been loaded in the
section.

I have even tried sending a section reference(to the current row section) to
the scan delegate but no luck. 

Code bellow. The Scan delegate is implemented within the inherited DVC.

A little help please!



public override void LoadView () {
Root = new RootElement(Delivery);
Section top = new Section();
var scanElement = new ScannerEntryElement(EAN, Scan here, , Scan);
top.Add(scanElement);
section = new Section(Rows);
foreach (DeliveryOutRow row in
Database.Main.TableDeliveryOutRow().Where(arg = arg.DeliveryNo == n)) {
var element = new DeliveryOutRowElement (row);
element.BackgroundColor = row.PickedQty  
row.SalesOrderQty ? UIColor.Red
: UIColor.Green;
section.Add (element);
};

Root.Add(top);
Root.Add(section);
base.LoadView();
}

// summary
/// Scan the specified ean.
/// /summary
/// 
/// Ean.
/// 
private void Scan(string ean) {
Section section = Root.SectionList [1];  -- Wrong section, Allways the
same
foreach (Element e in section.Elements) {
if (ean.Equals(((DeliveryOutRowElement)e).Row.EAN )) {
((DeliveryOutRowElement)e).Row.PickedQty += 1;
Database.Main.Update(((DeliveryOutRowElement)e).Row);
ReloadData(); // Not working. View not updated.
}
}
}

public class ScannerEntryElement : MonoTouch.Dialog.EntryElement {
private ScanDelegate ScanAction;

private string EAN = ;
private Section section;
public AEntryElement (string caption, string placeholder, string value,
ScanDelegate ScanAction) : base(caption, placeholder, value) {
this.ScanAction = ScanAction;
}

protected override UITextField CreateTextField (RectangleF frame) {
UITextField textField = base.CreateTextField(frame);
NSNotificationCenter.DefaultCenter.AddObserver(
UITextField.TextFieldTextDidChangeNotification, 
(notification) = {
string s = 
((UITextField)notification.Object).Text.ToString();
if (s.Length == 13) {
EAN = s;
((UITextField)notification.Object).Text = ;
ScanAction(EAN);
}
});
return textField;   
}

private class ATextField : UITextField {
public ATextField() : base() {
KeyboardType = UIKeyboardType.NumberPad;
}
}
}

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/Working-with-Dialog-tp4654411.html
Sent from the MonoTouch mailing list archive at Nabble.com.
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Using Portable Library Projects in MonoDevelop/MonoTouch

2012-05-25 Thread Jeff Stedfast
Hi Stuart,

On Fri, May 25, 2012 at 9:02 AM, slodge m...@slodge.com wrote:

 Hi All

 I'm still plugging away at trying to get Portable Library projects to work
 fully across wp7, winrt, droid and touch.

 I'm especially trying this as it will deliver lots of benefits in terms of
 refactoring and csproj project management to me as a cross platform
 developer.

 I've previously managed to:

 - get all projects to build in VS2010 - using VSMonoTouch with a fair
 amount
 of hacking -
 http://slodge.blogspot.co.uk/2012/04/using-portable-library-tools-for.html

 - get all projects to run in wp7, winrt and monodroid from the PC

 - get MonoTouch/MonoDevelop on the Mac to load Portable Library Project
 files - but this seems only to work if I force the Profile type to
 Profile1

 - get MonoTouch projects to use Portable Class Libraries if I add them as
 compiled references rather than as project references.

 However, there are still a few gaps I'm trying to fill - all of them on
 MonoDevelop on the Mac:

 1. I don't seem to be able to find any way to load PLPs project files in
 MonoDevelop outside of Profile1 - if the .csproj file contains anything
 other than Profile1 in
 `TargetProfileFrameworkProfile1/TargetProfileFramework` then it won't
 load.


Hmm, this seems like a bug. I'll look into this. Could you submit a bug
report to http://bugzilla.xamarin.com for tracking? The IPhone Add-In
component is a good place to submit these (that should auto-assign the bugs
to me).



 2. I can't work out how to edit the installed profiles. Ideally I'd like to
 go even further than Profile 4 - ideally I'd like to extend this all the
 way
 up to Profile 104 as I can then link in my own type
 redirection/substitution
 stubs for the limited required System.Net and System.Windows assemblies.


There's currently no editor UI for this because we currently do not have
any of the XML files that define the profiles, so the only way to have done
it would have been to hard-code the profile names and relations.

We want to eventually have full support for .NETPortable projects and be
compatible with Microsoft, but we do not currently have the XML / API
definitions for the profiles as part of Mono. It *is* in our queue to
figure out how to generate these, because long-term we agree that this is
the way forward.

Once we find a way to include those in Mono, it'll become a high priority
to implement a UI for selecting these profile configurations.



 3. I can't work out how to reference portable library projects from
 MonoTouch projects - I can add the references, but as soon as I select a
 configuration like Debug|iPhoneSimulator then the PLP is greyed out and
 not build in active configuration appears.


What configurations does it work with? I could have sworn this worked.

Could you submit a bug for this one, too?

I'll look into this one as well.



 I appreciate that much of what I'm trying here is on the edge of what has
 currently been tried, and I realise that some of the features I'm trying to
 use are only available in Beta from Microsoft, but I really strongly
 believe
 in this as the way forwards - so that's why I'm trying so hard to get it
 working :)


We think it's the way forward, too.



 Has anyone got any ideas about what I could try to move this forwards? I am
 toying with the monodevelop source code right now, but haven't really
 gotten
 very far into it yet. If anyone has any ideas or suggestions I'd love to
 hear them.


The easiest way to poke around the .NETPortable stuff is probably to use
`git log --author=jeff` and then search for .NETPortable (it's how I remind
myself where the source files are!)

For example, one of the source files
is: main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProject.cs


Hope that helps,

Jeff
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Using Portable Library Projects in MonoDevelop/MonoTouch

2012-05-25 Thread Stuart Lodge
Thanks Jeff

Will drill down through your ideas during this weekend and into next week.
I'm already logging a few issues - but don't want to log too many when I
know I'm working on the edge of the dev curve.

What sort of thing do you need to know for the profiles - I've got this
https://gist.github.com/2788579

And I've also got very helpful contact from Daniel (@dsplaisted) within the
MS PCL/PLP team if that helps - he seems genuinely really keen to see PCLs
used across all platforms.

Stuart

On 25 May 2012 15:22, Jeff Stedfast j...@xamarin.com wrote:

 Hi Stuart,

 On Fri, May 25, 2012 at 9:02 AM, slodge m...@slodge.com wrote:

 Hi All

 I'm still plugging away at trying to get Portable Library projects to work
 fully across wp7, winrt, droid and touch.

 I'm especially trying this as it will deliver lots of benefits in terms of
 refactoring and csproj project management to me as a cross platform
 developer.

 I've previously managed to:

 - get all projects to build in VS2010 - using VSMonoTouch with a fair
 amount
 of hacking -
 http://slodge.blogspot.co.uk/2012/04/using-portable-library-tools-for.html

 - get all projects to run in wp7, winrt and monodroid from the PC

 - get MonoTouch/MonoDevelop on the Mac to load Portable Library Project
 files - but this seems only to work if I force the Profile type to
 Profile1

 - get MonoTouch projects to use Portable Class Libraries if I add them as
 compiled references rather than as project references.

 However, there are still a few gaps I'm trying to fill - all of them on
 MonoDevelop on the Mac:

 1. I don't seem to be able to find any way to load PLPs project files in
 MonoDevelop outside of Profile1 - if the .csproj file contains anything
 other than Profile1 in
 `TargetProfileFrameworkProfile1/TargetProfileFramework` then it won't
 load.


 Hmm, this seems like a bug. I'll look into this. Could you submit a bug
 report to http://bugzilla.xamarin.com for tracking? The IPhone Add-In
 component is a good place to submit these (that should auto-assign the bugs
 to me).



 2. I can't work out how to edit the installed profiles. Ideally I'd like
 to
 go even further than Profile 4 - ideally I'd like to extend this all the
 way
 up to Profile 104 as I can then link in my own type
 redirection/substitution
 stubs for the limited required System.Net and System.Windows assemblies.


 There's currently no editor UI for this because we currently do not have
 any of the XML files that define the profiles, so the only way to have done
 it would have been to hard-code the profile names and relations.

 We want to eventually have full support for .NETPortable projects and be
 compatible with Microsoft, but we do not currently have the XML / API
 definitions for the profiles as part of Mono. It *is* in our queue to
 figure out how to generate these, because long-term we agree that this is
 the way forward.

 Once we find a way to include those in Mono, it'll become a high priority
 to implement a UI for selecting these profile configurations.



 3. I can't work out how to reference portable library projects from
 MonoTouch projects - I can add the references, but as soon as I select a
 configuration like Debug|iPhoneSimulator then the PLP is greyed out and
 not build in active configuration appears.


 What configurations does it work with? I could have sworn this worked.

 Could you submit a bug for this one, too?

 I'll look into this one as well.



 I appreciate that much of what I'm trying here is on the edge of what has
 currently been tried, and I realise that some of the features I'm trying
 to
 use are only available in Beta from Microsoft, but I really strongly
 believe
 in this as the way forwards - so that's why I'm trying so hard to get it
 working :)


 We think it's the way forward, too.



 Has anyone got any ideas about what I could try to move this forwards? I
 am
 toying with the monodevelop source code right now, but haven't really
 gotten
 very far into it yet. If anyone has any ideas or suggestions I'd love to
 hear them.


 The easiest way to poke around the .NETPortable stuff is probably to use
 `git log --author=jeff` and then search for .NETPortable (it's how I remind
 myself where the source files are!)

 For example, one of the source files
 is: 
 main/src/core/MonoDevelop.Core/MonoDevelop.Projects/PortableDotNetProject.cs


 Hope that helps,

 Jeff


___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Using Portable Library Projects in MonoDevelop/MonoTouch

2012-05-25 Thread Stuart Lodge
Just logged the two issues and also updated the Gist so it shows slightly
more public member info in the profile dump -
https://gist.github.com/2788579

Hope that helps

Thanks again for your answers :)

Stuart - away for the weekend so will get back on this next week now :)
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] Using Portable Library Projects in MonoDevelop/MonoTouch

2012-05-25 Thread Jeff Stedfast
Thanks Stuart, I'll look into these issues.

Jeff

On Fri, May 25, 2012 at 11:25 AM, Stuart Lodge m...@slodge.com wrote:

 Just logged the two issues and also updated the Gist so it shows slightly
 more public member info in the profile dump -
 https://gist.github.com/2788579

 Hope that helps

 Thanks again for your answers :)

 Stuart - away for the weekend so will get back on this next week now :)

___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


[MonoTouch] UIDatePicker not scrolling Day or Month

2012-05-25 Thread ric3kg
Adding a DatePicker with the following code, I can scroll the year but not
the Day or Month. Any ideas?

datePicker = new UIDatePicker(pickerRect);
datePicker.Mode = UIDatePickerMode.Date;
datePicker.SetDate(appDelegate.store.builderPlan.p_startDateTime, true);
datePicker.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
datePicker.ValueChanged += delegate(object sender, EventArgs e) {
SetDate();
};
this.AddSubview(datePicker);

Thanks, Rick

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/UIDatePicker-not-scrolling-Day-or-Month-tp4654620.html
Sent from the MonoTouch mailing list archive at Nabble.com.
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


Re: [MonoTouch] UIDatePicker not scrolling Day or Month

2012-05-25 Thread ric3kg
The view did not encompass the picker, right hand side of picker was outside
the view...

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/UIDatePicker-not-scrolling-Day-or-Month-tp4654620p4654624.html
Sent from the MonoTouch mailing list archive at Nabble.com.
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


[MonoTouch] how to add attributes to a NSMutableAttributed string..

2012-05-25 Thread akaash1087


I  have actually made a pickerview.I want to decrease the text size of the
font that apperas in the rows.I cant figure out how I should it.

I am actually using Gettitle to populate the rows.I am returning string from
the function.But since I wanted to decrease the string size I decided to use
NSMutableAttributed string and then set the font size.There is a function
called Addattributes but I cant figure out how I should implement
it.Documentation is not available..cant figure out what I should pass as the
arguments.If core text API s are to be used then which one should I use.IF I
want to create font of a particular size then will 
*MonoTouch.CoreText.CTFont aFont =
MonoTouch.CoreText.CTFontDescriptor(Arial, 17f) *
do?
Can I convert a string to NSMutablestring?

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/how-to-add-attributes-to-a-NSMutableAttributed-string-tp4651293.html
Sent from the MonoTouch mailing list archive at Nabble.com.
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch


[MonoTouch] Problem MonoTouch

2012-05-25 Thread Francisco Valdés
Hi, i read this url
http://lists.ximian.com/pipermail/monotouch/2011-September/005464.html, y i
would like me know, how can i install monotouch in virtual machine??

Best Regards
Francisco
Santiago de Chile.
___
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch