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. GUI design question

GUI design question

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestiondesign
6 Posts 6 Posters 1 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.
  • E Offline
    E Offline
    Eddie Ng 0
    wrote on last edited by
    #1

    Hi all, I have a dialog which has a static textbox that says "The file c:\foo\bar.txt cannot be loaded. You must decide what to do now." and a few buttons beside the textbox to present the user with the choices. There is no problem with the dialog except when the pathname is really long (i.e. 4095 characters long), then the textbox cannot include the whole sentence. What do I do? I have think of a few ways already but these won't fix the problem: 1. Use a messagebox(but I need more buttons than just OK and Cancel) 2. Use a ellipsize function. (but I want to present the user with the full filename, that's the whole point of having another dialog box) 3. Use "Resizing text to fit in rect" in an earlier article by Jason Phillips. (but this will result in some really ugly code and break a lot of other codes) What I'm thinking of is, is there some GUI design techniques that will solve this common problem of long filename? Thanks in advance.

    A A 2 Replies Last reply
    0
    • E Eddie Ng 0

      Hi all, I have a dialog which has a static textbox that says "The file c:\foo\bar.txt cannot be loaded. You must decide what to do now." and a few buttons beside the textbox to present the user with the choices. There is no problem with the dialog except when the pathname is really long (i.e. 4095 characters long), then the textbox cannot include the whole sentence. What do I do? I have think of a few ways already but these won't fix the problem: 1. Use a messagebox(but I need more buttons than just OK and Cancel) 2. Use a ellipsize function. (but I want to present the user with the full filename, that's the whole point of having another dialog box) 3. Use "Resizing text to fit in rect" in an earlier article by Jason Phillips. (but this will result in some really ugly code and break a lot of other codes) What I'm thinking of is, is there some GUI design techniques that will solve this common problem of long filename? Thanks in advance.

      A Offline
      A Offline
      Alvaro Mendez
      wrote on last edited by
      #2

      Instead of a static text box, I recommend you use a "Read-Only" edit box. This will still chop off the name when it's long, but at least the user will be able to scroll through it with the cursor and even copy it to the clipboard if he/she wants. Regards, Alvaro

      U 1 Reply Last reply
      0
      • A Alvaro Mendez

        Instead of a static text box, I recommend you use a "Read-Only" edit box. This will still chop off the name when it's long, but at least the user will be able to scroll through it with the cursor and even copy it to the clipboard if he/she wants. Regards, Alvaro

        U Offline
        U Offline
        User 749
        wrote on last edited by
        #3

        Dear eng, I agree; a read-only edit box is the way to go. Also, you can turn on its "Word-Wrap" style simply by turning of the Auto HScroll and Horizontal Scroll styles. Then make it so that it looks like a listbox (as in area), so that the filename will wrap and add a Vertical Scroll bar (but turn off Auto VScroll) so theu user can scroll the text. They also get a context menu that they can use to copy text to the cliboard with! Yours, Brian Hart

        C 1 Reply Last reply
        0
        • U User 749

          Dear eng, I agree; a read-only edit box is the way to go. Also, you can turn on its "Word-Wrap" style simply by turning of the Auto HScroll and Horizontal Scroll styles. Then make it so that it looks like a listbox (as in area), so that the filename will wrap and add a Vertical Scroll bar (but turn off Auto VScroll) so theu user can scroll the text. They also get a context menu that they can use to copy text to the cliboard with! Yours, Brian Hart

          C Offline
          C Offline
          Chris Maunder
          wrote on last edited by
          #4

          What about using the ellipsize function, and using a multiline tooltip (http://www.codeproject.com/miscctrl/tooltipex.asp) to display the full path if the user needs it. It's an option...

          V 1 Reply Last reply
          0
          • E Eddie Ng 0

            Hi all, I have a dialog which has a static textbox that says "The file c:\foo\bar.txt cannot be loaded. You must decide what to do now." and a few buttons beside the textbox to present the user with the choices. There is no problem with the dialog except when the pathname is really long (i.e. 4095 characters long), then the textbox cannot include the whole sentence. What do I do? I have think of a few ways already but these won't fix the problem: 1. Use a messagebox(but I need more buttons than just OK and Cancel) 2. Use a ellipsize function. (but I want to present the user with the full filename, that's the whole point of having another dialog box) 3. Use "Resizing text to fit in rect" in an earlier article by Jason Phillips. (but this will result in some really ugly code and break a lot of other codes) What I'm thinking of is, is there some GUI design techniques that will solve this common problem of long filename? Thanks in advance.

            A Offline
            A Offline
            Adiga
            wrote on last edited by
            #5

            Hi I think you can go for multiline scrollable editbox with readonly attributes.

            1 Reply Last reply
            0
            • C Chris Maunder

              What about using the ellipsize function, and using a multiline tooltip (http://www.codeproject.com/miscctrl/tooltipex.asp) to display the full path if the user needs it. It's an option...

              V Offline
              V Offline
              vance787
              wrote on last edited by
              #6

              Dude, make it multi line text. use \n inside the text string to tell the static control to show the text in the next line. Also you need to increase the width of the control in order to see the rest of the lines. I hope this helps. vance http://upside.hypermart.net

              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