I am trying to set a different left margin in a regular rve. I have to have a controlpanel for other things, but the defaultmargin is stomping all over my leftmargin setting. I've tried all this and nothing works, all I get is whatever the defaultmargin is set to:
I don't want to load document settings that would change the margin (at least, I don't think I'm loading any). Is there any way to override the leftmargin size setting with a control panel in use?
Looks like it's not the presence controlpanel. I put one in my small test app and it was fine. In my "real" app there's a lot of code and I had to fine the right place to put rve.LeftMargin := 85 and it's OK.
Sergey Tkachenko wrote: Thu Sep 04, 2025 6:08 am
If you want to override default settings of RVAControlPanel, make your changes in rvActionNew.OnNew event.
Sergey, yes, that worked. I'm working on switching my line number code from a component to code that paints directly to the rve canvas (I had to widen the leftmargin to do it). I've got it working now and so far it has some advantages over the way I was approaching it before. I don't save or load margins so I don't have to worry about that. I did have a little code I had to fix that wasn't working right but that was minor.
I sent a private message about the RVFontCombos.pas. DId you have time to look at that?
Well, while painting line numbers in the rve directly looked good and was easiest to do, changing the rve left margin was just too squirrely. I went with a panel that I subclassed to expose its canvas and added an onpaint method. This worked as well.