📄 supercls.txt
字号:
* Program...........: SUPERCLS (Superclass Utility)
* Author............: Ken R. Levy
* Project...........: Supercls
* Created...........: 07/02/1995
* Modified..........: 05/31/1999
* Copyright.........: (Public Domain) Flash Creative Management, Inc., 1995
* Copyright.........: (Public Domain) Ken R. Levy, 1996-1999
* Upgrade information from pre 08/97 versions:
* SuperCls.app is now for Visual FoxPro 6.0 only.
* Tip: Pressing TAB at any time will bring up a dialog to view the current property or
* window to edit the current method/event.
* Tip: Pressing Alt+F10 at any time while the mouse is over an object brings up the
* ObjectX context senstive utility menu.
* Tip: In a startup program for VFP, and in a program that is called after a
* CLEAR ALL, include the following 2 lines to setup SuperCls and IntelliSense:
* DO <path>SuperCls WITH ,,3
* Top: If there is no setting for ON KEY LABEL F2 when SuperCls is started,
* then the following default will be set to fire the IntelliSense dialog:
* ON KEY LABEL F2 DO FORM <path>OLSBldr.scx
* Recommendations:
* The default is for SuperCls to be hooked up via a timer to auto-display when
* a code edit window is activated, and it remains the default for backward
* compatibility. It is suggested that something like the following is used to
* start SuperCls:
* DO <path>SuperCls WITH ,,3
* The two lines above will first run the toolbar with the timer off, so that it
* is always open, which is more important now with the new IntelliSense dialog
* which doesn't require a snippet edit window to be open in order for it to run.
* The second line docks the toolbar to the bottom left corner of the VFP screen,
* which of course is not required or can be any other of the three sides.
* What's New:
* Command completion in the IntelliSense dialog for all VFP language
* commands and functions.
*********
* NOTE: SuperCls.dbf is currently under construction, some commands and functions
* are missing or need to be updated. If you find any missing commands or
* functions, e-mail a list to ken_levy@csi.com
**********
* Clicking the Edit Superclass Method button shows a class tree if more than
* one superclass ocntains code. Rightclicking the Edit Superclass Method
* behaves like previous versions by editing the first parent class containing
* code.
* A new 3rd parameter nDockLocation. If specified (0-3), the timer is disabled and
* the toolbar is docked in that position.
* Example:
* DO <path>SuperCls WITH ,,3
* Tip: Set up a hot key to run the IntelliSense dialog at any time:
* ON KEY LABEL F2 DO FORM <path>OLSBldr
* This will allow typing in the command window something like _screen, then
* press F2, enter .AddObject(<params>) then press ENTER.
* Insert Superclass Method Call Button:
* Instead of just a simple DODEFAULT() and superclass::method insert, this
* button now inserts something like below:
* Click:
* IF NOT DODEFAULT(p1,p2,p3,...)
* RETURN .F.
* ENDIF
* RightClick:
* IF NOT superclass::method(p1,p2,p3,...)
* RETURN .F.
* ENDIF
* Shift-Click:
* LPARAMETERS p1,p2,p3,...
* IF NOT DODEFAULT(p1,p2,p3,...)
* RETURN .F.
* ENDIF
* Shift-RightClick:
* LPARAMETERS p1,p2,p3,...
* IF NOT superclass::method(p1,p2,p3,...)
* RETURN .F.
* ENDIF
* Object Line Syntax Builder (IntelliSense) Button:
* This feature is completely re-written from the previous version.
* The IntelliSense dialog now emulates the behavior found in Visual Basic 5.0
* and VBA in Office 97 which is to automatically detect when a property,
* event, method, or object reference occurs, and to list them in a pick list,
* and if a method is selected, automatically show the parameter list and which
* parameter is currently being edited. The parameter list is automatically
* searched up the class hierarchy so code does not have to be in the instance
* or class referenced.
* When typing, entering a . will automatically attempt to resolve the object
* reference specified, and if an object is found, a listbox will appear with
* all members for that reference. In the listbox mode, the besides using type
* ahead to search the list, press SPACE or double-click the mouse will select
* an item and exit the listbox mode, pressing . will select the item and add a
* . after it in the Line textbox, pressing ( is valid for methods and will
* insert the reference with parameters, then display the parameters in the
* parameters editbox and indicate which parameter is being edited in the line.
* If the line is empty and you are in object reference mode, you can
* right click the editbox to display a list of VFP commands and functions.
* Press Ctrl+W or click the browser close button to select a command or
* function. Press ESC to abort and not select any command or function.
* If the line is empty, you can drag and drop the line editbox onto any object,
* and the target object will become the default reference as indicated in the
* dialog caption. Referring to this. will reference the object the IntelliSense
* dialog is linked to. This is more useful when not launced while in a snippet
* window. If launched while in a snippet window, the object for that snippet
* window will be the referenced object, so this. will refer to the object being
* edited in the Form or Class Designer.
* Pressing ENTER at any time will automatically insert the contents of the Line
* textbox and stuff them into the keyboard for the active window.
* Pressing SPACE at any time will select the current item and append it
* to the line textbox.
* Pressing TAB at any time will bring up a dialog to view the current property or
* window to edit the current method/event.
* After entering an object and the IntelliSense listbox is displayed, always
* after an object reference is entered followed by a ., the DOWNARROW will
* select the first item in the list, while PGDN will select the first object
* reference in the list (top of the second section).
* The IntelliSense listbox will display all properies, events, and methods in
* alphabetically order, followed by a divider line and any objects that are
* contained by that object, and also a parent reference if one exists.
*
* Note: When editing a snippet, clicking the IntelliSense button launches
* the IntelliSense dialog for that object, where THIS references the
* object of the snippet being edited. The VFP command/function feature
* of IntelliSense is disabled.
* Note: When editing a snippet, right clicking the IntelliSense button
* launches the IntelliSense dialog stand alone, with no object reference
* for THIS. The VFP command/function feature of IntelliSense is enabled.
* This rightclick launching mode is the same as pressing F2 or running
* form OLSBldr.scx.
* Parameters for OLSBldr.scx:
* tvObject,tcWindow
* tvObject: If an object is specified, it becomes the relative object (this).
* if a string is speccified, it becomes the default line text.
* tcWindow: Specifies a specific window to ouput the generate string after
* pressing ENTER.
* Examples:
* DO FORM <path>OLSBldr WITH _screen,"Command"
* DO FORM <path>OLSBldr WITH "_screen.AddObject()","Command"
* DO FORM <path>OLSBldr WITH _oBrowser
* Tip: Referencing any global object (or object currently scoped) can be
* entered, like _screen.ActiveForm.Caption, or _screen.Forms[1]., etc.
* Simply run SuperCls.app to initialize. A single public memvar
* referencing the toolbar and also a timer object scoped to _screen will be
* created. Whenever you edit a snippet in the form/class designer, the
* toolbar will automatically be visible. You can insert a
* DODEFAULT() line at the current cursor position (saves typing)
* and you can view the code (if any) of the related superclass method.
* You can simply use it to view, or you can actually modify the
* superclass method code. Even though the VCX record is locked since an
* instance in the designer is open, there is some techniques which works
* that around that limitation. The steps used create a new (temp) VCX
* with the record of the Methods field, add the snippet changes to it, then
* close it, recompile, then take the new compiled ObjCode field and replace
* it in the VCX. Since an instance (child object) is running in memory,
* the memory cache is not cleared at this point, so any new instance
* created won't reflect the method change unless a CLEAR CLASS or CLEAR ALL
* is executed. To save time, the timer holds an array of all classed that
* need to be cleared, and when all designers are closed (ASELOBJ(,1)=0),
* the class are automatically cleared. All you need to do is call
* SuperCls.app on start-up and whenever you CLEAR ALL.
* The SuperCls toolbar automatically detects when the Trace window is active.
* When it is, it makes the toolbar visible, then disables the timer. Then,
* when you finish with the Trace window and close it, just RightClick on the
* toolbar (not the buttons) and it will re-activate the timer.
* Note: The SuperCls toolbar buttons use Wingdings font, which must installed
* for the button pictures to display properly (Wingdings is installed
* by Windows by default).
* Execute SuperCls.app to initialize the Superclass Utility toolbar.
* The toolbar will automatically appear whenever a code snippet window
* is being edited within the Form/Class Designers.
* The toolbar can be released by releasing memvar goSuperclassToolbar or:
* Example: goSuperclassToolbar.Release()
* Tip: The toolbar position can be controlled after SuperCls.app executes:
* Example: goSuperclassToolbar.Dock(0)
* Example: goSuperclassToolbar.Left=0
* Example: goSuperclassToolbar.ControlBox=.T.
*
* Tip: A subclass of Supercls can be used to instead of Supercls:
* Example: Supercls("MySupercls")
* Example: Supercls("MyClassLibrary,MySubclass")
* Example: Supercls("MySupercls",.T.)
* Example: Supercls("MyClassLibrary,MySubclass",.T.)
*
* Tip: The timer used to display the toolbar can be disabled:
* Example: Supercls(,.T.)
* Example: Supercls("MySuperclsSubclass",.T.)
* Warning: The Superclass Utility automatically sets up classes to be
* cleared from memory via CLEAR CLASS after a superclass has been edited.
* The classes are not cleared until after all instances of the Form/Class
* Designers have been closed. Since the automatic clearing of classes is
* controlled by a timer, there is one limitation. When in the Form
* Designer, pressing the Run button will *not* properly let the timer
* clear the modified classes until after the form is executed since the
* timer detectes when ASELOBJ(<array>,1)=0. Timers don't run until after
* the DO FORM executes, so any classes needing to be cleared won't be
* properly cleared since instances will exist in the running form. The
* CLEAR CLASS command only works when no instances of the specified class
* exist in memory. So if methods of a class relating to an object in the
* Form Designer is modified, the Form Designer and all other Form/Class
* Designer windows must be closed before the modified class is cleared
* from the cached memory so that any new instances will reflect the
* change. Instead of pressing the Run toolbar button in the Form Designer
* after making a method change using the Superclass Utility, just close
* the Form Designer and then run the form using DO FORM. Not doing this
* won't cause the change to be lost, but will only prevent the class in
* memory from being cleared properly so that new instances created will
* reflected the modified method(s).
* Note: The class hierarchy is automatically searched to find the first
* superclass that contains code. The edit window name's caption will
* container the string "superclass_" followed by class.method.
* Note: If the object is a member of a container class and that container,
* the class hierarchy is searched and not the parent container.
*
* Note: If you RightClick on the [::] command button, the text inserted
* will be cParentClass::cMethod or cClass::cMethod with the cParentClass
* (or cClass) and cMethod names automatically used based on the class or
* object being edited. Generally DODEFAULT() is the best solution for
* calling the immediate parentclass or class, but this option still
* remains available.
*
* Note: If you RightClick on the [?] help command button, the program name
* and version number is displayed in a WAIT WINDOW.
* -----------------------------------------------------------
* COPYRIGHT NOTICE
* All source code and documentation contained in Supercls were
* developed by Ken R. Levy, 1996-1997, and also at Flash Creative
* Management, Inc., 1995, and has been placed into the public domain.
* You may use, modify, copy, distribute, and demonstrate any source
* code, example programs, or documentation contained in Supercls
* freely without copyright protection. All files contained in
* Supercls are provided 'as is' without warranty of any kind. In no
* event shall its authors, contributors, or distributors be liable
* for any damages.
* COMMENTS/SUGGESTIONS/PROBLEMS/QUESTIONS
* Please use CompuServe's FOXUSER forum (section 3rd Party Products)
* directed to All or to Ken Levy: ken_levy@csi.com
* -----------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -