1 -- Created on: 1996-03-05
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
23 class Act from IFSelect inherits Activator
25 ---Purpose : Act gives a simple way to define and add functions to be ran
26 -- from a SessionPilot, as follows :
28 -- Define a function as
29 -- static IFSelect_RetStatus myfunc
30 -- (const Standard_CString name,
31 -- const Handle(IFSelect_SessionPilot)& pilot)
33 -- When ran, it receives the exact name (string) of the called
34 -- function, and the SessionPilot which brings other infos
37 -- IFSelect_Act::AddFunc (name,help,myfunc);
38 -- for a normal function, or
39 -- IFSelect_Act::AddFSet (name,help,myfunc);
40 -- for a function which is intended to create a control item
41 -- name and help are given as CString
43 -- Then, it is available for run
45 uses CString, AsciiString, SessionPilot, ActFunc, ReturnStatus
51 Create (name, help : CString; func : ActFunc) returns mutable Act;
52 ---Purpose : Creates an Act with a name, help and a function
53 -- mode (Add or AddSet) is given when recording
55 Do (me : mutable; number : Integer; pilot : mutable SessionPilot)
57 ---Purpose : Execution of Command Line. remark that <number> is senseless
58 -- because each Act brings one and only one function
60 Help (me; number : Integer) returns CString;
61 ---Purpose : Short Help for commands : returns the help given to create
63 -- to record functions
65 SetGroup (myclass; group : CString; file : CString = "");
66 ---Purpose : Changes the default group name for the following Acts
67 -- group empty means to come back to default from Activator
68 -- Also a file name can be precised (to query by getsource)
70 AddFunc (myclass; name, help : CString; func : ActFunc)
71 ---Purpose : Adds a function with its name and help : creates an Act then
72 -- records it as normal function
74 -- Error if <name> already recorded (see Activator)
76 AddFSet (myclass; name, help : CString; func : ActFunc)
77 ---Purpose : Adds a function with its name and help : creates an Act then
78 -- records it as function for XSET (i.e. to create control item)
80 -- Error if <name> already recorded (see Activator)
84 thename : AsciiString;
85 thehelp : AsciiString;