NCBI C++ ToolKit
macro_cmd_composite.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_OBJUTILS___MACRO_CMD_COMPOSITE__HPP
2 #define GUI_OBJUTILS___MACRO_CMD_COMPOSITE__HPP
3 
4 /* $Id: macro_cmd_composite.hpp 34809 2016-02-16 16:09:37Z asztalos $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Anatoly Osipov
30  *
31  * File Description: Command for combining functions execution for topmost iterator.
32  * Keypoint is that each command executed outside for the first time
33  * because internal command data may depend on the results of previous
34  * command execution.
35  *
36  */
37 
39 
40 /** @addtogroup GUI_MACRO_SCRIPTS_UTIL
41  *
42  * @{
43  */
44 
46 
47 /// implements special composite command, which does not call to its internal commands when run
48 /// the very first time.
49 ///
50 /// This command calls to its internal commands when the command is undone and redone.
51 /// This allows doing modifications step by step while executing macro and
52 /// make undo and redo as a single "atomic" action.
54  public CCmdComposite
55 {
56 public:
57  CMacroCmdComposite(const string& label) : CCmdComposite(label), m_NeverExecuted(true) {}
58 
59  /// @name IEditCommand interface implementation
60  /// @{
61  virtual void Execute();
62  virtual void Unexecute();
63  /// @}
64 protected:
66 };
67 
69 
70 /* @} */
71 
72 #endif // GUI_OBJUTILS___MACRO_CMD_COMPOSITE__HPP
virtual void Unexecute()
Undo (opposite to Execute())
virtual void Execute()
Do the editing action.
implements special composite command, which does not call to its internal commands when run the very ...
#define true
Definition: bool.h:35
CMacroCmdComposite(const string &label)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIOBJUTILS_EXPORT
Definition: gui_export.h:512
static const char label[]
Modified on Fri Sep 20 14:57:44 2024 by modify_doxy.py rev. 669887