Creating the GUI part of the template in Visual Studio

Is there a feature you'd like us to add? Post it here.

Creating the GUI part of the template in Visual Studio

Postby Rahman on Wed Dec 13, 2006 11:48 am

hello guys,

I believe it is hard to create the GUI part of the my generation compare to code smith. It took me sometimes to customise a guy that takes couple of extra inputs from the user ...

Is there a way to enable to create the GUI using visual studio and then copy and paste it in Interface Code tab of Mygeneration?

this will save a lot of timee

many thanks
Rahman
Lurker
 
Posts: 5
Joined: Wed Dec 06, 2006 4:06 am

Postby justin.greenwood on Wed Dec 13, 2006 2:08 pm

The answer is \"yes, but...\". You can create your input form in visual studio in a DLL and then call it from the template. However, you have to pull the collected data into the ZeusInput object yourself. There are some examples out there and an article in the template library. I personally think it's easier to just create the form through the template GUI code. It does auto layout and provides jsut about any control you would need. It's not pretty, but pretty isn't what code-generation is about. You'll find that there are many advantages to doing it the MyGeneration way. They automatically re-populate for project files (that has to be done manually with windows forms). They also auto-bind to the ZeusInput object.
User avatar
justin.greenwood
Site Admin
 
Posts: 441
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN

Postby mike.griffin on Wed Dec 13, 2006 2:11 pm

Yes, you can create full winform UI's, there is a sample shipped with MyGeneration, see Tutorials=>C#=>Chapter 2 and look at the interface code tab, you'll see

Code: Select all
public class MyForm : System.Windows.Forms.Form
{
   private System.Windows.Forms.Label lblDatabases;
   private System.Windows.Forms.ComboBox cboxDatabases;
   private System.Windows.Forms.Label lblTables;
   private System.Windows.Forms.ListBox lboxTables;
   private System.Windows.Forms.Button btnOkay;

}


The trick here is to get the users choices back to the body of the template, which you can see in.

Code: Select all
public void btnOkay_Click(object sender, EventArgs args)
{
}


Also, take a look at this, it's the code for the Samples -> Winform Demo template
http://www.mygenerationsoftware.com/Tem ... 3762b5337e


You can bind to MyMeta and write your full blown UI in a Windows.Forms app, however, as stated in the license, you cannot ship any product bound to MyMeta or redistribute it in any way. In that zip file you will see how to manually load an instance of MyMeta, you're executeable will have to be named MyGeneration.exe. See if you can make sense of this.
User avatar
mike.griffin
Site Admin
 
Posts: 3290
Joined: Sat Apr 03, 2004 6:10 am
Location: Indianapolis, IN


Return to Enhancements

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron