973c2be1 |
1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
42cf5bc1 |
14 | |
15 | #include <IFSelect_ContextModif.hxx> |
16 | #include <IFSelect_EditForm.hxx> |
17 | #include <IFSelect_ModifEditForm.hxx> |
18 | #include <Interface_CopyTool.hxx> |
19 | #include <Interface_InterfaceModel.hxx> |
20 | #include <Interface_Protocol.hxx> |
21 | #include <Standard_Type.hxx> |
22 | #include <TCollection_AsciiString.hxx> |
7fd59977 |
23 | |
92efcf78 |
24 | IMPLEMENT_STANDARD_RTTIEXT(IFSelect_ModifEditForm,IFSelect_Modifier) |
25 | |
b311480e |
26 | IFSelect_ModifEditForm::IFSelect_ModifEditForm |
7fd59977 |
27 | (const Handle(IFSelect_EditForm)& editform) |
28 | : IFSelect_Modifier (Standard_False) { theedit = editform; } |
29 | |
30 | Handle(IFSelect_EditForm) IFSelect_ModifEditForm::EditForm () const |
31 | { return theedit; } |
32 | |
33 | |
34 | void IFSelect_ModifEditForm::Perform |
35 | (IFSelect_ContextModif& ctx, |
36 | const Handle(Interface_InterfaceModel)& target, |
35e08fe8 |
37 | const Handle(Interface_Protocol)& /*protocol*/, |
38 | Interface_CopyTool& /*TC*/) const |
7fd59977 |
39 | { |
40 | for (ctx.Start(); ctx.More(); ctx.Next()) { |
41 | Standard_Boolean done = theedit->ApplyData(ctx.ValueResult(),target); |
42 | if (done) ctx.Trace(); |
43 | else ctx.AddWarning (ctx.ValueResult(),"EditForm could not be applied"); |
44 | } |
45 | } |
46 | |
47 | TCollection_AsciiString IFSelect_ModifEditForm::Label () const |
48 | { |
49 | Standard_CString editlab = theedit->Label(); |
50 | TCollection_AsciiString lab ("Apply EditForm"); |
51 | if (editlab && editlab[0] != '\0') { |
52 | lab.AssignCat (" : "); |
53 | lab.AssignCat (editlab); |
54 | } |
55 | return lab; |
56 | } |