Lesson+6

===**LESSON 6 ** ===

**//SEQUENTIAL STRUCTURES: GRAPHICAL USER INTERFACE//** Mouse commands allow you to create programs with a Graphical User Interface (GUI), this means you can have clickable buttons. Here are the basic mouse commands.


 * Mouse.where (x, y, button) ||  ||   ||
 * Mouse.ButtonMoved(motion) ||  ||   ||
 * Mouse.ButtonWait (motiont, x,y,buttonnumber, buttonUpDown) ||  ||   ||

Here is an example of how they work. **1) Mouse.Where**

**var x, y, button : int ** **loop ** **cls ** **Mouse.Where (x, y, button) ** **locatexy (10, 50) ** **put x:10, y:30 ** **end loop **

2) Mouse.ButtonWait var x, y, buttonnumber, buttonUpDown : int <span style="font-family: Arial; font-size: 18px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">loop <span style="font-family: Arial; font-size: 18px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">Mouse.ButtonWait ("down",x, y, buttonnumber, buttonUpDown) <span style="font-family: Arial; font-size: 18px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">drawfilloval (x,y, 20,20,red) <span style="font-family: Arial; font-size: 18px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">end loop

<span style="font-family: 'Courier New',Courier,monospace; font-size: 18px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">3)Mouse.ButtonMoved <span style="font-family: 'Courier New',Courier,monospace; font-size: 18px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">var x, y, buttonnumber, buttonUpDown : int <span style="font-family: 'Courier New',Courier,monospace; font-size: 18px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">loop <span style="font-family: 'Courier New',Courier,monospace; font-size: 18px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">if Mouse.ButtonMoved ("up") <span style="font-family: 'Courier New',Courier,monospace; font-size: 18px;">then <span style="color: #000080; font-family: 'Courier New',Courier,monospace; font-size: 18px; line-height: 27px;">Mouse.ButtonWait ("up", x, y, buttonnumber, buttonUpDown) <span style="font-family: 'Courier New',Courier,monospace; font-size: 18px; line-height: 27px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">drawfillbox (x, y, x+20, y+20, brightgreen) <span style="font-family: 'Courier New',Courier,monospace; font-size: 18px; line-height: 27px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">elsif Mouse.ButtonMoved ("down") <span style="font-family: 'Courier New',Courier,monospace; font-size: 18px; line-height: 27px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">then Mouse.ButtonWait ("down", x, y, buttonnumber, buttonUpDown) <span style="font-family: 'Courier New',Courier,monospace; font-size: 18px; line-height: 27px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">drawfilloval (x, y, 20, 20, red) <span style="font-family: 'Courier New',Courier,monospace; font-size: 18px; line-height: 27px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">end if <span style="font-family: 'Courier New',Courier,monospace; font-size: 18px; line-height: 27px; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">end loop

<span style="font-size: 1.3em; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 5px;">**Task**
====<span style="color: #000080; font-family: Arial,Helvetica,sans-serif; font-size: 1.06em; font-weight: normal; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 5px;">1) Modify any of your previous programs such that they have a graphical user interface. ====

=<span style="font-size: 1.4em; margin: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 5px;">** Note: From this point on, all programs must be GUI compliant ** =