Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MessageBox with custom button captions
Message
From
18/12/2002 11:48:53
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
18/12/2002 08:50:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00733772
Message ID:
00734140
Views:
49
>I'll look at it again then, thanks! What I've done so far is create a form that works as a messagebox and I pass the message, title, and button captions to the form. It works fine and I was able to resize the form and buttons based on the captions and size of the message, but rather than include the form in the project, I'd like to be able to save it as a class and add the code to a method of the calling form and run it that way. Is there anyway to do this that you know of?

Mmmmm... just look into alert.prg and tear it apart if you like. It does contain a definition of a form class, and it resizes as needed. There's one correction that's not posted yet, when sizing the buttons, it uses only two measures instead of three..
.buttons(i).height=fontmetric(1,g_fontname,g_fontsize)+;
			fontmetric(2,g_fontname,g_fontsize)+;
			fontmetric(3,g_fontname,g_fontsize)
is what it should be - current version lacks the last line, so the buttons turn out lacking some height.

I guess I've come somewhere halfway between procedural and OOP in this one - the form class is still in code, but then I feel it's still justified, because the code which is needed for wrapping the instantiation of the form is together with the class, so the call you need to make is still one-liner. Having this form class in a vcx would mean I'd have a few files more to include - simpler this way.

> I've never included one form definition inside another form, so I don't know if it is possible. I've always just added the form or class to the project.

You lost me here... not sure what you mean by "include one form definition inside another form".

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform