Wednesday, November 10, 2004

Wangdera Controls Version 0.8

I just uploaded a new version of the Wangdera Control Suite, the most significant piece of which is RichTextBox2/RichTextEditor. In addition to fixing a bunch of bugs (some of them pretty significant), I've also added support for a new editing format: Link2. Link2 is a lot like Link, except you can set the underlining and the text color to whatever you like. The built-in Link format mandates blue text with a solid underline. That's a non-starter for an application like FlexWikiPad that needs to indicate whether the destination of the link already exists or not.


This turned out to be a major undertaking. Because of the inherent “it almost doesn't suck” nature of the underlying rich edit control, I found myself in a lengthy spiral of getting it almost working, only to discover that I need to change “just one more thing”. To give you some idea of how far down the spiral went, let me share that I had to completely rewrite the double-click handling of the control by intercepting and processing all WM_LBUTTONCLICK events. Quite a rabbit hole.


But I got it working, and I'm pretty pleased with it. My next steps for the control will be to add support for things like bullets, borders, and shading. The latter two are particularly important for what I want to do with FlexWikiPad. Once I get that done, I'll do a pass through to focus on whatever bugs I know about, then stamp it 1.0. After that, I'll integrate it into FlexWikiPad as part of my complete overhaul of the formatting engine. And if I do that right, I should be able to turn the knob way up on how powerful and customizable FlexWikiPad is. Wish me luck!

7 comments:

  1. I like your Controls but I am not sure if I will use it, because of a missing feature.

    I'd like very much to see, on the next version, something like the selected lines you can have in a ListView but the possibility to change the color.



    What do you think about it?

    ReplyDelete
  2. I'm not quite sure what you mean. Can you explain more? You can already change the foreground and background color of the text...

    ReplyDelete
  3. Ok.

    Create a simple application with a listbox. insert some element on listbox.Items . Start you application. Click on an element on the listbox.

    See that blue highlight that cove the whole line? That's what I mean: A highlight for the whole line.



    ReplyDelete
  4. btw. another thing that seems to be missing from a richtextbox is the ability to set the BackgroundColor AFTER Enabled is set to false.



    ReplyDelete
  5. Ah, I see where the confusion was: you're asking for another control entirely. Tell you what - file a feature request on the SourceForge website (sf.net/projects/wangdera) and I'll try to get to it. It almost certainly won't be soon.



    As for the BackgroundColor one, I'll have to take a look at that. If you can file a bug on that, too, that would be helpful.

    ReplyDelete
  6. Ok, I'll do it..but I don't understand why it is not possible to have such a highlight line inside an editor. Think about a code editor, when you check the code you wrote in it, the editor could show you the whole line where an error is.

    ReplyDelete
  7. Ah, OK, *now* I understand; my apologies. You'd like the background of the whole line to change colors, not just the background of the text. (I thought you wanted a ListBox.) You can change the background color of the text now, but it doesn't extend past the end of the text all the way to the right margin, which is what you want, right?



    The API for the RichEdit control supports this, but doesn't actually draw it. So I need to override WM_PAINT handling and do it myself. Tricky, but I'll try.

    ReplyDelete