home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sams Cobol 24 Hours
/
Sams_Cobol_24_Hours.iso
/
Cobol32
/
PowerGEM
/
Powergem.z
/
SAMPLE.SCP
< prev
next >
Wrap
Text File
|
1996-09-23
|
7KB
|
222 lines
//**********************************************************************
//
// Script Sample Source for 32bit Applications
//
// Specify the following setup items of PowerFRAMEVIEW environment
// for the tool to be incorporated:
//
// - Set Extension
// - Set Tool Class Name
// - Set Install Directory of Tool
// - Set Start up Information of Tool
// - Associate Extensions with Tool
// - Set Menu of Development Manager
//
// Refer to the PowerGEM Plus V1.0 Handbook for details on how to
// incorporate a tool into PowerFRAMEVIEW
//
// ALL Rights Reserved, CopyRight (C) FUJITSU LIMITED 1995,1996
//**********************************************************************
//**********************************************************************
// A public variable can be referred to from other function.
//**********************************************************************
public :
var tool ; // Object ID
var ToolClass = "EDIT";
var Ast_Filespec ;
var Com_Filespec ;
var Com_Term = 0 ; // Terminates flag
exec() {
var Filespec ;
MessageOpen(ToolClass) ; // Open Message Path
Ast_Filespec = MakeFilespec("*", 0) ;
MakeEvent("R", ToolClass, "START", Ast_Filespec, "start") ;
}
//***********************************************************************
// Start callback function is called when a start message is received.
//***********************************************************************
start() {
var Get_MessageID ;
var Filespec ;
var PathName ;
var FileName ;
var CommandLine ;
var SenderToolClass ;
var MessageType ;
var ToolClassName ;
var CommandName ;
var Data ;
var Originator ;
Get_MessageID = GetMessageID();
Filespec = GetFilespec();
if(Com_filespec == Filespec)
{
ActivateWindow(tool) ;
MessageSend(Get_MessageID, "N", ToolClass, "START",Filespec) ;
return(TRUE);
}
Com_Filespec = Filespec ;
SenderToolClass = GetSenderToolClass() ;
MessageType = GetMessageType() ;
ToolClassName = GetToolClass() ;
CommandName = GetCommand() ;
Data = GetData(1) ;
Originator = GetOriginator();
//***********************************************************************
// Register start callback function for Filespec.
//***********************************************************************
DeleteEvent("R", ToolClass, "START", Ast_Filespec) ;
MakeEvent("R", ToolClass, "START", Com_Filespec, "start") ;
//***********************************************************************
// Register following callback function for Filespec.
// - STOP : Stop Tool
// - MAXIMIZE : Minimize a window
// - MINIMIZE : Maximize a window
// - NORMALIZE : Normalize a window
//***********************************************************************
MakeEvent("R", ToolClass, "STOP" , Com_Filespec, "stop" ) ;
MakeEvent("R", ToolClass, "MAXIMIZE" , Com_Filespec, "maximize" ) ;
MakeEvent("R", ToolClass, "MINIMIZE" , Com_Filespec, "minimize" ) ;
MakeEvent("R", ToolClass, "NORMALIZE", Com_Filespec, "normalize" ) ;
//***********************************************************************
// Use cat function, When Tool concatenates parameters (the specified
// character strings).
// CommandLine = cat("parameters", PathName) ;
//***********************************************************************
PathName = FilespecToPathName(Com_Filespec) ;
//***********************************************************************
// Start the tool
// Change file name (SAMPLE.EXE) for specified tool
// ex. tool = ToolExecEX("NOTEPAD.EXE",PathName,TRUE);
//***********************************************************************
tool = ToolExecEX("SAMPLE.EXE",PathName,TRUE);
if( IsNULL(tool) ) {
MessageSend(Get_MessageID, "F", ToolClass, "START" , Com_Filespec);
MessageSend(MakeMessageID(), "N", ToolClass, "STATUS",
Com_Filespec, "NOTRUNNING") ;
del_event();
Com_Term = 1 ;
MessageClose();
Close();
return(0);
}
MessageSend(MakeMessageID(), "N", ToolClass, "STATUS",
Filespec, "STARTING") ;
MessageSend(MakeMessageID(), "N", ToolClass, "STATUS", Filespec, "READY") ;
MessageSend(Get_MessageID, "N", ToolClass, "START", Filespec) ;
}
//***********************************************************************
// Stop callback function is called when a stop message is received.
//***********************************************************************
stop() {
var Filespec ;
var ToolID ;
SCRIPT.ErrorDisplay = False ;
ToolID = closewindow(tool);
SCRIPT.ErrorDisplay = True ;
Filespec = GetFilespec();
MessageSend(MakeMessageID(), "N", ToolClass, "STATUS",
Filespec, "NOTRUNNING") ;
MessageSend(GetMessageID(), "N", ToolClass, "STOP", Filespec) ;
del_event() ;
MessageClose();
Com_Term = 1 ;
Close();
}
//***********************************************************************
// Maximize callback function is called when a maximize message is received.
//***********************************************************************
maximize() {
MaximizeWindow(tool) ;
ActivateWindow(tool) ;
MessageSend(GetMessageID(), "N", ToolClass, "MAXIMIZE",
GetFilespec());
}
//***********************************************************************
// Minimize callback function is called when a minimize message is received.
//***********************************************************************
minimize() {
MinimizeWindow(tool) ;
ActivateWindow(tool) ;
MessageSend(GetMessageID(), "N", ToolClass, "MINIMIZE",
GetFilespec());
}
//***********************************************************************
// Normalize callback function is called when a normalize message is received.
//***********************************************************************
normalize() {
RestoreWindow(tool) ;
ActivateWindow(tool) ;
MessageSend(GetMessageID(), "N", ToolClass, "NORMALIZE",
GetFilespec());
}
//***********************************************************************
// Terminate callback function is called when a Terminate message is received.
// The following operation or function causes Terminate message
// - Close Icon of Maro Manager
// - Call Close function in Script
//***********************************************************************
Terminate() {
if(Com_Term != 0) {
Return(0);
}
SCRIPT.ErrorDisplay = False ;
closewindow(tool);
SCRIPT.ErrorDisplay = True ;
MessageSend(MakeMessageID(), "N", ToolClass, "STATUS",
Com_Filespec, "NOTRUNNING") ;
MessageSend(MakeMessageID(), "N", ToolClass, "STOP", Com_Filespec) ;
del_event() ;
MessageClose();
Com_Term = 1 ;
Close() ;
}
//******************************************************************
// Deletes a message pattern
//******************************************************************
del_event() {
DeleteEvent("R", ToolClass, "START" , Com_Filespec) ;
DeleteEvent("R", ToolClass, "STOP" , Com_Filespec) ;
DeleteEvent("R", ToolClass, "MAXIMIZE" , Com_Filespec) ;
DeleteEvent("R", ToolClass, "MINIMIZE" , Com_Filespec) ;
DeleteEvent("R", ToolClass, "NORMALIZE", Com_Filespec) ;
}