39 #include <tqcolordialog.h>
40 void itemAttributeDialog::init( )
49 void itemAttributeDialog::ChangeText_clicked()
52 TQColor c = TQColorDialog::getColor( myItem->textColor(),
this );
54 myItem->setTextColor( c );
55 TQPixmap * pix = (TQPixmap *)ChangeText->pixmap();
56 pix->fill( myItem->textColor() );
57 ChangeText->repaint();
61 void itemAttributeDialog::ChangeStart_clicked()
65 myItem->shapes( start, middle, end );
67 myItem->colors( st, mi, en );
68 TQColor c = TQColorDialog::getColor( st,
this );
72 myItem->setColors( st, mi, en );
78 void itemAttributeDialog::ChangeMiddle_clicked()
82 myItem->shapes( start, middle, end );
84 myItem->colors( st, mi, en );
85 TQColor c = TQColorDialog::getColor( mi,
this );
89 myItem->setColors( st, mi, en );
94 void itemAttributeDialog::ChangeEnd_clicked()
98 myItem->shapes( start, middle, end );
100 myItem->colors( st, mi, en );
101 TQColor c = TQColorDialog::getColor( en,
this );
105 myItem->setColors( st, mi, en );
112 DateEdit1->setDate( item->
startTime().date() );
113 TimeEdit1->setTime( item->
startTime().time() );
114 switch( item->
type() ) {
115 case KDGanttViewItem::Event:
121 case KDGanttViewItem::Summary:
124 DateEdit3->setDate( item->
endTime().date() );
125 TimeEdit3->setTime( item->
endTime().time() );
131 case KDGanttViewItem::Task:
134 DateEdit3->setDate( item->
endTime().date() );
135 TimeEdit3->setTime( item->
endTime().time() );
150 StartBox->setEnabled(
true );
151 switch( item->
type() ) {
152 case KDGanttViewItem::Event:
153 MiddleBox->setEnabled(
false );
154 EndBox->setEnabled(
false );
155 ChangeMiddle->setEnabled(
false );
156 ChangeEnd->setEnabled(
false );
157 HighMiddle->setEnabled(
false );
158 HighEnd->setEnabled(
false );
159 DateEdit2->setEnabled(
false );
160 TimeEdit2->setEnabled(
false );
161 DateEdit3->setEnabled(
false );
162 TimeEdit3->setEnabled(
false );
163 DateEdit4->setEnabled(
true );
164 TimeEdit4->setEnabled(
true );
165 DateEdit5->setEnabled(
false );
166 TimeEdit5->setEnabled(
false );
171 case KDGanttViewItem::Summary:
172 MiddleBox->setEnabled(
true );
173 EndBox->setEnabled(
true );
174 ChangeMiddle->setEnabled(
true );
175 ChangeEnd->setEnabled(
true );
176 HighMiddle->setEnabled(
true );
177 HighEnd->setEnabled(
true );
179 DateEdit2->setEnabled(
true );
180 TimeEdit2->setEnabled(
true );
181 DateEdit3->setEnabled(
true );
182 TimeEdit3->setEnabled(
true );
183 DateEdit4->setEnabled(
false );
184 TimeEdit4->setEnabled(
false );
185 DateEdit5->setEnabled(
true );
186 TimeEdit5->setEnabled(
true );
188 DateEdit3->setDate( item->
endTime().date() );
189 TimeEdit3->setTime( item->
endTime().time() );
195 case KDGanttViewItem::Task:
196 MiddleBox->setEnabled(
false );
197 StartBox->setEnabled(
false );
198 EndBox->setEnabled(
false );
199 ChangeMiddle->setEnabled(
false );
200 ChangeEnd->setEnabled(
false );
201 HighMiddle->setEnabled(
false );
202 HighEnd->setEnabled(
false );
204 DateEdit2->setEnabled(
false );
205 TimeEdit2->setEnabled(
false );
206 DateEdit3->setEnabled(
true );
207 TimeEdit3->setEnabled(
true );
208 DateEdit4->setEnabled(
false );
209 TimeEdit4->setEnabled(
false );
210 DateEdit5->setEnabled(
false );
211 TimeEdit5->setEnabled(
false );
213 DateEdit3->setDate( item->
endTime().date() );
214 TimeEdit3->setTime( item->
endTime().time() );
221 DateEdit2->setEnabled(
false );
222 TimeEdit2->setEnabled(
false );
223 DateEdit3->setEnabled(
false );
224 TimeEdit3->setEnabled(
false );
225 DateEdit4->setEnabled(
false );
226 TimeEdit4->setEnabled(
false );
227 DateEdit5->setEnabled(
false );
228 TimeEdit5->setEnabled(
false );
229 DateEdit1->setEnabled(
false );
230 TimeEdit1->setEnabled(
false );
233 DateEdit1->setEnabled(
true );
234 TimeEdit1->setEnabled(
true );
236 DateEdit1->setDate( item->
startTime().date() );
237 TimeEdit1->setTime( item->
startTime().time() );
238 if ( item->
pixmap() != 0 )
239 setIcon( *(item->
pixmap()) );
240 setCaption(
"Properties of " + ((TQListViewItem*)item)->text(0) );
241 itemName->setText(((TQListViewItem*)item)->text(0) );
245 LineEdit1->setText( item->text() );
247 item->shapes( start, middle, end );
249 item->colors( st, mi, en );
253 item->highlightColors( st, mi, en );
257 ChangeText->setPixmap(TQPixmap( 16,16 ));
259 pix = (TQPixmap *)ChangeText->pixmap();
260 pix->fill( item->textColor() );
261 StartBox->setCurrentItem((
int)start );
262 MiddleBox->setCurrentItem((
int)middle );
263 EndBox->setCurrentItem( (
int) end );
264 CalBox->setChecked( item-> displaySubitemsAsGroup() );
265 PrioSpinBox->setValue( item->priority() );
266 PrioSlider->setValue( item->priority() );
271 void itemAttributeDialog::HighStart_clicked()
273 if ( !myItem)
return;
275 myItem->shapes( start, middle, end );
277 myItem->highlightColors( st, mi, en );
278 TQColor c = TQColorDialog::getColor( st,
this );
282 myItem->setHighlightColors( st, mi, en );
288 void itemAttributeDialog::HighMiddle_clicked()
290 if ( !myItem)
return;
292 myItem->shapes( start, middle, end );
294 myItem->highlightColors( st, mi, en );
295 TQColor c = TQColorDialog::getColor( mi,
this );
299 myItem->setHighlightColors( st, mi, en );
305 void itemAttributeDialog::HighEnd_clicked()
307 if ( !myItem)
return;
309 myItem->shapes( start, middle, end );
311 myItem->highlightColors( st, mi, en );
312 TQColor c = TQColorDialog::getColor( en,
this );
316 myItem->setHighlightColors( st, mi, en );
322 void itemAttributeDialog::DateEdit1_valueChanged(
const TQDate & )
324 if ( !myItem)
return;
326 dt.setDate( DateEdit1->date() );
327 dt.setTime( TimeEdit1->time() );
330 myItem->setStartTime( dt );
336 void itemAttributeDialog::TimeEdit1_valueChanged(
const TQTime & )
338 if ( !myItem)
return;
340 dt.setDate( DateEdit1->date() );
341 dt.setTime( TimeEdit1->time() );
342 if ( dt.isValid() ) {
343 myItem->setStartTime( dt );
350 void itemAttributeDialog::DateEdit2_valueChanged(
const TQDate & )
352 if ( !myItem)
return;
354 dt.setDate( DateEdit2->date() );
355 dt.setTime( TimeEdit2->time() );
356 if ( dt.isValid() ) {
363 void itemAttributeDialog::TimeEdit2_valueChanged(
const TQTime & )
365 if ( !myItem)
return;
367 dt.setDate( DateEdit2->date() );
368 dt.setTime( TimeEdit2->time() );
369 if ( dt.isValid() ) {
376 void itemAttributeDialog::DateEdit3_valueChanged(
const TQDate & )
378 if ( !myItem)
return;
380 dt.setDate( DateEdit3->date() );
381 dt.setTime( TimeEdit3->time() );
382 if ( dt.isValid() ) {
383 myItem->setEndTime( dt );
389 void itemAttributeDialog::TimeEdit3_valueChanged(
const TQTime & )
391 if ( !myItem)
return;
393 dt.setDate( DateEdit3->date() );
394 dt.setTime( TimeEdit3->time() );
395 if ( dt.isValid() ) {
396 myItem->setEndTime( dt );
402 void itemAttributeDialog::LineEdit1_textChanged(
const TQString & )
404 if ( !myItem)
return;
405 myItem->setText(LineEdit1->text());
409 void itemAttributeDialog::StartBox_activated(
const TQString & s )
412 myItem->shapes( start, middle, end );
413 start = KDGanttViewItem::stringToShape( s );
414 myItem->setShapes( start, middle, end );
419 void itemAttributeDialog::MiddleBox_activated(
const TQString & s )
422 myItem->shapes( start, middle, end );
423 middle = KDGanttViewItem::stringToShape( s );
424 myItem->setShapes( start, middle, end );
430 void itemAttributeDialog::EndBox_activated(
const TQString & s )
433 myItem->shapes( start, middle, end );
434 end = KDGanttViewItem::stringToShape( s );
435 myItem->setShapes( start, middle, end );
441 void itemAttributeDialog::DateEdit4_valueChanged(
const TQDate & )
443 if ( !myItem)
return;
445 dt.setDate( DateEdit4->date() );
446 dt.setTime( TimeEdit4->time() );
447 if ( dt.isValid() ) {
454 void itemAttributeDialog::TimeEdit4_valueChanged(
const TQTime & )
456 if ( !myItem)
return;
458 dt.setDate( DateEdit4->date() );
459 dt.setTime( TimeEdit4->time() );
460 if ( dt.isValid() ) {
467 void itemAttributeDialog::DateEdit5_valueChanged(
const TQDate & )
469 if ( !myItem)
return;
471 dt.setDate( DateEdit5->date() );
472 dt.setTime( TimeEdit5->time() );
473 if ( dt.isValid() ) {
480 void itemAttributeDialog::TimeEdit5_valueChanged(
const TQTime & )
482 if ( !myItem)
return;
484 dt.setDate( DateEdit5->date() );
485 dt.setTime( TimeEdit5->time() );
486 if ( dt.isValid() ) {
494 void itemAttributeDialog::itemName_textChanged(
const TQString & )
496 if ( !myItem)
return;
497 ((TQListViewItem*)myItem)->setText( 0, itemName->text() );
498 setCaption(
"Properties of " + itemName->text() );
502 void itemAttributeDialog::PrioSpinBox_valueChanged(
int val )
504 if ( !myItem)
return;
505 myItem->setPriority( val );
506 PrioSlider->blockSignals(
true );
507 PrioSlider->setValue( val );
508 PrioSlider->blockSignals(
false );
513 void itemAttributeDialog::CalBox_toggled(
bool mode )
515 if ( !myItem)
return;
516 myItem->setDisplaySubitemsAsGroup( mode );
517 if (myItem->firstChild() )
522 void itemAttributeDialog::PrioSlider_valueChanged(
int val )
524 if ( !myItem)
return;
525 myItem->setPriority( val );
526 PrioSpinBox->blockSignals(
true );
527 PrioSpinBox->setValue( val );
528 PrioSpinBox->blockSignals(
false );
const TQPixmap * pixmap(int column=0) const
TQDateTime endTime() const
bool displaySubitemsAsGroup() const
KDGanttViewItem * firstChild() const
TQDateTime startTime() const
static TQPixmap getPixmap(KDGanttViewItem::Shape shape, const TQColor &shapeColor, const TQColor &backgroundColor, int itemSize)