MessageToolbar::MessageToolbar() { // Create toolbar buttons tag = new QPushButton(); trash = new QPushButton(); replyall = new QPushButton(); reply = new QPushButton(); forward = new QPushButton(); // Set button icons tag->setIcon(QIcon(":/eskridge/sleekmail/icons/Star.png")); trash->setIcon(QIcon(":/eskridge/sleekmail/icons/Trash.png")); replyall->setIcon(QIcon(":/eskridge/sleekmail/icons/ReplyAll.png")); reply->setIcon(QIcon(":/eskridge/sleekmail/icons/Reply.png")); forward->setIcon(QIcon(":/eskridge/sleekmail/icons/Forward.png")); // Configure each of the buttons setupButton(tag); setupButton(trash); setupButton(replyall); setupButton(reply); setupButton(forward); // Create a layout layout = new QHBoxLayout(); layout->setMargin(5); layout->setSpacing(0); layout->addWidget(tag); layout->addWidget(trash); layout->addWidget(forward); layout->addWidget(reply); layout->addWidget(replyall); setLayout(layout); }
/* * main.c */ int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer unsigned int event; P2DIR = 0xFF; P2OUT = 0; setupButton(PORT1, P4, 0x1234, HIGH_TO_LOW); setupButton(PORT1, P5, 0x1212, HIGH_TO_LOW); setupButton(PORT1, P3, 0xDEAD, HIGH_TO_LOW); for(;;) { event = getButtonEvent(); if(event == 0x1234) { P2OUT ^= BIT0; } else if(event == 0x1212) { P2OUT ^= BIT1; } else if (event == 0xDEAD) { P2OUT ^= BIT2; } } return 0; }
AppToolbar::AppToolbar() { // Create toolbar buttons refresh = new QPushButton(); compose = new QPushButton(); add = new QPushButton(); settings = new QPushButton(); // Set button icons refresh->setIcon(QIcon(":/eskridge/sleekmail/icons/Reload.png")); compose->setIcon(QIcon(":/eskridge/sleekmail/icons/Compose.png")); add->setIcon(QIcon(":/eskridge/sleekmail/icons/Add.png")); settings->setIcon(QIcon(":/eskridge/sleekmail/icons/Settings.png")); // Configure each of the buttons setupButton(refresh); setupButton(compose); setupButton(add); setupButton(settings); // Create a layout layout = new QHBoxLayout(); layout->setMargin(5); layout->setSpacing(0); layout->addWidget(refresh); layout->addWidget(compose); layout->addWidget(add); layout->addWidget(settings); setLayout(layout); }
QFrame *AbstractController::discFrame() { /** Disc and Menus handling */ QFrame *discFrame = new QFrame( this ); QHBoxLayout *discLayout = new QHBoxLayout( discFrame ); discLayout->setSpacing( 0 ); discLayout->setMargin( 0 ); QFrame *chapFrame = new QFrame( discFrame ); QHBoxLayout *chapLayout = new QHBoxLayout( chapFrame ); chapLayout->setSpacing( 0 ); chapLayout->setMargin( 0 ); QToolButton *prevSectionButton = new QToolButton( chapFrame ); setupButton( prevSectionButton ); BUTTON_SET_BAR2( prevSectionButton, toolbar/dvd_prev, qtr("Previous Chapter/Title" ) ); chapLayout->addWidget( prevSectionButton ); QToolButton *nextSectionButton = new QToolButton( chapFrame ); setupButton( nextSectionButton ); BUTTON_SET_BAR2( nextSectionButton, toolbar/dvd_next, qtr("Next Chapter/Title" ) ); chapLayout->addWidget( nextSectionButton ); discLayout->addWidget( chapFrame ); chapFrame->hide(); QFrame *menuFrame = new QFrame( discFrame ); QHBoxLayout *menuLayout = new QHBoxLayout( menuFrame ); menuLayout->setSpacing( 0 ); menuLayout->setMargin( 0 ); QToolButton *menuButton = new QToolButton( menuFrame ); setupButton( menuButton ); menuLayout->addWidget( menuButton ); BUTTON_SET_BAR2( menuButton, toolbar/dvd_menu, qtr( "Menu" ) ); discLayout->addWidget( menuFrame ); menuFrame->hide(); /* Change the navigation button display when the IM navigation changes */ CONNECT( THEMIM->getIM(), chapterChanged( bool ), chapFrame, setVisible( bool ) ); CONNECT( THEMIM->getIM(), titleChanged( bool ), menuFrame, setVisible( bool ) ); /* Changes the IM navigation when triggered on the nav buttons */ CONNECT( prevSectionButton, clicked(), THEMIM->getIM(), sectionPrev() ); CONNECT( nextSectionButton, clicked(), THEMIM->getIM(), sectionNext() ); CONNECT( menuButton, clicked(), THEMIM->getIM(), sectionMenu() ); return discFrame; }
UserItemWidget::UserItemWidget(QWidget *parent, QString itemPath, bool isDir, bool goback) : QFrame(parent){ createWidget(); //Now fill it appropriately if(itemPath.endsWith(".desktop")){ bool ok = false; XDGDesktop item = LXDG::loadDesktopFile(itemPath, ok); if(ok){ icon->setPixmap( LXDG::findIcon(item.icon, "preferences-system-windows-actions").pixmap(30,30) ); name->setText( this->fontMetrics().elidedText(item.name, Qt::ElideRight, 180) ); }else{ icon->setPixmap( LXDG::findIcon("unknown","").pixmap(30,30) ); name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, 180) ); } }else if(isDir){ if(itemPath.endsWith("/")){ itemPath.chop(1); } if(goback){ icon->setPixmap( LXDG::findIcon("go-previous","").pixmap(30,30) ); name->setText( tr("Go Back") ); }else{ icon->setPixmap( LXDG::findIcon("folder","").pixmap(30,30) ); name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, 180) ); } }else{ if(itemPath.endsWith("/")){ itemPath.chop(1); } icon->setPixmap( LXDG::findMimeIcon(itemPath.section("/",-1).section(".",-1)).pixmap(30,30) ); name->setText( this->fontMetrics().elidedText(itemPath.section("/",-1), Qt::ElideRight, 180) ); } linkPath = QFile::symLinkTarget(itemPath); icon->setWhatsThis(itemPath); if(isDir && !linkPath.isEmpty()){ isDir = false; } //not a real directory - just a sym link isDirectory = isDir; //save this for later isShortcut = itemPath.contains("/home/") && (itemPath.contains("/Desktop/") || itemPath.contains("/.lumina/favorites/") ); //Now setup the button appropriately setupButton(goback); }
void setup() { cli(); setupButton(); DDRB set(LED); PORTB set(LED); sei(); }
// Language change stuff void LineEditWithIcon::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { setupButton(); } else { QWidget::changeEvent(e); } }
MyLineEdit::MyLineEdit(QWidget *parent) : LineEditWithIcon(parent) { setupButton(); button->hide(); connect(button, SIGNAL(clicked()), this, SLOT(clear())); connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(updateCloseButton(const QString&))); }
UserItemWidget::UserItemWidget(QWidget *parent, XDGDesktop item) : QFrame(parent){ createWidget(); isDirectory = false; linkPath = QFile::symLinkTarget(item.filePath); isShortcut = item.filePath.contains("/home/") && (item.filePath.contains("/Desktop/") || item.filePath.contains("/.lumina/favorites/") ); //Now fill it appropriately icon->setPixmap( LXDG::findIcon(item.icon,"preferences-system-windows-actions").pixmap(30,30) ); name->setText( this->fontMetrics().elidedText(item.name, Qt::ElideRight, 180) ); icon->setWhatsThis(item.filePath); //Now setup the button appropriately setupButton(); }
LineEditWithIcon::LineEditWithIcon(QWidget *parent) : QLineEdit(parent) { button = new QToolButton(this); button->setCursor(Qt::ArrowCursor); setupButton(); }
QFrame *AbstractController::telexFrame() { /** * Telextext QFrame **/ QFrame *telexFrame = new QFrame( this ); QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame ); telexLayout->setSpacing( 0 ); telexLayout->setMargin( 0 ); CONNECT( THEMIM->getIM(), teletextPossible( bool ), telexFrame, setVisible( bool ) ); /* On/Off button */ QToolButton *telexOn = new QToolButton; setupButton( telexOn ); BUTTON_SET_BAR2( telexOn, toolbar/tv, qtr( "Teletext Activation" ) ); telexOn->setEnabled( false ); telexOn->setCheckable( true ); telexLayout->addWidget( telexOn ); /* Teletext Activation and set */ CONNECT( telexOn, clicked( bool ), THEMIM->getIM(), activateTeletext( bool ) ); CONNECT( THEMIM->getIM(), teletextPossible( bool ), telexOn, setEnabled( bool ) ); /* Transparency button */ QToolButton *telexTransparent = new QToolButton; setupButton( telexTransparent ); BUTTON_SET_BAR2( telexTransparent, toolbar/tvtelx, qtr( "Toggle Transparency " ) ); telexTransparent->setEnabled( false ); telexTransparent->setCheckable( true ); telexLayout->addWidget( telexTransparent ); /* Transparency change and set */ CONNECT( telexTransparent, clicked( bool ), THEMIM->getIM(), telexSetTransparency( bool ) ); CONNECT( THEMIM->getIM(), teletextTransparencyActivated( bool ), telexTransparent, setChecked( bool ) ); /* Page setting */ QSpinBox *telexPage = new QSpinBox( telexFrame ); telexPage->setRange( 100, 899 ); telexPage->setValue( 100 ); telexPage->setAccelerated( true ); telexPage->setWrapping( true ); telexPage->setAlignment( Qt::AlignRight ); telexPage->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum ); telexPage->setEnabled( false ); telexLayout->addWidget( telexPage ); /* Contextual & Index Buttons */ QSignalMapper *contextButtonMapper = new QSignalMapper( this ); QToolButton *contextButton = NULL; int i_iconminsize = __MAX( 16, telexOn->minimumHeight() ); QPixmap iconPixmap( i_iconminsize, i_iconminsize ); iconPixmap.fill( Qt::transparent ); QPainter iconPixmapPainter( &iconPixmap ); QLinearGradient iconPixmapPainterGradient( iconPixmap.rect().center() / 2, iconPixmap.rect().center() ); #define CREATE_CONTEXT_BUTTON(color, key) \ iconPixmapPainterGradient.setColorAt( 0, QColor( color ).lighter(150) );\ iconPixmapPainterGradient.setColorAt( 1.0, QColor( color ) );\ iconPixmapPainter.setBrush( iconPixmapPainterGradient );\ iconPixmapPainter.drawEllipse( iconPixmap.rect().adjusted( 4, 4, -5, -5 ) );\ contextButton = new QToolButton();\ setupButton( contextButton );\ contextButton->setIcon( iconPixmap );\ contextButton->setEnabled( false );\ contextButtonMapper->setMapping( contextButton, key << 16 );\ CONNECT( contextButton, clicked(), contextButtonMapper, map() );\ CONNECT( contextButtonMapper, mapped( int ),\ THEMIM->getIM(), telexSetPage( int ) );\ CONNECT( THEMIM->getIM(), teletextActivated( bool ), contextButton, setEnabled( bool ) );\ telexLayout->addWidget( contextButton ) CREATE_CONTEXT_BUTTON("grey", 'i'); /* index */ CREATE_CONTEXT_BUTTON("red", 'r'); CREATE_CONTEXT_BUTTON("green", 'g'); CREATE_CONTEXT_BUTTON("yellow", 'y'); CREATE_CONTEXT_BUTTON("blue", 'b'); #undef CREATE_CONTEXT_BUTTON /* Page change and set */ CONNECT( telexPage, valueChanged( int ), THEMIM->getIM(), telexSetPage( int ) ); CONNECT( THEMIM->getIM(), newTelexPageSet( int ), telexPage, setValue( int ) ); CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexPage, setEnabled( bool ) ); CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexTransparent, setEnabled( bool ) ); CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexOn, setChecked( bool ) ); return telexFrame; }
QWidget *AbstractController::createWidget( buttonType_e button, int options ) { bool b_flat = options & WIDGET_FLAT; bool b_big = options & WIDGET_BIG; bool b_shiny = options & WIDGET_SHINY; bool b_special = false; QWidget *widget = NULL; switch( button ) { case PLAY_BUTTON: { PlayButton *playButton = new PlayButton; setupButton( playButton ); BUTTON_SET_BAR( playButton ); CONNECT_MAP_SET( playButton, PLAY_ACTION ); CONNECT( this, inputPlaying( bool ), playButton, updateButtonIcons( bool )); playButton->updateButtonIcons( THEMIM->getIM()->playingStatus() == PLAYING_S ); widget = playButton; } break; case STOP_BUTTON:{ NORMAL_BUTTON( STOP ); } break; case OPEN_BUTTON:{ NORMAL_BUTTON( OPEN ); } break; case OPEN_SUB_BUTTON:{ NORMAL_BUTTON( OPEN_SUB ); } break; case PREVIOUS_BUTTON:{ NORMAL_BUTTON( PREVIOUS ); } break; case NEXT_BUTTON: { NORMAL_BUTTON( NEXT ); } break; case SLOWER_BUTTON:{ NORMAL_BUTTON( SLOWER ); ENABLE_ON_INPUT( SLOWERButton ); } break; case FASTER_BUTTON:{ NORMAL_BUTTON( FASTER ); ENABLE_ON_INPUT( FASTERButton ); } break; case PREV_SLOW_BUTTON:{ QToolButtonExt *but = new QToolButtonExt; setupButton( but ); BUTTON_SET_BAR( but ); CONNECT( but, shortClicked(), THEMIM, prev() ); CONNECT( but, longClicked(), THEAM, skipBackward() ); widget = but; } break; case NEXT_FAST_BUTTON:{ QToolButtonExt *but = new QToolButtonExt; setupButton( but ); BUTTON_SET_BAR( but ); CONNECT( but, shortClicked(), THEMIM, next() ); CONNECT( but, longClicked(), THEAM, skipForward() ); widget = but; } break; case FRAME_BUTTON: { NORMAL_BUTTON( FRAME ); ENABLE_ON_VIDEO( FRAMEButton ); } break; case FULLSCREEN_BUTTON: case DEFULLSCREEN_BUTTON: { NORMAL_BUTTON( FULLSCREEN ); ENABLE_ON_VIDEO( FULLSCREENButton ); } break; case FULLWIDTH_BUTTON: { NORMAL_BUTTON( FULLWIDTH ); } break; case EXTENDED_BUTTON:{ NORMAL_BUTTON( EXTENDED ); } break; case PLAYLIST_BUTTON:{ NORMAL_BUTTON( PLAYLIST ); } break; case SNAPSHOT_BUTTON:{ NORMAL_BUTTON( SNAPSHOT ); ENABLE_ON_VIDEO( SNAPSHOTButton ); } break; case RECORD_BUTTON:{ QToolButton *recordButton = new QToolButton; setupButton( recordButton ); CONNECT_MAP_SET( recordButton, RECORD_ACTION ); BUTTON_SET_BAR( recordButton ); ENABLE_ON_INPUT( recordButton ); recordButton->setCheckable( true ); CONNECT( THEMIM->getIM(), recordingStateChanged( bool ), recordButton, setChecked( bool ) ); widget = recordButton; } break; case ATOB_BUTTON: { AtoB_Button *ABButton = new AtoB_Button; setupButton( ABButton ); ABButton->setShortcut( qtr("Shift+L") ); BUTTON_SET_BAR( ABButton ); ENABLE_ON_INPUT( ABButton ); CONNECT_MAP_SET( ABButton, ATOB_ACTION ); CONNECT( THEMIM->getIM(), AtoBchanged( bool, bool), ABButton, updateButtonIcons( bool, bool ) ); widget = ABButton; } break; case INPUT_SLIDER: { SeekSlider *slider = new SeekSlider( Qt::Horizontal, NULL, !b_shiny ); SeekPoints *chapters = new SeekPoints( this, p_intf ); CONNECT( THEMIM->getIM(), chapterChanged( bool ), chapters, update() ); slider->setChapters( chapters ); /* Update the position when the IM has changed */ CONNECT( THEMIM->getIM(), positionUpdated( float, int64_t, int ), slider, setPosition( float, int64_t, int ) ); /* And update the IM, when the position has changed */ CONNECT( slider, sliderDragged( float ), THEMIM->getIM(), sliderUpdate( float ) ); CONNECT( THEMIM->getIM(), cachingChanged( float ), slider, updateBuffering( float ) ); /* Give hint to disable slider's interactivity when useless */ CONNECT( THEMIM->getIM(), inputCanSeek( bool ), slider, setSeekable( bool ) ); widget = slider; } break; case MENU_BUTTONS: widget = discFrame(); break; case TELETEXT_BUTTONS: widget = telexFrame(); widget->hide(); break; case VOLUME_SPECIAL: b_special = true; case VOLUME: { SoundWidget *snd = new SoundWidget( this, p_intf, b_shiny, b_special ); widget = snd; } break; case TIME_LABEL: { TimeLabel *timeLabel = new TimeLabel( p_intf ); widget = timeLabel; } break; case SPLITTER: { QFrame *line = new QFrame; line->setFrameShape( QFrame::VLine ); line->setFrameShadow( QFrame::Raised ); line->setLineWidth( 0 ); line->setMidLineWidth( 1 ); widget = line; } break; case ADVANCED_CONTROLLER: if( qobject_cast<AdvControlsWidget *>(this) == NULL ) { advControls = new AdvControlsWidget( p_intf, this ); widget = advControls; } break; case REVERSE_BUTTON:{ QToolButton *reverseButton = new QToolButton; setupButton( reverseButton ); CONNECT_MAP_SET( reverseButton, REVERSE_ACTION ); BUTTON_SET_BAR( reverseButton ); reverseButton->setCheckable( true ); /* You should, of COURSE change this to the correct event, when/if we have one, that tells us if trickplay is possible . */ CONNECT( this, inputIsTrickPlayable( bool ), reverseButton, setVisible( bool ) ); reverseButton->setVisible( false ); widget = reverseButton; } break; case SKIP_BACK_BUTTON: { NORMAL_BUTTON( SKIP_BACK ); ENABLE_ON_INPUT( SKIP_BACKButton ); } break; case SKIP_FW_BUTTON: { NORMAL_BUTTON( SKIP_FW ); ENABLE_ON_INPUT( SKIP_FWButton ); } break; case QUIT_BUTTON: { NORMAL_BUTTON( QUIT ); } break; case RANDOM_BUTTON: { NORMAL_BUTTON( RANDOM ); RANDOMButton->setCheckable( true ); RANDOMButton->setChecked( var_GetBool( THEPL, "random" ) ); CONNECT( THEMIM, randomChanged( bool ), RANDOMButton, setChecked( bool ) ); } break; case LOOP_BUTTON:{ LoopButton *loopButton = new LoopButton; setupButton( loopButton ); loopButton->setToolTip( qtr( "Click to toggle between loop all, loop one and no loop") ); loopButton->setCheckable( true ); { int i_state = NORMAL; if( var_GetBool( THEPL, "loop" ) ) i_state = REPEAT_ALL; if( var_GetBool( THEPL, "repeat" ) ) i_state = REPEAT_ONE; loopButton->updateButtonIcons( i_state ); } CONNECT( THEMIM, repeatLoopChanged( int ), loopButton, updateButtonIcons( int ) ); CONNECT( loopButton, clicked(), THEMIM, loopRepeatLoopStatus() ); widget = loopButton; } break; case INFO_BUTTON: { NORMAL_BUTTON( INFO ); } break; case PLAYBACK_BUTTONS:{ widget = new QWidget; DeckButtonsLayout *layout = new DeckButtonsLayout( widget ); BrowseButton *prev = new BrowseButton( widget, BrowseButton::Backward ); BrowseButton *next = new BrowseButton( widget ); RoundButton *play = new RoundButton( widget ); layout->setBackwardButton( prev ); layout->setForwardButton( next ); layout->setRoundButton( play ); CONNECT_MAP_SET( prev, PREVIOUS_ACTION ); CONNECT_MAP_SET( next, NEXT_ACTION ); CONNECT_MAP_SET( play, PLAY_ACTION ); } break; case ASPECT_RATIO_COMBOBOX: widget = new AspectRatioComboBox( p_intf ); widget->setMinimumHeight( 26 ); break; case SPEED_LABEL: widget = new SpeedLabel( p_intf, this ); break; case TIME_LABEL_ELAPSED: widget = new TimeLabel( p_intf, TimeLabel::Elapsed ); break; case TIME_LABEL_REMAINING: widget = new TimeLabel( p_intf, TimeLabel::Remaining ); break; default: msg_Warn( p_intf, "This should not happen %i", button ); break; } /* Customize Buttons */ if( b_flat || b_big ) { QFrame *frame = qobject_cast<QFrame *>(widget); if( frame ) { QList<QToolButton *> allTButtons = frame->findChildren<QToolButton *>(); for( int i = 0; i < allTButtons.count(); i++ ) applyAttributes( allTButtons[i], b_flat, b_big ); } else { QToolButton *tmpButton = qobject_cast<QToolButton *>(widget); if( tmpButton ) applyAttributes( tmpButton, b_flat, b_big ); } } return widget; }
QFrame *AbstractController::telexFrame() { /** * Telextext QFrame **/ QFrame *telexFrame = new QFrame( this ); QHBoxLayout *telexLayout = new QHBoxLayout( telexFrame ); telexLayout->setSpacing( 0 ); telexLayout->setMargin( 0 ); CONNECT( THEMIM->getIM(), teletextPossible( bool ), telexFrame, setVisible( bool ) ); /* On/Off button */ QToolButton *telexOn = new QToolButton; setupButton( telexOn ); BUTTON_SET_BAR2( telexOn, toolbar/tv, qtr( "Teletext Activation" ) ); telexOn->setEnabled( false ); telexOn->setCheckable( true ); telexLayout->addWidget( telexOn ); /* Teletext Activation and set */ CONNECT( telexOn, clicked( bool ), THEMIM->getIM(), activateTeletext( bool ) ); CONNECT( THEMIM->getIM(), teletextPossible( bool ), telexOn, setEnabled( bool ) ); /* Transparency button */ QToolButton *telexTransparent = new QToolButton; setupButton( telexTransparent ); BUTTON_SET_BAR2( telexTransparent, toolbar/tvtelx, qtr( "Toggle Transparency " ) ); telexTransparent->setEnabled( false ); telexTransparent->setCheckable( true ); telexLayout->addWidget( telexTransparent ); /* Transparency change and set */ CONNECT( telexTransparent, clicked( bool ), THEMIM->getIM(), telexSetTransparency( bool ) ); CONNECT( THEMIM->getIM(), teletextTransparencyActivated( bool ), telexTransparent, setChecked( bool ) ); /* Page setting */ QSpinBox *telexPage = new QSpinBox( telexFrame ); telexPage->setRange( 0, 999 ); telexPage->setValue( 100 ); telexPage->setAccelerated( true ); telexPage->setWrapping( true ); telexPage->setAlignment( Qt::AlignRight ); telexPage->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum ); telexPage->setEnabled( false ); telexLayout->addWidget( telexPage ); /* Page change and set */ CONNECT( telexPage, valueChanged( int ), THEMIM->getIM(), telexSetPage( int ) ); CONNECT( THEMIM->getIM(), newTelexPageSet( int ), telexPage, setValue( int ) ); CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexPage, setEnabled( bool ) ); CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexTransparent, setEnabled( bool ) ); CONNECT( THEMIM->getIM(), teletextActivated( bool ), telexOn, setChecked( bool ) ); return telexFrame; }
FormulaToolWidget::FormulaToolWidget( KoFormulaTool* tool, QWidget* parent ) : QTabWidget( parent ) { m_tool = tool; setupUi( this ); // setup the element insert menus m_fractionMenu.addAction( m_tool->action( "insert_fraction" ) ); m_fractionMenu.addAction( m_tool->action( "insert_bevelled_fraction" ) ); m_fenceMenu.addAction( m_tool->action( "insert_fence" ) ); m_fenceMenu.addAction( m_tool->action( "insert_enclosed" ) ); m_tableMenu.addAction( m_tool->action( "insert_33table" ) ); m_tableMenu.addAction( m_tool->action( "insert_21table" ) ); m_rootMenu.addAction( m_tool->action( "insert_root" ) ); m_rootMenu.addAction( m_tool->action( "insert_sqrt" ) ); m_scriptsMenu.addAction( m_tool->action( "insert_subscript" ) ); m_scriptsMenu.addAction( m_tool->action( "insert_supscript" ) ); m_scriptsMenu.addAction( m_tool->action( "insert_subsupscript" ) ); m_scriptsMenu.addAction( m_tool->action( "insert_underscript" ) ); m_scriptsMenu.addAction( m_tool->action( "insert_overscript" ) ); m_scriptsMenu.addAction( m_tool->action( "insert_underoverscript" ) ); m_alterTableMenu.addAction( m_tool->action( "insert_row") ); m_alterTableMenu.addAction( m_tool->action( "insert_column") ); m_alterTableMenu.addAction( m_tool->action( "remove_row") ); m_alterTableMenu.addAction( m_tool->action( "remove_column") ); // assign menus to toolbuttons buttonFence->setMenu( &m_fenceMenu ); buttonFence->setDefaultAction( m_tool->action( "insert_fence" ) ); buttonRoot->setMenu( &m_rootMenu ); buttonRoot->setDefaultAction( m_tool->action( "insert_sqrt" ) ); buttonFraction->setMenu( &m_fractionMenu ); buttonFraction->setDefaultAction(m_tool->action("insert_fraction")); buttonTable->setMenu( &m_tableMenu ); buttonTable->setDefaultAction(m_tool->action( "insert_33table")); buttonScript->setMenu( &m_scriptsMenu ); buttonScript->setDefaultAction(m_tool->action( "insert_subscript")); buttonAlterTable->setMenu(&m_alterTableMenu); buttonAlterTable->setDefaultAction(m_tool->action("insert_row")); // setup the buttons for symbol insertion buttonArrows->setText(QChar(0x2190)); setupButton(buttonArrows,m_arrowMenu,i18n("Arrows"), symbolsInRange(0x2190,0x21FF)); buttonGreek->setText(QChar(0x03B2)); setupButton(buttonGreek,m_greekMenu,i18n("Greek"), symbolsInRange(0x0391,0x03A1) <<symbolsInRange(0x03A3,0x03A9) <<symbolsInRange(0x03B1,0x03C9)); buttonRelation->setText(QChar(0x2265)); setupButton(buttonRelation,m_relationMenu,i18n("Relations"), symbolsInRange(0x223C,0x2292) <<symbolsInRange(0x2AAE,0x2ABA)); buttonOperators->setText(QChar(0x2211)); setupButton(buttonOperators,m_operatorMenu,i18n("Operators"), symbolsInRange(0x220F,0x2219) <<symbolsInRange(0x2227,0x2233) <<symbolsInRange(0x2207,0x2208)); buttonMisc->setText(QChar(0x211A)); setupButton(buttonMisc,m_miscMenu,i18n("Miscellaneous"), symbolsInRange(0x2200,0x2205) <<symbolsInRange(0x221F,0x2222)); buttonRow->hide(); connect( buttonLoad, SIGNAL( clicked() ), m_tool, SLOT( loadFormula() ) ); connect( buttonSave, SIGNAL( clicked() ), m_tool, SLOT( saveFormula() ) ); connect( buttonAlterTable, SIGNAL( triggered( QAction* ) ), m_tool, SLOT( changeTable(QAction*))); }