On Sunday, September 21, 2003, at 07:56 AM, Bernie Wylde wrote: > On Sunday, Sep 21, 2003, at 11:23 Europe/London, Robert Covington > wrote: >> On Sunday, September 21, 2003, at 05:44 AM, Bernie Wylde wrote: >>> My current project allows the user to re-arrange controls in certain >>> windows. >>> The following code detects a click on a control and puts little >>> black squares in each corner to show that it is selected. The >>> control can then be dragged (the full code also allows resizing). >>> The problem I'm having is after the control is moved and the mouse >>> button released, the little black squares are erased (presumably by >>> the control). I'd like them to remain. >>> Any ideas? >> Robert Bob Additions, maybe good, maybe not. Live drag or not too >> (cool), see comments. Would need another global set as to whether to >> re-set the selection or not in the _wndRefresh area ( whether button >> is to be re hi-lited or not), like DIM gButtonSelected(_maxbuttons) >> and then in this case gButtonSelected(1) = _True down in mouse, then >> check in _wndRefresh before re-setting or not. You'll need to be >> re-drawing it anyway in the wndRefresh area already I'd think, so >> there. >> Anyway, I left that check for you to install or not. >> Carbon events would be required for the optimum approaches I would >> think, and that's carbon complicated. > > Robert, > > Thank you. _wndRefresh never crossed my mind. > > I'd already incorporated live drag/resize which looks better and > reduces the amount of code. > > Cheers > Bernie > Didn't cross my mind until I thought, why is the FN ValidRect(r) I tried not working to prevent a refresh? Then I think, maybe without a DoDialog vector, the button will always refresh or something if clicked...but that didn't pan out, since a gray button doesn't register a _BtnClick event...so I just added a beep, and something was going on in dialog-a-ville, so I printed the event then did a lookup to see what it was, and a _wndrefresh was happening at the end of the drag. I guess the Appearance button control redraw sets that up. Anyhow, that's one way to handle it. If you just used _kControlCanDragWithResizeHandles, you could avoid all this though. <g> If that existed. :) Robert Bob