void WTextEdit::init() { WApplication *app = WApplication::instance(); setInline(false); initTinyMCE(); version_ = getTinyMCEVersion(); setJavaScriptMember(" WTextEdit", "new " WT_CLASS ".WTextEdit(" + app->javaScriptClass() + "," + jsRef() + ");"); setJavaScriptMember (WT_RESIZE_JS, "function(e, w, h) { var obj = $('#" + id() + "').data('obj'); " "obj.wtResize(e, w, h); };"); std::string direction = app->layoutDirection() == LayoutDirection::LeftToRight ? "ltr" : "rtl"; setConfigurationSetting("directionality", direction); std::string toolbar; if (version_ < 4) toolbar = "fontselect,|,bold,italic,underline,|,fontsizeselect,|" ",forecolor,backcolor,|" ",justifyleft,justifycenter,justifyright,justifyfull,|,anchor,|" ",numlist,bullist"; else toolbar = "undo redo | styleselect | bold italic | link"; setToolBar(0, toolbar); for (int i = 1; i <= 3; i++) setToolBar(i, std::string()); setConfigurationSetting("doctype", wApp->docType()); setConfigurationSetting("relative_urls", true); if (version_ < 4) { //this setting is no longer mentioned in the tinymce documenation though... setConfigurationSetting("button_tile_map", true); setConfigurationSetting("theme", std::string("advanced")); setConfigurationSetting("theme_advanced_toolbar_location", std::string("top")); setConfigurationSetting("theme_advanced_toolbar_align", std::string("left")); } onChange_.connect(this, &WTextEdit::propagateOnChange); }
DiscDetails::DiscDetails( SApplication *parent ) : SPage( tr("Disc Details") , parent ) { p = new DiscDetailsPrivate; p->spacer_widget = new QWidget(); p->spacer_widget->setSizePolicy( QSizePolicy::MinimumExpanding , QSizePolicy::MinimumExpanding ); p->slider = new SSliderWidget(); p->slider->setShowingAll( true ); p->slider->addWidget( p->spacer_widget ); p->toolbar = new QToolBar(); p->toolbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon ); p->toolbar->setStyleSheet( "QToolBar{ border-style:solid ; margin:0px }" ); p->scroll = new QScrollArea(); p->scroll->setWidget( p->slider ); p->scroll->setWidgetResizable( true ); p->scroll->setFrameShadow( QFrame::Plain ); p->scroll->setFrameShape( QFrame::NoFrame ); p->scroll->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); p->scroll->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); p->scroll->viewport()->setAutoFillBackground( false ); p->layout = new QVBoxLayout( this ); //p->layout->addWidget( p->toolbar ); p->layout->addWidget( p->scroll ); p->layout->setContentsMargins( 1 , 1 , 1 , 1 ); p->layout->setSpacing( 1 ); init_actions(); setToolBar( p->toolbar ); setMinimumSize( QSize(720,350) ); }
void ToolBarsManager::addBookmarksBar() { BookmarksBarDialog dialog; if (dialog.exec() == QDialog::Accepted) { setToolBar(dialog.getDefinition()); } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); setGeometry(100,100,1142,800); setMenuBar(); setToolBar(); //resizable(false); this->setFixedSize(this->width(),this->height()); ui->textEdit->setText(QString(",>>,>,>,\n------------------------------------------------\n<------------------------------------------------\n[->++++++++++<]\n++++++++++>\n[\n\t[->+<<<<<.>>>>]\n\t<.>>\n\t[-<+>]\n\t<-\n]")); memLen = 256; braifuck = NULL; setSingnals(); }
void ToolBarsManager::resetToolBar(int identifier) { QAction *action(qobject_cast<QAction*>(sender())); if (action && identifier < 0) { identifier = action->data().toInt(); } if (identifier >= 0 && identifier < OtherToolBar && QMessageBox::question(NULL, tr("Reset Toolbar"), tr("Do you really want to reset this toolbar to default configuration?"), (QMessageBox::Yes | QMessageBox::Cancel)) == QMessageBox::Yes) { const QHash<QString, ToolBarDefinition> defaultDefinitions(loadToolBars(SessionsManager::getReadableDataPath(QLatin1String("toolBars.json"), true), true)); ToolBarDefinition definition(defaultDefinitions.value(getToolBarName(identifier))); definition.identifier = identifier; setToolBar(definition); } }
void ToolBarsManager::configureToolBar(int identifier) { QAction *action(qobject_cast<QAction*>(sender())); if (action && identifier < 0) { identifier = action->data().toInt(); } if (identifier >= 0 && identifier < m_definitions.count()) { ToolBarDialog dialog(identifier); if (dialog.exec() == QDialog::Accepted) { setToolBar(dialog.getDefinition()); } } }
void AppMainWindow::refresh() { SApplication *application = p->page->parentApp(); const SAboutData & about = application->parent(); QString name = p->page->title(); if( name.isEmpty() ) name = about.name(); QIcon icon = p->page->icon(); if( icon.isNull() ) icon = about.icon(); setWindowTitle( name ); setWindowIcon( icon ); setToolBar( p->page->toolBar() ); setStatusBar( p->page->statusBar() ); }
/* * Description : virtual functions from base class IRBaseView. * handle view commands * * see also : IRBaseView::handleCommand */ TIRHandleResult IRCategoryView::handleCommand(TIRViewCommand aCommand, TIRViewCommandReason aReason) { Q_UNUSED(aReason); TIRHandleResult ret = IrAbstractListViewBase::handleCommand(aCommand, aReason); switch (aCommand) { case EIR_ViewCommand_TOBEACTIVATED: { if (EIRViewPara_Genre == iViewParameter) { if (ABSTRACT_LIST_VIEW_BASE_WITH_TOOLBAR_SECTION != iLoadedSection) { iLoader.load(ABSTRACT_LIST_VIEW_BASE_LAYOUT_FILENAME, ABSTRACT_LIST_VIEW_BASE_WITH_TOOLBAR_SECTION); iLoadedSection = ABSTRACT_LIST_VIEW_BASE_WITH_TOOLBAR_SECTION; } } else { if (ABSTRACT_LIST_VIEW_BASE_NO_TOOLBAR_SECTION != iLoadedSection) { iLoader.load(ABSTRACT_LIST_VIEW_BASE_LAYOUT_FILENAME, ABSTRACT_LIST_VIEW_BASE_NO_TOOLBAR_SECTION); iLoadedSection = ABSTRACT_LIST_VIEW_BASE_NO_TOOLBAR_SECTION; setToolBar(NULL); } } } break; case EIR_ViewCommand_ACTIVATED: if (EIRViewPara_Genre == getViewParameter()) { getViewManager()->saveScreenShot(); } break; default: break; } return ret; }
LibraryUI::LibraryUI( const QString & name , SApplication *parent ) : SPage( name , parent ) { this->setAcceptDrops( true ); QDir conf_dir( Silicon::config() + "/Library" ); conf_dir.mkpath( conf_dir.path() ); QString path = conf_dir.path() + "/library"; library = new Librarydb( path ); item_list = new ItemList(); item_list->setLibrary( library ); item_list->setIconSize( QSize(32,32) ); item_list->setContextMenuPolicy( Qt::CustomContextMenu ); tags_list = new TagsList(); tags_list->setLibrary( library ); //tags_list->setFixedWidth( 235 ); char_list = new CharList(); char_list->setFixedWidth( 43 ); char_list->setLibrary( library ); char_list->setFilterList( tags_list ); format_list = new FormatList(); format_list->setFixedWidth( 73 ); format_list->setFilterList( char_list ); filters_box = new QGroupBox( tr("Filters") ); filters_box->setFixedWidth( 313 ); filters_layout = new QHBoxLayout( filters_box ); filters_layout->addWidget( format_list ); filters_layout->addWidget( char_list ); filters_layout->addWidget( tags_list ); list_widget_box = new QGroupBox( "Result List" ); list_widget_layout = new QVBoxLayout( list_widget_box ); list_widget_layout->addWidget( item_list ); item_preview = new ItemPreview(); toolbar = new QToolBar(); toolbar->setToolButtonStyle( Qt::ToolButtonTextBesideIcon ); toolbar->setStyleSheet( "QToolBar{border-style:solid}" ); lists_layout = new QHBoxLayout(); lists_layout->addWidget( filters_box ); lists_layout->addWidget( list_widget_box ); base_layout = new QVBoxLayout( this ); //base_layout->addWidget( toolbar ); base_layout->addLayout( lists_layout ); base_layout->addWidget( item_preview ); mounter = SiDiTools::createImageMounter( this ); isoinfo = new SIsoInfo( this ); QObject::connect( isoinfo , SIGNAL(copyrightUpdated(QString)) , item_preview , SLOT(setCopyright(QString)) ); QObject::connect( isoinfo , SIGNAL(volumeUpdated(QString)) , item_preview , SLOT(setVolumeID(QString)) ); QObject::connect( isoinfo , SIGNAL(applicationIdReaded(QString)) , item_preview , SLOT(setApplicationID(QString)) ); QObject::connect( isoinfo , SIGNAL(systemUpdated(QString)) , item_preview , SLOT(setSystemID(QString)) ); QObject::connect( isoinfo , SIGNAL(publisherUpdated(QString)) , item_preview , SLOT(setPublisher(QString)) ); QObject::connect( isoinfo , SIGNAL(formatUpdated(QString)) , item_preview , SLOT(setFormat(QString)) ); QObject::connect( tags_list , SIGNAL(rowChenged(QStringList)) , item_list , SLOT(setItems(QStringList)) ); QObject::connect( item_list , SIGNAL(currentRowChanged(int)) , this , SLOT(itemChanged(int)) ); QObject::connect( item_list , SIGNAL(itemDoubleClicked(QListWidgetItem*)) , this , SLOT(mountCurrentItem()) ); setupActions(); reload(); setToolBar( toolbar ); setMinimumSize( QSize(720,350) ); }