Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Clipper > Re: shift+down
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 6 Topic 3841 of 3903
Post > Topic >>

Re: shift+down

by "Stephen Quinn" <stevejqNO@[EMAIL PROTECTED] > Feb 15, 2008 at 07:06 AM

> Hi friends: I need to select a group of records that are shown inside
> a browse...how can I active the key shift+arrow down in order to get
> those records in one step....thanks in advance

// Make an array visible to the whole file
STATIC aTagList := {}

////////////////////////////////////////////
// Add/Delete items from an array when pressing the spacebar in the
TBrowse
CASE nKey = K_SPACE
    nRecNo := ( cAlias )->( RECNO() )
    nPos := ASCAN( aTagList, {|x| x = nRecNo }
    IF nPos = 0
        // Not there so add it to the list
        AADD( aTagList, nRecNo )
        // Sort aTaglist if you want
    ELSE
        // Already there so remove this record from the list
        ADEL( aTagList, nPos )
        ASIZE( aTagList, Len( aTagList ) - 1 )
    ENDIF

////////////////////////////////////////////
// To change the colours in the the TBrowse to show selected items
// Use the oTB:ColorSpec to add whatever colours you want
oTB:ColorBlock := {|| IIF( ColourEm( cAlias ), { 3, 4 }, { 1, 2 } ) }

////////////////////////////////////////////
STATIC FUNCTION ColourEm( cAlias )
    LOCAL nPos
    LOCAL nRecNo

    // Get the current record no
    nRecNo := ( cAlias )->( RECNO() )
    // See if it's in the list
    nPos := ASCAN( aTagList, {|x| x = nRecNo } )

    RETURN nPos > 0

-- 
CYA
Steve




 6 Posts in Topic:
shift+down
target <rmtarget@[EMAI  2008-02-14 10:44:42 
Re: shift+down
dlzc <dlzc1@[EMAIL PRO  2008-02-14 14:31:14 
Re: shift+down
diego <diegobph@[EMAIL  2008-02-14 22:08:24 
Re: shift+down
sebas22 <nospam@[EMAIL  2008-02-15 06:49:45 
Re: shift+down
"Stephen Quinn"  2008-02-15 07:06:21 
Re: shift+down
"Marek Horodyski&quo  2008-02-15 09:46:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 1:33:09 CDT 2008.