BTW: I was thinking of adding a Status Bar on the bottom of the control. Dunno if i should.

If you do decide to do this I think you should make it a style or the edit control could optionally receive the window handle of the application's status bar and send messages while the parant app still has full control over it.

but seriously... I think a really cool idea would be the ability to have an application define a pre-processing function

This seams like a good Idea to me, maybe the same could be acheived by subclassing the control but it would be far better to be able to pass the edit control the address of a proc to call. Maybe have a few different optional procs like drawing/text operation/etc
Posted on 2002-05-02 10:02:11 by Kudos
I like the idea of a callback better for the status bar. I can fill a structure with just the info to use, and send it in a callback. The call back can be controlled by a style stetting in the control. If not set, it does nothing, if set, it send out a stucture with the edit mode, x,y pos, total size, etc. Then its up to the user to deal with, and i dont need to overload the queue with a ton of messages.

As for speed, i observed that syntax highlighting on richedit while scrolling is *very* choppy. I would like to make this scroll smoothly with the mouse wheel.

Thanx for your thoughts.
:NaN:
Posted on 2002-05-02 17:15:22 by NaN
Here is the lastest update. Got multiple lines working. I tried my hardest to get it to crash but i couldnt.

See if you can. I only got ENTER key programmed. The Up/Down cursors are not programmed.. As well there is no vertical scroll bar programmed. ((this is tonight's fun :grin: ))

I punched in about 100 lines (even though i can see only 24) of various lenght and it destroyed every link cleanly when finished.

So its going good, and i think the end of the dirty work is in sight. The only thing beyond this that may be a pain to work in is the SHIFT selecting text. But i will cross these bridges when the time comes :)

If your bored... Check it out and see if you can crash it... If you succeed let me know how you did it ;) Thanx.

See next post
Posted on 2002-05-02 23:12:45 by NaN
Well i did get a bunch more done... :)

Here it is. (( Got Wheel Mouse working :grin: ))

By the way, for those who use a wheel mouse; Do you think setting the wheel (middle) button to toggle the wheel messages between the horizantal or vertical scroll bars is a good idea?? (not yet implemented, just an idea).

If not, what would you think is a good use for the middle button?
Posted on 2002-05-03 05:10:54 by NaN
Nice work :alright:
It seems that it scrolls 4 lines at a time right now, maybe you can read the correct value from the registry? You can set the number of lines to scroll in the mouse settings of windows, It would be nice if it used that value.

Clicking the scrollwheel to auto-scroll would be nice as well, but not the most important thing I think.

btw using the scroll wheel hides the caret on my machine..

Thomas
Posted on 2002-05-03 09:30:00 by Thomas
Is this supposed to happen? (XP)
Posted on 2002-05-03 09:57:18 by iblis
I just found one problem when you have deleted a line and press delete again it dosen't go on to delete the previous line
Posted on 2002-05-03 10:33:35 by Kudos
Thomas, I wasnt aware it had a registry entry. Is this on all machines that use *any* scroll wheel? Reading the MSDN last night didnt give me any indication of this. As well i choose 4 lines as it is easy to produce (ie: shl edx, 2 ;) ). I was thinking of making it a 'setting' for the window tho. It woudl be extremely easy to do.

BTW: So are you for the idea of toggling which scroll bar gets the wheel messages with the mouse wheel, or are you suggesting i write some hot-tacking, where moving the mouse 'above' the click point will scroll up, 'down' will scroll down etc. etc. etc.


iblis, Thank you for the nice graphic ;) . Im aware of the Caret issues. Its a bit complicated to code right (took me forever to tweek just right for the horizantal scroller), so i decided to ignore it for the moment and go to bed :) . I will fix it up tonight.

Kudos, Thank you for observing this as well, i still have to fill in *several* to-do's regarding things like backspace, delete, cursor up, cursor down, etc. Each line is a link of memory in a linked list, so doing any of these involves tansversing the linked list, which will take some time to code and get right. Its a tricky area, cause one small oversight, and BOOOM, you get a memory leak :rolleyes: . So i havent coded them up yet, but they are coming! The end is in sight ;)


Thanks all for testing (much appreciated, and your all in my credits for you time to test ;) )
:NaN:
Posted on 2002-05-03 15:04:26 by NaN
Anyone have "control" wishes?

Some recient ideas i've been having (not implemented) are:
    [*]3d Text Write each line of text with a background shadow color (like disabled text on buttons).
    [*]Set background to a bitmap.
    [*]Middle button fuction to toggle the scroll bar controlled (discussed above).


    No promises, but currious to see what you might have in mind.
    :alright:
    NaN
Posted on 2002-05-03 15:09:18 by NaN
Some ideas I would like to see

    [*]Built in syntax hilighting engine
    [*]URL handeling
    [*]Auto indent
    [*]Make the control able to output it's text in txt or rtf format using a text streaming function in the way rich edit dose it.
Posted on 2002-05-03 16:57:40 by Kudos
I would like to see a "console" mode for the control, where you can give it a standard handle or a pipe handle and set the line buffer size, so that after x amount of lines have scrolled up, they get deleted so they don't take up memory... etc. etc.

(That might also be useful for an IDE when you want to catch the output from console mode applications like ML and LINK)



Edit: Oooh also the ability to change the cursor shape. I know richedit can do that already but I don't like the way it's implemented.

Edit2: And the ability to load application-defined bitmap fonts... kind of like how in DOS text mode you can mess with the VGA font table and change the look of each character. A nice side-effect is you could see all 256 characters of the old ascii table. ;)
Posted on 2002-05-03 17:54:57 by iblis
If you add syntax highligh, please add export to HTML, RTF and vBB Code :)
Posted on 2002-05-03 18:26:12 by bazik
I like the suggestions, keep them coming:

Kudos: URL handeling - Good idea, and easy to implement.. will do.. Would be nice have when commenting your source, and provide web links. :alright:

Make the control able to output it's text in txt or rtf format using a text streaming function in the way rich edit dose it. - Im not familiar with rtf at all, or what its good for. Can you give me more idea of why it would be useful? As far as i know rtf was a poor man's 'word' format, and never really piddled with it. So im in the dark here.

iblis: Oooh also the ability to change the cursor shape. I know richedit can do that already but I don't like the way it's implemented. -- Easy to do, right now im not making my own, but using the windows default. Froms the doc's on the Caret control, all i would need is a bitmap for it.. simple enough.

And the ability to load application-defined bitmap fonts... kind of like how in DOS text mode you can mess with the VGA font table and change the look of each character. A nice side-effect is you could see all 256 characters of the old ascii table. -- Should be able to now, the only thing is im restricting it to fixed width fonts that are printable. I prefer fixed width fonts, and have no real intentions of getting into the 'mess' of calculating each line's lenght based on the sum of each char's widths. Right now, i *know* how many chars are to printed per line, cause i know the window size, and the font width. Its simple and to the point. But thanx for the suggestion..

bAZiK: If you add syntax highligh, please add export to HTML, RTF and vBB Code ~~ I am planning on full customizable syntax highlighting. I think the export to HTML is a good idea! But why the other two?? I dont know them or know why i would want this. ? Thanx.

Thanks for the ideas! Much appreciated, please if you have more, lemme know. :)

:NaN:
Posted on 2002-05-03 21:10:27 by NaN
hi NaN

vbcode (as sugested by bAZiK) is used by this board for formating it would allow people to post code and retain it's origonal higlighting.
I don't have any information about how to produce an rtf file, I thought of it as a way of preseving highlighting when saving a file but if your doing html then maybe there is no need.
Posted on 2002-05-03 22:10:08 by Kudos
Well im still in the dark for RTF. (I can find the format) But i dunno why it would be needed. I dont mind adding code, just would like to know why...

But i see your point for vBB. I will have to look into it when i find a moment. Do you know if its similar to html?

Thanx
:NaN:
Posted on 2002-05-03 22:23:45 by NaN
Posted on 2002-05-03 22:40:14 by Hiroshimator
Well im still in the dark for RTF

the advantage of rtf is it can be edited on just about any machine.

But i see your point for vBB. I will have to look into it when i find a moment. Do you know if its similar to html?

it's almost the same more info can be found in the faq section at the top of this board
Posted on 2002-05-03 23:20:18 by Kudos
Thanx Hiro and Kudos!

I decided to go on a side sub-project and play with more GDI. Turned out to be more than i expected, and had to do some learning (thx bitRake and Eoin). But now I got a kool background option for the control, which is customizeable to your reading pleasure :)

Check it out. I think you'll like it. You can set the alpha blend on the window control with a bitmap background. In this small example i hardwired it to load "Spider.jpg". You can rename any GIF,BMP,TIFF, JPG to this and see it work on a pic of your choice. BUT BE WARNED, i only have 1 situation coded for display (bitmap bigger than the window). It wont properly show smaller bitmaps yet. (uncertain if i should tile or center them).

Anywho check it out, and see what you think.
:alright:
NaN

BTW: You *MUST* have MMX support on your computer (for now anyways).
Posted on 2002-05-06 01:10:16 by NaN
NaN it's looking good and I havn't managed to crash it yet :)
But I just tried wordwrap and the text disapeared.

EDIT:
hmm I just notice when a bitmap is set Blue and Red background color is inverted
Posted on 2002-05-06 02:23:31 by Kudos
Very cool effect. I think it would be cool to have an animated background behind the text - nothing fancy or fast moving - just a slowing evolving abstraction.
Posted on 2002-05-06 08:49:19 by bitRAKE