Announcement

Collapse
No announcement yet.

Ownerdrawn Label - Win2000 - Odd 'Feature'?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ownerdrawn Label - Win2000 - Odd 'Feature'?

    I use the following code to draw multiline 'dot filled' labels:

    Code:
    DrawText @dis.hDC, szBuf, -1, tmprc, %DT_WORDBREAK OR %DT_END_ELLIPSIS OR %DT_LEFT OR %DT_NOPREFIX
    Which seems to work to a certain point, up until the screen and font gets sized up a bit.

    To get the 'dot filled' effect, I simply tack a bunch of periods on the end of the label caption, and use %DT_END_ELLIPSIS to cut it off and put '...' at the end.

    This seems to be the only OS this happens on - is anyone aware of any sort of thing in Win2K that could cause this?

    Picture of it working on XP:



    Picture of what it looks like on 2K:



    If anyone has any ideas/suggestions - any help would be much appreciated. I have no ideas...
    Adam Drake
    Drake Software

  • #2
    Adam, this interests me because your example appears to be part of the 8867
    page 3?

    I just finished programming a pcl version to print of this.
    Client Writeup for the CPA

    buffs.proboards2.com

    Links Page

    Comment


    • #3
      That it is...Only visual example I have...I will work on seeing if I can generate a failing code example in the next day or so - the actual code is just impossible to post here to test.
      Adam Drake
      Drake Software

      Comment


      • #4
        why not do it with graphic/xprint ? A few years ago, I did a 1120 (or 1120S) with input for the screen and pcl for output.
        It would be similar to the 8867 although the 8867 is much simpler, mostly yes/no questions. That was before graphic/xprint
        was included, so it was just with modal dialogs.
        Last edited by Fred Buffington; 18 Jan 2008, 06:25 PM.
        Client Writeup for the CPA

        buffs.proboards2.com

        Links Page

        Comment


        • #5
          Because of the complexity of the application and what it would take to change, and the possibility that changing over to a GRAPHIC control instead could slow things down (if I size it I have to kill and recreate the control), that unfortunately is not an option.
          Adam Drake
          Drake Software

          Comment


          • #6
            Because of the complexity of the application and what it would take to change, and the possibility that changing over to a GRAPHIC control instead could slow things down (if I size it I have to kill and recreate the control), that unfortunately is not an option
            Gee, I wish I could know - without trying - that GRAPHIC will be slower.

            How can I acquire that skill?
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              Didn't say it will be - I said it is possible that it could slow things down...
              Adam Drake
              Drake Software

              Comment


              • #8
                Was it just me...

                or did the two pasted in examples have:
                a)different sized fonts and
                b)different fonts (one looked narrow the other more bold) and
                c)different backgrounds

                Could it be a "this font doesn't exist in Win2K so the 2nd guessing OS will substitute this font" kind of thing?

                Seems I've heard of that in some printing applications. Maybe GUIs have the same pitfalls too?
                Nathan Maddox

                Comment


                • #9
                  It wasn't just you.

                  One is a screen cap from XP - apparently the normal size. I can't find a size at which it fails in XP, just didn't pay attention to the fact that I hadn't sized the window up before I took the screen shot.

                  The other is a screen cap from 2K - the background color settings are just a little different between the two.
                  Adam Drake
                  Drake Software

                  Comment


                  • #10
                    I'm also finding that this isn't related to just ownerdrawn, I also see the effect in regular labels that are nothing more than multiple lines of text. It seems like in certain situations, extra line breaks are getting thrown into the mix for some unknown reason.
                    Adam Drake
                    Drake Software

                    Comment


                    • #11
                      If anyone is particularly curious about this one - I did find a resolution.

                      However, it is oh so odd. I discovered that the wrapping on each word was occurring even in non-ownerdrawn labels.

                      So, I made everything ownerdrawn to attempt to correct this, and draw each label by hand, multiline and the like, and found that GetTabbedTextExtent and GetTextExtentPoint32 both return a required width of 25,000+ pixels to draw a short line of text, in the situation that I was sizing the control up with the window on certain font sizes, then causing my code to fail too.

                      Oddly enough, a call to DrawText to do nothing but calculate the rectangle made those two functions return the correct values in Win2000, and the drawing code now works without a hiccup (so far as I can tell).

                      I am completely clueless as to how under certain circumstances, only in Windows 2000, the OS could think it needs 25 or so monitors worth of width to draw text.
                      Adam Drake
                      Drake Software

                      Comment


                      • #12
                        GetTabbedTextExtent and GetTextExtentPoint32 both return a required width of 25,000+ pixels to draw a short line of text,
                        I've never had a problem with those functions on any O/S. Show failing code.

                        MCM
                        Michael Mattias
                        Tal Systems (retired)
                        Port Washington WI USA
                        [email protected]
                        http://www.talsystems.com

                        Comment

                        Working...
                        X