Isx.prg reste un exellent complément à Intellisense de Vfp 8.0.
Les modifications que je lui est apporté auguement notre confort d'aide à la programmation.
Ce que Isx faisait avant
Affiche dans un popup : - Les variables LOCAL, PRIVATE, PUBLIC, LPARAMETER and PARAMETER - Les champs de tables ouvertent - Alt-I les variable locaux LOCAL, PRIVATE, PUBLIC, LPARAMETER and PARAMETER - Alt-rightarrow Les #define
Ce que fait de plus maintenant - Alt-Q pour arrêter Isx - Alt-Q pour redemarrer Isx - Ouvre automatiquements : -Les tables présentes dans le répertoire courant et de recherche(set path to) -Les vues présentes dans le projet actif -Les query présent dans le répertoire courant et de recherche(set path to) petit point à ne pas négliger. Le curseur produit par fichier MyQuery.qpr doit être du même nom que le fichier
20/6/05, Th N
ISX2b supporte l'IDE localisée en Français.
Redémarrer VFP pour recharger ISX complètement.
17/01/2008, Eddy Maue
Correction d'un p'tit bug
17/01/2008, Eddy Maue
En cette heure tardive "23:15" et avec beaucoup de retard, je viens d'appliqué les modif de Thierry
Code source :
*======================================================================================== * * Version: 2005-06-17 Dec-06-1 ISX Revision 002b * *======================================================================================== * * This program implements partial IntelliSense in VFP 6. To enable * IntelliSenseX, simply execute this program at any time when using * Visual FoxPro or put it into your startup program. * * To configure ISX please see the section just below the comment block. * * To stop IntelliSenseX run this program again and pass "QUIT" as a * parameter. Alternatively, you can simply remove the ON KEY LABEL * macros for the ALT+I and the "." key. * * Currently only IntelliSense for variable names is implemented. This * means that whenever you enter "m." in a MODIFY COMMAND window or * in a Method edit window, you get a list of all variables declared * in the current procedure. ISX doesn't parse the entire sourcecode * for memory variables, but only the current procedure or method and * only those variables listed in a LOCAL, PRIVATE, PUBLIC, LPARAMETER * and PARAMETER statement. ALT+I can be used to trigger this list. * * ALT+RIGHTARROW triggers a universal autocomplete function that tries to determine the * type of what you have entered and offers a list of all possible values. * * Please note that I haven't written this program as an excercise for * good coding styles <g>, rather as an excercise to see if * IntelliSense is possible within Visual FoxPro itself. Therefore * you won't find the Assertions you would otherwise find in my code. * *======================================================================================== * * Acknowledgements * * Thanks to George Tasker for his really helpful documentation on the * FoxTools.Fll. You can download his ToolHelp.Hlp file from the * UniversalThread and the CompuServe MSDEVAPP forum. George also made * some suggestions to improve this program. * * Also thanks to Ken Levy, who couldn't implement an inline Intelli- * Sense feature in his SuperCls and thereby convinced me that there * must be a way to do it, even only for the purpose of doing * something that Ken Levy couldn't do. <bg> * * Thanks to all the folks that posted me bug reports, especially * Frank Cazabon. Thanks to Gerry Hughes for correcting the typos in * my comments. * * Louis D. Zelus added a nifty feature to my version to make ISX * even more useful. Thanks for that! The code based on his work is * marked with "LDZ:". * * Sietse Wijnkler added a lot of new cool features: He added the * ability to distinguish different types that all are triggered by * a period and the code to display variables, object properties and * field names. Code based on his work is marked with "SW:". * * Jürgen "wOOdy" Wondzinski pointed out that special characters like * "ö" are valid variable names and IsAlpha() returns .T. for them. * Therefore any of these characters is detected by ISX, as well. * * Tamar E. Granor and Peter Steinke, both requested the list DEFINE * features which is why I finally added it. * * Thanks to Eddy Maue for his contributions: * * Ce que Isx fait de plus maintenant * - Alt-Q pour arrêter Isx * - Alt-Q pour redemarrer Isx * - Ouvre automatiquements : * -Les tables présentes dans les répertoires courants et de recherches * (set path to) * -Les vues présentes dans le projet actif * -Les query présents dans les répertoires courants et de recherches * (set path to) * Petit point à ne pas négliger. Le curseur produit par le fichier * MyQuery.qpr doit être du même nom que le fichier * * Fev,21,2005 -------------------------------------- * * Bug : J'ai noté un problème lorsqu'une table ou un objet se terminait par * un m comme thisform ou Do form ou TableItem. Lorsque j'appuyais sur * la Space Bar un conflit apparaissait entre Isx et l'Intellisense * Manager de vfp 8.0 * Voir "Modifié le 20 fevrier 2005" * * in English: * - ALT+Q enables/disables ISX * - files are opened automatically: * - tables available in the current directory or the search path (SET PATH TO) * - Views available in the current project * - Queries available in the current directory or the search path (SET PATH TO) * Minor, but important restriction: The cursor created by the query program * must have the same alias as the filename. * * June,17,2005, Thierry Nivelet -------------------------------------- * * Bug : Les constantes ne sont pas listée dans l'IDE VFP localisée en Français * Constants list pop-up don't appear with french localized version of VFP IDE * Voir/See "Modifié le 17 juin 2005" * * * Thanks to all those who pointed out bugs in ISX's releases: * * - Nina Schwanzer * - Del Lee * - Pamela Thalacker * - Christophe Chenavier * *======================================================================================== * * This program has been written in 1999-2002 by Christof Lange * and is placed into Public Domain. You can use the entire * code or parts of it as you like in any private or commercial * application. None of the contributors to this programm can be hold * liable for any damage or problems, using this program may cause. * * If you added a new feature, please let me know. If you want I add * your feature to my master copy of ISX to let others use your * feature, as well. Please note that since the entire program is * placed into Public Domain, this places your code into Public * Domain, as well. Of course, your contributions are acknlowdeged in * the comment at the beginning of this file. * *======================================================================================== * * Known problems: * * - Variable declaration of the following variations are not parsed * at all: * * PROCEDURE Name(var) * FUNCTION Name(var) * * - So far ISX has not been tested with different Display appearance * settings, like wider scrollbars or form borders, large fonts and * the like. Some values are hardcoded and might be wrong for non- * standard Windows settings. * * - When you enter a period into a textbox, the cursor is set to the first character of * the textbox and then the period entered. If SelectOnEntry is true, everything is * replaced by the period. This is caused by a bug in VFP that makes all ON KEY LABEL * behave this way. You can disable this behavior by commenting out the lines starting * with "ON KEY LABEL .". In this case, you must use ALT+I or ALT+RIGHTARROW do expand * the variable. * *========================================================================================
*======================================================================================== * Configuration. * * Over the time I got many enhanced versions of ISX, many of which include new hotkeys. * To give everyone control over the hotkey assignment and to disable/enable particular * features, I added the following configuration section. By commenting out a #DEFINE, you * disable a particular feature. Changing the value changes the hotkey. * *========================================================================================
*======================================================================================== * Provides a generic autocomplete function. AutoComplete checks all content providers * if they have something to add to the global list and displays the list as a popup *======================================================================================== ProcedureAutocomplete Lparameters tcProviders, tcInvocation && "VAR,OBJ,TABLE", "."
*-------------------------------------------------------------------------------------- * The list of providers can be limited. This speeds up program execution if one knows * from the context that only few content providers actually fit. *-------------------------------------------------------------------------------------- Local lcProviders IfEmpty(m.tcProviders)
lcProviders = "DEFINE,VAR,TABLE,OBJ" Else&& Dot_Activation
lcProviders = Upper(m.tcProviders) Endif
*----------------------------------------------------------------- * Make sure, FoxTools.Fll is loaded. *----------------------------------------------------------------- IfNot"FOXTOOLS.FLL" $ Upper(Set("Library")) SetLibraryTo (Home()+"FoxTools.Fll") Additive Endif
*----------------------------------------------------------------- * Get the current window and verify that it is a valid window. *----------------------------------------------------------------- Local lnWHandle
lnWHandle = GetCurrentWindow() * Activate Screen * ? lnWHandle, m.tcInvocation If lnWHandle == 0
*----------------------------------------------------------------- * Verify that the current window is indeed an edit window. *----------------------------------------------------------------- Local lnEditSource
lnEditSource = GetEditSource(m.lnWHandle) IfNotInlist( m.lnEditSource, 1, 8, 10, 12 ) IfNotEmpty(m.tcInvocation) ClearTypeahead Keyboard"{Mouse}"+m.tcInvocation Plain Endif Return Endif
*-------------------------------------------------------------------------------------- * Fill an object with details about the current context. We determine what the user * has entered so far and what's left from that Position. *-------------------------------------------------------------------------------------- Local loISX
loISX = Createobject("Relation")
loISX.AddProperty("nWHandle",m.lnWHandle)
loISX.AddProperty("nEditSource",m.lnEditSource)
loISX.AddProperty("aList[1]")
loISX.AddProperty("nCount",0)
loISX.AddProperty("cTextLeft",GetLineLeftFromCursor(m.lnWHandle))
loISX.AddProperty("cName","")
loISX.AddProperty("cEntity","")
loISX.AddProperty("cInvocation",m.tcInvocation)
*-------------------------------------------------------------------------------------- * Determine the part of the name that has been entered so far. This code has been * kindly provided by Louis D. Zelus. *-------------------------------------------------------------------------------------- Local lcLine, lcChar IfEmpty(m.tcInvocation) DoWhileLen(m.loISX.cTextLeft) > 0
lcChar = Right( m.loISX.cTextLeft, 1 ) IfIsalpha(m.lcChar) OrIsdigit(m.lcChar) Or m.lcChar == "_"
loISX.cTextLeft = Left( m.loISX.cTextLeft, Len(m.loISX.cTextLeft)-1 )
loISX.cName = m.lcChar + m.loISX.cName Else Exit Endif Enddo Endif
*-------------------------------------------------------------------------------------- * Determines the name of the entity. This code is courtesy of Sietse Wijnkler. *-------------------------------------------------------------------------------------- DoWhileLen(m.loISX.cTextLeft) > 0
lcChar = Right( m.loISX.cTextLeft, 1 ) IfIsalpha(m.lcChar) OrIsdigit(m.lcChar) Or m.lcChar == "_"Or m.lcChar == "."
loISX.cTextLeft = Left( m.loISX.cTextLeft, Len(m.loISX.cTextLeft)-1 )
loISX.cEntity = m.lcChar + m.loISX.cEntity Else Exit Endif Enddo IfRight(loISX.cEntity,1) == "."
loISX.cEntity = Left( m.loISX.cEntity, Len(m.loISX.cEntity)-1 ) Endif
*-------------------------------------------------------------------------------------- * Get data from each provider and merge it into the list *-------------------------------------------------------------------------------------- LocallaAll[1], lnAll, laRequest[1], lnRequest, lnProvider
lnAll = 0 For lnRequest=1 ToAlines(laRequest,Chrtran(m.lcProviders,",",Chr(13)+Chr(10)),.T.) For lnProvider=1 ToAlen(laProvider,1) IfUpper(Alltrim(laRequest[m.lnRequest])) == laProvider[m.lnProvider,1]
loISX.nCount = 0 Dimension loISX.aList[1]
loISX.aList = ""
&laProvider[m.lnProvider,2](m.loISX) If m.loISX.nCount > 0 DimensionlaAll[m.lnAll+m.loISX.nCount] Acopy(m.loISX.aList,laAll,1,m.loISX.nCount, m.lnAll+1)
lnAll = m.lnAll + m.loISX.nCount Endif Endif Endfor Endfor
*-------------------------------------------------------------------------------------- * If there's anything in the list, display the popup *-------------------------------------------------------------------------------------- If m.lnAll == 0 IfNotEmpty(m.tcInvocation) ClearTypeahead Keyboard"{Mouse}"+m.tcInvocation Plain Endif Else IfNotEmpty(m.tcInvocation)
InsertText( m.lnWHandle, m.tcInvocation ) Endif
loISX.nCount = m.lnAll Dimension loISX.aList[loISX.nCount] Acopy(laAll,loISX.aList)
DisplayPopup(loISX) Endif
Endproc
*======================================================================================== * Determines all include files that fit in the current situation and adds them to the * list. *======================================================================================== Procedure CP_Defines Lparameters toISX
*======================================================================================== * Adds all constants from an include file to the array. *======================================================================================== Procedure ReadDefines Lparameter toISX, tcFile
*-------------------------------------------------------------------------------------- * File must exist. *-------------------------------------------------------------------------------------- IfNotFile(m.tcFile) Return Endif
*-------------------------------------------------------------------------------------- * To increase performance, we cache files if possible. *-------------------------------------------------------------------------------------- LocallaDefine[1], lnItem, lnCount IfNot IsInCache("DEFINE", m.toISX, m.tcFile ) IfVersion(4) >= "07.00"
lnCount = Aprocinfo(laDefine,m.tcFile) Else
lnCount = X6_AProcInfo(@laDefine,m.tcFile) Endif For lnItem=1 To m.lnCount IfUpper(laDefine[m.lnItem,3]) $ "DEFINE,DEFINIR,DÉFINIR"&& Modifié le 17 juin 2005, Th N
toISX.nCount = toISX.nCount + 1 Dimension toISX.aList[toISX.nCount]
toISX.aList[toISX.nCount] = laDefine[m.lnItem,1] Endif Endfor
AddToCache("DEFINE", m.toISX, m.tcFile ) Endif
Endproc
*======================================================================================== * The cache is an array in _SCREEN that holds the name of the file, the time stamp, the * provider ID and the contents of the array. *======================================================================================== Procedure IsInCache Lparameter tcProvider, toISX, tcFile
*======================================================================================== * Adds the current entry to the cache. *======================================================================================== Procedure AddToCache Lparameter tcProvider, toISX, tcFile
Local lnItem _Screen.ISXCache[m.lnLine,1] = m.tcFile+"?"+m.tcProvider _Screen.ISXCache[m.lnLine,2] = Fdate(m.tcFile,1) _Screen.ISXCache[m.lnLine,3] = toISX.nCount _Screen.ISXCache[m.lnLine,4] = "" For lnItem=1 To toISX.nCount _Screen.ISXCache[m.lnLine,4] = _Screen.ISXCache[m.lnLine,4] + ;
toISX.aList[m.lnItem] + Chr(13)+Chr(10) Endfor
Endproc
*==================================================================== * SW: Fills an array with all PEMs for the objectname typed in * Returns the number of PEMs. The object has to exist to work *==================================================================== Procedure CP_Objects Lparameters toISX
Local lnVarCount IfType(toISX.cEntity) = [O] IfVersion(4) >= "07.00" IfUpper(toISX.cEntity) == "_SCREEN"OrUpper(toISX.cEntity) == "_SCREEN" Return Endif Endif LocallaMembers[1]
toISX.nCount = Amembers(laMembers, Evaluate(toISX.cEntity), 1) **************************************************************************** * Modifié le 20 fevrier 2005 **************************************************************************** *!* FOR m.lnCount = 1 TO toISX.nCount *!* toISX.aList[m.lnCount] = PROPER(laMembers[m.lnCount,1]) *!* NEXT * debut If m.toISX.nCount = 0 Return Endif Dimension toISX.aList[m.toISX.nCount] For m.lnCount = 1 To toISX.nCount
toISX.aList[m.lnCount] = Proper(laMembers[m.lnCount,1]) Next * fin Endif
Endproc
*==================================================================== * SW: Fills an array with all Fields for the cursor typed in. * Returns the number of Fields. The cursor has to be open to work *==================================================================== Procedure CP_Tables Lparameters toISX
Local lnCount, lcName
lcName = Juststem(toISX.cEntity) * November 11, 2004 Modified by Eddy Maue IfOccurs(".",toISX.cEntity)==0 And !"m." == Lower(toISX.cEntity+".") And ; IIF(Used(m.lcName),.T.,; IIF(File(m.lcName+".dbf"),OpenTable(m.lcName),; IIF(File(m.lcName+".qpr"),ExecQuery(m.lcName),OpenView(m.lcName))))
toISX.nCount = Fcount(m.lcName) Dimension toISX.aList[toISX.nCount] For m.lnCount = 1 To toISX.nCount
toISX.aList[m.lnCount] = Proper(Field(m.lnCount, m.lcName)) Next Endif
Endproc
*==================================================================== * Open the table * Eddy Maue * November 11, 2004 * December 15, 2004 * Contribution of Thierry * Before use (m.lcName) in 0 * After Use (m.lcName) AGAIN In 0 *==================================================================== Procedure OpenTable Lparameters lcName Use (m.lcName) AgainIn 0 ReturnUsed(m.lcName) Endproc
*==================================================================== * Open a query *==================================================================== * Eddy Maue * November 11, 2004 *==================================================================== Procedure ExecQuery Lparameters lcName Do (lcName+".qpr") ReturnUsed(lcName) Endproc
*==================================================================== * Open a view *==================================================================== * Eddy Maue * November 11, 2004 *==================================================================== Procedure OpenView Lparameters lcName,lcSafety,lcConsol IfType("_vfp.ActiveProject")="U" .Or. Empty(Dbc()) Return.F. Endif
m.lcSafety = "Set Safety "+Set("safety") SetSafetyOff ListViewsToFile _view.tmp Noconsole If":"+Alltrim(Lower(lcName))+"(" $ Strtran(Lower(Filetostr("_view.tmp"))," ","") Use (lcName) In 0 Endif
&lcSafety ReturnUsed(m.lcName)
*======================================================================================== * Displays a popup with all the values from taList, lets the user incrementally approach * the desired item and inserts it into the editor. *======================================================================================== Procedure DisplayPopup Lparameter toISX
*==================================================================== * Determines the source of the window identified by the passed * WHandle. It returns the following values: * * -1 The window is not an edit window * 0 Command Window * 1 MODIFY COMMAND window * 2 MODIFY FILE window * 8 Menu Designer code window * 10 Method Edit Window in Class or Form Designer * 12 MODIFY PROCEDURE window * * This procedure uses _EdGetEnv() from the FoxTools.Fll to determine * the edit source. Passing an invalid handle causes an exception in * VFP 5 and VFP 3. In VFP 6 this raises an error 2028 (API function * caused an exception). Therefore we return -1 in this case, too. *==================================================================== Procedure GetEditSource Lparameter tnWHandle
*==================================================================== * Returns the WHandle of the current edit window or 0, if no edit * window is available. *==================================================================== Procedure GetCurrentWindow
Local lnWindowOnTop
lnWindowOnTop = _WOnTop() If m.lnWindowOnTop <= 0 Return 0 Endif If GetEditSource( m.lnWindowOnTop ) == -1
lnWindowOnTop = 0 Endif
Return m.lnWindowOnTop
*==================================================================== * Returns the current cursor position in the edit window identified * by the WHandle. On error -1 is returned. *==================================================================== Procedure GetFileCursorPos Lparameters tnWHandle
Local lnCursorPos
lnCursorPos = _EdGetPos( m.tnWHandle )
Return m.lnCursorPos
*==================================================================== * Changes the current cursor position in the edit window identified * by the WHandle. *==================================================================== Procedure SetFileCursorPos Lparameter tnWHandle, tnPosition
_EdSetPos( m.tnWHandle, m.tnPosition )
Endproc
*==================================================================== * Returns the current line of the edit window identified by the * WHandle. The line number is zero based. On Error -1 is returned. *==================================================================== Procedure GetCurrentLine Lparameters tnWHandle
*==================================================================== * Returns the cursor position within the current line of the edit * window identified by the WHandle. The cursor position is 0 based. * On error -1 is returned. *==================================================================== Procedure GetCurrentCol Lparameters tnWHandle
*==================================================================== * Returns the beginning of the specific line in the edit window * identified by WHandle. Returns -1 on error. *==================================================================== Procedure GetLineStart Lparameter tnWHandle, tnLineNo
Local lnLineStart
lnLineStart = _EdGetLPos( m.tnWHandle, m.tnLineNo )
Return m.lnLineStart
*==================================================================== * Returns the text of the specified line in the edit window * identified by the WHandle. A terminating carriage return is * removed. Returns an empty string on error. The line must be zero * based. *==================================================================== Procedure GetLine Lparameters tnWHandle, tnLine
*==================================================================== * Returns the text in the current line that is to the left of the * cursor in the edit window identified by the WHandle. Returns "" on * error. *==================================================================== Procedure GetLineLeftFromCursor Lparameters tnWHandle
*==================================================================== * Inserts text in the edit window identified by WHandle. The text is * stored in tcText, the position is optional. tcOptions can contains * a combination of the following values: * * R The current selection is replaced * B The cursor is positioned at the beginning of the inserted * text. * E (default) The cursor is positioned at the end of the inserted * text. * H The inserted text is highlighted. *==================================================================== Procedure InsertText Lparameters tnWHandle, tcText, tnPosition, tcOptions
*----------------------------------------------------------------- * If a position is passed, Change the current cursor position * accordingly. *----------------------------------------------------------------- IfVartype(m.tnPosition) == "N"
SetFileCursorPos( m.tnWHandle, m.tnPosition ) Endif
*----------------------------------------------------------------- * Insert the Text at the current position. If the "R" option is * used, delete the current selection. *----------------------------------------------------------------- Local lnStartPosition, lnEndPosition If"R" $ m.lcOptions
_EdDelete( m.tnWHandle ) Endif
lnStartPosition = GetFileCursorPos( m.tnWHandle )
_EdInsert( m.tnWHandle, m.tcText, Len(m.tcText) )
lnEndPosition = GetFileCursorPos( m.tnWHandle )
*----------------------------------------------------------------- * Set the cursor accordingly. "E" is the default of VFP. We don't * need any action for that. *----------------------------------------------------------------- DoCase Case"B" $ m.lcOptions
SetFileCursorPos( m.tnWHandle, m.lnStartPosition ) Case"H" $ m.lcOptions
_EdSelect( m.tnWHandle, m.lnStartPosition, m.lnEndPosition ) Endcase
Endproc
*======================================================================================== * Fills an array with all variable declarations in the current procedure of the edit * window identified by the WHandle. Variable declarations are only searched backward from * the current position. Returns the number of variables. * *! 2004-10Oct-19 ChrisW * Added support for variables with non-english characters such as "ö". * In VFP 9 the array limitation has been lifted. *======================================================================================== Procedure CP_Variables Lparameters toISX
*-------------------------------------------------------------------------------------- * Check if the current entity is a variable *-------------------------------------------------------------------------------------- Local llIsVariable DoCase CaseUpper(toISX.cEntity)=="M"
llIsVariable = .T. CaseEmpty(m.toISX.cEntity) IfEmpty(toISX.cInvocation)
llIsVariable = .T. Else
llIsVariable = .F. Endif Otherwise
llIsVariable = .F. Endcase IfNot m.llIsVariable Return Endif
*----------------------------------------------------------------- * Get the current line as a starting point. We start with the line * before that line. *----------------------------------------------------------------- Local lnEnd
lnEnd = GetCurrentLine( toISX.nWHandle ) If lnEnd <= 0 Return Else
lnEnd = m.lnEnd - 1 Endif
*----------------------------------------------------------------- * Because GetLine() is quite slow with large program files, we * read the entire program up to the line before the current line * into an array and parse that. Since an array can only contain * up to 65000 lines, we make sure that we don't read more than * that into the laText array. *----------------------------------------------------------------- Local lnLineCount, laText[1], lnStart If m.lnEnd >= 65000 AndVersion(4) < "09.00"
lnStart = m.lnEnd - 65000 Else
lnStart = 0 Endif
lnLineCount = AGetLines(m.toISX.nWHandle,@laText,m.lnStart,m.lnEnd)
*-------------------------------------------------------------------------------------- * Parse all lines backwards for the following keywords: LOCAL, * PUBLIC, PROCEDURE, FUNCTION. We add all variables in the * LOCAL and PUBLIC lines and stop parsing when we find PROCEDURE * or FUNCTION. *-------------------------------------------------------------------------------------- Local lnCurrentLine, lcLine, lnPos, laDeclarations[1], lcCommand, ;
lnCurrentVar, lcCurrentVar, lnPosInVar, lnLineOffset, ;
lcChar
For lnCurrentLine = m.lnLineCount To 1 Step -1
lcLine = NormalizeLine( laText[m.lnCurrentLine] ) IfLen(m.lcLine) < 4 Loop Endif
*======================================================================================== * Returns .T., when the first string is a FoxPro command. *======================================================================================== Procedure IsFoxProCommand Lparameter tcCommand, tcCommandList
*==================================================================== * Normalizes a line. This means: All tabs are converted to single * blanks, leading or trailing blanks are removed. Comments starting * with && are removed. *==================================================================== Procedure NormalizeLine Lparameters tcLine
*==================================================================== * GetKeyLabel takes the parameters passed to the KeyPress event and * returns the label name that can be used for KEYBOARD or ON KEY * LABEL, etc. *==================================================================== Procedure GetKeyLabel Lparameter tnKeyCode, tnSAC
Local lcLabel DoCase CaseBetween(m.tnKeyCode,33,126)
lcLabel = Chr(m.tnKeyCode) CaseBetween(m.tnKeyCode,128,255)
lcLabel = Chr(m.tnKeyCode) Case m.tnSAC == 2 AndBetween(m.tnKeyCode,1,26) DoCase Case m.tnKeyCode == 2
lcLabel = "CTRL+RIGHTARROW" Case m.tnKeyCode == 8
lcLabel = "" Case m.tnKeyCode == 10
lcLabel = "CTRL+ENTER" Case m.tnKeyCode == 23
lcLabel = "CTRL+END" Case m.tnKeyCode == 26
lcLabel = "CTRL+LEFTARROW" Otherwise
lcLabel = "CTRL+" + Chr(m.tnKeyCode+64) Endcase Case m.tnSAC == 0 And m.tnKeyCode < 0
lcLabel = "F" + Alltrim(Str(Abs(m.tnKeyCode)+1)) Case m.tnSAC == 0 And m.tnKeyCode == 22
lcLabel = "INS" Case m.tnSAC == 1 And m.tnKeyCode == 22
lcLabel = "SHIFT+INS" Case m.tnSAC == 0 And m.tnKeyCode == 1
lcLabel = "HOME" Case m.tnSAC == 0 And m.tnKeyCode == 7
lcLabel = "DEL" Case m.tnSAC == 0 And m.tnKeyCode == 28
lcLabel = "F1" Case m.tnSAC == 0 And m.tnKeyCode == 6
lcLabel = "END" Case m.tnSAC == 0 And m.tnKeyCode == 18
lcLabel = "PGUP" Case m.tnSAC == 0 And m.tnKeyCode == 3
lcLabel = "PGDN" Case m.tnSAC == 0 And m.tnKeyCode == 5
lcLabel = "UPARROW" Case m.tnSAC == 0 And m.tnKeyCode == 28
lcLabel = "F1" Case m.tnSAC == 0 And m.tnKeyCode == 24
lcLabel = "DNARROW" Case m.tnSAC == 0 And m.tnKeyCode == 4
lcLabel = "RIGHTARROW" Case m.tnSAC == 0 And m.tnKeyCode == 19
lcLabel = "LEFTARROW" Case m.tnSAC == 0 And m.tnKeyCode == 27
lcLabel = "ESC" Case m.tnSAC == 0 And m.tnKeyCode == 13
lcLabel = "ENTER" Case m.tnSAC == 0 And m.tnKeyCode == 127
lcLabel = "BACKSPACE" Case m.tnSAC == 0 And m.tnKeyCode == 9
lcLabel = "TAB" Case m.tnSAC == 0 And m.tnKeyCode == 32
lcLabel = "SPACEBAR" Case m.tnSAC == 1 And m.tnKeyCode == 13
lcLabel = "SHIFT+ENTER" Case m.tnSAC == 1 And m.tnKeyCode == 127
lcLabel = "SHIFT+BACKSPACE" Case m.tnSAC == 1 And m.tnKeyCode == 15
lcLabel = "SHIFT+TAB" Case m.tnSAC == 1 And m.tnKeyCode == 32
lcLabel = "SHIFT+SPACEBAR" Case m.tnSAC == 2 And m.tnKeyCode == 29
lcLabel = "CTRL+HOME" Case m.tnSAC == 2 And m.tnKeyCode == 31
lcLabel = "CTRL+PGUP" Case m.tnSAC == 2 And m.tnKeyCode == 30
lcLabel = "CTRL+PGDN" Case m.tnSAC == 2 And m.tnKeyCode == 128
lcLabel = "CTRL+BACKSPACE" Case m.tnSAC == 2 And m.tnKeyCode == 32
lcLabel = "CTRL+SPACEBAR" Otherwise
lcLabel = "" Endcase
Return m.lcLabel
*==================================================================== * Fills an array with all lines between nStart and nEnd. *==================================================================== Procedure AGetLines Lparameter tnWHandle, raText, tnStart, tnEnd
*----------------------------------------------------------------- * Copy the text between nStart and nEnd into a string variable. *----------------------------------------------------------------- Local lnStartPos, lnEndPos, lcString
lnStartPos = GetLineStart( m.tnWHandle, m.tnStart )
lnEndPos = GetLineStart( m.tnWHandle, m.tnEnd+1 ) - 1
lcString = _EdGetStr( m.tnWHandle, m.lnStartPos, m.lnEndPos )
*----------------------------------------------------------------- * And parse this into an array *----------------------------------------------------------------- Local lnCount
lnCount = Alines( raText, m.lcString )
Return m.lnCount
*==================================================================== * The FoxTools function _AGetEnv() doesn't return proper font infor- * mation. Instead it claims that "MS Sans Serif", 8 pt. is the * current font. This function returns font information for the speci- * fied window by accessing the GDI. *==================================================================== Procedure WGetFontInfo Lparameter tnWHandle, rcFontName, rnFontSize, rnStyle
*----------------------------------------------------------------- * In addition to the window handle of this window we also need * the HWND of the child window that contains the actual editor. * The GetClientWindow() function retrieves this window handle. *----------------------------------------------------------------- Local lnHWND
lnHWND = GetClientWindow( m.tnWHandle ) If m.lnHWND == 0 Return.F. Endif
*----------------------------------------------------------------- * Using this HWND we can then get a Device Context. *----------------------------------------------------------------- Local lnHWND, lnHDC DeclareLong GetDC In Win32API Long
lnHDC = GetDC( m.lnHWND ) If m.lnHDC == 0 Return.F. Endif
*----------------------------------------------------------------- * With this device context we can now get an object handle to the * currently selected font. *----------------------------------------------------------------- Local lnHFONT DeclareLong GetCurrentObject In Win32API Long, Long
lnHFONT = GetCurrentObject( m.lnHDC, 6 ) && OBJ_FONT If m.lnHFONT == 0 Return.F. Endif
*----------------------------------------------------------------- * The HFONT handle to the current font can be used to obtain more * detailled information about the selected font. We need to rename * the API function GetObject(), because it interferes with VFP's * GETOBJECT() function *----------------------------------------------------------------- Local lcLogFont DeclareIntegerGetObjectIn Win32API As GDI_GetObject ; LONG, Integer, String@
lcLogFont = Replicate( Chr(0), 1024 ) If GDI_GetObject( m.lnHFONT, 1024, @lcLogFont ) == 0 Return.F. Endif
*----------------------------------------------------------------- * Now to extract the font information from the LOGFONT structure. *----------------------------------------------------------------- Local lnSize, lcName, lnStyle
lnSize = Abs( FromInt(Left(m.lcLogFont,4)) - 2^32 )
lcName = Substr( m.lcLogFont, 29 )
lcName = Left( m.lcName, At(Chr(0),m.lcName)-1 )
lnStyle = 0 If FromInt(Substr(m.lcLogFont,17,4)) == 700
lnStyle = m.lnStyle + 1 Endif If FromInt(Substr(m.lcLogFont,21,4)) # 0
lnStyle = m.lnStyle + 2 Endif
*----------------------------------------------------------------- * We now have the height of the font in pixels but what we need * are points. *----------------------------------------------------------------- Local lnResolution DeclareInteger GetDeviceCaps In Win32API Integer, Integer
lnResolution = GetDeviceCaps( m.lnHDC, 90 ) && LOGPIXELSY
lnSize = m.lnSize / m.lnResolution * 72
lnSize = Round( m.lnSize, 0 )
*----------------------------------------------------------------- * Finally release the device context *----------------------------------------------------------------- DeclareInteger ReleaseDC In Win32API Long, Long
ReleaseDC( m.lnHWND, m.lnHDC )
*----------------------------------------------------------------- * And pass the values pack as parameters *-----------------------------------------------------------------
rcFontName = m.lcName
rnFontSize = m.lnSize
rnStyle = m.lnStyle
Return.T.
*==================================================================== * The editor only works on the editor window and you can only get the * HWND of this window using the Window Handle. For many Windows ope- * rations, however, you need the HWND of the child window that con- * tains the actual editor area. This function returns the HWND of * this window. It's not that easy, because Method snippet windows * actually have two child windows, one for the text editor and one * with the method and object dropdown combos. *==================================================================== Procedure GetClientWindow Lparameter tnWHandle
*----------------------------------------------------------------- * Convert the Window Handle into a HWND *----------------------------------------------------------------- Local lnHWND
lnHWND = _WhToHWND( m.tnWHandle )
*----------------------------------------------------------------- * FindWindowEx returns all child windows of a given parent window. * We use it to find a child of the edit window that doesn't have * another child window, because method edit windows have a second * which we can identify since it has another child window. *----------------------------------------------------------------- Local lnChild DeclareInteger FindWindowEx In Win32API ; Integer, Integer, String, String
lnChild = 0 DoWhile.T.
lnChild = FindWindowEx( m.lnHWND, m.lnChild, Null, Null ) If m.lnChild == 0 Exit Endif If FindWindowEx( m.lnChild, 0, Null, Null ) == 0 Exit Endif Enddo
Return m.lnChild
*==================================================================== * Returns the position of the text cursor (caret) in _SCREEN coordi- * nates. If the window identified by the passed window handle doesn't * have the focus, or the position can't be determined, this function * returns .F. *==================================================================== Procedure GetCaretPosition Lparameter tnWHandle, rnTop, rnLeft
*----------------------------------------------------------------- * Check whether this window has got the focus. *----------------------------------------------------------------- DeclareInteger GetFocus In Win32API If GetFocus() # _WhToHWND( m.tnWHandle ) Return.F. Endif
*----------------------------------------------------------------- * Determine the cursor position. This position is relative to the ** OK * client area of the editing subwindow of the actual editing win- * dow. *----------------------------------------------------------------- Local lnLeft, lnTop, lcPOINT DeclareInteger GetCaretPos In Win32API String@
lcPOINT = Space(8) If GetCaretPos( @lcPOINT ) == 0
lnLeft = Mcol(3)
lnTop = Mrow(3) Else
lnLeft = Asc(Left(m.lcPOINT,1))+256*Asc(Substr(m.lcPOINT,2,1))
lnTop = Asc(Substr(m.lcPOINT,5,1))+256*Asc(Substr(m.lcPOINT,6,1)) Endif
*----------------------------------------------------------------- * To convert this postion to _SCREEN coordinates, we have to * determine the position of the client window relative to the * desktop window and correlate this with the absolute position of * the _SCREEN window. Hence, we need first the HWNDs of both * windows. *----------------------------------------------------------------- Local lnChild, lnScreen DeclareInteger GetParent In Win32API Integer
lnChild = GetClientWindow( m.tnWHandle ) If m.lnChild == 0 Return.F. Endif
lnScreen = GetParent( _WhToHWND(m.tnWHandle) ) If m.lnScreen == 0 Return.F. Endif
*----------------------------------------------------------------- * Now we can determine the position of both windows. *----------------------------------------------------------------- Local lnChildTop, lnChildLeft, lnScreenTop, lnScreenLeft, lcRect
lcRect = Replicate( Chr(0), 16 ) DeclareInteger GetWindowRect In Win32API Long, String@
GetWindowRect( m.lnChild, @lcRect )
lnChildLeft = FromInt( Left(m.lcRect,4) )
lnChildTop = FromInt( Substr(m.lcRect,5,4) )
GetWindowRect( m.lnScreen, @lcRect )
lnScreenLeft = FromInt( Left(m.lcRect,4) )
lnScreenTop = FromInt( Substr(m.lcRect,5,4) )
*----------------------------------------------------------------- * Now combine the position of the edit window and the cursor * position. *-----------------------------------------------------------------
rnLeft = m.lnLeft + m.lnChildLeft - m.lnScreenLeft
rnTop = m.lnTop + m.lnChildTop - m.lnScreenTop
Endproc
Procedure FromInt
Parameter tcString Private nValue, nT
nValue =0 For nT = 1 ToLen(tcString)
nValue = nValue + Asc(Substr(tcString,nT,1))*256^(nT-1) Endfor Return nValue
*==================================================================== * The following class displays a popup window at the current cursor * position and lets the user continue to type. * * The characters a-z, A-Z, 0-9 and _ are inserted into the active * edit window as the user types. The previous position is saved in * order to restore the text if necessary. * * ESC terminates the popup and doesn't change the text. * * TAB inserts the current selection and terminates the popup. * * SPACEBAR inserts the current selection, adds a blank and terminates * the popup. * * Any other key terminates the popup and is repeated so it is handled * properly by VFP. If the user enters the first character that * doesn't match an item in the list, or entered a full item where * none exists that has the same name, but additional characters, the * list is terminated as well. * *==================================================================== DefineClass isxForm AsForm
*==================================================================== * When the form is initialized, we have to determine its position * and get a handle to the current edit window. Pass an array to this * form that contains all possible values the user can enter. *==================================================================== ProcedureInit Lparameter toISX WithThis
*----------------------------------------------------------------- * Get the handle for the current window. *-----------------------------------------------------------------
.nWHandle = toISX.nWHandle
.nCurrentPos = GetFileCursorPos( .nWHandle )
*----------------------------------------------------------------- * Copy the array and sort it case-insensitive *----------------------------------------------------------------- LocallaValues[1], lnValue IfVersion(4) >= "07.00" Asort( toISX.aList, -1, -1, 0, 1 ) Else DimensionlaValues[toISX.nCount,2] For lnValue = 1 To toISX.nCount laValues[m.lnValue,1] = Upper(toISX.aList[m.lnValue]) laValues[m.lnValue,2] = m.lnValue Endfor Asort( laValues, 1 ) Endif
*----------------------------------------------------------------- * The original version of the following few code blocks has been * kindly provided by Louis D. Zelus. I've modified it to match the * rest of the code here. The purpose is to simulate a behavior * in VB. If the variable is inserted via ALT+I, everything already * typed is used to position the list and if the already entered * parts are sufficient to uniquely identify the variablem it's * inserted without displaying the popup at all. All blocks based * on his code start with LDZ. *-----------------------------------------------------------------
*----------------------------------------------------------------- * LDZ: If a variable name has been entered, we highlight it in the * edit window. *----------------------------------------------------------------- Local lnStartPos, lnEndPos, lcInput
lcInput = toISX.cName IfLen(m.lcInput) > 0
lnEndPos = GetFileCursorPos( .nWHandle )
lnStartPos = m.lnEndPos - Len(m.lcInput)
_EdSelect( .nWHandle, m.lnStartPos, m.lnEndPos ) Endif
*----------------------------------------------------------------- * LDZ: Try to find this variable name in the list of variables we * assembled above. If we find it, we select this entry and save * what has been entered so far. *----------------------------------------------------------------- Local lnIndex IfLen(m.lcInput) > 0
lnIndex = At( ":"+Upper(m.lcInput), .cVarString ) If m.lnIndex == 0
.isxList.ListIndex = 0 Else
.isxList.ListIndex = (m.lnIndex/129) + 1 Endif
.cSearchString = m.lcInput Endif
*----------------------------------------------------------------- * LDZ: If there's no second instance of this start, accept it * immediately without displaying the popup. The full variable name * is inserted with the proper case at the current position * replacing the selection. *----------------------------------------------------------------- IfLen(m.lcInput) > 0 IfAt( ":"+Upper(m.lcInput), .cVarString, 2 ) == 0 ; andNot m.lnIndex == 0
InsertText( .nWHandle, "", , "R" )
InsertText( .nWHandle, .isxList.List[.isxList.ListIndex,2] ) Return.F. Endif Endif
*----------------------------------------------------------------- * Determine the cursor position in _SCREEN coordinates *----------------------------------------------------------------- Local lnLeft, lnTop IfNot GetCaretPosition( .nWHandle, @lnTop, @lnLeft ) Return.F. Endif
*----------------------------------------------------------------- * As we position the popup BELOW the current line, we need to * know the height of this line in pixels. *----------------------------------------------------------------- Local lnLineHeight, lcFontName, lnFontSize IfNot WGetFontInfo( .nWHandle, @lcFontName, @lnFontSize ) Return.F. Endif
lnLineHeight = Fontmetric( 1, m.lcFontName, m.lnFontSize )
*----------------------------------------------------------------- * We make sure that the popup doesn't move below the VFP window to * keep it visible all the time. If it doesn't fit into the area * below the cursor, we move it upwards. *----------------------------------------------------------------- If m.lnTop + .Height + m.lnLineHeight > _Screen.Height
lnTop = m.lnTop - .Height Else
lnTop = m.lnTop + m.lnLineHeight Endif
lnLeft = m.lnLeft + Fontmetric(6,m.lcFontName,m.lnFontSize)
.Top = m.lnTop
.Left = m.lnLeft
*----------------------------------------------------------------- * If the Up or Down Arrow has been pressed, we do nothing, but * remember that the user scrolled in the list, because this acti- * vates the enter key. *----------------------------------------------------------------- Local llScrolled If m.tnSAC == 0 AndInlist( m.tnKeyCode, 5, 24 )
.Parent.lScrolled = .T. Return Endif
llScrolled = .Parent.lScrolled
.Parent.lScrolled = .F.
*----------------------------------------------------------------- * Determines whether a name qualifier has been entered. *----------------------------------------------------------------- Local llQualifier
llQualifier = .F. If m.tnSAC == 0 AndBetween(m.tnKeyCode,Asc("a"),Asc("z"))
llQualifier = .T. Endif If m.tnSAC == 1 AndBetween(m.tnKeyCode,Asc("A"),Asc("Z"))
llQualifier = .T. Endif If m.tnSAC == 0 AndBetween(m.tnKeyCode,Asc("0"),Asc("9"))
llQualifier = .T. Endif *!* If m.tnSAC == 1 And m.tnKeyCode == Asc("_") If m.tnSAC == 0 And m.tnKeyCode == Asc("_")
llQualifier = .T. Endif
*----------------------------------------------------------------- * If a qualifier has been entered, we insert the character into * the current edit window. We also perform an incremental search * on the Text being inserted. *----------------------------------------------------------------- Local lcSearch, lnIndex If m.llQualifier
lcSearch = .Parent.cSearchString + Chr(m.tnKeyCode) Endif
*----------------------------------------------------------------- * BACKSPACE deletes the last character. *----------------------------------------------------------------- If m.tnSAC == 0 And m.tnKeyCode == 127 IfLen(.Parent.cSearchString) > 0
lcSearch = .Parent.cSearchString
lcSearch = Left( m.lcSearch, Len(m.lcSearch)-1 )
llQualifier = .T. Endif Endif
*----------------------------------------------------------------- * Now that we handled BACKSPACE, we can update the variable name * in the edit window. *----------------------------------------------------------------- If m.llQualifier
InsertText( .Parent.nWHandle, m.lcSearch, , "RH" )
lnIndex = At( ":"+Upper(m.lcSearch), .Parent.cVarString ) If m.lnIndex == 0
.ListIndex = 0 Else
.ListIndex = (m.lnIndex/129) + 1 Endif
.Parent.cSearchString = m.lcSearch Nodefault Return Endif
*----------------------------------------------------------------- * The following flags determine how to procede. *----------------------------------------------------------------- Local lcTextToInsert, llResendKey, llClearInput
lcTextToInsert = ""
llResendKey = .T.
llClearInput = .F. DoCase
*----------------------------------------------------------------- * If TAB has been pressed, insert the current selection and * release the popup *----------------------------------------------------------------- Case m.tnSAC == 0 And m.tnKeyCode == 9 And .ListIndex > 0
lcTextToInsert = .List[.ListIndex,2]
llResendKey = .F.
llClearInput = .T.
*----------------------------------------------------------------- * If ENTER has been pressed after the user made a selection with * the arrow keys, we insert the current selection and release the * popup, because after scrolling the user has the feeling of using * a plain listbox where enter performs a selection. *----------------------------------------------------------------- Case m.tnSAC == 0 ; and m.tnKeyCode == 13 ; and .ListIndex > 0 ; and m.llScrolled
lcTextToInsert = .List[.ListIndex,2]
llResendKey = .F.
llClearInput = .T.
*----------------------------------------------------------------- * Several keys insert the current selection plus the typed * character and release the popup. These are usually keys that * directly follow a variable name. *----------------------------------------------------------------- CaseInlist(m.tnKeyCode, ; Asc(" "), Asc(")"), Asc("["), Asc("."), Asc("="), ; Asc("+"), Asc("-"), Asc("*"), Asc("/"), Asc("%"), ; Asc(","), Asc("]") ;
) And .ListIndex > 0
lcTextToInsert = .List[.ListIndex,2]
llClearInput = .T.
*----------------------------------------------------------------- * If ESC has been pressed, the text is unselected. *----------------------------------------------------------------- Case m.tnSAC == 0 And m.tnKeyCode == 27
llResendKey = .F.
*----------------------------------------------------------------- * terminate the popup for any other key and leave the text. *----------------------------------------------------------------- Otherwise Endcase
*----------------------------------------------------------------- * If the currently entered Text should be deleted, insert an empty * string using the replace option. Insert text afterwards. *----------------------------------------------------------------- If m.llClearInput
InsertText( .Parent.nWHandle, "", , "R" ) Else
SetFileCursorPos( ;
.Parent.nWHandle, ;
.Parent.nCurrentPos + Len(.Parent.cSearchString) ;
) Endif IfNotEmpty( m.lcTextToInsert )
InsertText( .Parent.nWHandle, m.lcTextToInsert ) Endif
*----------------------------------------------------------------- * Close the form. *----------------------------------------------------------------- Nodefault Thisform.Release()
*----------------------------------------------------------------- * And repeat the keystroke if necessary *----------------------------------------------------------------- Local lcKey If m.llResendKey
lcKey = GetKeyLabel( m.tnKeyCode, m.tnSAC ) IfNotEmpty(m.lcKey) ClearTypeahead IfLen(m.lcKey) == 1 Keyboard m.lcKey Else Keyboard"{"+m.lcKey+"}" Endif Endif Endif
Endwith Endproc
*==================================================================== * Double-clicking is the same as TAB. *==================================================================== Procedure isxList.DblClick
ClearTypeahead Keyboard"{Tab}"Plain
Endproc
Enddefine
*======================================================================================== * VFP 6: Returns a specific word in a string *======================================================================================== Function X6_GetWordNum Lparameter tcString, tnWord, tcDelimiter
Local lcString, lcDelimiter, lnWord, laWords[1], lnFound, lcWord
*======================================================================================== * VFP 6: Returns a list of all defines *======================================================================================== Procedure X6_AProcInfo Lparameter taArray, tcFile
Enddefine&& ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ tmrTask As Timer
Commentaires
le 15/12/2004, Thierry a écrit : Merci Eddy, j'utilise ISX avec l'ouverture automatique des tables.
Il y a un problème lorqu'on a préalablement ouvert une table avec un nom d'alias. Exemple : use client alias client1 puis dans un PRG : client. --> ERREUR dans ISX.
Je propose donc cette petite modification :
Procedure OpenTable Lparameters lcName Use (m.lcName) AGAIN In 0 Return Used(m.lcName) ENDPROC
le 21/12/2004, Luc a écrit : IsX est un super complément (c'est étonnant que ces fonctionnalités ne soient pas implantées d'origine dans Fox).
J'ai eu un problème avec les variables comportant des caractères accentués, qiIsX tronque malheureusement pour les variables francophones.
Je propose de modifier lcValidChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_" en : lcValidChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_" + Upper("éùèçàù")
dans la procédure CP_Variables.
le 21/12/2004, Luc a écrit : Encore une petite chose pour que IsX fonctionne avec les instructions #Define en version française :
Dans "Procedure ReadDefines", on peut remplacer If laDefine[m.lnItem,3] == "Define" par If laDefine[m.lnItem,3] == "Define" ; .or. laDefine[m.lnItem,3] == "Definir"
J'ai apporté des modifications à la procédure CP_Variables pour - gérer les procédures HIDDEN et PROTECTED - inclure les tableaux déclarés par LOCAL ARRAY à la liste des variables. Peux-tu les intégrer ?
Remplacer * ======================== If IsFoxProCommand( m.lcCommand, "PROCEDURE,FUNCTION" ) Exit Endif If Not IsFoxProCommand(m.lcCommand,"LOCAL,PUBLIC,LPARAMETERS,PARAMETERS,PRIVATE") Loop Endif * ========================
par
* ======================== If IsFoxProCommand (m.lcCommand, "PROCEDURE,FUNCTION,HIDDEN,PROTECTED") Exit ENDIF If not IsFoxProCommand(m.lcCommand,"LOCAL,PUBLIC,PRIVATE,LPARAMETERS,PARAMETERS") Loop Endif IF m.lcCommand =="LOCAL" ; AND Iif(Version(4) >= "07.00", GetWordNum(m.lcLine, 2), X6_GetWordNum(m.lcLine,2)) == "ARRAY" m.lcLine = Strtran(m.lcLine, "ARRAY") ENDIF * ========================
Merci Th N, www.abaqueinside.com
le 30/09/2005, Thierry a écrit : Pour une compatibilté avec le clavier AZERTY. (touche _ )
Remplacer dans la procédure isxList.KeyPress :
If m.tnSAC == 1 And m.tnKeyCode == Asc("_")
par :
If m.tnSAC == 0 And m.tnKeyCode == Asc("_")
le 30/09/2005, Thierry a écrit : Pour pouvoir utiliser les touches Page Up/Down dans la selection des noms, remplacer dans la procédure isxList.KeyPress :
If m.tnSAC == 0 And Inlist( m.tnKeyCode, 5, 24 )
par :
If m.tnSAC == 0 And Inlist( m.tnKeyCode, 5, 24, 3, 18 )
Merci Eddy, j'utilise ISX avec l'ouverture automatique des tables.
Il y a un problème lorqu'on a préalablement ouvert une table avec un nom d'alias.
Exemple :
use client alias client1
puis dans un PRG : client. --> ERREUR dans ISX.
Je propose donc cette petite modification :
Procedure OpenTable
Lparameters lcName
Use (m.lcName) AGAIN In 0
Return Used(m.lcName)
ENDPROC