Changeset 354
- Timestamp:
- 06/03/08 07:00:11 (6 months ago)
- Files:
-
- trunk/qd/qd.d (modified) (1 diff)
- trunk/qd/test2.d (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/qd/qd.d
r351 r354 608 608 mouse.pos = pt(x, y); 609 609 if (pushed == 1) { 610 mouse.pressed = true; 610 611 if (button == 1) mouse._leftclicked = true; 611 612 if (button == 3) mouse._rightclicked = true; 612 613 } 614 if (pushed == -1) mouse.pressed = false; 613 615 } 614 616 615 617 struct mouse { 616 618 static { 617 union { 618 pt pos; 619 int x, y; 620 } 619 pt pos; 620 int x() { return pos.x; } int y() { return pos.y; } 621 621 bool _leftclicked, _rightclicked; 622 bool pressed; 622 623 bool clicked() { if (!_leftclicked) return false; _leftclicked = false; return true; } 623 624 bool rightclicked() { if (!_rightclicked) return false; _rightclicked = false; return true; } trunk/qd/test2.d
r353 r354 83 83 // auto backup = myArea; area = null; area = backup; 84 84 } 85 void handleMouse(proc yield) {85 /*void handleMouse(proc yield) { 86 86 enum State { start, inside, drag_zoomin, doZoomin, drag_zoomout, doZoomout }; 87 87 pt start, end; … … 117 117 ); 118 118 tf.runState(yield); 119 } 119 }*/ 120 120 alias void delegate(T p, void delegate(float)) func; 121 121 void lyapunov(T p, void delegate(float) dg) { … … 303 303 } 304 304 ]; 305 transitions.addBidirectionalEdge({ return mouse. button; }, State.inside, State.dragging);305 transitions.addBidirectionalEdge({ return mouse.pressed; }, State.inside, State.dragging); 306 306 transitions.addEdges( 307 { return (mouse.pos in this)&&!mouse. button; }, State.start, State.inside,307 { return (mouse.pos in this)&&!mouse.pressed; }, State.start, State.inside, 308 308 { return !(mouse.pos in this); }, State.inside, State.start 309 309 ); … … 441 441 442 442 list!(Window) windows; 443 this() { mouse.sched~=stackthread=&mousethr; }443 // this() { mouse.sched~=stackthread=&mousethr; } 444 444 void draw() { windows.each((Window w) { w.draw(); }); } 445 void mousethr(proc yield) {446 assert(mouse.sched.runsMe);445 /*void mousethr(proc yield) { 446 // assert(mouse.sched.runsMe); 447 447 enum State { start, title_inside, title_dragging, resize_inside, resize_dragging } 448 448 pt lastpos; … … 484 484 ); 485 485 transitions.runState(yield); 486 } 486 }*/ 487 487 } 488 488
