Пример #1
0
void MarkerStorage::generateMarkers(PCube fromCube, const Area* fromArea)
{
	Context* context = Context::getContext();
	CPDatabase db = CONST_COMMITABLE_CAST(Database, context->getParent(fromCube));
	PEngineBase engine = context->getServer()->getEngine(EngineBase::CPU, false);

	PCubeArea ca(new CubeArea(db, fromCube, *fromArea));
	PArea area = ca->expandStar(CubeArea::BASE_ELEMENTS);

	//go through string storage
	PSourcePlanNode sn(new SourcePlanNode(fromCube->getStringStorageId(), area, fromCube->getObjectRevision()));
	PProcessorBase cs = engine->createProcessor(sn, true);
	while (cs->next()) {
		addMarker(cs->getKey());
	}
	//go through numeric storage
	sn.reset(new SourcePlanNode(fromCube->getNumericStorageId(), area, fromCube->getObjectRevision()));
	cs = engine->createProcessor(sn, true);
	while (cs->next()) {
		addMarker(cs->getKey());
	}
	//go through marker storage
	sn.reset(new SourcePlanNode(fromCube->getMarkerStorageId(), area, fromCube->getObjectRevision())); // TODO: -jj- right version object?
	cs = engine->createProcessor(sn, true);
	while (cs->next()) {
		addMarker(cs->getKey());
	}

	//go through changedCells
	PCellMapPlanNode cmpn(new CellMapPlanNode(fromCube->getMarkerStorageId(), area));
	cs = engine->createProcessor(cmpn, true);
	while (cs->next()) {
		addMarker(cs->getKey());
	}
}
Пример #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{    
    ui->setupUi(this);

    // Table of markers
    ui->tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
    ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
    connect(ui->buttonMarkerAdd,SIGNAL(clicked()),ui->plot,SLOT(addMarker()));
    connect(ui->plot,SIGNAL(MarkerListUpdate(int)),this,SLOT(tableWidget_update(int)));

    // connecting markers actions
    connect(ui->actionMark_save, SIGNAL(triggered()), ui->plot, SLOT(saveXml()));

    // Horizontal ScrollBar config
    ui->horizontalScrollBar->setMinimum(0);
    ui->horizontalScrollBar->setMaximum(0);
    connect(ui->horizontalScrollBar,SIGNAL(valueChanged(int)),ui->plot,SLOT(setImgOffset(int)));
    connect(ui->plot,SIGNAL(ImgOffset(int)),ui->horizontalScrollBar,SLOT(setValue(int)));
    connect(ui->plot,SIGNAL(MaximumOffset(int)),this,SLOT(setScrollBarMaximumValue(int)));

    //splitter default size
    QList<int> size;
    size.append(10);
    size.append(800);
    ui->splitter_2->setSizes(size);
    ui->zoomSpinBox->setValue(ui->plot->settings->plotZoomX() * 100);
}
Пример #3
0
void DocumentMarkerController::addDictationResultMarker(Range* range, const RetainPtr<id>& metadata)
{
    for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
        RefPtr<Range> textPiece = markedText.range();
        addMarker(&textPiece->startContainer(), DocumentMarker(DocumentMarker::DictationResult, textPiece->startOffset(), textPiece->endOffset(), String(), Vector<String>(), metadata));
    }
}
Пример #4
0
void TextFrame::onSelectionChanged()
{
    wxStyledTextCtrl* txt = getCurrentTextCtrl();
    int len = txt->GetLength();

    // Rem Bookmark markers
    remMarkers(TEXT_MARKER_SEARCH);

    // Rem indicators (Scintilla)
    txt->SetIndicatorCurrent(TEXT_INDICATOR_SEARCH);
    txt->IndicatorClearRange(0, len);

    wxString sel = txt->GetSelectedText();
    int sellen = sel.Length();
    if(sellen>0)
    {
        int pos = -1;
        while(pos = txt->FindText(pos+1, len, sel), pos>=0 && pos<len )
        {
            // Add markers and indicators
            addMarker(TEXT_MARKER_SEARCH, sel, txt->LineFromPosition(pos));
            txt->IndicatorFillRange(pos, sellen);
        }
    }

}
Пример #5
0
void DocumentMarkerController::addMarker(Range* range, DocumentMarker::MarkerType type, const String& description, const Vector<String>& interpretations, const RetainPtr<id>& metadata)
{
    for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
        RefPtr<Range> textPiece = markedText.range();
        addMarker(&textPiece->startContainer(), DocumentMarker(type, textPiece->startOffset(), textPiece->endOffset(), description, interpretations, metadata));
    }
}
Пример #6
0
void QCustomPlotExt::addMarker()
{
    QPen pen;
    pen.setColor(Qt::darkRed);
    pen.setStyle(Qt::DashLine);
    addMarker(pen);
}
Пример #7
0
void TextFrame::addBookmark(int line, wxString name)
{
    wxStyledTextCtrl* txt = getCurrentTextCtrl();
    if(txt)
    {
        // Define bookmark line
        if(line==wxNOT_FOUND)
            line = txt->GetCurrentLine();

        // Define bookmark name
        if(name.IsEmpty())
        {
            name = txt->GetCurLine(NULL);
            name.Trim();
            if(name.IsEmpty())
                name = wxGetTextFromUser(_("Name of the new bookmark"), _("New bookmark"), name);
        }

        if(!name.IsEmpty())
        {
            // Set bookmark for bookmark panel
            BookmarkList& list = getDocument()->getBookmarks();
            Bookmark bm = {line, name};
            list.insert(bm);
            UpdateBookmarkPanel();

            // Add Bookmark marker
            addMarker(TEXT_MARKER_BOOKMARK, name, line);
        }
    }
}
Пример #8
0
void CSoundAnimation::load()
{
	CIFile file;

	// Open the file
	if (!file.open(_Filename.c_str()))
	{
		throw NLMISC::Exception("Can't open the file for reading");
	}

	// Create the XML stream
	CIXml input;

	// Init
	if (input.init (file))
	{
		xmlNodePtr animNode = input.getRootNode ();
		xmlNodePtr markerNode = input.getFirstChildNode(animNode, "MARKER");

		while (markerNode != 0)
		{
			CSoundAnimMarker* marker = new CSoundAnimMarker();

			const char *time = (const char*) xmlGetProp(markerNode, (xmlChar*) "time");
			if (time == 0)
			{
				throw NLMISC::Exception("Invalid sound animation marker");
			}

			marker->setTime((float) atof(time));
			xmlFree ((void*)time);


			xmlNodePtr soundNode = input.getFirstChildNode(markerNode, "SOUND");

			while (soundNode != 0)
			{
				char *name = (char*) xmlGetProp(soundNode, (xmlChar*) "name");
				if (name == 0)
				{
					throw NLMISC::Exception("Invalid sound animation marker");
				}

				marker->addSound(NLMISC::CSheetId(string(name), "sound"));

				xmlFree ((void*)name);

				soundNode = input.getNextChildNode(soundNode, "SOUND");
			}

			addMarker(marker);

			markerNode = input.getNextChildNode(markerNode, "MARKER");
		}
	}

	// Close the file
	file.close ();
	_Dirty = false;
}
CirclePrimitive::CirclePrimitive(Body *body, const QPointF &pos, qreal r, QObject *parent) :
    PrimitiveWithStaticMarkers(body,parent),m_pos(pos),m_r(r)
{
    setName("Circle");
    addMarker(new CirclePrimitiveMarker(this));
    updateText();
}
Пример #10
0
void DocumentMarkerController::addMarker(Range* range, DocumentMarker::MarkerType type, const String& description)
{
    for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
        RefPtr<Range> textPiece = markedText.range();
        addMarker(&textPiece->startContainer(), DocumentMarker(type, textPiece->startOffset(), textPiece->endOffset(), description));
    }
}
Пример #11
0
void DocumentMarkerController::addMarker(Range* range, DocumentMarker::MarkerType type, String description, const Vector<String>& interpretations, const RetainPtr<id>& metadata)
{
    // Use a TextIterator to visit the potentially multiple nodes the range covers.
    for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
        RefPtr<Range> textPiece = markedText.range();
        addMarker(textPiece->startContainer(), DocumentMarker(type, textPiece->startOffset(), textPiece->endOffset(), description, interpretations, metadata));
    }
}
Пример #12
0
void DocumentMarkerController::addDictationResultMarker(Range* range, const RetainPtr<id>& metadata)
{
    // Use a TextIterator to visit the potentially multiple nodes the range covers.
    for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
        RefPtr<Range> textPiece = markedText.range();
        addMarker(textPiece->startContainer(), DocumentMarker(DocumentMarker::DictationResult, textPiece->startOffset(), textPiece->endOffset(), String(), Vector<String>(), metadata));
    }
}
Пример #13
0
void DocumentMarkerController::addMarker(Range* range, DocumentMarker::MarkerType type, const String& description)
{
    // Use a TextIterator to visit the potentially multiple nodes the range covers.
    for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
        RefPtr<Range> textPiece = markedText.range();
        addMarker(textPiece->startContainer(), DocumentMarker(type, textPiece->startOffset(), textPiece->endOffset(), description));
    }
}
Пример #14
0
void DocumentMarkerController::addTextMatchMarker(const Range* range, bool activeMatch)
{
    for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
        RefPtr<Range> textPiece = markedText.range();
        unsigned startOffset = textPiece->startOffset();
        unsigned endOffset = textPiece->endOffset();
        addMarker(&textPiece->startContainer(), DocumentMarker(startOffset, endOffset, activeMatch));
    }
}
Пример #15
0
void Graph::loadMarkers(DataFileParser *file, int axis)
{
    quint32 count = file->readVal<quint32>();
    for(quint32 i = 0; i < count; ++i)
    {
        double val = file->readVal<double>();
        QColor color(file->readString());
        addMarker(val, color, axis);
    }
}
Пример #16
0
void ChartWidget::addMarker(ViewWaveInfo *vwi, int x)
{
	WaveInfo* wave = vwi->waveInfo();

	MarkerType markerType = MarkerType_Time;
	if (wave->type == WaveType_FID)
		markerType = MarkerType_FidPeak;
	else if (wave->type == WaveType_EAD)
		markerType = MarkerType_EadPeakXY;

	addMarker(vwi, markerType, x);
}
Пример #17
0
bool EventValidator::validateNoWaitingEvent() 
{
   addMarker("Validate No Waiting Events");

   bool bWaitingEvents = hasUnprocessedEvents();
   if (bWaitingEvents)
   {
      m_eErrorType = EVENT_VALIDATOR_ERROR_UNEXPECTED;
      report();
   }
   return bWaitingEvents;
}
Пример #18
0
void TextFrame::addBookmarksFromProvider()
{
    BookmarkList& list = getDocument()->getBookmarks();

    // Remove existing markers then add from provider
    remMarkers(TEXT_MARKER_BOOKMARK);
    for(BookmarkList::iterator it=list.begin(); it!=list.end(); ++it)
    {
        addMarker(TEXT_MARKER_BOOKMARK, it->name, it->line);
    }

    // Update Bookmark panel
    UpdateBookmarkPanel();
}
Пример #19
0
void Graph::mouseDoubleClickEvent(QMouseEvent *event)
{
    int axis = getAxisOnPos(event->pos());
    if(axis == -1)
        return QwtPlot::mouseDoubleClickEvent(event);

    event->accept();

    GraphMarkerDialog d(axis, this);
    if(d.exec() == QDialog::Accepted)
    {
        addMarker(d.getValue(), d.getColorVal(), axis);
        replot();
    }
}
Пример #20
0
void DocumentMarkerController::addDictationPhraseWithAlternativesMarker(Range* range, const Vector<String>& interpretations)
{
    ASSERT(interpretations.size() > 1);
    if (interpretations.size() <= 1)
        return;

    size_t numberOfAlternatives = interpretations.size() - 1;
    for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
        RefPtr<Range> textPiece = markedText.range();
        DocumentMarker marker(DocumentMarker::DictationPhraseWithAlternatives, textPiece->startOffset(), textPiece->endOffset(), "", Vector<String>(numberOfAlternatives), RetainPtr<id>());
        for (size_t i = 0; i < numberOfAlternatives; ++i)
            marker.setAlternative(interpretations[i + 1], i);
        addMarker(&textPiece->startContainer(), marker);
    }
}
Пример #21
0
void KiviatView::setMarkerCount(int newMarkerCount)
{
   prop_markerCount=newMarkerCount;

   //Delete old markers
   qDeleteAll(markers);
   markers.clear();


   markers.reserve(prop_markerCount);

   float frac=1.0/prop_markerCount;
   for(int i=1; i<=prop_markerCount; i++)
      markers.push_back(addMarker(i*frac));

}
void MapViewer::updateViewer(bool isForward)
{

    if ( isForward )
    {
        if (actionData[currentRecord]){
            addMarker(currentRecord);
        }
        currentRecord != 0 ? addLine(currentRecord) : removeAllLines();
    }
    else
    {
        if (actionData[currentRecord]){
            removeMarker(currentRecord);
        }
        currentRecord != recordCounter - 1 ? removeLine(currentRecord) : addAllLines();
    }
}
Пример #23
0
// copies markers from srcNode to dstNode, applying the specified shift delta to the copies.  The shift is
// useful if, e.g., the caller has created the dstNode from a non-prefix substring of the srcNode.
void DocumentMarkerController::copyMarkers(Node* srcNode, unsigned startOffset, int length, Node* dstNode, int delta)
{
    if (length <= 0)
        return;

    if (!possiblyHasMarkers(DocumentMarker::AllMarkers()))
        return;
    ASSERT(!m_markers.isEmpty());

    MarkerLists* markers = m_markers.get(srcNode);
    if (!markers)
        return;

    bool docDirty = false;
    for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) {
        OwnPtr<MarkerList>& list = (*markers)[markerListIndex];
        if (!list)
            continue;

        unsigned endOffset = startOffset + length - 1;
        MarkerList::iterator startPos = std::lower_bound(list->begin(), list->end(), startOffset, doesNotInclude);
        for (MarkerList::iterator i = startPos; i != list->end(); ++i) {
            DocumentMarker* marker = i->get();

            // stop if we are now past the specified range
            if (marker->startOffset() > endOffset)
                break;

            // pin the marker to the specified range and apply the shift delta
            docDirty = true;
            if (marker->startOffset() < startOffset)
                marker->setStartOffset(startOffset);
            if (marker->endOffset() > endOffset)
                marker->setEndOffset(endOffset);
            marker->shiftOffsets(delta);

            addMarker(dstNode, *marker);
        }
    }

    // repaint the affected node
    if (docDirty && dstNode->renderer())
        dstNode->renderer()->doNotUseInvalidatePaintForWholeRendererSynchronously();
}
Пример #24
0
void DocumentMarkerController::addTextMatchMarker(const Range* range, bool activeMatch)
{
    // Use a TextIterator to visit the potentially multiple nodes the range covers.
    for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) {
        RefPtr<Range> textPiece = markedText.range();
        unsigned startOffset = textPiece->startOffset();
        unsigned endOffset = textPiece->endOffset();
        addMarker(textPiece->startContainer(), DocumentMarker(startOffset, endOffset, activeMatch));
        if (endOffset > startOffset) {
            // Rendered rects for markers in WebKit are not populated until each time
            // the markers are painted. However, we need it to happen sooner, because
            // the whole purpose of tickmarks on the scrollbar is to show where
            // matches off-screen are (that haven't been painted yet).
            Node* node = textPiece->startContainer();
            Vector<RenderedDocumentMarker*> markers = markersFor(node);
            markers[markers.size() - 1]->setRenderedRect(range->boundingBox());
        }
    }
}
Пример #25
0
bool DocumentMarkerController::addUserSpellingMarker(Node* node, unsigned start, unsigned length, RefPtr<DOMStringList> suggestions, unsigned options)
{
    if (!node || !length)
        return false;

    Node* spellingNode = userSpellingNode(node);
    if (!spellingNode)
        return false;

    // Serialize the suggestions into text until the DocumentMarker class supports multiple descriptions.
    String description;
    for (size_t i = 0; i < suggestions->length(); i++) {
        description += suggestions->item(i);
        description.append('\n');
    }
    addMarker(spellingNode, DocumentMarker(DocumentMarker::UserSpelling, start, start + length, description));

    UNUSED_PARAM(options);
    return true;
}
Пример #26
0
// copies markers from srcNode to dstNode, applying the specified shift delta to the copies.  The shift is
// useful if, e.g., the caller has created the dstNode from a non-prefix substring of the srcNode.
void DocumentMarkerController::copyMarkers(Node* srcNode, unsigned startOffset, int length, Node* dstNode, int delta)
{
    if (length <= 0)
        return;

    if (!possiblyHasMarkers(DocumentMarker::AllMarkers()))
        return;
    ASSERT(!m_markers.isEmpty());

    MarkerList* list = m_markers.get(srcNode);
    if (!list)
        return;

    bool docDirty = false;
    unsigned endOffset = startOffset + length - 1;
    for (size_t i = 0; i != list->size(); ++i) {
        DocumentMarker marker = list->at(i);

        // stop if we are now past the specified range
        if (marker.startOffset() > endOffset)
            break;

        // skip marker that is before the specified range or is the wrong type
        if (marker.endOffset() < startOffset)
            continue;

        // pin the marker to the specified range and apply the shift delta
        docDirty = true;
        if (marker.startOffset() < startOffset)
            marker.setStartOffset(startOffset);
        if (marker.endOffset() > endOffset)
            marker.setEndOffset(endOffset);
        marker.shiftOffsets(delta);

        addMarker(dstNode, marker);
    }

    // repaint the affected node
    if (docDirty && dstNode->renderer())
        dstNode->renderer()->repaint();
}
Пример #27
0
QDiagramWidget::QDiagramWidget(QWidget *parent) :
    QCustomPlotExt(parent)
{
    xAxis->setTickLabelType(QCPAxis::ltDateTime);
    xAxis->setDateTimeFormat("H:mm");
    xAxis->setDateTimeSpec(Qt::UTC);
    xAxis->setRange(0.0, 1.0);
    yAxis->setRange(0.0, 1.0);
    yAxis2->setRange(0.0, 1.0);
    yAxis2->setVisible(true);

    addGraph(xAxis, yAxis2);
    graph(0)->setPen(QPen(Qt::lightGray));

    addGraph(xAxis, yAxis);
    graph(1)->setPen(QPen(Qt::blue));
    graph(1)->setBrush(QBrush(QColor(0, 0, 255, 20)));

    QPen pen;
    pen.setColor(GPXLab::appColor);
    pen.setStyle(Qt::DashLine);
    addMarker(pen);
    connect(this, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(newSelection(QMouseEvent*)));
}
Пример #28
0
void MarkerView::addMarker()
{
	addMarker(-1);
}
Пример #29
0
MarkerView::MarkerView(QWidget* parent)
: TopWin(parent, "markerview", Qt::Window /*| WDestructiveClose*/)
{
	//setAttribute(Qt::WA_DeleteOnClose);

	setWindowTitle(tr("OOMidi: Marker"));

	QAction* markerAdd = new QAction(QIcon(*flagIcon), tr("add marker"), this);
	connect(markerAdd, SIGNAL(triggered()), SLOT(addMarker()));

	QAction* markerDelete = new QAction(QIcon(*deleteIcon), tr("delete marker"), this);
	connect(markerDelete, SIGNAL(triggered()), SLOT(deleteMarker()));

	//---------Pulldown Menu----------------------------
	/* We probably don't need an empty menu - Orcan
	QMenu* fileMenu = new QMenu(tr("&File"));
	menuBar()->addMenu(fileMenu);
	 */
	QMenu* editMenu = menuBar()->addMenu(tr("&Edit"));

	editMenu->addAction(markerAdd);
	editMenu->addAction(markerDelete);

	//---------ToolBar----------------------------------
	tools = addToolBar(tr("marker-tools"));
	tools->addActions(undoRedo->actions());

	QToolBar* edit = addToolBar(tr("edit tools"));
	edit->addAction(markerAdd);
	edit->addAction(markerDelete);

	//---------------------------------------------------
	//    master
	//---------------------------------------------------

	QWidget* w = new QWidget;
	setCentralWidget(w);
	QVBoxLayout* vbox = new QVBoxLayout(w);

	table = new QTreeWidget(w);
	table->setAllColumnsShowFocus(true);
	table->setSelectionMode(QAbstractItemView::SingleSelection);

	QStringList columnnames;
	columnnames << tr("Bar:Beat:Tick")
			<< tr("Hr:Mn:Sc:Fr:Sf")
			<< tr("Lock")
			<< tr("Text");

	table->setHeaderLabels(columnnames);
	table->setColumnWidth(2, 40);
	table->header()->setStretchLastSection(true);

	connect(table, SIGNAL(itemSelectionChanged()),
			SLOT(markerSelectionChanged()));
	connect(table, SIGNAL(itemClicked(QTreeWidgetItem*, int)),
			SLOT(clicked(QTreeWidgetItem*)));

	QGroupBox* props = new QGroupBox(tr("Marker Properties"));
	QHBoxLayout *hbox = new QHBoxLayout;

	///editTick = new PosEdit;
	editTick = new Awl::PosEdit;
	editTick->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
			QSizePolicy::Fixed));

	///editSMPTE = new PosEdit;
	editSMPTE = new Awl::PosEdit;
	editSMPTE->setSmpte(true);
	editSMPTE->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
			QSizePolicy::Fixed));

	lock = new QToolButton;
	lock->setIcon(*lockIcon);
	lock->setCheckable(true);

	editName = new QLineEdit;
	editName->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,
			QSizePolicy::Preferred));

	hbox->addWidget(editTick);
	hbox->addWidget(editSMPTE);
	hbox->addWidget(lock);
	hbox->addWidget(editName);
	props->setLayout(hbox);

	connect(editName, SIGNAL(textChanged(const QString&)),
			SLOT(nameChanged(const QString&)));
	connect(editTick, SIGNAL(valueChanged(const Pos&)),
			SLOT(tickChanged(const Pos&)));
	connect(editSMPTE, SIGNAL(valueChanged(const Pos&)),
			SLOT(tickChanged(const Pos&)));
	connect(editSMPTE, SIGNAL(valueChanged(const Pos&)),
			editTick, SLOT(setValue(const Pos&)));
	connect(editTick, SIGNAL(valueChanged(const Pos&)),
			editSMPTE, SLOT(setValue(const Pos&)));
	connect(lock, SIGNAL(toggled(bool)),
			SLOT(lockChanged(bool)));
	connect(song, SIGNAL(markerChanged(int)),
			SLOT(markerChanged(int)));

	vbox->addWidget(table);
	vbox->addWidget(props);

	//---------------------------------------------------
	//    Rest
	//---------------------------------------------------

	//connect(song, SIGNAL(songChanged(int)), SLOT(updateList()));
	connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));

	updateList();

	// work around for probable QT/WM interaction bug.
	// for certain window managers, e.g xfce, this window is
	// is displayed although not specifically set to show();
	// bug: 2811156  	 Softsynth GUI unclosable with XFCE4 (and a few others)
	show();
	hide();

}
Пример #30
0
StandardRuler::StandardRuler(RosegardenDocument *doc,
                             RulerScale *rulerScale,
                             double xorigin,
                             int barHeight,
                             bool invert,
                             bool isForMainWindow,
                             QWidget* parent) :
        QWidget(parent),
        m_invert(invert),
        m_isForMainWindow(isForMainWindow),
        m_loopRulerHeight(10),
        m_currentXOffset(0),
        m_doc(doc),
        m_rulerScale(rulerScale),
        m_markerRuler(0)
{
//    QString localStyle("QWidget { background-color: #EEEEEE; color: #000000; }");

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->setMargin(0);
    layout->setSpacing(0);
    setLayout(layout);
	
    if (!m_invert) {
        m_markerRuler = new MarkerRuler
                       (m_doc, m_rulerScale, barHeight - m_loopRulerHeight, xorigin, this);
        layout->addWidget(m_markerRuler);
    }

    m_loopRuler = new LoopRuler
                  (m_doc, m_rulerScale, m_loopRulerHeight, xorigin, m_invert, m_isForMainWindow, this);
    layout->addWidget(m_loopRuler);

    if (m_invert) {
        m_markerRuler = new MarkerRuler
                       (m_doc, m_rulerScale, barHeight - m_loopRulerHeight, xorigin, this);
        layout->addWidget(m_markerRuler);
    }

//    m_markerRuler->setStyleSheet(localStyle);
//    m_loopRuler->setStyleSheet(localStyle);
//    m_markerRuler->setToolTip(QString("I am m_markerRuler. My style is: %1").arg(localStyle));


    QObject::connect
        (CommandHistory::getInstance(), SIGNAL(commandExecuted()),
         this, SLOT(update()));

    if (RosegardenMainWindow::self()) {
        QObject::connect
                (m_markerRuler, SIGNAL(editMarkers()),
                 RosegardenMainWindow::self(), SLOT(slotEditMarkers()));

        QObject::connect
                (m_markerRuler, SIGNAL(addMarker(timeT)),
                 RosegardenMainWindow::self(), SLOT(slotAddMarker(timeT)));

        QObject::connect
                (m_markerRuler, SIGNAL(deleteMarker(int, timeT, QString, QString)),
                 RosegardenMainWindow::self(), SLOT(slotDeleteMarker(int, timeT, QString, QString)));

        QObject::connect
                (m_loopRuler, SIGNAL(setPlayPosition(timeT)),
                 RosegardenMainWindow::self(), SLOT(slotSetPlayPosition(timeT)));
    }
}