mail-archives/mono-osx/2011-January/003873.html

167 строки
6.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-osx] [MonoMac] MM Add-in templates
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20%5BMonoMac%5D%20MM%20Add-in%20templates&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="003872.html">
<LINK REL="Next" HREF="003885.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-osx] [MonoMac] MM Add-in templates</H1>
<B>kjpou</B>
<A HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20%5BMonoMac%5D%20MM%20Add-in%20templates&In-Reply-To="
TITLE="[Mono-osx] [MonoMac] MM Add-in templates">kjpou at pt.lu
</A><BR>
<I>Fri Jan 28 11:24:05 EST 2011</I>
<P><UL>
<LI>Previous message: <A HREF="003872.html">[Mono-osx] [MonoMac] MonoMac add-in template
</A></li>
<LI>Next message: <A HREF="003885.html">[Mono-osx] [MonoMac] MM Add-in templates
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3873">[ date ]</a>
<a href="thread.html#3873">[ thread ]</a>
<a href="subject.html#3873">[ subject ]</a>
<a href="author.html#3873">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Michael
Thank you for the response.
&gt; You need to add the added files to the addin's&lt;Runtime&gt; element so
&gt; that they get included in the addin when packed for the online
&gt; repository.
did not see those but have added them.
&gt; In the .xft.xml files, LanguageName should be C#.
I forgot to ask what that should be in my post. Have now changed it to c#
&gt;Also, they both have
&gt; a DependsOn for a nonexistent xib file,
I thought I had taken those DependsOn out already. Anyway got them out
for sure now.
&gt; and since they don't have
&gt; designer classes, don't need to be partial.
For the way I was using them they had to be partial. Probably short
sighted on my part (see below about the Register)
&gt; Maybe I don't understand the purpose of the &quot;Inherited NSView&quot;, but I
&gt; assume they are meant to be able to be created either programmatically
&gt; or as a child widget in a nib (rather than the owner/root widget).
&gt; &gt; From programmatic use, it would be useful to have a parameterless
&gt; ctor, and for using in nibs it would be good to add a Register
&gt; attribute to make the objective-C name of the class explicit (since
&gt; there is no designer class doing this).
Added the constructor that takes no parameters. I assumed that it would
inherit the NSView constructor.
I thought about the Register as well but the way I am using it there was
no need to add the Register. Here is the only way I have been using these.
Within my nib I create a subclass of a NSView with the name of the class
I am going to use for example MyCustomView. Then on the Custom NSView
that I add to the ContentView I change the Type to MyCustomView within
IB. When I save this it is automatically sent back to the designer
class via the MonoDevelop Bridge with IB.
// Should subclass MonoMac.AppKit.NSView
[MonoMac.Foundation.Register(&quot;MyCustomView&quot;)]
public partial class MyCustomView {
}
This automatically is registered and is marked as partial. Thus you can
not decorate with Register nor mark the class as non partial.
As I said probably a little short sighted.
Kenneth
On 1/28/11 7:56 AM, Michael Hutchinson wrote:
&gt; On Thu, Jan 27, 2011 at 11:36 PM, kjpou&lt;<A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">kjpou at pt.lu</A>&gt; wrote:
&gt;&gt; Hello all
&gt;&gt;
&gt;&gt; This may not be found useful but would have definitely loved the
&gt;&gt; Inherited NSView while going through the Core Animation Book samples.
&gt;&gt; They are very simple and was just trying to get my feet wet with the
&gt;&gt; add-in code.
&gt;&gt;
&gt;&gt; What it does is add two new File types to the add-in.
&gt;&gt;
&gt;&gt; Inherited NSView - Creates a class that inherits from NSView.
&gt;&gt; Inherited NSWindow - Creates a class that inherits from NSWindow.
&gt;&gt;
&gt;&gt; These do not create NIB files associated like what is delivered but are
&gt;&gt; used to override what is defined in a NIB file when creating a custom
&gt;&gt; view or custom window.
&gt;&gt;
&gt;&gt; I definitely find the Inherited NSView handy and a time saver. NSWindow
&gt;&gt; less so as have only had need to do that twice so far.
&gt;&gt;
&gt;&gt; Added the Inherited NSWindow because it was basically a copy and paste
&gt;&gt; of the Inherited NSView.
&gt;&gt;
&gt;&gt; If there are problems with what was done please let me know.
&gt; You need to add the added files to the addin's&lt;Runtime&gt; element so
&gt; that they get included in the addin when packed for the online
&gt; repository.
&gt;
&gt; In the .xft.xml files, LanguageName should be C#. Also, they both have
&gt; a DependsOn for a nonexistent xib file, and since they don't have
&gt; designer classes, don't need to be partial.
&gt;
&gt; Maybe I don't understand the purpose of the &quot;Inherited NSView&quot;, but I
&gt; assume they are meant to be able to be created either programmatically
&gt; or as a child widget in a nib (rather than the owner/root widget).
&gt; &gt; From programmatic use, it would be useful to have a parameterless
&gt; ctor, and for using in nibs it would be good to add a Register
&gt; attribute to make the objective-C name of the class explicit (since
&gt; there is no designer class doing this).
&gt;
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="003872.html">[Mono-osx] [MonoMac] MonoMac add-in template
</A></li>
<LI>Next message: <A HREF="003885.html">[Mono-osx] [MonoMac] MM Add-in templates
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3873">[ date ]</a>
<a href="thread.html#3873">[ thread ]</a>
<a href="subject.html#3873">[ subject ]</a>
<a href="author.html#3873">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-osx">More information about the Mono-osx
mailing list</a><br>
</body></html>