Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FindClass. ( MM 7. 0 ) and Visible Project Issue
Message
From
01/07/2004 15:46:40
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
FindClass. ( MM 7. 0 ) and Visible Project Issue
Miscellaneous
Thread ID:
00919824
Message ID:
00919824
Views:
58
If one has the project visible either ‘floating’ on the desktop or dock on the toolbar and the FindClass tool is called the project disappears. Yes it is on the window menu and the developer can ‘re-open’ but it is IMO a pain. The following is my suggestion for an enhancement:

Method: GetLibraryOfClass
Class: CProjectUtils
Class Lib: MMUtils.vcx

Added the Var: llProjectVisible and the call to ( the new method ) This.isProjectVisible
LPARAMETERS tcClass, tcProject
LOCAL llProjectOpen, lnSelect, loVCXObj, llFound, lcName, llProjectVisible

*-- If the project is opened, is it visible --*
llProjectVisible = This.isProjectVisible( tcProject )
Later in the same method added the 2nd parameter to the .ModifyProject( ) method call.
IF llProjectOpen
	This.ModifyProject( tcProject, llProjectVisible )
ENDIF
Method: isProjectVisible ( Added )
Class: CProjectUtils
Class Lib: MMUtils.vcx
*   Library: 	Mmutils.vcx
*   Class: 	Cprojectutils  
*   Method: 	Isprojectvisible() 
*----------------------- Usage Section --------------------------
*)  Description: Will return .f. if project is not open, or not visible
*   Scope:      Protected
*   Parameters: Project Name
*$  Usage:      
*$              
*   Returns:  Logical
*--------------------- Maintenance Section ----------------------
*   Change Log:
*       CREATED 	07/01/04 - ALT
*		MODIFIED
*----------------------------------------------------------------

LPARAMETERS tcProject
 
  ASSERT PCOUNT() = 1 ;
    AND VARTYPE( tcProject ) = [C] ;
    AND NOT EMPTY( tcProject ) ;
  MESSAGE [Incorrect parameter passed to IsProjectVisible( ) ]
   
  
  LOCAL loProject
	
  *-- Attempt to find the project of interest
  *-- and then return the visible status
  FOR EACH loProject IN _VFP.Projects
    IF  UPPER( loProject.Name ) == UPPER( tcProject ) ;
      OR UPPER( JUSTSTEM( loProject.Name ) ) == UPPER( JUSTSTEM( tcProject ) )
		
RETURN loProject.Visible
   ENDIF
		
  NEXT

RETURN .F.  &&-- Default to .f. if project was not found
Method: ModifyProject
Class: CProjectUtils
Class Lib: MMUtils.vcx

Modified the start of the method to handle optional 2nd parameter:
LPARAMETERS tcProject, tlMakeProjectVisible
 
* Code Added 07/01/04 by ALT
  IF PCOUNT( ) = 1
	LOCAL tlMakeProjectVisible
	tlMakeProjectVisible = .f.
  Endif
And Added this IF/ELSE/ENDIF block
*----------------------------------------
*--- If the project isn't open, MODIFY it
*----------------------------------------
IF VARTYPE(This.oProject) != "O"
	
	IF tlMakeProjectVisible
		MODI PROJ (tcProject) NOWAIT
	ELSE
		MODI PROJ (tcProject) NOWAIT NOSHOW
	ENDIF 
	
	This.oProject = Application.ActiveProject
ENDIF
Reply
Map
View

Click here to load this message in the networking platform