1. RE: Win32Lib: Mouse Down Event for Window
- Posted by Brian Broker <bkb at cnw.com> May 13, 2004
- 458 views
Don't confuse your event variables...
procedure win_Main_onMouse (integer self, integer event, sequence params)--params is ( int event, int x, int y, int shift ) object junk integer mouse_event sequence mpos mouse_event = params[1] mpos = params[2..3] if mouse_event != MouseMove then junk = message_box(sprintf("Event = %d",{event}),"Check",MB_OK) end if if mouse_event = LeftDown then junk = message_box("Left down!","Check",MB_OK) end if setText( StatusBar14, sprintf("%d,%d",mpos) ) end procedure setHandler( win_Main, w32HMouse, routine_id("win_Main_onMouse"))
-- Brian cklester wrote: > > > posted by: cklester <cklester at yahoo.com> > > Shouldn't the following work for the left mouse button down event? > > procedure win_Main_onMouse (integer self, integer event, sequence > params)--params is ( int event, int x, int y, int shift ) > object junk > if event != 3 then > junk = message_box(sprintf("Event = %d",{event}),"Check",MB_OK) > end if > if event = LeftDown then > junk = message_box("Left down!","Check",MB_OK) > end if > setText( StatusBar14, > sprintf("%d,%d",{mpos[1]-rect[1]+1,mpos[2]-rect[2]+1}) ) > end procedure > setHandler( win_Main, w32HMouse, routine_id("win_Main_onMouse"))
2. RE: Win32Lib: Mouse Down Event for Window
- Posted by Brian Broker <bkb at cnw.com> May 13, 2004
- 470 views
Please define "paint by mouse"... I started writing an mspaint-type program once, if that's what you mean. -- Brian cklester wrote: > > > posted by: cklester <cklester at yahoo.com> > > cklester wrote: > > > > Shouldn't the following work for the left mouse button down event? > > I've modified it to the following: > > procedure win_Main_onMouse (integer self, integer event, sequence > params)--params is ( int event, int x, int y, int shift ) > sequence mpos, rect > integer leftDragged > mpos = getPointerPos() > rect = getClientRect( win_Main ) > leftDragged = False > > if params[1] = LeftDown or leftDragged then > leftDragged = True > elsif params[1] = LeftUp then > leftDragged = False > end if > setText( StatusBar14, > sprintf("%d,%d",{mpos[1]-rect[1]+1,mpos[2]-rect[2]+1}) ) > end procedure > setHandler( win_Main, w32HMouse, routine_id("win_Main_onMouse")) > > Anybody have a "paint by mouse" example anywhere?
3. RE: Win32Lib: Mouse Down Event for Window
- Posted by cklester <cklester at yahoo.com> May 14, 2004
- 454 views
Brian Broker wrote: > > Please define "paint by mouse"... I started writing an mspaint-type > program once, if that's what you mean. Yeah, I want to be able to "paint" on a bitmap with my mouse, like in MSPaint.
4. RE: Win32Lib: Mouse Down Event for Window
- Posted by Brian Broker <bkb at cnw.com> May 14, 2004
- 458 views
Uhm... yeah... I've got *some* of that. I'll even throw in my floodfill include that I'm not even sure I've yet used in this unfinished demo. The floodfill was used in a USA states ID program now in the archives from years ago. Anyway, here's my unfinished work, designed for Win32Lib .59.1 - go nuts... http:\\cnw.com\~bkb\Eu\Paint.zip (case sensitive, as always) -- Brian (some day I'll actually finish something before life-events kick me down) cklester wrote: > > > posted by: cklester <cklester at yahoo.com> > > Greg Haberek wrote: > > > > I think the word we may be looking for here is "fill" as in color only > > an > > certain area given specific boundaries. > > No, I want to be able to click on a bitmap, > and where I click the program "paints" according > to whatever "brush" I've selected. Then, when > I drag my mouse all over, the program continues > to paint the same "brush" pattern... until I release > the mouse and am no longer "painting." > > Now, who can show me some of that? :)