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. character display window in a dialog???

character display window in a dialog???

Scheduled Pinned Locked Moved C / C++ / MFC
c++comdata-structuresbusinessjson
6 Posts 3 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.
  • M Offline
    M Offline
    MJ_Karas
    wrote on last edited by
    #1

    Hello: I am in the midst of trying to make a small dialog based application that has an interface to a COM port. I need to be able to display the data that comes from the COM port into a text type box that is organized in specific rows and columns similar to a terminal display. I have tried to use an edit control, a static text box and other types of controls but none give me the features I need. I am curious as to whether anyone has any idea of where I can start with this project in order to get it off the ground. Here I list the requirements that are needed for this text display area... - It needs to permit me to use a fixed width pitch for the characters so that distinct columns are produced. It would be nice of the actual font used is selectable but that is not a requirement. - The text area needs to be accessable to dynamically determined row and column positions of the array so that a text string can be displayed. - Any given part of the text needs to be able to be displayed in an alternate color scheme. Ideally the effect that needs to be achieved is to make certain text appear as reverse video to the rest of the text in the box. - It is not really necessary for there to be any kind of cursor in the text area for "user entry of data. Just think of this text area as a display field. - The control mechanism needs to be able to function as a control on a dialog. I am somewhat experienced with creating windows applications but so far all my work has been with dialog based applets. The current project is one of this type and the request for help here is to try to add a small display window to the dialog that works somewhat like the text box of a HyperTerminal window with regards to the display of data characters that will be arriving from a serial port. Any help, discussion, pointers, or sample code would be extremely helpful to me. Note that I am working in a Win32 environment with MFC and Visual C++ Ver 6. Thanks Mike Karas -

    X K 2 Replies Last reply
    0
    • M MJ_Karas

      Hello: I am in the midst of trying to make a small dialog based application that has an interface to a COM port. I need to be able to display the data that comes from the COM port into a text type box that is organized in specific rows and columns similar to a terminal display. I have tried to use an edit control, a static text box and other types of controls but none give me the features I need. I am curious as to whether anyone has any idea of where I can start with this project in order to get it off the ground. Here I list the requirements that are needed for this text display area... - It needs to permit me to use a fixed width pitch for the characters so that distinct columns are produced. It would be nice of the actual font used is selectable but that is not a requirement. - The text area needs to be accessable to dynamically determined row and column positions of the array so that a text string can be displayed. - Any given part of the text needs to be able to be displayed in an alternate color scheme. Ideally the effect that needs to be achieved is to make certain text appear as reverse video to the rest of the text in the box. - It is not really necessary for there to be any kind of cursor in the text area for "user entry of data. Just think of this text area as a display field. - The control mechanism needs to be able to function as a control on a dialog. I am somewhat experienced with creating windows applications but so far all my work has been with dialog based applets. The current project is one of this type and the request for help here is to try to add a small display window to the dialog that works somewhat like the text box of a HyperTerminal window with regards to the display of data characters that will be arriving from a serial port. Any help, discussion, pointers, or sample code would be extremely helpful to me. Note that I am working in a Win32 environment with MFC and Visual C++ Ver 6. Thanks Mike Karas -

      X Offline
      X Offline
      xxhimanshu
      wrote on last edited by
      #2

      use a list control that does what u r looking for..and it also displays in rows and colums..search for more on list in CP and u will find many such articles... cheers Himanshu

      M 1 Reply Last reply
      0
      • M MJ_Karas

        Hello: I am in the midst of trying to make a small dialog based application that has an interface to a COM port. I need to be able to display the data that comes from the COM port into a text type box that is organized in specific rows and columns similar to a terminal display. I have tried to use an edit control, a static text box and other types of controls but none give me the features I need. I am curious as to whether anyone has any idea of where I can start with this project in order to get it off the ground. Here I list the requirements that are needed for this text display area... - It needs to permit me to use a fixed width pitch for the characters so that distinct columns are produced. It would be nice of the actual font used is selectable but that is not a requirement. - The text area needs to be accessable to dynamically determined row and column positions of the array so that a text string can be displayed. - Any given part of the text needs to be able to be displayed in an alternate color scheme. Ideally the effect that needs to be achieved is to make certain text appear as reverse video to the rest of the text in the box. - It is not really necessary for there to be any kind of cursor in the text area for "user entry of data. Just think of this text area as a display field. - The control mechanism needs to be able to function as a control on a dialog. I am somewhat experienced with creating windows applications but so far all my work has been with dialog based applets. The current project is one of this type and the request for help here is to try to add a small display window to the dialog that works somewhat like the text box of a HyperTerminal window with regards to the display of data characters that will be arriving from a serial port. Any help, discussion, pointers, or sample code would be extremely helpful to me. Note that I am working in a Win32 environment with MFC and Visual C++ Ver 6. Thanks Mike Karas -

        K Offline
        K Offline
        KarstenK
        wrote on last edited by
        #3

        I would think about a "owner drawn" control. You derive a CStatic in which you Paint yourself. Then you need a output, for which you make such a control in your dialog resources. It´s a lot of work, but you´ll should enjoy it.:cool: Try this @ home. (B&B)

        M 1 Reply Last reply
        0
        • X xxhimanshu

          use a list control that does what u r looking for..and it also displays in rows and colums..search for more on list in CP and u will find many such articles... cheers Himanshu

          M Offline
          M Offline
          MJ_Karas
          wrote on last edited by
          #4

          I have looked at all the CList control articles on this web site and tried to study each carefully. I cannot directly see how a list control would be used to simply display a box of text. I did see one article about using the CustomDraw features of the List Control - but that seems way over kill to me....... does it need to be this complicated to support a terminal emulator screen at 25x80 characters with just a reverse video attribute capability? Michael Karas

          1 Reply Last reply
          0
          • K KarstenK

            I would think about a "owner drawn" control. You derive a CStatic in which you Paint yourself. Then you need a output, for which you make such a control in your dialog resources. It´s a lot of work, but you´ll should enjoy it.:cool: Try this @ home. (B&B)

            M Offline
            M Offline
            MJ_Karas
            wrote on last edited by
            #5

            Thanks for the suggestion.....unfortunately I have no idea where to start in order to implement such a control. Can you make a suggestion where I can see a sample CStatic control in "Owner Drawn" mode that supports multiple lines (25 in my case) where the string for each row would be independent and each row need to be displayed in a manner with some text in normal video (black char on white background) and some characters in reverse video (white char on black background)? Michael Karas

            K 1 Reply Last reply
            0
            • M MJ_Karas

              Thanks for the suggestion.....unfortunately I have no idea where to start in order to implement such a control. Can you make a suggestion where I can see a sample CStatic control in "Owner Drawn" mode that supports multiple lines (25 in my case) where the string for each row would be independent and each row need to be displayed in a manner with some text in normal video (black char on white background) and some characters in reverse video (white char on black background)? Michael Karas

              K Offline
              K Offline
              KarstenK
              wrote on last edited by
              #6

              It is very simple you drawing in the Onpaint message handler evry thing. with Texout and so on. There is the CDC class which will help you. Try this @ home. (B&B)

              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