24static const char* const buttonnone[]={
42static const char* const buttonsolid[]={
54static const char* const buttongradient[]={
79static const char* const buttonpattern[]={
98static const char* const buttonnone[]={
124static const char* const buttonsolid[]={
147static const char* const buttongradient[]={
180static const char* const buttonpattern[]={
207#include <tqtoolbutton.h>
208#include <tqtooltip.h>
210#include <tdelocale.h>
212#include "karbon_part.h"
214#include "vselection.h"
215#include "vstrokecmd.h"
217#include "vtypebuttonbox.h"
219VTypeButtonBox::VTypeButtonBox( KarbonPart *part,
220 TQWidget* parent, const char* name )
221 : TQHButtonGroup( parent, name ),
222 m_part( part ), m_isStrokeManipulator( false )
224 setMaximumWidth( parent->width() - 2 );
227 TQToolButton* button = new TQToolButton( this );
228 button->setPixmap( TQPixmap( ( const char **) buttonnone ) );
229 button->setMaximumWidth( 14 );
230 button->setMaximumHeight( 14 );
231 TQToolTip::add( button, i18n( "None" ) );
232 insert( button, none );
235 button = new TQToolButton( this );
236 button->setPixmap( TQPixmap( ( const char **) buttonsolid ) );
237 button->setMaximumWidth( 14 );
238 button->setMaximumHeight( 14 );
239 TQToolTip::add( button, i18n( "Solid" ) );
240 insert( button, solid );
243 button = new TQToolButton( this );
244 button->setPixmap( TQPixmap( ( const char **) buttongradient ) );
245 button->setMaximumWidth( 14 );
246 button->setMaximumHeight( 14 );
247 TQToolTip::add( button, i18n( "Gradient" ) );
248 insert( button, gradient );
251 button = new TQToolButton( this );
252 button->setPixmap( TQPixmap( ( const char **) buttonpattern ) );
253 button->setMaximumWidth( 14 );
254 button->setMaximumHeight( 14 );
255 TQToolTip::add( button, i18n( "Pattern" ) );
256 insert( button, pattern );
258 setInsideMargin( 1 );
259 setInsideSpacing( 1 );
260 connect( this, TQ_SIGNAL( clicked( int ) ),
261 this, TQ_SLOT( slotButtonPressed( int ) ) );
265VTypeButtonBox::slotButtonPressed( int id )
267 if( m_part && m_part->document().selection()->objects().count() > 0 ) {
268 if ( m_isStrokeManipulator )
269 manipulateStrokes( id );
271 manipulateFills( id );
276VTypeButtonBox::setStroke()
278 m_isStrokeManipulator = true;
282VTypeButtonBox::setFill()
284 m_isStrokeManipulator = false;
288VTypeButtonBox::manipulateFills( int id )
291 m_fill = *m_part->document().selection()->objects().getFirst()->fill();
294 m_fill.setType( VFill::none );
305 m_part->addCommand( new VFillCmd( &m_part->document(), m_fill ), true );
309VTypeButtonBox::manipulateStrokes( int id )
312 m_stroke = *m_part->document().selection()->objects().getFirst()->stroke();
315 m_stroke.setType( VStroke::none );
326 m_part->addCommand( new VStrokeCmd( &m_part->document(), &m_stroke ), true );
329#include "vtypebuttonbox.moc"
Keeps track of visual per document properties.
|