+ Reply to Thread
Results 1 to 2 of 2

Thread: Rich Text Box capabilities

  1. #1

    Default Rich Text Box capabilities

    Hey Ron

    The Description box that you are using, I noticed you can control colors inside it.

    Can you do different alignment also (center, right etc)?
    also can you do simple graphics, say like the durability blue bar for items?


    Another thought that has occurred to me.

    I was planning on using 2 description boxes (1 for the current items list and 1 for the item you were building). Could we make the description box a control and then have 2 instances of it that we pass the appropriate data to?

  2. #2
    Join Date
    Mar 2005
    Location
    California
    Posts
    2,099

    Default

    Quote Originally Posted by Dragonstar View Post
    Hey Ron

    The Description box that you are using, I noticed you can control colors inside it.
    Yep. Check out EditStreamCallback in the MainScreen.cpp file. The colors are set up by the color table in the prefix (colortbl entry), and you simply pass in a control code (like so {\\cf1 text here}) to change the color.

    Can you do different alignment also (center, right etc)?
    Yeah, that's easy enough, though I'd have to look up the code for it. But it exists automatically.

    also can you do simple graphics, say like the durability blue bar for items?
    You can, though it's a bit tricky. I'd have to experiment to figure out how to pull it off. But I've seen it done before.

    I was planning on using 2 description boxes (1 for the current items list and 1 for the item you were building). Could we make the description box a control and then have 2 instances of it that we pass the appropriate data to?
    Absolutely. There are actually two rich edit boxes on the main page, and both of them use the same callback, so there is an example already you could use. If you are okay with using the same color table, this is fine. You can also set up a callback for each seperate one (this is what I did in DC where the rich text boxes are totally different from each other). If they need to do different things (like use different fonts or have different graphics), that's probably the way to go. Otherwise, you may as well use the same callback for both.
    "They laughed when I said I was going to be a comedian ... They're not laughing now." - Bob Monkhouse

+ Reply to Thread

Similar Threads

  1. Milestone 2
    By RonHiler in forum General Discussion
    Replies: 12
    Last Post: 10-21-2005, 04:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts