Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open multiple methods with Document View
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00687310
Message ID:
00687722
Views:
14
Brian,

Thanks, that should work well for classes that don't contain anything else, but the method name will still need the other name components for methods of contained objects.


>I had a quick minute to tweak, so now this works with a classlib...
>
>
>
* OpenAllMethods.prg 08-Aug-02
>
>* this function opens all overridden methods
>
>local laJunk[1], loOutermost
>
>set step on
>
>=aselobj(laJunk,1)
>
>* filename, [classname] needed inside recursive function
>
>private lcFile, lcClass
>
>lcFile = upper( sys( 1271, laJunk[1] ) )
>
>* find the outermost object
>
>loOutermost = laJunk[1]
>
>if ( "VCX" $ lcFile )
>   do while ( ( type( "loOutermost.parent" ) == "O" ) and ;
>              ( type( "loOutermost.parent.parent.parent" ) == "O" ) )
>      loOutermost = loOutermost.parent
>   enddo
>   lcClass = loOutermost.Name
>else
>   do while ( type( "loOutermost.parent" ) == "O" )
>      loOutermost = loOutermost.parent
>   enddo
>endif
>
>DrillDown( loOutermost )
>return
>
>function DrillDown( loObject )
>
>* find the full containership name
>
>local lcObjectName, loFullname
>
>lcObjectName = ""
>loFullname = loObject
>do while ( type( "loFullname.parent" ) = "O" )
>   lcObjectName = loFullname.Name + "." + lcObjectName
>   loFullname = loFullname.parent
>enddo
>
>* strip off the outermost container
>
>lcObjectName = substr( lcObjectName, at( '.', lcObjectName ) + 1 )
>
>local i, n, laMembers[1], lcMethod
>
>n = amembers( laMembers, loObject, 1, 'C' )
>
>for i = 1 to n
>   if ( laMembers[i,2] $ "Method Event" )
>      lcMethod = lcObjectName + laMembers[i,1]
>* debugout ">" + lcMethod + "<"
>
>
>*      if ( ".SCX" $ lcFile )
>*         modify form (lcFile) nowait method &lcMethod
>*      else
>*         modify class (lcClass) of (lcFile) nowait method &lcMethod
>*      endif
>
>      DO CASE
>         CASE ( ".SCX" $ lcFile )
>            modify form (lcFile) nowait method &lcMethod
>         CASE ( ".VCX" $ lcFile )
>            *-- Strip class from Method
>            lcMethod = JUSTEXT(lcMethod)
>            modify class (lcClass) of (lcFile) nowait method &lcMethod
>         OTHERWISE
>            modify class (lcClass) of (lcFile) nowait method &lcMethod
>      ENDCASE
>
>
>   endif
>endfor
>
>* process contained objects
>
>n = amembers( laMembers, loObject, 2 )
>
>for i = 1 to n
>   DrillDown( evaluate( "loObject." + laMembers[i] ) )
>endfor
>
>return
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform