Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

bishop_pass

To rich edit or not

This topic is 5922 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well, I''ve played with edit controls, but never with rich edit controls. I''m not sure if they are what I want. Here''s what I want. I want a scrollable text field where I can control the colors and fonts for particular (but not all) pieces of text. I don''t need or want the user to be able to change or edit the text, but I do need the user to be able to highlight and copy the text. I need to be able to dynamically update the text in the window. I am strictly using the Win32 API from C. Are rich edit controls what I am looking for? Or something else?

Share this post


Link to post
Share on other sites
Advertisement
Yeah, that''ll do it. Takes a little getting used to, but it''ll work. I wrote a control that displays output from a device connected to the serial port, and we need to display each line in different colors depending on the type of message. I don''t dynamically change the text (I set fixed-width or not on creation), but I know it can be done.

Your only option besides this (that I know of--speak up if anyone knows different) is to just write your own control, but that means handling _everything_ yourself. We were doing this before, but when I changed the control over to a Rich Edit control (rather than our own stuff), we instantly got copy/paste and mousewheel controls, which we would have needed to add ourselves.

The only pain with the control was that I didn''t like how horizontal scroll worked--as I would add lines to the end of the control it would jump around. I disabled horizontal scrolling and just have it wrapping now, but I''d really like that resolved some day.

Share this post


Link to post
Share on other sites
One benefit of a rich edit control versus a regular edit control is the amount of text that can be held by the control. A regular edit control is ''supposedly'' limited to 64 Kb. I say supposedly because I''ve gotten more to fit in them on NT - but I''ve been told that 9x does limit them to that amount of text.

From what you''ve described - I list box or list view might also work for you. But if you want to try your hand at the Rich Edit in C, I can send you some basic starter code if you want.

Share this post


Link to post
Share on other sites
quote:
Original post by LessBread
But if you want to try your hand at the Rich Edit in C, I can send you some basic starter code if you want.

That would be great. Send it over!

Thanks to both of you for your replies.

Share this post


Link to post
Share on other sites
I tried such thing myself once. But the only way I found to dynamically change properties was to get the text selected, add the properties you want and change the selection back (the user could type in my edit box). That made the text jump around in the box so I ended up writing my own edit control.

Share this post


Link to post
Share on other sites
I''m not entirely certain that I need to change the existing text dynamically, but I will need to append to the end of the existing text with new text. I would like to be able to do that without any unpleasant flickering.

Share this post


Link to post
Share on other sites
quote:
Original post by bishop_pass
That would be great. Send it over! Thanks to both of you for your replies.


It''s on it''s way. No problem.

Share this post


Link to post
Share on other sites
Thanks for the email, LessBread. I haven''t looked at it yet, but when I come around to that part of my code, I will. Thanks again.

Share this post


Link to post
Share on other sites
quote:
Original post by bishop_pass
Thanks for the email, LessBread. I haven''t looked at it yet, but when I come around to that part of my code, I will. Thanks again.


Sure thing. Let me know how it works out for you.

Btw - the cops found my car after two weeks. The theives removed the front end body parts, the radiator,alternator,battery and then stuck the front end of a Caprice on to it. Bastards totally ruined it. I ended up signing it over to the towing company so as to not have to pay them. I managed to hold on to the front license plate (an old black and gold plate) otherwise - $3000 gone - poof - just like that.

Share this post


Link to post
Share on other sites
If I recall, you said you had no comprehensive coverage on it. Geez, what a bummer.

I had a brand new ''95 Astro Van (I had a it for about 6 months) when the police called me one evening and said: "Would you mind going outside and telling us if your car is missing?".

I''m like "Huh?" I walk outside and there''s nothing but broken glass where I park my van. I go back inside and the police tell me over the phone that my van has been recovered (I just learned it had been stolen one minute ago) and they tell me it has been used in a crime. And they tell me that I can come recover it right now where they found it.

I go and get it. The ignition and steering column is jacked. The driver side window is busted out. There is blood behind the front seats. Apparently the crime it was used in was a shooting. Whether it was a gang hit, or a driveby, I don''t know, but apparently one of the passengers in my van took a hit as well. For the next day or two, I found a few stray bullets in my car. But anyway, when I recovered my van, I also noticed that the whole right side had been seriously swiped (dented and about a 6 foot long swipe).

I swear, if I ever catch some punk kid gang member in the act of stealing another car of mine, I will go into a rage and attempt to cause serious damage to said individual.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!