~ubuntu-branches/ubuntu/intrepid/tcm/intrepid

« back to all changes in this revision

Viewing changes to src/ui/nodealignmentdialog.c

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2003-07-03 20:08:21 UTC
  • Revision ID: james.westby@ubuntu.com-20030703200821-se4xtqx25e5miczi
Tags: upstream-2.20
ImportĀ upstreamĀ versionĀ 2.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
////////////////////////////////////////////////////////////////////////////////
 
2
//
 
3
// This file is part of Toolkit for Conceptual Modeling (TCM).
 
4
// (c) copyright 2000, Vrije Universiteit Amsterdam.
 
5
// Author: Frank Dehne (frank@cs.vu.nl).
 
6
//
 
7
// TCM is free software; you can redistribute it and/or modify
 
8
// it under the terms of the GNU General Public License as published by
 
9
// the Free Software Foundation; either version 2 of the License, or
 
10
// (at your option) any later version.
 
11
//
 
12
// TCM is distributed in the hope that it will be useful,
 
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
// GNU General Public License for more details.
 
16
//
 
17
// You should have received a copy of the GNU General Public License
 
18
// along with TCM; if not, write to the Free Software
 
19
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
20
// 02111-1307, USA.
 
21
////////////////////////////////////////////////////////////////////////////////
 
22
#include "nodealignmentdialog.h"
 
23
#include "bitmap.h"
 
24
#include <Xm/Xm.h>
 
25
#include "AlignTop.xbm"
 
26
#include "AlignBottom.xbm"
 
27
#include "AlignLeft.xbm"
 
28
#include "AlignRight.xbm"
 
29
#include "AlignHorizontal.xbm"
 
30
#include "AlignVertical.xbm"
 
31
 
 
32
NodeAlignmentDialog::NodeAlignmentDialog(Widget w): 
 
33
                NToggleListDialog(w, False) { 
 
34
        SetAutoUnmanage(False);
 
35
}
 
36
 
 
37
void NodeAlignmentDialog::Configure() {
 
38
        NToggleListDialog::Configure();
 
39
        List<string *> labels;
 
40
        labels.add(new string("Node Alignment"));
 
41
        List<List<string *> *> items;
 
42
        List<string *> l;
 
43
        l.add(new string("Top"));
 
44
        l.add(new string("Horizontal"));
 
45
        l.add(new string("Bottom"));
 
46
        l.add(new string("Left"));
 
47
        l.add(new string("Vertical"));
 
48
        l.add(new string("Right"));
 
49
        items.add(&l);
 
50
        CreateToggleLists(&labels, &items);
 
51
        labels.clear();
 
52
        l.clear();
 
53
        ManageHelpButton(True);
 
54
        SetHelpButtonLabel("Default");
 
55
        Bitmap topIcon = {AlignTop_width, AlignTop_height, 
 
56
                            AlignTop_bits};
 
57
        Bitmap horizIcon = {AlignHorizontal_width, AlignHorizontal_height, 
 
58
                            AlignHorizontal_bits};
 
59
        Bitmap bottomIcon = {AlignBottom_width, AlignBottom_height, 
 
60
                            AlignBottom_bits};
 
61
        Bitmap leftIcon = {AlignLeft_width, AlignLeft_height, 
 
62
                            AlignLeft_bits};
 
63
        Bitmap vertIcon = {AlignVertical_width, AlignVertical_height, 
 
64
                            AlignVertical_bits};
 
65
        Bitmap rightIcon = {AlignRight_width, AlignRight_height, 
 
66
                            AlignRight_bits};
 
67
        SetItemBitmap(0, 0, &topIcon);
 
68
        SetItemBitmap(0, 1, &horizIcon);
 
69
        SetItemBitmap(0, 2, &bottomIcon);
 
70
        SetItemBitmap(0, 3, &leftIcon);
 
71
        SetItemBitmap(0, 4, &vertIcon);
 
72
        SetItemBitmap(0, 5, &rightIcon);
 
73
        List<Widget> *tl = (*GetToggleList())[0];
 
74
        Widget rc = XtParent((*tl)[0]);
 
75
        AddLiteClue((*tl)[0], "Align top");
 
76
        AddLiteClue((*tl)[1], "Align horizontal");
 
77
        AddLiteClue((*tl)[2], "Align bottom");
 
78
        AddLiteClue((*tl)[3], "Align left");
 
79
        AddLiteClue((*tl)[4], "Align vertical");
 
80
        AddLiteClue((*tl)[5], "Align right");
 
81
        XtVaSetValues(rc, XmNnumColumns, 2, 
 
82
                          XmNorientation, XmHORIZONTAL, 0);
 
83
}