Guidance
指路人
g.yi.org
software / rapidq / examples / GUI / Grid / QStringGrid Inserting and deleting rows.bas

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

  
'From:   "Manuel Candela"  Mon Apr 14, 2003  11:23 pm

'This code was extracted from the examples and i did add "showkey" ,
'"wasAll" and the statement addOptions. Write anything over a
'intermediate cell and check. It does work.

     $INCLUDE "RAPIDQ.INC"
     $ESCAPECHARS ON

     $DEFINE K_ESC 27
     $DEFINE K_CTRL_Y 25
     $DEFINE K_CTRL_I 9
     $DEFINE K_CTRL_A 1

     CONST AgeList = "10\n11\n12\n13\n14\n15\n16\n17\n18\n19"

     SUB EllipsisClick (Col AS LONG, Row AS LONG, Sender AS QSTRINGGRID)
      Sender.Cell(Col, Row) = "Comments"+STR$(Row)
     END SUB

     SUB ShowKey (key AS BYTE, sender AS QSTRINGGRID) ', shift AS INTEGER)
      IF key = K_CTRL_Y THEN
       IF sender.rowcount > (1+sender.Fixedrows) THEN
        sender.deleterow(sender.row)
       END IF
      ELSEIF key = K_CTRL_I THEN
       sender.insertrow(sender.row)
      ELSEIF key = K_CTRL_A THEN
       sender.rowcount = sender.rowcount + 1
      END IF
     END SUB

     SUB wasAll (key AS BYTE, sender AS QFORM)
      IF key = K_ESC THEN
       sender.CLOSE
      END IF
     END SUB


     CREATE Form AS QFORM
      keyPreview = 1
      CREATE Grid AS QSTRINGGRID
       Align = alClient
       AddOptions(goEditing)
       FixedRows = 1
       FixedCols = 0
       ColCount = 4
       RowCount = 10
       DefaultRowHeight = 20
       ColumnStyle(0) = gcsList
       ColumnStyle(1) = gcsEllipsis
       ColumnList(0) = AgeList
       Cell(0,0) = " Age"
       Cell(1,0) = " Comments"
       OnEllipsisClick = EllipsisClick
       OnKeyPress = showKey
      END CREATE

      CAPTION = "Inserting and deleting rows"
      onKeyPress = wasAll
      Center
      SHOWMODAL
     END CREATE
掌柜推荐
 
 
¥264.00 ·
 
 
¥810.00 ·
 
 
¥1,480.00 ·
 
 
¥1,370.00 ·
 
 
¥1,290.00 ·
 
 
¥397.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2009-07-25 17:30:04