>>*---------------------- Location Section ------------------------ ><snip> >>*---------------------------------------------------------------- >>LPARAMETERS tcControlSource, tcTagName >>LOCAL lnCount, lcField, lcIndexExpr, lcCursor, lnIndexes, ; >> lcAscDesc, lnRecNo, loSelect >>LOCAL ARRAY laIndex[1] >> >>*---------------------------------------------------------- >>*-- Get the field, cursor name for the ControlSource cursor >>*---------------------------------------------------------- >>lcField = SUBSTR(tcControlSource, AT(".", tcControlSource) + 1) >>lcCursor = JUSTSTEM(tcControlSource) >> >>
>*lcField = SUBSTR(tcControlSource, AT(".", tcControlSource) + 1) >lcField = JUSTEXT(tcControlSource) >>
>>*---------------------- Location Section ------------------------ >>* Library: Acustomcontrols.vcx >>* Class: Grdsorting >>* Method: Headerclick() >>*----------------------- Usage Section -------------------------- >>*) Description: Custom method which fires when Header is clicked (idea from Barbara Peisch) >>*) >>* Scope: Public >>* Parameters: >>*$ Usage: >>*$ >>* Returns: >>*--------------------- Maintenance Section ---------------------- >>* Change Log: >>* CREATED 01/06/2005 - NN >>* MODIFIED >>*---------------------------------------------------------------- >>LOCAL loCalledBy AS OBJECT >> >>AEVENTS[aCurEvent,0] >>loCalledBy = aCurEvent[1] && should be a Header object >> >>IF VARTYPE(m.loCalledBy)= "O" AND NOT EMPTY(m.loCalledBy.PARENT.CONTROLSOURCE) >> LOCAL lcOrder >> lcOrder = SET('order') && Save current tag >> THIS.SetOrder(m.loCalledBy.PARENT.CONTROLSOURCE) >> IF this.lShowSortingArrows AND NOT SET('order')== m.lcOrder >>** Clear the picture of the previously sorted column >> this.ClearHeaderPictures() >> this.SetHeaderPicture(m.loCalledBy) >> endif >>ENDIF>>
>>*---------------------- Location Section ------------------------ >>* Library: Acustomcontrols.vcx >>* Class: Grdsorting >>* Method: Clearheaderpictures() >>*----------------------- Usage Section -------------------------- >>*) Description: >>*) >> >>* Scope: Public >>* Parameters: >>*$ Usage: >>*$ >>* Returns: >>*--------------------- Maintenance Section ---------------------- >>* Change Log: >>* CREATED 01/24/2005 - NN >>* MODIFIED >>*---------------------------------------------------------------- >>LOCAL loColumn, loControl >>FOR EACH loColumn IN THIS.COLUMNS >> FOR EACH loControl IN loColumn.CONTROLS >> IF UPPER(loControl.BASECLASS) = "HEADER" >> loControl.resettodefault('picture') >> ENDIF >> ENDFOR >>ENDFOR>>
>* for each is slow >FOR iColumn=1 to m.THIS.COLUMNcount > this.Columns[m.iColumn].Control[1].resettodefault('picture') >ENDFOR >>
>save Ordered column header reference into a grid property >this.OrderHeader = header >when you clear it: >=VARTYPE('m.this.OrderHeader')=='O' AND this.OrderHeader.resettodefault('picture') >>
>this.ClearHeaderPictures("Picture") && a empty procedure >* on this.SetHeaderPicture(m.loCalledBy) >* unfortunately on VFP is not possible this very usefull command: >*=UNBINDEVENTS(m.this,"ClearHeaderPicture") && REMOVE ALL DELEGATE OF ClearHeaderPicture >=BINDEVENT(m.this,"ClearHeaderPicture",m.loCalledBy,"resettodefault") >loCalledBy.Picture = .... >>