Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Centering WAIT WINDOW command
Message
From
23/09/2021 02:48:50
 
 
To
22/09/2021 15:17:20
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01682301
Message ID:
01682345
Views:
56
>>>>>Hi,
>>>>>
>>>>>I am trying to find a message(s) discussing how to center a WAIT WINDOW command in a VFP window. I would be very surprised if this has never been discussed or brought up. But no matter what I enter in the UT Search, I cannot find a thread. What would you enter in the UT Search to find such a message(s)?
>>>>>
>>>>>TIA
>>>>
>>>>Using Sergey Berezniker's code I can place the WAIT WIND almost exactly where I want. But I have to do a trial and error a few times. It would be nice if I could get the value of the length of the string to be shown in WAIT WIND. For example, say my string is "Please wait". Is there a way to calculate the width (or a length) in Foxels of this string?
>>>>
>>>>TIA
>>>
>>>https://doughennig.blogspot.com/2006/04/forget-txtwidth-use-gdipmeasurestring.html
>>
>>
>>One of the examples used in the article you suggested (thank you!) is
>>
>>lnWidth = txtwidth(lcText, lcFontName, lnFontSize,  lcFontStyle)
>>
>>
>>I replaced lcFontName with _screen.FontName and lnFontSize with _screen.FontSize.
>>
>>But I don't know what property of _screen to use for the value of lcFontStyle. The _screen does not have a property matching the name "FontStyle" but has other Font* properties.
>>
>>Do you happen to know what property of _screen to use for lcFontStyle?
>
>try
>
>WITH THIS
>
>  lcFontStyle = IIF(.FONTBOLD,"B","") + ;
>   IIF(.FONTITALIC,"I","") + ;
>   IIF(.FONTSTRIKETHRU,"-","") + ;
>   IIF(.FONTUNDERLINE,"U","")
>*...
>
>at least this is what FONTMETRIC is using,
>
>Aunt EDIT says: This is what TXTWIDTH is using.
>
>EDIT #2 (can't let it be)
>enter
>
>HELP TXTWIDTH
>
>in command window. Look up section cFontStyle. I've listed all styles of use.
FUNCTION FontStyleStr ( oCtrl )
    * coCtrl can either be a form or a control
    LOCAL lcRet

    IF PEMSTATUS(oCtrl,"FONTBOLD",5) ;
            AND PEMSTATUS(oCtrl,"FONTITALIC",5) ;
            AND PEMSTATUS(oCtrl,"FONTOUTLINE",5) ;
            AND PEMSTATUS(oCtrl,"FONTSHADOW",5) ;
            AND PEMSTATUS(oCtrl,"FONTSTRIKETHRU",5) ;
            AND PEMSTATUS(oCtrl,"FONTUNDERLINE",5) THEN
        lcRet = IIF(oCtrl.FONTBOLD,"B","") ;
            + IIF(oCtrl.FONTITALIC,"I","") ;
            + IIF(oCtrl.FONTOUTLINE,"O","") ;
            + IIF(oCtrl.FONTSHADOW,"S","") ;
            + IIF(oCtrl.FONTSTRIKETHRU,"-","") ;
            + IIF(oCtrl.FONTUNDERLINE,"_","")
        IF EMPTY(m.lcRet) THEN
            lcRet = "N"
        ENDIF
    ELSE
        lcRet = ""
    ENDIF
    RETURN m.lcRet
ENDFUNC  && FontStyleStr
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform