Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Messageboxes
Message
From
04/10/1998 15:13:29
 
 
To
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:
00143725
Views:
28
>>>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.

I still think the only way that would work is the word-by-word approach to determine line length so you can get a more accurate number of lines. The MLINES function doesn't take into account the font size when determining lines, it's merely looking for the # of characters (MEMOWIDTH) or a character to determine a new line.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform