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

« back to all changes in this revision

Viewing changes to src/ui/linewidthdialog.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 "linewidthdialog.h"
 
23
#include "bitmap.h"
 
24
#include <Xm/Xm.h>
 
25
#include "LineWidth1.xbm"
 
26
#include "LineWidth2.xbm"
 
27
#include "LineWidth3.xbm"
 
28
#include "LineWidth4.xbm"
 
29
#include "LineWidth5.xbm"
 
30
#include "LineWidth6.xbm"
 
31
#include "LineWidth7.xbm"
 
32
#include "LineWidth8.xbm"
 
33
#include "LineWidth9.xbm"
 
34
 
 
35
LineWidthDialog::LineWidthDialog(Widget w): NToggleListDialog(w, False) { 
 
36
        SetAutoUnmanage(False);
 
37
}
 
38
 
 
39
void LineWidthDialog::MakeLabels(List<string *> *labels) {
 
40
        labels->add(new string("Line Width"));
 
41
}
 
42
 
 
43
void LineWidthDialog::MakeItems(List<List<string *> *> *items) {
 
44
        List<string *> *l = new List<string *>;
 
45
        l->add(new string("1"));
 
46
        l->add(new string("2"));
 
47
        l->add(new string("3"));
 
48
        l->add(new string("4"));
 
49
        l->add(new string("5"));
 
50
        l->add(new string("6"));
 
51
        l->add(new string("7"));
 
52
        l->add(new string("8"));
 
53
        l->add(new string("9"));
 
54
        items->add(l);
 
55
}
 
56
 
 
57
void LineWidthDialog::MakeBitmaps() {
 
58
        Bitmap icon1 = {LineWidth1_width, LineWidth1_height, LineWidth1_bits};
 
59
        Bitmap icon2 = {LineWidth2_width, LineWidth2_height, LineWidth2_bits};
 
60
        Bitmap icon3 = {LineWidth3_width, LineWidth3_height, LineWidth3_bits};
 
61
        Bitmap icon4 = {LineWidth4_width, LineWidth4_height, LineWidth4_bits};
 
62
        Bitmap icon5 = {LineWidth5_width, LineWidth5_height, LineWidth5_bits};
 
63
        Bitmap icon6 = {LineWidth6_width, LineWidth6_height, LineWidth6_bits};
 
64
        Bitmap icon7 = {LineWidth7_width, LineWidth7_height, LineWidth7_bits};
 
65
        Bitmap icon8 = {LineWidth8_width, LineWidth8_height, LineWidth8_bits};
 
66
        Bitmap icon9 = {LineWidth9_width, LineWidth9_height, LineWidth9_bits};
 
67
        SetItemBitmap(0, 0, &icon1);
 
68
        SetItemBitmap(0, 1, &icon2);
 
69
        SetItemBitmap(0, 2, &icon3);
 
70
        SetItemBitmap(0, 3, &icon4);
 
71
        SetItemBitmap(0, 4, &icon5);
 
72
        SetItemBitmap(0, 5, &icon6);
 
73
        SetItemBitmap(0, 6, &icon7);
 
74
        SetItemBitmap(0, 7, &icon8);
 
75
        SetItemBitmap(0, 8, &icon9);
 
76
}
 
77
 
 
78
void LineWidthDialog::MakeLiteClues() {
 
79
        List<Widget> *tl = (*GetToggleList())[0];
 
80
        AddLiteClue((*tl)[0], "1");
 
81
        AddLiteClue((*tl)[1], "2");
 
82
        AddLiteClue((*tl)[2], "3");
 
83
        AddLiteClue((*tl)[3], "4");
 
84
        AddLiteClue((*tl)[4], "5");
 
85
        AddLiteClue((*tl)[5], "6");
 
86
        AddLiteClue((*tl)[6], "7");
 
87
        AddLiteClue((*tl)[7], "8");
 
88
        AddLiteClue((*tl)[8], "9");
 
89
}
 
90
 
 
91
void LineWidthDialog::Configure() {
 
92
        NToggleListDialog::Configure();
 
93
        List<string *> labels;
 
94
        List<List<string *> *> items;
 
95
        MakeLabels(&labels);
 
96
        MakeItems(&items);
 
97
        CreateToggleLists(&labels, &items);
 
98
        labels.clear();
 
99
        for (items.first(); !items.done(); items.next())
 
100
                items.cur()->clear();
 
101
        items.clear();
 
102
        ManageHelpButton(True);
 
103
        SetHelpButtonLabel("Default");
 
104
        MakeBitmaps();
 
105
        MakeLiteClues();
 
106
        List<Widget> *tl = (*GetToggleList())[0];
 
107
        Widget rc = XtParent((*tl)[0]);
 
108
        XtVaSetValues(rc, XmNnumColumns, 3, 
 
109
                          XmNorientation, XmHORIZONTAL, 0);
 
110
}