Becky Diskind | 5 Oct 2011 21:42

.NET WinForm Application on the iPad

Our goal: To have the ability to run a .NET C# Winform App or parts of it as an iPad app.

What is the easiest way to do this, and what’s involved in the process?

Thank you.

_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list
Rafael Teixeira | 5 Oct 2011 23:41
Picon
Gravatar

Re: .NET WinForm Application on the iPad

On Wed, Oct 5, 2011 at 4:42 PM, Becky Diskind <bdiskind <at> astorchocolate.com> wrote:

Our goal: To have the ability to run a .NET C# Winform App or parts of it as an iPad app.

What is the easiest way to do this, and what’s involved in the process?

That is not possible. You need to rewrite the UI to use the managed wrappers to the IPad UI toolkit.

Rafael "Monoman" Teixeira
---------------------------------------
"The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' (I found it!) but 'That's funny ...'"
Isaac Asimov
US science fiction novelist & scholar (1920 - 1992) 
_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list
Becky Diskind | 6 Oct 2011 03:03

Re: .NET WinForm Application on the iPad

What about the actual C# code? Does it all need to be rewritten too?

 

Can you expand on the basics of what the entire procedure entails?

 

Thank you.

 

From: Rafael Teixeira [mailto:monoman <at> gmail.com]
Sent: Wednesday, October 05, 2011 5:41 PM
To: Becky Diskind
Cc: mono-winforms-list <at> lists.ximian.com
Subject: Re: [Mono-winforms-list] .NET WinForm Application on the iPad

 

On Wed, Oct 5, 2011 at 4:42 PM, Becky Diskind <bdiskind <at> astorchocolate.com> wrote:

Our goal: To have the ability to run a .NET C# Winform App or parts of it as an iPad app.

What is the easiest way to do this, and what’s involved in the process?

That is not possible. You need to rewrite the UI to use the managed wrappers to the IPad UI toolkit.

 

Rafael "Monoman" Teixeira
---------------------------------------
"The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' (I found it!) but 'That's funny ...'"
Isaac Asimov

US science fiction novelist & scholar (1920 - 1992) 

_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list
James Clancey | 6 Oct 2011 04:03
Picon
Gravatar

Re: .NET WinForm Application on the iPad

You need to go through and separate your business layer out from you UI layer. You will then be able to use the majority of your business layer in Monotouch.  

Thanks,
James Clancey

On Oct 5, 2011, at 5:03 PM, "Becky Diskind" <bdiskind <at> astorchocolate.com> wrote:

What about the actual C# code? Does it all need to be rewritten too?

 

Can you expand on the basics of what the entire procedure entails?

 

Thank you.

 

From: Rafael Teixeira [mailto:monoman <at> gmail.com]
Sent: Wednesday, October 05, 2011 5:41 PM
To: Becky Diskind
Cc: mono-winforms-list <at> lists.ximian.com
Subject: Re: [Mono-winforms-list] .NET WinForm Application on the iPad

 

On Wed, Oct 5, 2011 at 4:42 PM, Becky Diskind <bdiskind <at> astorchocolate.com> wrote:

Our goal: To have the ability to run a .NET C# Winform App or parts of it as an iPad app.

What is the easiest way to do this, and what’s involved in the process?

That is not possible. You need to rewrite the UI to use the managed wrappers to the IPad UI toolkit.

 

Rafael "Monoman" Teixeira
---------------------------------------
"The most exciting phrase to hear in science, the one that heralds new discoveries, is not 'Eureka!' (I found it!) but 'That's funny ...'"
Isaac Asimov

US science fiction novelist & scholar (1920 - 1992) 

_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list
_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list
Paul F. Johnson | 6 Oct 2011 20:09
Picon

Using special characters in labels

Hi,

Is it possible to use the likes of superscript and subscript in labels
(for example, so that I could have x2 and have the 2 in superscript) or
mix character sets in a label (eg have Ex read sigma x)?

I've looked and can't find anything useful....

Thanks

Paul
--

-- 
Vertraue mir, ich weiss, was ich mache...

_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Paul F. Johnson | 8 Oct 2011 14:03
Picon

An odd redraw problem

Hi,

I don't know where the problem lies with this one as I'm seeing the same
behaviour with mono and under VS 2010 on Linux and Windows platforms.

I have a simple winform which has in it a NumericUpDown, two group boxes
and two buttons. The code then dynamically inserts a number of NumberBox
objects into one group box and a pile of labels into the other.

(A numberbox is just an overloaded TextBox - details are at
http://www.all-the-johnsons.co.uk/csharp/numberbox.html)

If I click the NumericUpDown, the code inserts new boxes and also
reduces it as expected. However, if I click once to create 3 boxes and
then go back down to 2, half of the third row still remains and I have
no idea why!

NumericUpDown goes from 3 to 6, no decimals

[code]
private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            drawBoxes((int)numericUpDown1.Value);
        }

        private void drawBoxes(int number)
        {
            int ar = number;
            int b = ar;
            int p = 0; // position
            int r = 0; // current row
            ar = Convert.ToInt32(Math.Pow(ar, 2));
            NumberBox[] tmp = new NumberBox[ar];
            Label[] lbl = new Label[ar];
            int t = 0;
	    int m = 65;
            for (int n = 0; n < ar; ++n)
            {
		m += n;
                tmp[n] = new NumberBox();
                tmp[n].Location = new System.Drawing.Point(7 + p, 20 +
(26 * r));
                tmp[n].Name = "numberBox" + n.ToString();
                tmp[n].Size = new System.Drawing.Size(42, 20);
                tmp[n].TabIndex = n;
                groupBox1.Controls.Add(tmp[n]);

                lbl[n] = new Label();
                lbl[n].Location = new System.Drawing.Point(7 + p, 20 +
(26 * r));
                lbl[n].Name = "label" + m.ToString();
                lbl[n].Text = "0";
                lbl[n].Size = new System.Drawing.Size(42, 20);
                lbl[n].TabIndex = m;
                groupBox2.Controls.Add(lbl[n]);

                p += 48;
                if (t + 1 != b)
                    t++;
                else
                {
                    t = 0;
                    r++;
                    p = 0;
                }
            }
            int z = 8 + b * 48;
            int y = 8 + (b * 26) + 16;
            groupBox1.Size = new System.Drawing.Size(z, y);
            groupBox2.Location = new System.Drawing.Point(32 + b * 48,
43);
            groupBox2.Size = new System.Drawing.Size(z, y);
            this.clear.Location = new System.Drawing.Point(16, y + 48);
            this.calc.Location = new System.Drawing.Point(97, y + 48);
            ClientSize = new System.Drawing.Size(z * 2 + 32, y + 80);
            nbArray = tmp; // global variable
            rdArray = lbl; // global variable
        }

I've gone through the code with the debugger, but can't spot anything
out of the ordindary. I've also tried adding an Invalidate() at the end
of the method, but still it gives the half box.

Any help here would be appreciated

Thanks

Paul
--

-- 
Vertraue mir, ich weiss, was ich mache...

_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Robert Jordan | 8 Oct 2011 14:17
Picon
Gravatar

Re: An odd redraw problem

On 08.10.2011 14:03, Paul F. Johnson wrote:
> If I click the NumericUpDown, the code inserts new boxes and also
> reduces it as expected. However, if I click once to create 3 boxes and
> then go back down to 2, half of the third row still remains and I have
> no idea why!

Your code does not seem to remove controls. I see how you
create and add them to some container, but you never
remove them.

Robert

_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Paul F. Johnson | 8 Oct 2011 14:33
Picon

Re: An odd redraw problem

Hi,

> > If I click the NumericUpDown, the code inserts new boxes and also
> > reduces it as expected. However, if I click once to create 3 boxes and
> > then go back down to 2, half of the third row still remains and I have
> > no idea why!
> 
> Your code does not seem to remove controls. I see how you
> create and add them to some container, but you never
> remove them.

Ah! I thought that as I dynamically create them, they'd just be removed
(if I go from say 6 rows to 5 rows, row 6 is completely removed).

How do I go about removing them? Ideally, I'd remove all then add the
new ones in.

Thanks

Paul

--

-- 
Vertraue mir, ich weiss, was ich mache...

_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Andy Hume | 10 Oct 2011 21:51
Picon
Favicon

Re: Using special characters in labels

> -----Original Message-----
> From: mono-winforms-list-bounces <at> lists.ximian.com [mailto:mono-
> winforms-list-bounces <at> lists.ximian.com] On Behalf Of Paul F. Johnson
> Sent: 06 October 2011 19:09
> To: mono-winforms
> Subject: [Mono-winforms-list] Using special characters in labels
> 
> Hi,
> 
> Is it possible to use the likes of superscript and subscript in labels
(for
> example, so that I could have x2 and have the 2 in superscript) or mix
> character sets in a label (eg have Ex read sigma x)?
> 
There's no 'rich' text in buttons IIRC.  However there are Unicode
characters that should help though, e.g. U+00B2 is Superscript 2, ditto 3,
and 1 is U+00B9
http://www.fileformat.info/info/unicode/block/latin_supplement/list.htm
That's dependent on font support of course...

Andy

_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Stifu | 21 Oct 2011 23:26
Picon
Favicon
Gravatar

Re: WinForms DragEventsArgs.KeyState

Hi,

This is a bug in Mono.

It comes from this file:
https://github.com/mono/mono/blob/master/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Dnd.cs

Every DragEventArgs object intialized in this class pass 0 as the keystate
value.

Not sure how to fix this right now, but anyone can pick this up.

dardino wrote:
> 
> Hello!
> 
> i tryed to find a solution for my problem:
> i need to know if a CRTL or ALT or SHIFT key are pressed at the Drop
> Event.
> this is my code:
> 
>         void pictureBox1_DragDrop(object sender, DragEventArgs e)
>         {                    
>                switch (e.KeyState)
>                     {
>                         case 0: // no key pressed => move
>                             Console.WriteLine("No key pressed");
>                             break;
>                         case 8: // pressed CTRL => copy
>                             Console.WriteLine("CTRL are pressed");
>                             break;
>                         case 12: // SHIFT + CTRL => swap
>                             Console.WriteLine("SHIF + CTRL are pressed");
>                             break;
>                         default:
>                             break;
>                     }
>         }
> 
> Under Windows it work perfectly!
> Under linux e.KeyState has value 0 all time.
> 
> Why?
> 
> Anyone has a solution for my problem?
> 
> Thanks!
> 

--
View this message in context: http://mono.1490590.n4.nabble.com/WinForms-DragEventsArgs-KeyState-tp3925675p3926823.html
Sent from the Mono - WinForms mailing list archive at Nabble.com.
_______________________________________________
Mono-winforms-list maillist  -  Mono-winforms-list <at> lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


Gmane