kpresenter

KPrShadowDialogImpl.cpp
1#include <tqspinbox.h>
2#include <tqgroupbox.h>
3#include <tqlayout.h>
4#include <tqbuttongroup.h>
5
6#include <kcolorbutton.h>
7#include <tdelocale.h>
8
9#include "KPrShadowDialogImpl.h"
10#include "KPrTextPreview.h"
11
12KPrShadowDialogImpl::KPrShadowDialogImpl( TQWidget *parent, const char* name )
13 : ShadowDialogBase( parent, name )
14{
15 _preview = new KPrTextPreview( previewPanel );
16 TQHBoxLayout *lay = new TQHBoxLayout( previewPanel, previewPanel->lineWidth(), 0 );
17 lay->addWidget( _preview );
18 distanceSpinBox->setSuffix(i18n("pt"));
19 ltButton->setPixmap( BarIcon( "shadowLU" ) );
20 tButton->setPixmap( BarIcon( "shadowU" ) );
21 rtButton->setPixmap( BarIcon( "shadowRU" ) );
22 rButton->setPixmap( BarIcon( "shadowR" ) );
23 rbButton->setPixmap( BarIcon( "shadowRB" ) );
24 bButton->setPixmap( BarIcon( "shadowB" ) );
25 lbButton->setPixmap( BarIcon( "shadowLB" ) );
26 lButton->setPixmap( BarIcon( "shadowL" ) );
27
28 connect( colorButton, TQ_SIGNAL( changed( const TQColor& ) ),
29 TQ_SLOT( colorChanged( const TQColor& ) ) );
30}
31
32void KPrShadowDialogImpl::setShadowDirection( ShadowDirection d )
33{
34 _preview->setShadowDirection( d );
35 directionGroup->setButton( d );
36}
37
38void KPrShadowDialogImpl::setShadowDistance( int d )
39{
40 _preview->setShadowDistance( d );
41 distanceSpinBox->setValue( d );
42}
43
44void KPrShadowDialogImpl::setShadowColor( const TQColor &c )
45{
46 _preview->setShadowColor( c );
47 colorButton->setColor( c );
48}
49
50void KPrShadowDialogImpl::colorChanged( const TQColor& c )
51{
52 _preview->setShadowColor( c );
53}
54
55void KPrShadowDialogImpl::directionChanged( int d )
56{
57 _preview->setShadowDirection( (ShadowDirection)d );
58}
59
60void KPrShadowDialogImpl::distanceChanged( int d )
61{
62 _preview->setShadowDistance( d );
63}
64
65void KPrShadowDialogImpl::applyClicked()
66{
67 emit apply();
68}
69
70void KPrShadowDialogImpl::okClicked()
71{
72 applyClicked();
73 accept();
74}
75
76ShadowDirection KPrShadowDialogImpl::shadowDirection()
77{
78 return (ShadowDirection) ( directionGroup->id( directionGroup->selected() ) );
79}
80
81int KPrShadowDialogImpl::shadowDistance()
82{
83 return distanceSpinBox->value();
84}
85
86TQColor KPrShadowDialogImpl::shadowColor()
87{
88 return colorButton->color();
89}
90#include "KPrShadowDialogImpl.moc"