Commit 7644d01c027e38ececc498601cbfd4c9ca127989
1 parent
1bf9f941
*** empty log message ***
Showing
3 changed files
with
11 additions
and
6 deletions
Show diff stats
anubis_dev/library/widgets4/bubble_manager.anubis
| ... | ... | @@ -31,7 +31,7 @@ public type BMCommand: |
| 31 | 31 | bubble manager never shows more than one bubble. |
| 32 | 32 | |
| 33 | 33 | |
| 34 | - Now, here is how you may create the bubble manager. | |
| 34 | + Here is how you may create the bubble manager. | |
| 35 | 35 | |
| 36 | 36 | public define Widget |
| 37 | 37 | bubble_manager |
| ... | ... | @@ -96,7 +96,7 @@ define (Int32,Int32) |
| 96 | 96 | When a new value is put into the command variable, the next function is called. It just |
| 97 | 97 | recomputes the smallest rectangle containing the given area. The value is put into the |
| 98 | 98 | dynamic variable 'br_v'. The result is an answer saying that the widget must be redrawn |
| 99 | - within the rectangle of the old and new bubbles (if any). | |
| 99 | + within the rectangles of the old bubble and new bubble (if any). | |
| 100 | 100 | |
| 101 | 101 | define WidgetAnswer |
| 102 | 102 | handle_bubble_change | ... | ... |
anubis_dev/library/widgets4/menu_manager.anubis
| ... | ... | @@ -605,6 +605,7 @@ define WidgetAnswer |
| 605 | 605 | Widget content, |
| 606 | 606 | Var(HorizontalDirection) hdvar, |
| 607 | 607 | Var(VerticalDirection) vdvar, |
| 608 | + RGB menu_color | |
| 608 | 609 | ) = |
| 609 | 610 | if member(l,var_id(command_v)) |
| 610 | 611 | then if *command_v is |
| ... | ... | @@ -616,6 +617,7 @@ define WidgetAnswer |
| 616 | 617 | default_event_handling(etb,[],content,changed(l))), |
| 617 | 618 | |
| 618 | 619 | l_r(menu,r) then |
| 620 | + with menu = insert_if_needed(menu_color,menu,content), | |
| 619 | 621 | if size(menu) is (w1,h1) then |
| 620 | 622 | if size(content) is (w,h) then |
| 621 | 623 | if get_menu_position(widget_rectangle(etb,r),w1,h1,w,h,left_right(hdvar)) is (x1,y1) then |
| ... | ... | @@ -624,6 +626,7 @@ define WidgetAnswer |
| 624 | 626 | default_event_handling(etb,*menu_list_v,content,changed(l))), |
| 625 | 627 | |
| 626 | 628 | t_b(menu,r) then |
| 629 | + with menu = insert_if_needed(menu_color,menu,content), | |
| 627 | 630 | if size(menu) is (w1,h1) then |
| 628 | 631 | if size(content) is (w,h) then |
| 629 | 632 | if get_menu_position(widget_rectangle(etb,r),w1,h1,w,h,top_bottom(vdvar)) is (x1,y1) then |
| ... | ... | @@ -644,6 +647,7 @@ define (WidgetEventToolBox,WidgetEvent) -> WidgetAnswer |
| 644 | 647 | Widget content, |
| 645 | 648 | Var(HorizontalDirection) hdvar, |
| 646 | 649 | Var(VerticalDirection) vdvar, |
| 650 | + RGB menu_color | |
| 647 | 651 | ) = |
| 648 | 652 | (WidgetEventToolBox etb, WidgetEvent e) |-> |
| 649 | 653 | if e is |
| ... | ... | @@ -661,7 +665,8 @@ define (WidgetEventToolBox,WidgetEvent) -> WidgetAnswer |
| 661 | 665 | captured_mouse_liberated(f) then default_event_handling(etb,*menu_list_v,content,e), |
| 662 | 666 | key_down(f) then default_event_handling(etb,*menu_list_v,content,e), |
| 663 | 667 | keyboard_recaptured(f) then default_event_handling(etb,*menu_list_v,content,e), |
| 664 | - changed(l) then handle_changed(etb,menu_list_v,l,command_v,content,hdvar,vdvar) | |
| 668 | + changed(l) then handle_changed(etb,menu_list_v,l,command_v,content, | |
| 669 | + hdvar,vdvar,menu_color) | |
| 665 | 670 | }. |
| 666 | 671 | |
| 667 | 672 | |
| ... | ... | @@ -688,7 +693,7 @@ public define Widget |
| 688 | 693 | ( |
| 689 | 694 | (One u) |-> /*forget(ticket);*/ size(content), |
| 690 | 695 | draw_method(menu_list_v,content), |
| 691 | - event_handler(command_v,menu_list_v,content,hdvar,vdvar), | |
| 696 | + event_handler(command_v,menu_list_v,content,hdvar,vdvar,color), | |
| 692 | 697 | (One u) |-> [register(command_v) . registrations(content)(unique)] |
| 693 | 698 | ). |
| 694 | 699 | ... | ... |
anubis_dev/library/widgets4/mouse_tracker.anubis
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | This widget is an invisible widget surrounding another widget (called its |
| 15 | 15 | 'content'). The purpose of the mouse tracker is just to maintain a variable up to date. |
| 16 | 16 | This variable contains the coordinates of the mouse (relative to the mouse tracker, or, |
| 17 | - which is the same to the content). | |
| 17 | + which is the same, to the content). | |
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | read widget.anubis |
| ... | ... | @@ -36,7 +36,7 @@ public define Widget |
| 36 | 36 | mouse_tracker |
| 37 | 37 | ( |
| 38 | 38 | Var((Int32,Int32)) mouse_position, |
| 39 | - Widget content | |
| 39 | + Widget content | |
| 40 | 40 | ) = |
| 41 | 41 | create_widget |
| 42 | 42 | ( | ... | ... |