app.aboutForm

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

app.aboutForm

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:12 pm

by David Mitchell >> Fri, 9 Apr 1999 6:17:21 GMT

How do I show this form?

I have tried:

create app.aboutForm transient;
app.aboutForm.show;

and:

var
f : Form;begin

f := app.aboutForm;
create f transient;
f.show;
end;

But neither one works? How do I show it without hard coding the aboutForm?

Thanks

David

- Individualists, UNITE!

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: app.aboutForm

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:12 pm

by Dean Cooper >> Fri, 9 Apr 1999 7:32:43 GMT

Hi David,

app.aboutForm is a reference to the persistent definition of your about form (an instance of Form), not the class of your about form. The app.aboutForm reference is of type Form, so:
create app.aboutForm transient;

is creating a transient instance of the Form class, which isn't what you want. Your next fragment:
var
f : Form;
begin
f := app.aboutForm;
create f transient;

is doing the same thing. The "create f transient" is assigning to f a reference to a transient instance of Form (because f is of type Form); the initial assignment to f of app.aboutForm is redundant.

This should do what you want:

vars
formClass : Class;
f : Form;begin

formClass := currentSchema.getClass(app.aboutForm.name);
create f as formClass transient;
f.show;
end;

We use the name of the form (obtained via app.aboutForm.name) to get the form's class. Once we have the class, we can use this to create the appropriate kind of form instance (referenced by f).

Hope this helps.

Dean.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: app.aboutForm

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:12 pm

by David Mitchell >> Sat, 10 Apr 1999 8:36:02 GMT

Thanks very much Dean.

David
Jade Kid

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: app.aboutForm

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:12 pm

by Eric Peachey >> Sun, 11 Apr 1999 23:00:43 GMT
How do I show this form?


One way of doing this is to assign a standard 'Help List' menu for your main application form (using the Painter). The standard menu includes options for 'help', 'using help' and 'about'. If you do this then Jade will call the 'aboutForm' you set for your application.

Eric Peachey
Cardinal Engineering Centre Dunedin


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 1 guest