Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtprintinfo / UI / DtWorkArea.C
1 /* $XConsortium: DtWorkArea.C /main/2 1995/07/17 14:04:34 drk $ */
2 /*                                                                      *
3  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
4  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
5  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
6  * (c) Copyright 1993, 1994 Novell, Inc.                                *
7  */
8
9 #include "DtWorkArea.h"
10 #include "DtMainW.h"
11 #include "DtActions.h"
12
13 DtWorkArea::DtWorkArea(char *category,
14                        AnyUI *parent,
15                        char *name,
16                        ContainerType container_type,
17                        SelectionType select_type)
18         : Container(category, parent, name, container_type, select_type)
19 {
20    _mainW = (DtMainW *) parent->Parent();
21 }
22
23 void DtWorkArea::NotifySelected(BaseUI *obj)
24 {
25    Container::NotifySelected(obj);
26
27    if (_mainW->UIClass() != MAIN_WINDOW)
28       return;
29
30    BaseUI **selection;
31    int n_items;
32    Selection(&n_items, &selection);
33    if (n_items)
34       _mainW->actionsMenu->UpdateActions(n_items, selection[0]);
35    else
36       _mainW->actionsMenu->UpdateActions(n_items, NULL);
37    delete []selection;
38 }
39
40 void DtWorkArea::NotifyOpen(BaseUI *obj) 
41 {
42    if (_mainW->UIClass() != MAIN_WINDOW)
43       return;
44
45    _mainW->OpenClose(obj);
46 }