Guidance
指路人
g.yi.org
software / rapidq / examples / GUI / spin / qspintext / qspintext.inc

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

  
' Qspintext component for Rapid-Q by Mesut Akcan
' ver : 1.01
' 7 July 2000, update : 7 Sept. 2000
' http://kaynak.cjb.net
' http://makcan.virtualave.net
' makcan@softhome.net
'$typecheck on
'-----------------
'Updated 20.04.04  Andrew Shelkovenko diakin@narod.ru
' OnChange event added
'bgcolor property added - editor bgcolor
'fontcolor property added- editor font color


     DECLARE SUB QspintextOnChange (vl AS LONG)

     TYPE Qspintext EXTENDS QPANEL

      OnChange AS EVENT (QspintextOnChange)
public:
      max AS LONG
      min AS LONG
      value AS LONG
      bgcolor AS LONG
      fontcolor AS LONG
      ed AS QEDIT
      sb AS QSCROLLBAR

      SUB initial
       WITH Qspintext
        .sb.max=.min * -1
        .sb.min=.max * -1
        .ed.text=STR$(.value)
        .ed.PARENT=Qspintext
        .sb.PARENT=Qspintext

        .sb.kind=1
        .sb.width=18
        .sb.top=2 :
        .sb.height=18

        .ed.top=3
        .ed.left=2
        .ed.height=16 :
        .ed.borderstyle=0
        .ed.width=Qspintext.width - 22
       '' print "ed.width=",.ed.width

        .sb.left= .ed.width+.ed.left+2
        .ed.COLOR=.bgcolor 'clBlue'.color
        .ed.font.COLOR=.fontcolor
       END WITH
      END SUB

''    event OnClick
''    CALLFUNC(Qspintext.OnChange,vl)
''    end event

      EVENT sb.onchange
       DIM p AS LONG

       WITH Qspintext
        p=.sb.position * -1
        .ed.text=STR$(p)
        .value=p
        vl=p
        Qspintext.ed.COLOR=Qspintext.bgcolor '&H0000FF

        CALLFUNC(.OnChange,vl)

       END WITH
      END EVENT

      EVENT ed.onchange
''        Qspintext.sb.position=val(Qspintext.ed.text) * -1
''        vl=Qspintext.sb.position
''        CALLFUNC(Qspintext.OnChange1,vl)
      END EVENT

      EVENT ed.onkeydown (key AS WORD, shift AS INTEGER)
       DIM p AS LONG
       p=Qspintext.sb.position

       IF key=38 THEN
        DEC p :
        Qspintext.sb.position = p  ' up
        Qspintext.ed.COLOR=Qspintext.bgcolor '&H0000FF

       ELSEIF key=40 THEN
        INC p :
        Qspintext.sb.position = p  ' dw
        vl=Qspintext.sb.position
        Qspintext.ed.COLOR=Qspintext.bgcolor '&H0000FF

       ELSEIF key=13 THEN
        Qspintext.sb.position=VAL(Qspintext.ed.text) * -1
        Qspintext.ed.COLOR=Qspintext.bgcolor '&H0000FF
        CALLFUNC(Qspintext.OnChange,vl)
       ELSE
        Qspintext.ed.COLOR=&H0000FF

       END IF



      END EVENT

      CONSTRUCTOR
       width=50 : height=22
       sb.kind=1
       sb.width=18
       sb.top=2 :
       sb.height=18

       ed.top=3
       ed.left=2
       ed.height=16 :
       ed.borderstyle=0
       ed.width=Qspintext.width - 22

       sb.left= Qspintext.ed.width+Qspintext.ed.left+2
       ed.COLOR=-2147483648'Qspintext.bgcolor
       bgcolor=-2147483643'-2147483647'-2147483648
       fontcolor=0
       bevelouter=1

      END CONSTRUCTOR


     END TYPE
掌柜推荐
 
 
¥738.00 ·
 
 
¥890.00 ·
 
 
¥1,280.00 ·
 
 
¥264.00 ·
 
 
¥317.00 ·
 
 
¥296.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:56:16