コード例 #1
0
	void FrameView::update(bool modified)
	{
		if (m_updating)
			return;

		DocInfo *info = activeDocInfo();
		if (info == NULL)
			return;
		FtmDocument *doc = info->doc();

		m_updating = true;

		const int pxunit = font.pixelSize();

		int chans = doc->GetAvailableChannels();

		horizontalScrollBar()->setRange(0, doc->GetAvailableChannels()-1);
		verticalScrollBar()->setRange(0, doc->GetFrameCount()-1);

		horizontalScrollBar()->setValue(info->currentChannel());
		verticalScrollBar()->setValue(info->currentFrame());

		int w_compensation = size().width() - viewport()->size().width();

		setFixedWidth(pxunit*2*(chans+1) + w_compensation);

		if (modified || (!gui::isPlaying()) || (!(m_currentFrame == info->currentFrame() && m_currentChannel == info->currentChannel())))
			viewport()->update();

		m_updating = false;
	}