-
Notifications
You must be signed in to change notification settings - Fork 0
/
annotationinfodialog.ui.h
168 lines (152 loc) · 5.59 KB
/
annotationinfodialog.ui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
/* -*- c++ -*-
* annotationinfodialog.ui.h
*
* Header for the AnnotationInfoDialog class
* Copyright (C) 2002 lignum Computing, Inc. <lignumcad@lignumcomputing.com>
* $Id$
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename slots use Qt Designer which will
** update this file, preserving your code. Create an init() slot in place of
** a constructor, and a destroy() slot in place of a destructor.
*****************************************************************************/
/*!
* Initialize the Annotation information dialog.
*/
void AnnotationInfoDialog::init()
{
int width = boldButton->sizeHint().width();
width = QMAX( width, boldButton->sizeHint().height() );
width = QMAX( width, italicButton->sizeHint().width() );
width = QMAX( width, italicButton->sizeHint().height() );
width = QMAX( width, underlineButton->sizeHint().width() );
width = QMAX( width, underlineButton->sizeHint().height() );
boldButton->setFixedSize( width, width );
italicButton->setFixedSize( width, width );
underlineButton->setFixedSize( width, width );
QFont font;
if ( !OpenGLGlobals::instance()->annotationFont().isEmpty() )
font.fromString( OpenGLGlobals::instance()->annotationFont() );
annotationTextEdit->setFont( font );
QValueList<int> sizes = QFontDatabase::standardSizes();
QValueList<int>::Iterator it = sizes.begin();
for ( ; it != sizes.end(); ++it )
sizesComboBox->insertItem( QString::number( *it ) );
QPixmap sample( 24, 24 );
sample.fill( annotationTextEdit->colorGroup().text() );
colorButton->setPixmap( sample );
}
/*!
* Set the bold attribute of the selected text. Also makes this the current
* state of the bold attribute.
* \param bold new bold attribute.
*/
void AnnotationInfoDialog::boldButton_toggled( bool bold )
{
annotationTextEdit->setBold( bold );
}
/*!
* Set the italic attribute of the selected text. Also makes this the current
* state of the italic attribute.
* \param italic new italic attribute.
*/
void AnnotationInfoDialog::italicButton_toggled( bool italic )
{
annotationTextEdit->setItalic( italic );
}
/*!
* Set the underline attribute of the selected text. Also makes this the
* current state of the underline attribute.
* \param underline new underline attribute.
*/
void AnnotationInfoDialog::underlineButton_toggled( bool underline )
{
annotationTextEdit->setUnderline( underline );
}
/*!
* Set the point size of the selected text. Also makes this the current
* state of the font size.
* \param value new point size.
*/
void AnnotationInfoDialog::pointSizeSpinBox_valueChanged( int value )
{
annotationTextEdit->setPointSize(value);
}
/*!
* Set the color of the selected text. Runs the standard Qt color selector.
* Also makes this the current state of the color attribute.
*/
void AnnotationInfoDialog::colorButton_clicked()
{
QColor color = QColorDialog::getColor( annotationTextEdit->color(), this );
annotationTextEdit->setColor( color );
QPixmap sample( 24, 24);
sample.fill( color );
colorButton->setPixmap( sample );
}
/*!
* This is invoked when the text edit cursor enters a region of text
* with a different color from the current color.
* \param color current color at cursor.
*/
void AnnotationInfoDialog::annotationTextEdit_currentColorChanged( const QColor & color )
{
QPixmap sample( 24, 24 );
sample.fill( color );
colorButton->setPixmap( sample );
}
/*!
* This is invoked when the text edit cursor enters a region of
* different attributes from the current attributes.
* \param font current font at cursor.
*/
void AnnotationInfoDialog::annotationTextEdit_currentFontChanged( const QFont & font )
{
boldButton->setOn( font.bold() );
italicButton->setOn( font.italic() );
underlineButton->setOn( font.underline() );
sizesComboBox->setCurrentText( QString::number( font.pointSize() ) );
}
/*!
* This is invoked when the user changes the font point size.
* \param text point size text from combo box.
*/
void AnnotationInfoDialog::sizesComboBox_activated( const QString & text )
{
annotationTextEdit->setPointSize( text.toInt() );
}
/*!
* Display brief help message for annotation text editor.
*/
void AnnotationInfoDialog::buttonHelp_clicked()
{
QWhatsThis::display( tr("<p><b>Annotation Information</b></p>\
<p>This dialog allows you to edit selected properties of a \
text annotation. These include:\
<ul>\
<li>Name</li>\
<li>Text (including font size, color and style)</li>\
</ul></p>\
<p>After the properties are adjusted as desired, click on the \
<b>OK</b> button (or press <b>Enter</b> or <b>Alt+O</b>) \
to accept your changes. Clicking the <b>Cancel</b> button \
(or pressing <b>ESC</b> or <b>Alt+C</b>) will exit the \
dialog without applying the changes.</p>" ) );
}