In some programs (like Word) near the scroll bar (above, below, or to the side of the scroll button) might be a splitter icon, or a button of something, but the point is that you don't have just a scroll bar on the right or bottom, there might also be a few buttons there in addition to the scroll bar. If I had a richedit control, or an edit control, and I wanted to display my own button in addition to the scroll bar, how might I achieve this? TIA, Shawn
Posted on 2001-01-21 03:29:00 by _Shawn
Shawn, The basic logic of a splitter window is to code 3 windows for the client area, 2 rich edit controls and a third as the splitter which is about 3 - 5 pixels wide. You use SetCapture() with the mousedown drag and size the windows in the client area after the button is released with MoveWindow(). Generally rich edit controls set their own scroll bars and I don't think there is an adjustment for their size, if it is set with no wrap, you will get both in the normal position, left & bottom depending on what text is in the control. Now I guess that to place buttons near the normal scroll bars is doable but it mewans that you lose some of the client area doing it, depending on where you put the buttons. Regards, hutch@pbq.com.au
Posted on 2001-01-21 05:48:00 by Steve Hutchesson
The MSWord GUI has lots and lots of elements of elements to it. The scrollbars are NOT part of the edit box, they are seperate control windows linked with code. This is similar to any newbie's first visual basic program with every control in the toolbox thrown onto a form.
Posted on 2001-01-21 08:46:00 by Ernie
Thanks for the replies, however, to better understand what I'm talking about, I posted a small screen snap of a program... http://leabre.freeservers.com/Word_Image.gif I've seen some controls which do it. I was hoping I wouldn't have to write my own control for that, or that it wouldn't be too complicated, becuase it's a fairly common practice, I just don't know how to do it (other than what hutch described). Thanks, Shawn
Posted on 2001-01-21 16:04:00 by _Shawn
I hate to be the one to break this to you, but those were the controls I was speaking of. Actually, the three buttons below the vertical scroll are a rebar band or such, but I didn't want to say cause that would scare you further The weird thing about windows programming in perhaps 80% of the project is managing the user interface. If you are lucky you get to spend 20% of yourt time DOING SOMETHING USEFULL. Mostly, you spend your time watching the controls messaging each other and taking action on those. So, those are NOT the scroll bars of a MDI frame window or such, they are standard scroll bars, who's messages get trapped and passed on to another window to scroll it. No magic here, just lots of low level dirt processing.
Posted on 2001-01-21 16:48:00 by Ernie
So if I were to place my own buttons (or controls, or whatever, in addition to scrollbars) aesthecially placed in the edit window, I would just have to wath for the appropriate messages and then do something to simulate the scroll and adjust the clipping appropriately? It's that easy? shawn
Posted on 2001-01-21 20:54:00 by _Shawn
Yes, that's the procedure. No, it's not eazy; just try resizing the main window and make the others adjust to it. And a double dozen other special cases. But it is straightforard. Well, mostly.
Posted on 2001-01-22 01:01:00 by Ernie
Actually, it is easy, it only took me about 15 minutes to accomplish the task... I just leave the old scrolls there, but put mine on top, the solves the clipping problem, since it's already clipped, and then deal with the other issues as they arise. All I need to do is make sure the top of the controls are alway 16 pixels or so above the bottom of the window, and then that they width of the scroll is always 16 pixels or so from the right of the window and all is well. After finding all my favorite programs which do the same thing, I noticed they all place their own controls and a real scroll control where the scroll are. It's rather easy. I'll post a submit a sample tutorial on Icz soon. Right now, I'm working on a context sensitive help tutorials in assembly. I'll be using it. This will be the first .h I've converted to asm .inc file... what a pain (doing it by hand). Anyway, my DSL is down starting tomarrow (Wednesday) until Feb 10th, so I won't be able to upload anything, but at least I can post here =) Shawn
Posted on 2001-01-23 16:17:00 by _Shawn