Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MMSec_cGrid modification
Message
De
16/02/2001 18:45:38
Rex Mahel
Realm Software, Llc
Ohio, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
MMSec_cGrid modification
Divers
Thread ID:
00476905
Message ID:
00476905
Vues:
57
Kevin,

The MMSec_CGrid builder can be modified to allow invalid ControlSource messages to be more descriptive. Add the following to the ColumnSetUp method:


*---------------------------------------
*--- Get any column's method code
*---------------------------------------
SELECT * ;
FROM MMBDMeta ;
WHERE ;
UPPER(MMBDMeta.cKey) = 'GRIDCOLUMNCONTROL ' ;
INTO CURSOR MM_TempGridCode

SCAN
*--- Get the method name ---*
lcMethod = ALLTR(MM_TempGridCode.cMethod)
loThisColumn = ThisForm.oObject.Columns[tnColumn]

FOR liControl = 1 TO loThisColumn.ControlCount
loControl = loThisColumn.Controls[liControl]
IF loControl.BaseClass = "Header"
LOOP
ENDIF
*--- Check if the column already contains code
lcCode = loControl.ReadMethod(lcMethod)
IF EMPTY(lcCode)
*--- The method is empty. Replace with specified code
loControl.WriteMethod(lcMethod,MM_TempGridCode.mMemo)
ENDIF
ENDFOR
ENDSCAN

USE IN MM_TempGridCode
<\pre>

Also add a the following to the MMBDMETA table:

CKEY CMETHOD MMEMO
GRIDCOLUMNCONTROL ERROR MEMO

With the memo field being:


LPARAMETERS nError, cMethod, nLine, tcSys16, toErrObj

*-----------------------------------------------------------
*--- If tcSys16 is empty, it indicates this object is the
*--- source of the error. If so, set tcSys16 to SYS(16)
*--- and make toErrObj a reference to this object
*-----------------------------------------------------------
IF EMPTY(tcSys16)
tcSys16 = SYS(16)
toErrObj = This
ENDIF

*------------------------------------------------
*--- If the developer has specified an invalid
*--- ControlSource field for the control, display
*--- a Wait Window error message
*------------------------------------------------
IF INLIST(nError,12,13) AND goApp.lDebugMode AND UPPER(JustExt(cMethod)) = 'CONTROLSOURCE'
WAIT WINDOW 'Invalid ControlSource in: ' + This.Parent.Parent.Name + "." + This.Parent.Name + "." + This.Name
ELSE
*----------------------------------------------------
*--- Pass the error up the containership hierarchy
*
*--- Call the Parent's Error method
*-------------------------------------
THIS.Parent.Error(nError, cMethod, nLine, tcSys16, toErrObj)
ENDIF
<\pre>

Notice this shows the grid and column name as well as the control.

Thanks

Rex
Répondre
Fil
Voir

Click here to load this message in the networking platform