xposure Posted February 12, 2005 Posted February 12, 2005 i'm in the process of making a look-a-like of the MS version for the code window, i've already have it code folding and displaying line numbers correctly. i recently came across i snip where some used the api to resize the client area so you can actually just subclass/inherit the control and draw to it rather then actually making a user control throwing a richtextbox on it and then drawing to the main control. the problem i seem to be having is the fact that when the rtb redraws it still erases the screen in the nonclient area making a harsh flickering, the margin that has the graphical data is in a surface that i just redraw when needed and update when needed, but like i said even with that the rtb insists on clearing the entire line, i've tried killing ncpaint and a few others with no luck. anyone have any ideas how to solve this? another thing is when the code folds into a single line i use a surface once again to draw the grey border and the grey text for the collapsed code description and then convert it to emf then to wmf and then to rtf which works but the rtb selects it like word would and puts blocks in the corners (making it ugly) anyone else have a idea on maybe i different approach? and last but not least how in the hell can you make the vertical scrollbar scroll in line increments rather then pixels (vs.net does whole lines) p.s. when i get a working version i'll post a link to my site which will have full source to the control -Xposure Quote
mookie Posted February 12, 2005 Posted February 12, 2005 i'm in the process of making a look-a-like of the MS version for the code window, i've already have it code folding and displaying line numbers correctly. i recently came across i snip where some used the api to resize the client area so you can actually just subclass/inherit the control and draw to it rather then actually making a user control throwing a richtextbox on it and then drawing to the main control. the problem i seem to be having is the fact that when the rtb redraws it still erases the screen in the nonclient area making a harsh flickering, the margin that has the graphical data is in a surface that i just redraw when needed and update when needed, but like i said even with that the rtb insists on clearing the entire line, i've tried killing ncpaint and a few others with no luck. anyone have any ideas how to solve this? another thing is when the code folds into a single line i use a surface once again to draw the grey border and the grey text for the collapsed code description and then convert it to emf then to wmf and then to rtf which works but the rtb selects it like word would and puts blocks in the corners (making it ugly) anyone else have a idea on maybe i different approach? and last but not least how in the hell can you make the vertical scrollbar scroll in line increments rather then pixels (vs.net does whole lines) p.s. when i get a working version i'll post a link to my site which will have full source to the control -Xposure im dying to see what it is that you have for code because ive been searching for a while to see how it is that you do the code folding Quote
xposure Posted February 13, 2005 Author Posted February 13, 2005 screenshot here is a quick screen shot of what its looking like, (this is a old version i scraped yesterday due to too many tweaks i kept coming up with and weren't worth trying to hack/implement) http://www.shol.com/jasper/codefold.jpg -Xposure Quote
mskeel Posted February 14, 2005 Posted February 14, 2005 (edited) That looks totally sweet. What are you using to draw the lines, boxes, regions...? GDI+ is pretty slow when it comes to drawing/redrawing.. Also. notice the tricks VS uses to get around doing what you want to do. Maybe it just isn't possible. In my version, VS is framed so the text editor area never actually moves or resisizes when you resize VS. Then, when you resize the frame, nohting is redrawn until you let go of the mouse button. Still no flicker, though...but they have infinite money... I can't wait 'till you get that finished, man. That looks awesome. Edited February 14, 2005 by mskeel Quote
xposure Posted February 15, 2005 Author Posted February 15, 2005 Well its good to see some interest Yea i'm using System.Drawing, but its not bad at all, if there is some other approaches that you might know of go ahead and post i only now of DirectX and GDI. On the other hand it is efficient, it only redraws when it needs to the actual left margin is stored into a surface which can just be repainted using one line of code, but if the line numbers or anything else along the lines of changing the leftmargin the it calls renderleftmargin which redraw to the left margin surface which then invalidates the left side to repaint it P.S. i've had plans on making a generic IDE, with subversion support and project management, and a plugin framework for making additional mods to it, if anyone is interested in it or just wants to post and/or brainstorm some things go ahead and throw a post up:) -Xile Quote
*Experts* Nerseus Posted February 15, 2005 *Experts* Posted February 15, 2005 I haven't look at the code, but the SharpDevelop project already has a working, OpenSource IDE that looks nearly identical to Visual Studio including regions in code. If you want to do this all yourself, I'd look there to see how they did it. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
xposure Posted February 15, 2005 Author Posted February 15, 2005 Will do i guess i never mentioned the reasoning behind it was i do a lot of programming between MCUs and mostly on a z80, all the MCUs IDEs suck horribly, for example zilogs zds 2, if you extensively use the assembler you start getting freak errors on line numbers that don't exist, and HeW isn't much better you need a 800+ to run it:) but anyways i don't touch C and i love ASM, so its about time there is a true IDE for it:) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.