Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Text getting truncated

Text getting truncated

Scheduled Pinned Locked Moved C / C++ / MFC
help
11 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vikram attiganal
    wrote on last edited by
    #1

    Hello, I am finding an issue where in I have a Text which is longer than a single line with no spaces. This text is not displayed completely in the tool tip. It gets truncated. I make use of CDC for the tooltip display rectangle, CDC* pDC = GetDC(); CRect rect(0, 0, 0, 0); CString sComment = "this is a comment bigggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg comment 2 2 2"; pDC->DrawText(sComment, &rect, DT_CALCRECT | DT_LEFT | DT_WORDBREAK | DT_NOPREFIX | DT_TOP); int iheight = rect.Height(); // It wont return the correct rectangle height //Output is this is a comment biggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg Can anyone tell me what the issue is. Thank you, ~ Vikram

    CPalliniC L 2 Replies Last reply
    0
    • V vikram attiganal

      Hello, I am finding an issue where in I have a Text which is longer than a single line with no spaces. This text is not displayed completely in the tool tip. It gets truncated. I make use of CDC for the tooltip display rectangle, CDC* pDC = GetDC(); CRect rect(0, 0, 0, 0); CString sComment = "this is a comment bigggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg comment 2 2 2"; pDC->DrawText(sComment, &rect, DT_CALCRECT | DT_LEFT | DT_WORDBREAK | DT_NOPREFIX | DT_TOP); int iheight = rect.Height(); // It wont return the correct rectangle height //Output is this is a comment biggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg Can anyone tell me what the issue is. Thank you, ~ Vikram

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      If you don't like the clipped text, then why didn't you specify the DT_NOCLIP formt? :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
      [My articles]

      In testa che avete, signor di Ceprano?

      V 1 Reply Last reply
      0
      • V vikram attiganal

        Hello, I am finding an issue where in I have a Text which is longer than a single line with no spaces. This text is not displayed completely in the tool tip. It gets truncated. I make use of CDC for the tooltip display rectangle, CDC* pDC = GetDC(); CRect rect(0, 0, 0, 0); CString sComment = "this is a comment bigggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg comment 2 2 2"; pDC->DrawText(sComment, &rect, DT_CALCRECT | DT_LEFT | DT_WORDBREAK | DT_NOPREFIX | DT_TOP); int iheight = rect.Height(); // It wont return the correct rectangle height //Output is this is a comment biggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg Can anyone tell me what the issue is. Thank you, ~ Vikram

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Interestingly this is an exact duplicate of this question[^], even though the ids are different. I cannot believe that two different CP members randomly created exactly the same issue in the last few days. Are you (or the other person) perhaps a sock puppet?

        Just say 'NO' to evaluated arguments for diadic functions! Ash

        M L 2 Replies Last reply
        0
        • CPalliniC CPallini

          If you don't like the clipped text, then why didn't you specify the DT_NOCLIP formt? :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          V Offline
          V Offline
          vikram attiganal
          wrote on last edited by
          #4

          I need the text to be displayed on multiple lines, but i need to avoid text truncation.

          CPalliniC 1 Reply Last reply
          0
          • V vikram attiganal

            I need the text to be displayed on multiple lines, but i need to avoid text truncation.

            CPalliniC Offline
            CPalliniC Offline
            CPallini
            wrote on last edited by
            #5

            I suppose you got the wrong height because you've passed an empty rectangle to the function. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            In testa che avete, signor di Ceprano?

            1 Reply Last reply
            0
            • L Lost User

              Interestingly this is an exact duplicate of this question[^], even though the ids are different. I cannot believe that two different CP members randomly created exactly the same issue in the last few days. Are you (or the other person) perhaps a sock puppet?

              Just say 'NO' to evaluated arguments for diadic functions! Ash

              M Offline
              M Offline
              Maximilien
              wrote on last edited by
              #6

              or the user simply changed his name ?

              Watched code never compiles.

              L 1 Reply Last reply
              0
              • M Maximilien

                or the user simply changed his name ?

                Watched code never compiles.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Well, a simple view of both user entries shows this not to be the case.

                Just say 'NO' to evaluated arguments for diadic functions! Ash

                S 1 Reply Last reply
                0
                • L Lost User

                  Well, a simple view of both user entries shows this not to be the case.

                  Just say 'NO' to evaluated arguments for diadic functions! Ash

                  S Offline
                  S Offline
                  Sauro Viti
                  wrote on last edited by
                  #8

                  then, a very strange case of telepathy :wtf:

                  C 1 Reply Last reply
                  0
                  • S Sauro Viti

                    then, a very strange case of telepathy :wtf:

                    C Offline
                    C Offline
                    Code o mat
                    wrote on last edited by
                    #9

                    ...or collective conciousness...hell the borg are coming!

                    > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world. Fry: But this is HDTV. It's got better resolution than the real world <

                    1 Reply Last reply
                    0
                    • L Lost User

                      Interestingly this is an exact duplicate of this question[^], even though the ids are different. I cannot believe that two different CP members randomly created exactly the same issue in the last few days. Are you (or the other person) perhaps a sock puppet?

                      Just say 'NO' to evaluated arguments for diadic functions! Ash

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      Or team members in a race to please the boss (chetana is usually a girl's name and vikram a boy's)

                      ...byte till it megahertz... my donation to web rubbish

                      L 1 Reply Last reply
                      0
                      • L Lost User

                        Or team members in a race to please the boss (chetana is usually a girl's name and vikram a boy's)

                        ...byte till it megahertz... my donation to web rubbish

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #11

                        Maybe they should get together and make beautiful programs ...

                        Just say 'NO' to evaluated arguments for diadic functions! Ash

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups