-rw-r--r-- | noncore/apps/tableviewer/ui/commonwidgets.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/tableviewer/ui/tvbrowseview.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/tableviewer/ui/tvfilterview.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/tableviewer/ui/tvlistview.cpp | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/noncore/apps/tableviewer/ui/commonwidgets.cpp b/noncore/apps/tableviewer/ui/commonwidgets.cpp index 4c47951..e82018c 100644 --- a/noncore/apps/tableviewer/ui/commonwidgets.cpp +++ b/noncore/apps/tableviewer/ui/commonwidgets.cpp | |||
@@ -1,136 +1,136 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include <qlineedit.h> | 21 | #include <qlineedit.h> |
22 | #include <qlayout.h> | 22 | #include <qlayout.h> |
23 | #include <qlabel.h> | 23 | #include <qlabel.h> |
24 | #include <qcombobox.h> | 24 | #include <qcombobox.h> |
25 | 25 | ||
26 | #include <qpe/datebookmonth.h> | 26 | #include <qpe/datebookmonth.h> |
27 | #include <qpopupmenu.h> | 27 | #include <qpopupmenu.h> |
28 | #include <qspinbox.h> | 28 | #include <qspinbox.h> |
29 | #include "commonwidgets.h" | 29 | #include "commonwidgets.h" |
30 | 30 | ||
31 | DateEdit::DateEdit( QWidget *parent, const char *name, WFlags f ) | 31 | DateEdit::DateEdit( QWidget *parent, const char *name, WFlags f ) |
32 | : QToolButton(parent, name) | 32 | : QToolButton(parent, name) |
33 | { | 33 | { |
34 | QPopupMenu *m1 = new QPopupMenu(this); | 34 | QPopupMenu *m1 = new QPopupMenu(this); |
35 | dateSelector = new DateBookMonth(m1, 0, TRUE); | 35 | dateSelector = new DateBookMonth(m1, 0, TRUE); |
36 | m1->insertItem(dateSelector); | 36 | m1->insertItem(dateSelector); |
37 | setPopup(m1); | 37 | setPopup(m1); |
38 | setPopupDelay(0); | 38 | setPopupDelay(0); |
39 | 39 | ||
40 | connect(dateSelector, SIGNAL(dateClicked(int, int, int)), | 40 | connect(dateSelector, SIGNAL(dateClicked(int,int,int)), |
41 | this, SLOT(subValueChanged())); | 41 | this, SLOT(subValueChanged())); |
42 | 42 | ||
43 | setText(dateSelector->selectedDate().toString()); | 43 | setText(dateSelector->selectedDate().toString()); |
44 | } | 44 | } |
45 | 45 | ||
46 | 46 | ||
47 | DateEdit::~DateEdit() {} | 47 | DateEdit::~DateEdit() {} |
48 | 48 | ||
49 | QDate DateEdit::date() const | 49 | QDate DateEdit::date() const |
50 | { | 50 | { |
51 | return dateSelector->selectedDate(); | 51 | return dateSelector->selectedDate(); |
52 | } | 52 | } |
53 | 53 | ||
54 | void DateEdit::setDate(QDate d) | 54 | void DateEdit::setDate(QDate d) |
55 | { | 55 | { |
56 | dateSelector->setDate(d.year(), d.month(), d.day()); | 56 | dateSelector->setDate(d.year(), d.month(), d.day()); |
57 | setText(d.toString()); | 57 | setText(d.toString()); |
58 | } | 58 | } |
59 | 59 | ||
60 | QSizePolicy DateEdit::sizePolicy() const | 60 | QSizePolicy DateEdit::sizePolicy() const |
61 | { | 61 | { |
62 | QSizePolicy sp; | 62 | QSizePolicy sp; |
63 | sp.setHorData(QToolButton::sizePolicy().horData()); | 63 | sp.setHorData(QToolButton::sizePolicy().horData()); |
64 | sp.setVerData(QSizePolicy::Fixed); | 64 | sp.setVerData(QSizePolicy::Fixed); |
65 | 65 | ||
66 | return sp; | 66 | return sp; |
67 | } | 67 | } |
68 | 68 | ||
69 | void DateEdit::clear() | 69 | void DateEdit::clear() |
70 | { | 70 | { |
71 | QDate today = QDate::currentDate(); | 71 | QDate today = QDate::currentDate(); |
72 | 72 | ||
73 | dateSelector->setDate(today.year(), today.month(), today.day()); | 73 | dateSelector->setDate(today.year(), today.month(), today.day()); |
74 | setText(today.toString()); | 74 | setText(today.toString()); |
75 | } | 75 | } |
76 | 76 | ||
77 | void DateEdit::subValueChanged() | 77 | void DateEdit::subValueChanged() |
78 | { | 78 | { |
79 | QDate current = dateSelector->selectedDate(); | 79 | QDate current = dateSelector->selectedDate(); |
80 | 80 | ||
81 | setText(current.toString()); | 81 | setText(current.toString()); |
82 | emit valueChanged(current); | 82 | emit valueChanged(current); |
83 | } | 83 | } |
84 | 84 | ||
85 | TimeEdit::TimeEdit( QWidget *parent, const char *name, WFlags f ) | 85 | TimeEdit::TimeEdit( QWidget *parent, const char *name, WFlags f ) |
86 | : QWidget(parent, name, f) | 86 | : QWidget(parent, name, f) |
87 | { | 87 | { |
88 | QHBoxLayout *layout = new QHBoxLayout(this, 0); | 88 | QHBoxLayout *layout = new QHBoxLayout(this, 0); |
89 | 89 | ||
90 | layout->addWidget(hourKey = new QSpinBox(1, 12, 1, this)); | 90 | layout->addWidget(hourKey = new QSpinBox(1, 12, 1, this)); |
91 | hourKey->setWrapping(true); | 91 | hourKey->setWrapping(true); |
92 | hourKey->setMinimumWidth(30); | 92 | hourKey->setMinimumWidth(30); |
93 | hourKey->setMaximumWidth(35); | 93 | hourKey->setMaximumWidth(35); |
94 | 94 | ||
95 | layout->addWidget(new QLabel(" : ", this)); | 95 | layout->addWidget(new QLabel(" : ", this)); |
96 | layout->addWidget(minuteKey = new QSpinBox(0, 59, 1, this)); | 96 | layout->addWidget(minuteKey = new QSpinBox(0, 59, 1, this)); |
97 | minuteKey->setWrapping(true); | 97 | minuteKey->setWrapping(true); |
98 | minuteKey->setMinimumWidth(30); | 98 | minuteKey->setMinimumWidth(30); |
99 | minuteKey->setMaximumWidth(35); | 99 | minuteKey->setMaximumWidth(35); |
100 | 100 | ||
101 | layout->addWidget(new QLabel(" : ", this)); | 101 | layout->addWidget(new QLabel(" : ", this)); |
102 | layout->addWidget(secondKey = new QSpinBox(0, 59, 1, this, 0)); | 102 | layout->addWidget(secondKey = new QSpinBox(0, 59, 1, this, 0)); |
103 | secondKey->setWrapping(true); | 103 | secondKey->setWrapping(true); |
104 | secondKey->setMinimumWidth(30); | 104 | secondKey->setMinimumWidth(30); |
105 | secondKey->setMaximumWidth(35); | 105 | secondKey->setMaximumWidth(35); |
106 | 106 | ||
107 | layout->addWidget(ampm = new QComboBox(this)); | 107 | layout->addWidget(ampm = new QComboBox(this)); |
108 | ampm->insertItem("AM"); | 108 | ampm->insertItem("AM"); |
109 | ampm->insertItem("PM"); | 109 | ampm->insertItem("PM"); |
110 | 110 | ||
111 | layout->addStretch(-1); | 111 | layout->addStretch(-1); |
112 | 112 | ||
113 | clear(); | 113 | clear(); |
114 | 114 | ||
115 | connect(secondKey, SIGNAL(valueChanged(const QString&)), | 115 | connect(secondKey, SIGNAL(valueChanged(const QString&)), |
116 | this, SLOT(subValueChanged())); | 116 | this, SLOT(subValueChanged())); |
117 | connect(minuteKey, SIGNAL(valueChanged(const QString&)), | 117 | connect(minuteKey, SIGNAL(valueChanged(const QString&)), |
118 | this, SLOT(subValueChanged())); | 118 | this, SLOT(subValueChanged())); |
119 | connect(hourKey, SIGNAL(valueChanged(const QString&)), | 119 | connect(hourKey, SIGNAL(valueChanged(const QString&)), |
120 | this, SLOT(subValueChanged())); | 120 | this, SLOT(subValueChanged())); |
121 | connect(ampm, SIGNAL(activated(int)), | 121 | connect(ampm, SIGNAL(activated(int)), |
122 | this, SLOT(subValueChanged())); | 122 | this, SLOT(subValueChanged())); |
123 | } | 123 | } |
124 | 124 | ||
125 | 125 | ||
126 | TimeEdit::~TimeEdit() {} | 126 | TimeEdit::~TimeEdit() {} |
127 | 127 | ||
128 | QTime TimeEdit::time() const | 128 | QTime TimeEdit::time() const |
129 | { | 129 | { |
130 | int s,m,h; | 130 | int s,m,h; |
131 | 131 | ||
132 | s = secondKey->text().toInt(); | 132 | s = secondKey->text().toInt(); |
133 | m = minuteKey->text().toInt(); | 133 | m = minuteKey->text().toInt(); |
134 | h = hourKey->text().toInt(); | 134 | h = hourKey->text().toInt(); |
135 | 135 | ||
136 | if(ampm->currentItem() == 1) { | 136 | if(ampm->currentItem() == 1) { |
diff --git a/noncore/apps/tableviewer/ui/tvbrowseview.cpp b/noncore/apps/tableviewer/ui/tvbrowseview.cpp index 22bac55..8a65ed1 100644 --- a/noncore/apps/tableviewer/ui/tvbrowseview.cpp +++ b/noncore/apps/tableviewer/ui/tvbrowseview.cpp | |||
@@ -1,123 +1,123 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "tvbrowseview.h" | 20 | #include "tvbrowseview.h" |
21 | #include "browsekeyentry.h" | 21 | #include "browsekeyentry.h" |
22 | #include <qtoolbutton.h> | 22 | #include <qtoolbutton.h> |
23 | #include <qtextview.h> | 23 | #include <qtextview.h> |
24 | #include <qtextbrowser.h> | 24 | #include <qtextbrowser.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include "../xmlencodeattr.h" | 26 | #include "../xmlencodeattr.h" |
27 | 27 | ||
28 | /*! | 28 | /*! |
29 | \class TVBrowseView | 29 | \class TVBrowseView |
30 | \brief The widget describing how to draw the browse view user interface | 30 | \brief The widget describing how to draw the browse view user interface |
31 | 31 | ||
32 | This widget allows for the user to browse through the table, one element | 32 | This widget allows for the user to browse through the table, one element |
33 | at a time, or search on a single key. Its main goal is to show a | 33 | at a time, or search on a single key. Its main goal is to show a |
34 | single element in a readable format and make it easy for the user to | 34 | single element in a readable format and make it easy for the user to |
35 | rapidly find specific elements in the table. | 35 | rapidly find specific elements in the table. |
36 | */ | 36 | */ |
37 | 37 | ||
38 | /*! | 38 | /*! |
39 | Constructs a new TVBrowseView widget | 39 | Constructs a new TVBrowseView widget |
40 | */ | 40 | */ |
41 | TVBrowseView::TVBrowseView(TableState *t, QWidget* parent, const char *name, | 41 | TVBrowseView::TVBrowseView(TableState *t, QWidget* parent, const char *name, |
42 | WFlags fl ) | 42 | WFlags fl ) |
43 | { | 43 | { |
44 | if (!name) | 44 | if (!name) |
45 | setName("BrowseView"); | 45 | setName("BrowseView"); |
46 | 46 | ||
47 | // setSizePolicy(QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding, 0, 0, sizePolicy().hasHeightForWidth() ) ); | 47 | // setSizePolicy(QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding, 0, 0, sizePolicy().hasHeightForWidth() ) ); |
48 | QVBoxLayout *vlayout = new QVBoxLayout(this); | 48 | QVBoxLayout *vlayout = new QVBoxLayout(this); |
49 | textViewDisplay = new QTextBrowser(this, "textViewDisplay"); | 49 | textViewDisplay = new QTextBrowser(this, "textViewDisplay"); |
50 | vlayout->addWidget( textViewDisplay ); | 50 | vlayout->addWidget( textViewDisplay ); |
51 | 51 | ||
52 | keyEntry = new TVBrowseKeyEntry(this, "keyEntry"); | 52 | keyEntry = new TVBrowseKeyEntry(this, "keyEntry"); |
53 | vlayout->addWidget( keyEntry ); | 53 | vlayout->addWidget( keyEntry ); |
54 | 54 | ||
55 | /* connect the signals down */ | 55 | /* connect the signals down */ |
56 | 56 | ||
57 | connect(keyEntry, SIGNAL(searchOnKey(int, TVVariant)), | 57 | connect(keyEntry, SIGNAL(searchOnKey(int,TVVariant)), |
58 | this, SIGNAL(searchOnKey(int, TVVariant))); | 58 | this, SIGNAL(searchOnKey(int,TVVariant))); |
59 | connect(keyEntry, SIGNAL(sortChanged(int)), | 59 | connect(keyEntry, SIGNAL(sortChanged(int)), |
60 | this, SIGNAL(sortChanged(int))); | 60 | this, SIGNAL(sortChanged(int))); |
61 | 61 | ||
62 | ts = t; | 62 | ts = t; |
63 | keyEntry->setTableState(t); | 63 | keyEntry->setTableState(t); |
64 | } | 64 | } |
65 | 65 | ||
66 | /*! | 66 | /*! |
67 | Destroys the TVBrowseView widget | 67 | Destroys the TVBrowseView widget |
68 | */ | 68 | */ |
69 | TVBrowseView::~TVBrowseView() | 69 | TVBrowseView::~TVBrowseView() |
70 | { | 70 | { |
71 | } | 71 | } |
72 | 72 | ||
73 | void TVBrowseView::rebuildData() | 73 | void TVBrowseView::rebuildData() |
74 | { | 74 | { |
75 | if(!ts) | 75 | if(!ts) |
76 | return; | 76 | return; |
77 | if(!ts->current_elem) { | 77 | if(!ts->current_elem) { |
78 | /* also disable buttons */ | 78 | /* also disable buttons */ |
79 | textViewDisplay->setText(""); | 79 | textViewDisplay->setText(""); |
80 | return; | 80 | return; |
81 | } | 81 | } |
82 | 82 | ||
83 | setDisplayText(ts->current_elem); | 83 | setDisplayText(ts->current_elem); |
84 | } | 84 | } |
85 | 85 | ||
86 | /* Reset to initial state */ | 86 | /* Reset to initial state */ |
87 | void TVBrowseView::reset() | 87 | void TVBrowseView::reset() |
88 | { | 88 | { |
89 | textViewDisplay->setText(""); | 89 | textViewDisplay->setText(""); |
90 | keyEntry->reset(); | 90 | keyEntry->reset(); |
91 | } | 91 | } |
92 | 92 | ||
93 | /*! | 93 | /*! |
94 | sets the data element to be displayed to element | 94 | sets the data element to be displayed to element |
95 | */ | 95 | */ |
96 | void TVBrowseView::setDisplayText(const DataElem *element) | 96 | void TVBrowseView::setDisplayText(const DataElem *element) |
97 | { | 97 | { |
98 | QString rep = ""; | 98 | QString rep = ""; |
99 | 99 | ||
100 | KeyListIterator it(*ts->kRep); | 100 | KeyListIterator it(*ts->kRep); |
101 | 101 | ||
102 | while (it.current()) { | 102 | while (it.current()) { |
103 | if (element->hasValidValue(it.currentKey())) { | 103 | if (element->hasValidValue(it.currentKey())) { |
104 | if(it.currentKey() == ts->current_column) { | 104 | if(it.currentKey() == ts->current_column) { |
105 | rep += "<A name=\"ckey\"></A><B><FONT COLOR=#FF0000>" | 105 | rep += "<A name=\"ckey\"></A><B><FONT COLOR=#FF0000>" |
106 | + encodeAttr(it.current()->name()) | 106 | + encodeAttr(it.current()->name()) |
107 | + ":</FONT></B> "; | 107 | + ":</FONT></B> "; |
108 | } else { | 108 | } else { |
109 | rep += "<B>" + encodeAttr(it.current()->name()) + ":</B> "; | 109 | rep += "<B>" + encodeAttr(it.current()->name()) + ":</B> "; |
110 | } | 110 | } |
111 | rep += encodeAttr(element->toQString(it.currentKey())) + "<BR>"; | 111 | rep += encodeAttr(element->toQString(it.currentKey())) + "<BR>"; |
112 | } | 112 | } |
113 | ++it; | 113 | ++it; |
114 | } | 114 | } |
115 | 115 | ||
116 | textViewDisplay->setText(rep); | 116 | textViewDisplay->setText(rep); |
117 | textViewDisplay->scrollToAnchor("ckey"); | 117 | textViewDisplay->scrollToAnchor("ckey"); |
118 | } | 118 | } |
119 | 119 | ||
120 | void TVBrowseView::rebuildKeys() | 120 | void TVBrowseView::rebuildKeys() |
121 | { | 121 | { |
122 | keyEntry->rebuildKeys(); | 122 | keyEntry->rebuildKeys(); |
123 | } | 123 | } |
diff --git a/noncore/apps/tableviewer/ui/tvfilterview.cpp b/noncore/apps/tableviewer/ui/tvfilterview.cpp index b03e846..22f1fb7 100644 --- a/noncore/apps/tableviewer/ui/tvfilterview.cpp +++ b/noncore/apps/tableviewer/ui/tvfilterview.cpp | |||
@@ -1,188 +1,188 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "tvfilterview.h" | 20 | #include "tvfilterview.h" |
21 | #include <qtoolbutton.h> | 21 | #include <qtoolbutton.h> |
22 | #include <qcombobox.h> | 22 | #include <qcombobox.h> |
23 | #include <qlistview.h> | 23 | #include <qlistview.h> |
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qheader.h> | 25 | #include <qheader.h> |
26 | #include <qpushbutton.h> | 26 | #include <qpushbutton.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | 28 | ||
29 | #include <qpe/qpeapplication.h> | 29 | #include <qpe/qpeapplication.h> |
30 | 30 | ||
31 | TVFilterView::TVFilterView(TableState *t, QWidget* parent, | 31 | TVFilterView::TVFilterView(TableState *t, QWidget* parent, |
32 | const char *name, WFlags fl ) : QDialog(parent, name, TRUE, fl) | 32 | const char *name, WFlags fl ) : QDialog(parent, name, TRUE, fl) |
33 | { | 33 | { |
34 | if ( !name ) | 34 | if ( !name ) |
35 | setName( "Filter View" ); | 35 | setName( "Filter View" ); |
36 | 36 | ||
37 | QVBoxLayout *vlayout = new QVBoxLayout(this); | 37 | QVBoxLayout *vlayout = new QVBoxLayout(this); |
38 | 38 | ||
39 | display = new QListView(this, "display"); | 39 | display = new QListView(this, "display"); |
40 | display->addColumn("Key"); | 40 | display->addColumn("Key"); |
41 | display->addColumn("Constraint"); | 41 | display->addColumn("Constraint"); |
42 | display->addColumn("Value"); | 42 | display->addColumn("Value"); |
43 | display->header()->setClickEnabled(FALSE); | 43 | display->header()->setClickEnabled(FALSE); |
44 | display->header()->setResizeEnabled(FALSE); | 44 | display->header()->setResizeEnabled(FALSE); |
45 | 45 | ||
46 | vlayout->addWidget(display); | 46 | vlayout->addWidget(display); |
47 | 47 | ||
48 | QHBoxLayout *hlayout = new QHBoxLayout; | 48 | QHBoxLayout *hlayout = new QHBoxLayout; |
49 | hlayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); | 49 | hlayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); |
50 | 50 | ||
51 | newFilterButton = new QPushButton(this, "new Filter"); | 51 | newFilterButton = new QPushButton(this, "new Filter"); |
52 | newFilterButton->setMaximumSize(QSize(50, 32767)); | 52 | newFilterButton->setMaximumSize(QSize(50, 32767)); |
53 | newFilterButton->setText("New"); | 53 | newFilterButton->setText("New"); |
54 | hlayout->addWidget(newFilterButton); | 54 | hlayout->addWidget(newFilterButton); |
55 | 55 | ||
56 | deleteFilterButton = new QPushButton(this, "delete Filter"); | 56 | deleteFilterButton = new QPushButton(this, "delete Filter"); |
57 | deleteFilterButton->setMaximumSize(QSize(50, 32767)); | 57 | deleteFilterButton->setMaximumSize(QSize(50, 32767)); |
58 | deleteFilterButton->setText("Delete"); | 58 | deleteFilterButton->setText("Delete"); |
59 | hlayout->addWidget(deleteFilterButton); | 59 | hlayout->addWidget(deleteFilterButton); |
60 | 60 | ||
61 | clearFilterButton = new QPushButton(this, "delete Filter"); | 61 | clearFilterButton = new QPushButton(this, "delete Filter"); |
62 | clearFilterButton->setMaximumSize(QSize(60, 32767)); | 62 | clearFilterButton->setMaximumSize(QSize(60, 32767)); |
63 | clearFilterButton->setText("Clear All"); | 63 | clearFilterButton->setText("Clear All"); |
64 | hlayout->addWidget(clearFilterButton); | 64 | hlayout->addWidget(clearFilterButton); |
65 | 65 | ||
66 | vlayout->addLayout(hlayout); | 66 | vlayout->addLayout(hlayout); |
67 | 67 | ||
68 | QHBoxLayout *hlayout2 = new QHBoxLayout; | 68 | QHBoxLayout *hlayout2 = new QHBoxLayout; |
69 | 69 | ||
70 | keyNameCombo = new QComboBox(FALSE, this, "key name"); | 70 | keyNameCombo = new QComboBox(FALSE, this, "key name"); |
71 | keyNameCombo->setEnabled(FALSE); | 71 | keyNameCombo->setEnabled(FALSE); |
72 | hlayout2->addWidget(keyNameCombo); | 72 | hlayout2->addWidget(keyNameCombo); |
73 | 73 | ||
74 | QLabel *label = new QLabel(this); | 74 | QLabel *label = new QLabel(this); |
75 | label->setText("has value"); | 75 | label->setText("has value"); |
76 | hlayout2->addWidget(label); | 76 | hlayout2->addWidget(label); |
77 | 77 | ||
78 | keyEntry = new TVFilterKeyEntry(this, "key entry"); | 78 | keyEntry = new TVFilterKeyEntry(this, "key entry"); |
79 | keyEntry->setEnabled(FALSE); | 79 | keyEntry->setEnabled(FALSE); |
80 | 80 | ||
81 | vlayout->addLayout(hlayout2); | 81 | vlayout->addLayout(hlayout2); |
82 | vlayout->addWidget(keyEntry); | 82 | vlayout->addWidget(keyEntry); |
83 | 83 | ||
84 | connect(newFilterButton, SIGNAL( clicked() ), this, SLOT( newTerm() )); | 84 | connect(newFilterButton, SIGNAL( clicked() ), this, SLOT( newTerm() )); |
85 | connect(deleteFilterButton, SIGNAL( clicked() ), this, SLOT( deleteTerm())); | 85 | connect(deleteFilterButton, SIGNAL( clicked() ), this, SLOT( deleteTerm())); |
86 | connect(clearFilterButton, SIGNAL( clicked() ), this, SLOT( clearTerms())); | 86 | connect(clearFilterButton, SIGNAL( clicked() ), this, SLOT( clearTerms())); |
87 | 87 | ||
88 | connect(keyEntry, SIGNAL(valueChanged()), this, SLOT( updateTerm() )); | 88 | connect(keyEntry, SIGNAL(valueChanged()), this, SLOT( updateTerm() )); |
89 | connect(keyNameCombo, SIGNAL(activated(int)), this, SLOT( updateTerm() )); | 89 | connect(keyNameCombo, SIGNAL(activated(int)), this, SLOT( updateTerm() )); |
90 | 90 | ||
91 | connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, | 91 | connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, |
92 | SLOT(setTerm(QListViewItem *))); | 92 | SLOT(setTerm(QListViewItem*))); |
93 | 93 | ||
94 | ts = t; | 94 | ts = t; |
95 | current = 0; | 95 | current = 0; |
96 | terms.setAutoDelete(true); | 96 | terms.setAutoDelete(true); |
97 | do_filter = false; | 97 | do_filter = false; |
98 | 98 | ||
99 | #ifdef Q_WS_QWS | 99 | #ifdef Q_WS_QWS |
100 | QPEApplication::showDialog( this ); | 100 | QPEApplication::showDialog( this ); |
101 | #endif | 101 | #endif |
102 | } | 102 | } |
103 | 103 | ||
104 | /*! | 104 | /*! |
105 | Destroys the TVFilterView widget | 105 | Destroys the TVFilterView widget |
106 | */ | 106 | */ |
107 | TVFilterView::~TVFilterView() | 107 | TVFilterView::~TVFilterView() |
108 | { | 108 | { |
109 | } | 109 | } |
110 | 110 | ||
111 | void TVFilterView::rebuildData() | 111 | void TVFilterView::rebuildData() |
112 | { | 112 | { |
113 | } | 113 | } |
114 | 114 | ||
115 | void TVFilterView::reset() | 115 | void TVFilterView::reset() |
116 | { | 116 | { |
117 | keyNameCombo->clear(); | 117 | keyNameCombo->clear(); |
118 | keyIds.clear(); | 118 | keyIds.clear(); |
119 | } | 119 | } |
120 | 120 | ||
121 | void TVFilterView::rebuildKeys() | 121 | void TVFilterView::rebuildKeys() |
122 | { | 122 | { |
123 | int i; | 123 | int i; |
124 | 124 | ||
125 | if (!ts) return; | 125 | if (!ts) return; |
126 | if(!ts->kRep) return; | 126 | if(!ts->kRep) return; |
127 | keyEntry->setTableState(ts); | 127 | keyEntry->setTableState(ts); |
128 | 128 | ||
129 | /* set up the list of keys that can be compared on */ | 129 | /* set up the list of keys that can be compared on */ |
130 | keyNameCombo->clear(); | 130 | keyNameCombo->clear(); |
131 | KeyListIterator it(*ts->kRep); | 131 | KeyListIterator it(*ts->kRep); |
132 | 132 | ||
133 | i = 0; | 133 | i = 0; |
134 | while(it.current()) { | 134 | while(it.current()) { |
135 | if(ts->kRep->validIndex(it.currentKey())) { | 135 | if(ts->kRep->validIndex(it.currentKey())) { |
136 | keyNameCombo->insertItem(it.current()->name()); | 136 | keyNameCombo->insertItem(it.current()->name()); |
137 | keyIds.insert(i, it.currentKey()); | 137 | keyIds.insert(i, it.currentKey()); |
138 | ++i; | 138 | ++i; |
139 | } | 139 | } |
140 | ++it; | 140 | ++it; |
141 | } | 141 | } |
142 | } | 142 | } |
143 | 143 | ||
144 | bool TVFilterView::passesFilter(DataElem *d) { | 144 | bool TVFilterView::passesFilter(DataElem *d) { |
145 | if (!filterActive()) return true; | 145 | if (!filterActive()) return true; |
146 | 146 | ||
147 | 147 | ||
148 | FilterTerm *t; | 148 | FilterTerm *t; |
149 | 149 | ||
150 | for (t = terms.first(); t != 0; t = terms.next() ) { | 150 | for (t = terms.first(); t != 0; t = terms.next() ) { |
151 | /* check against filter */ | 151 | /* check against filter */ |
152 | switch(t->ct) { | 152 | switch(t->ct) { |
153 | case ct_less: | 153 | case ct_less: |
154 | if (!d->lessThan(t->keyIndex, t->value)) | 154 | if (!d->lessThan(t->keyIndex, t->value)) |
155 | return false; | 155 | return false; |
156 | break; | 156 | break; |
157 | case ct_more: | 157 | case ct_more: |
158 | if (!d->moreThan(t->keyIndex, t->value)) | 158 | if (!d->moreThan(t->keyIndex, t->value)) |
159 | return false; | 159 | return false; |
160 | break; | 160 | break; |
161 | case ct_equal: | 161 | case ct_equal: |
162 | if (!d->equalTo(t->keyIndex, t->value)) | 162 | if (!d->equalTo(t->keyIndex, t->value)) |
163 | return false; | 163 | return false; |
164 | break; | 164 | break; |
165 | case ct_contains: | 165 | case ct_contains: |
166 | if (!d->contains(t->keyIndex, t->value)) | 166 | if (!d->contains(t->keyIndex, t->value)) |
167 | return false; | 167 | return false; |
168 | break; | 168 | break; |
169 | case ct_startswith: | 169 | case ct_startswith: |
170 | if (!d->startsWith(t->keyIndex, t->value)) | 170 | if (!d->startsWith(t->keyIndex, t->value)) |
171 | return false; | 171 | return false; |
172 | break; | 172 | break; |
173 | case ct_endswith: | 173 | case ct_endswith: |
174 | if (!d->endsWith(t->keyIndex, t->value)) | 174 | if (!d->endsWith(t->keyIndex, t->value)) |
175 | return false; | 175 | return false; |
176 | break; | 176 | break; |
177 | default: | 177 | default: |
178 | qWarning("TVFilterView::passesFilter() " | 178 | qWarning("TVFilterView::passesFilter() " |
179 | "unrecognized filter type"); | 179 | "unrecognized filter type"); |
180 | return false; | 180 | return false; |
181 | } | 181 | } |
182 | } | 182 | } |
183 | return true; | 183 | return true; |
184 | } | 184 | } |
185 | 185 | ||
186 | bool TVFilterView::filterActive() const | 186 | bool TVFilterView::filterActive() const |
187 | { | 187 | { |
188 | /* when button operated, also check the do_filter value | 188 | /* when button operated, also check the do_filter value |
diff --git a/noncore/apps/tableviewer/ui/tvlistview.cpp b/noncore/apps/tableviewer/ui/tvlistview.cpp index b25e813..b10ff1d 100644 --- a/noncore/apps/tableviewer/ui/tvlistview.cpp +++ b/noncore/apps/tableviewer/ui/tvlistview.cpp | |||
@@ -11,194 +11,194 @@ | |||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "tvlistview.h" | 20 | #include "tvlistview.h" |
21 | #include "../db/common.h" | 21 | #include "../db/common.h" |
22 | #include <qtoolbutton.h> | 22 | #include <qtoolbutton.h> |
23 | #include <qlistview.h> | 23 | #include <qlistview.h> |
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | 25 | ||
26 | void TVListViewPrivate::setColumnWidth(int column, int width) | 26 | void TVListViewPrivate::setColumnWidth(int column, int width) |
27 | { | 27 | { |
28 | if(width > 70) width = 70; | 28 | if(width > 70) width = 70; |
29 | QListView::setColumnWidth(column, width); | 29 | QListView::setColumnWidth(column, width); |
30 | } | 30 | } |
31 | 31 | ||
32 | void TVListViewPrivate::setSorting(int column, bool increasing) | 32 | void TVListViewPrivate::setSorting(int column, bool increasing) |
33 | { | 33 | { |
34 | emit sortChanged(column); | 34 | emit sortChanged(column); |
35 | QListView::setSorting(column, increasing); | 35 | QListView::setSorting(column, increasing); |
36 | } | 36 | } |
37 | 37 | ||
38 | TVListViewPrivate::TVListViewPrivate(QWidget *parent, const char* name, | 38 | TVListViewPrivate::TVListViewPrivate(QWidget *parent, const char* name, |
39 | WFlags fl) : QListView(parent, name, fl) { | 39 | WFlags fl) : QListView(parent, name, fl) { |
40 | ; | 40 | ; |
41 | } | 41 | } |
42 | 42 | ||
43 | class TVListViewItem : public QListViewItem | 43 | class TVListViewItem : public QListViewItem |
44 | { | 44 | { |
45 | public: | 45 | public: |
46 | 46 | ||
47 | TVListViewItem(QListView *parent, DataElem *d); | 47 | TVListViewItem(QListView *parent, DataElem *d); |
48 | ~TVListViewItem(); | 48 | ~TVListViewItem(); |
49 | 49 | ||
50 | QString text(int i) const | 50 | QString text(int i) const |
51 | { | 51 | { |
52 | return data_reference->toQString(i); | 52 | return data_reference->toQString(i); |
53 | } | 53 | } |
54 | 54 | ||
55 | /* Do nothing... all data for this item should be generated */ | 55 | /* Do nothing... all data for this item should be generated */ |
56 | void setText(int i, const QString &) | 56 | void setText(int i, const QString &) |
57 | { | 57 | { |
58 | ; | 58 | ; |
59 | } | 59 | } |
60 | QString key(int i, bool a) const | 60 | QString key(int i, bool a) const |
61 | { | 61 | { |
62 | return data_reference->toSortableQString(i); | 62 | return data_reference->toSortableQString(i); |
63 | } | 63 | } |
64 | 64 | ||
65 | void setDataElem(DataElem *d) | 65 | void setDataElem(DataElem *d) |
66 | { | 66 | { |
67 | data_reference = d; | 67 | data_reference = d; |
68 | } | 68 | } |
69 | 69 | ||
70 | DataElem *getDataElem() { | 70 | DataElem *getDataElem() { |
71 | return data_reference; | 71 | return data_reference; |
72 | } | 72 | } |
73 | private: | 73 | private: |
74 | DataElem *data_reference; | 74 | DataElem *data_reference; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | TVListViewItem::TVListViewItem(QListView *parent, DataElem *d) | 77 | TVListViewItem::TVListViewItem(QListView *parent, DataElem *d) |
78 | : QListViewItem(parent) | 78 | : QListViewItem(parent) |
79 | { | 79 | { |
80 | data_reference = d; | 80 | data_reference = d; |
81 | } | 81 | } |
82 | 82 | ||
83 | TVListViewItem::~TVListViewItem() | 83 | TVListViewItem::~TVListViewItem() |
84 | { | 84 | { |
85 | data_reference = 0; | 85 | data_reference = 0; |
86 | } | 86 | } |
87 | 87 | ||
88 | TVListView::TVListView(TableState *t, QWidget* parent, | 88 | TVListView::TVListView(TableState *t, QWidget* parent, |
89 | const char *name, WFlags fl ) : QWidget(parent, name, fl) | 89 | const char *name, WFlags fl ) : QWidget(parent, name, fl) |
90 | { | 90 | { |
91 | if (!name) | 91 | if (!name) |
92 | setName("TVListView"); | 92 | setName("TVListView"); |
93 | 93 | ||
94 | // the next two lines need to be rationalized. | 94 | // the next two lines need to be rationalized. |
95 | resize(318,457); | 95 | resize(318,457); |
96 | setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7, | 96 | setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7, |
97 | (QSizePolicy::SizeType)7, sizePolicy().hasHeightForWidth())); | 97 | (QSizePolicy::SizeType)7, sizePolicy().hasHeightForWidth())); |
98 | setCaption(tr("List View")); | 98 | setCaption(tr("List View")); |
99 | 99 | ||
100 | QVBoxLayout *layout = new QVBoxLayout(this); | 100 | QVBoxLayout *layout = new QVBoxLayout(this); |
101 | layout->setSpacing(0); | 101 | layout->setSpacing(0); |
102 | layout->setMargin(0); | 102 | layout->setMargin(0); |
103 | 103 | ||
104 | listViewDisplay = new TVListViewPrivate(this, "listViewDisplay"); | 104 | listViewDisplay = new TVListViewPrivate(this, "listViewDisplay"); |
105 | layout->addWidget(listViewDisplay); | 105 | layout->addWidget(listViewDisplay); |
106 | 106 | ||
107 | connect(listViewDisplay, SIGNAL(currentChanged(QListViewItem *)), this, | 107 | connect(listViewDisplay, SIGNAL(currentChanged(QListViewItem*)), this, |
108 | SLOT(setCurrent(QListViewItem *))); | 108 | SLOT(setCurrent(QListViewItem*))); |
109 | connect(listViewDisplay, SIGNAL(sortChanged(int)), this, | 109 | connect(listViewDisplay, SIGNAL(sortChanged(int)), this, |
110 | SLOT(setSorting(int))); | 110 | SLOT(setSorting(int))); |
111 | 111 | ||
112 | listViewDisplay->setShowSortIndicator(true); | 112 | listViewDisplay->setShowSortIndicator(true); |
113 | 113 | ||
114 | it = new QListViewItemIterator(listViewDisplay); | 114 | it = new QListViewItemIterator(listViewDisplay); |
115 | ts = t; | 115 | ts = t; |
116 | } | 116 | } |
117 | 117 | ||
118 | TVListView::~TVListView() | 118 | TVListView::~TVListView() |
119 | { | 119 | { |
120 | } | 120 | } |
121 | 121 | ||
122 | void TVListView::addItem(DataElem *d) | 122 | void TVListView::addItem(DataElem *d) |
123 | { | 123 | { |
124 | TVListViewItem *i = new TVListViewItem(listViewDisplay, d); | 124 | TVListViewItem *i = new TVListViewItem(listViewDisplay, d); |
125 | 125 | ||
126 | delete it; | 126 | delete it; |
127 | it = new QListViewItemIterator(i); | 127 | it = new QListViewItemIterator(i); |
128 | } | 128 | } |
129 | 129 | ||
130 | /* remove current (it) item */ | 130 | /* remove current (it) item */ |
131 | void TVListView::removeItem() | 131 | void TVListView::removeItem() |
132 | { | 132 | { |
133 | QListViewItemIterator other(*it); | 133 | QListViewItemIterator other(*it); |
134 | 134 | ||
135 | QListViewItemIterator tmp = *it; | 135 | QListViewItemIterator tmp = *it; |
136 | (*it)++; | 136 | (*it)++; |
137 | if (!it->current()) { | 137 | if (!it->current()) { |
138 | *it = tmp; | 138 | *it = tmp; |
139 | (*it)--; | 139 | (*it)--; |
140 | if (!it->current()) { | 140 | if (!it->current()) { |
141 | delete it; | 141 | delete it; |
142 | it = 0; | 142 | it = 0; |
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | delete other.current(); | 146 | delete other.current(); |
147 | } | 147 | } |
148 | 148 | ||
149 | void TVListView::clearItems() | 149 | void TVListView::clearItems() |
150 | { | 150 | { |
151 | /* This is ok since the destructor for TVListItem does not know about | 151 | /* This is ok since the destructor for TVListItem does not know about |
152 | the data_reference pointer.. and hence will leave it alone */ | 152 | the data_reference pointer.. and hence will leave it alone */ |
153 | listViewDisplay->clear(); | 153 | listViewDisplay->clear(); |
154 | delete it; | 154 | delete it; |
155 | it = new QListViewItemIterator(listViewDisplay); | 155 | it = new QListViewItemIterator(listViewDisplay); |
156 | } | 156 | } |
157 | 157 | ||
158 | void TVListView::first() | 158 | void TVListView::first() |
159 | { | 159 | { |
160 | delete it; | 160 | delete it; |
161 | it = new QListViewItemIterator(listViewDisplay); | 161 | it = new QListViewItemIterator(listViewDisplay); |
162 | } | 162 | } |
163 | 163 | ||
164 | void TVListView::last() | 164 | void TVListView::last() |
165 | { | 165 | { |
166 | qWarning("TVListView::last not yet implemented"); | 166 | qWarning("TVListView::last not yet implemented"); |
167 | } | 167 | } |
168 | 168 | ||
169 | void TVListView::next() | 169 | void TVListView::next() |
170 | { | 170 | { |
171 | QListViewItemIterator tmp = *it; | 171 | QListViewItemIterator tmp = *it; |
172 | (*it)++; | 172 | (*it)++; |
173 | if (!it->current()) { | 173 | if (!it->current()) { |
174 | *it = tmp; | 174 | *it = tmp; |
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
178 | void TVListView::previous() | 178 | void TVListView::previous() |
179 | { | 179 | { |
180 | QListViewItemIterator tmp = *it; | 180 | QListViewItemIterator tmp = *it; |
181 | (*it)--; | 181 | (*it)--; |
182 | if (!it->current()) { | 182 | if (!it->current()) { |
183 | *it = tmp; | 183 | *it = tmp; |
184 | } | 184 | } |
185 | } | 185 | } |
186 | 186 | ||
187 | DataElem *TVListView::getCurrentData() { | 187 | DataElem *TVListView::getCurrentData() { |
188 | if (it->current()) { | 188 | if (it->current()) { |
189 | return ((TVListViewItem *)it->current())->getDataElem(); | 189 | return ((TVListViewItem *)it->current())->getDataElem(); |
190 | } | 190 | } |
191 | return NULL; | 191 | return NULL; |
192 | } | 192 | } |
193 | 193 | ||
194 | /*! Now to implement the closest match function */ | 194 | /*! Now to implement the closest match function */ |
195 | void TVListView::findItem(int keyId, TVVariant value) | 195 | void TVListView::findItem(int keyId, TVVariant value) |
196 | { | 196 | { |
197 | QListViewItem *i; | 197 | QListViewItem *i; |
198 | TVListViewItem *best_so_far = NULL; | 198 | TVListViewItem *best_so_far = NULL; |
199 | /* start at the beginning... go through till find the closest elem */ | 199 | /* start at the beginning... go through till find the closest elem */ |
200 | i = listViewDisplay->firstChild(); | 200 | i = listViewDisplay->firstChild(); |
201 | while (i) { | 201 | while (i) { |
202 | /* search stuff */ | 202 | /* search stuff */ |
203 | if(best_so_far) { | 203 | if(best_so_far) { |
204 | if (DataElem::closer( | 204 | if (DataElem::closer( |