Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Messageboxes
Message
From
03/10/1998 15:08:21
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00142123
Message ID:
00143632
Views:
31
>>Don't tell me. I was playing with an alternative to MessageBox for weeks (DOS version took just a few hours), and all it had was a n editbox and a commandbutton group. Sizing them to fit was a pain (you may find it used in VPasns - the solitaire game I've sent), and guessing (read as "trying to calculate") the size of the editbox once it receives its text was the worst. I decided I could live with one extra line at the end, because the other choice was more extra lines or fewer lines than needed. The exact number of lines was impossible to get.
>
>You could use TXTWIDTH to determine the length of lines at various cut-off points between words, but that's an awful lot of work just to determine the number of lines. We had to do our own "messagebox" like function because we needed more control over the buttons than the VFP one gives you. We just stuck to one fixed font to make our life easier to determine the number of lines, though. You would think that the VFP message box would have properties we could manipulate (like font, text on buttons, number of buttons, etc.), or at least parameters (parameter object?) to specify these types of things. Actually, a rich-text type of message area would be quite useful! Just dreaming, I suppose...

Well, I AM doing it all - it defaults to your global font settings (try the VPasns and try out changing the fonts, and look at what Alert() displays look like), and I AM using the TxtWidth method of this form (though not word by word - I'm using MemLines() and Mline() function to chop it into lines), it's just the number of lines in the editbox getting near to unpredictable if you try to determine its height calculating from its number of lines, so I either end up with last line getting chopped off, or having too many blank lines at the bottom.

I think the next incarnation of Alert() will use an array of textboxes, one per line. At least, it will be easier to control.

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