Guidance
指路人
g.yi.org
software / RapidQ / Examples / Devices / mouse / select2.rq

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'
'Menu Selection Ver0.2
'Usage: Move mouse on item, Click to select.
'Witten by Nadesom@yahoo.com
'2002.1
'
     DECLARE SUB 01click (Sender AS QLABEL)
     DECLARE SUB 02click (Sender AS QLABEL)
     DECLARE SUB 03click (Sender AS QLABEL)


     DECLARE SUB 01move (X AS LONG, Y AS LONG, Shift AS LONG, Sender AS QLABEL)
     DECLARE SUB 02move (X AS LONG, Y AS LONG, Shift AS LONG, Sender AS QLABEL)
     DECLARE SUB 03move (X AS LONG, Y AS LONG, Shift AS LONG, Sender AS QLABEL)

     DECLARE SUB Fmmove (X AS LONG, Y AS LONG, Shift AS LONG, Sender AS QFORM)

     DIM Font AS QFONT

     OldColor=RGB(0,200,0)
     Newcolor=RGB(200,0,0)

     Font.COLOR=OldColor

     CREATE Form AS QFORM
      CAPTION = "Select"
      Width = 100
      Height = 170
      Center
      CREATE Label1 AS QLABEL
       CAPTION = "ON"
       font=font
       Left = 40
       Top = 20
       Width = 50
       Height = 16
       OnClick = 01Click
       OnMouseMove=01move
      END CREATE
      CREATE Label2 AS QLABEL
       CAPTION = "OFF"
       font=font
       Left = 40
       Top = 60
       Width = 50
       Height = 16
       OnClick = 02Click
       OnMouseMove=02move
      END CREATE
      CREATE Label3 AS QLABEL
       CAPTION = "Exit"
       font=font
       Left = 40
       Top = 100
       Width = 50
       Height = 16
       OnClick = 03Click
       OnMouseMove=03move
      END CREATE
      OnMouseMove=FMMove
     END CREATE

     Form.SHOWMODAL

     SUB 01Click (Sender AS QLABEL)
      SHOWMESSAGE "You selection is ON"
     END SUB

     SUB 02Click (Sender AS QLABEL)
      SHOWMESSAGE "You selection is OFF"
     END SUB

     SUB 03Click (Sender AS QLABEL)
      END
     END SUB

     SUB 01move (X AS LONG, Y AS LONG, Shift AS LONG, Sender AS QLABEL)
      IF x<label1.width THEN label1.font.COLOR=NewColor
     END SUB

     SUB 02move (X AS LONG, Y AS LONG, Shift AS LONG, Sender AS QLABEL)
      IF x<label2.width THEN label2.font.COLOR=NewColor
     END SUB

     SUB 03move (X AS LONG, Y AS LONG, Shift AS LONG, Sender AS QLABEL)
      IF x<label3.width THEN label3.font.COLOR=NewColor
     END SUB

     SUB Fmmove (X AS LONG, Y AS LONG, Shift AS LONG, Sender AS QFORM)

      IF x<label1.left OR x>(label1.left+label1.width) OR y<label1.top OR y>(label1.top+label1.height) THEN
       label1.font.COLOR=OldColor
      END IF

      IF x<label2.left OR x>(label2.left+label2.width) OR y<label2.top OR y>(label2.top+label2.height) THEN
       label2.font.COLOR=OldColor
      END IF

      IF x<label3.left OR x>(label3.left+label3.width) OR y<label3.top OR y>(label3.top+label3.height) THEN
       label3.font.COLOR=OldColor
      END IF

     END SUB
掌柜推荐
 
 
¥860.00 ·
 
 
¥900.00 ·
 
 
¥810.00 ·
 
 
¥317.00 ·
 
 
¥1,370.00 ·
 
 
¥660.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:45:11