1 /***********************************************************************/
2 /* Open Visualization Data Explorer                                    */
3 /* (C) Copyright IBM Corp. 1989,1999                                   */
4 /* ALL RIGHTS RESERVED                                                 */
5 /* This code licensed under the                                        */
6 /*    "IBM PUBLIC LICENSE - Open Visualization Data Explorer"          */
7 /***********************************************************************/
8 
9 #include <dxconfig.h>
10 #include "../base/defines.h"
11 
12 
13 
14 
15 
16 #include "NoUndoDXWindowCommand.h"
17 #include "ToggleButtonInterface.h"
18 #include "DXWindow.h"
19 
NoUndoDXWindowCommand(const char * name,CommandScope * scope,boolean active,DXWindow * window,DXWindowCommandType comType)20 NoUndoDXWindowCommand::NoUndoDXWindowCommand(const char*   name,
21 				       CommandScope* scope,
22 				       boolean       active,
23 				       DXWindow  *window,
24 				       DXWindowCommandType comType ) :
25 	NoUndoCommand(name, scope, active)
26 {
27 	this->commandType = comType;
28 	this->dxWindow = window;
29 }
30 
31 
doIt(CommandInterface * ci)32 boolean NoUndoDXWindowCommand::doIt(CommandInterface *ci)
33 {
34     DXWindow *window = this->dxWindow;
35 
36     ASSERT(window);
37 
38     switch (this->commandType) {
39 	case NoUndoDXWindowCommand::ToggleWindowStartup:
40 	    window->toggleWindowStartup();
41 	    if (window->isStartup())
42 		this->notifyClients(ToggleButtonInterface::MsgToggleOn);
43 	    else
44 		this->notifyClients(ToggleButtonInterface::MsgToggleOff);
45 	    break;
46 	default:
47 	    ASSERT(0);
48     }
49 
50     return TRUE;
51 }
52 
53 
54