Information générale
Titre:
Combo Box Class won't allow typing...
Hi!
I made a combo box classs it works fine exept for 1 detail.
This is a drop down combo and I can type but as soon
as I resize the grid that contains it or when the valid event
fires....The values are gone.
I can only select items from the list and then it works.
The control source I set on the grid column I tried with and without a control source...
I can't figure out what is wrong can someone plese help me...
Here is the class...
*******************************************
DEFINE CLASS GeneralComboBox AS COMBOBOX
ctable=""
lrowsource=.F.
cCursor=""
cFld=""
PROCEDURE init
IF this.lrowsource
cName=alltrim(this.cFld)
IF NOT 'UNIT'$UPPER(cName)
this.rowsource="select "+cName+" from shppop where not empty("+cName+") order by "+cName+" into cursor cSHP"+cName
this.ccursor="cSHP"+cName
this.rowsourcetype=3
ELSE
this.rowsource="select distinct unitfrom from units where not empty(unitfrom) order by unitfrom into cursor cshpUnit"
this.ccursor="cshpUnit"
this.rowsourcetype=3
this.value="cm"
this.value="cm"
this.displayvalue="cm"
this.refresh()
ENDIF
ENDIF
this.fontsize=8
ENDPROC
PROCEDURE LOSTFOCUS
IF NOT EMPTY(THIS.cTable)
cTableFld=THIS.cTable+ "." +This.cFld
REPLACE &cTableFld WITH RTRIM(This.DisplayValue)
ENDIF
ENDPROC
PROCEDURE VALID
SET STEP ON
*!* IF NOT EMPTY(THIS.cTable)
*!* cTableFld=THIS.cTable+ "." +This.cFld
*!* REPLACE &cTableFld WITH RTRIM(This.DisplayValue)
*!* ENDIF
ENDPROC
PROCEDURE GOTFOCUS
LOCAL cField
cName=alltrim(this.cFld)
IF NOT 'UNIT'$UPPER(cName)
this.rowsource="select "+cName+" from shppop where not empty("+cName+") order by "+cName+" into cursor cSHP"+cName
this.ccursor="cSHP"+cName
this.rowsourcetype=3
ELSE
this.rowsource="select distinct unitfrom from units where not empty(unitfrom) order by unitfrom into cursor cshpUnit"
this.ccursor="cshpUnit"
this.rowsourcetype=3
this.value="cm"
this.displayvalue="cm"
this.refresh()
ENDIF
cField = THIS.cTable + "." + This.cFld
This.DisplayValue = RTRIM(&cField)
ENDPROC
PROCEDURE DESTROY
IF this.lrowsource
IF USED(THIS.cCursor)
USE IN (THIS.cCursor)
ENDIF
ENDIF
ENDPROC
PROCEDURE REFRESH
LOCAL cField
cField = THIS.cTable + "." + This.cFld
This.DisplayValue = RTRIM(&cField)
ENDPROC
PROCEDURE RIGHTCLICK
CopyPasteRowRightClick()
ENDPROC
ENDDEFINE
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement