Esempio n. 1
0
void AudioDisplay::SetTrackCursor(int new_pos, bool show_time)
{
	if (new_pos != track_cursor_pos)
	{
		int old_pos = track_cursor_pos;
		track_cursor_pos = new_pos;

		RefreshRect(wxRect(old_pos - scroll_left - 0, audio_top, 1, audio_height), false);
		RefreshRect(wxRect(new_pos - scroll_left - 0, audio_top, 1, audio_height), false);

		// Make sure the old label gets cleared away
		RefreshRect(track_cursor_label_rect, false);

		if (show_time)
		{
			AssTime new_label_time = TimeFromAbsoluteX(track_cursor_pos);
			track_cursor_label = new_label_time.GetAssFormated();
			track_cursor_label_rect.x += new_pos - old_pos;
			RefreshRect(track_cursor_label_rect, false);
		}
		else
		{
			track_cursor_label_rect.SetSize(wxSize(0,0));
			track_cursor_label.Clear();
		}
	}
}
Esempio n. 2
0
void thBarViewCtrl::Mark(int bar)
{
    if (bar == m_mark)
        return;

    //PRINTF("Mark(%d), m_mark = %d\n", bar, m_mark);

    // add the old bar and the new bar to the update region
    wxRect rc = m_rcClient;
    if (m_mark >= 0)
    {
        rc.x = GetBarArea(m_mark, rc.width);
        rc.x -= 4; rc.width += 8;
        RefreshRect(rc, false);
    }

    if (bar >= 0)
    {
        rc.x = GetBarArea(bar, rc.width);
        rc.x -= 4; rc.width += 8;
        RefreshRect(rc, false);
    }

    wxMemoryDC memDC;
    memDC.SelectObject(dbw.m_bmp);
    Erase(memDC); // sets m_mark = -1
    Mark(memDC, bar); // sets m_mark = bar
    memDC.SelectObject(wxNullBitmap);
    //Update();
}
Esempio n. 3
0
void BaseGrid::SelectRow(int row, bool addToSelected, bool select) {
	if (row < 0 || (size_t)row >= index_line_map.size()) return;

	AssDialogue *line = index_line_map[row];

	if (!addToSelected) {
		Selection sel;
		if (select) sel.insert(line);
		SetSelectedSet(sel);
		return;
	}

	if (select && selection.find(line) == selection.end()) {
		selection.insert(line);

		Selection added;
		added.insert(line);

		AnnounceSelectedSetChanged(added, Selection());
	}
	else if (!select && selection.find(line) != selection.end()) {
		selection.erase(line);

		Selection removed;
		removed.insert(line);

		AnnounceSelectedSetChanged(Selection(), removed);
	}

	int w = GetClientSize().GetWidth();
	RefreshRect(wxRect(0, (row + 1 - yPos) * lineHeight, w, lineHeight), false);
}
Esempio n. 4
0
void AudioDisplay::OnSelectionChanged()
{
	TimeRange sel(controller->GetPrimaryPlaybackRange());
	scrollbar->SetSelection(AbsoluteXFromTime(sel.begin()), AbsoluteXFromTime(sel.length()));

	if (audio_marker)
	{
		if (!scroll_timer.IsRunning())
		{
			// If the dragged object is outside the visible area, start the
			// scroll timer to shift it back into view
			int rel_x = RelativeXFromTime(audio_marker->GetPosition());
			if (rel_x < 0 || rel_x >= GetClientSize().GetWidth())
			{
				// 50ms is the default for this on Windows (hardcoded since
				// wxSystemSettings doesn't expose DragScrollDelay etc.)
				scroll_timer.Start(50, true);
			}
		}
	}
	else if (OPT_GET("Audio/Auto/Scroll")->GetBool() && sel.end() != 0)
	{
		ScrollTimeRangeInView(sel);
	}

	RefreshRect(scrollbar->GetBounds(), false);
}
Esempio n. 5
0
void wxVScrolledWindow::RefreshLines(size_t from, size_t to)
{
    wxASSERT_MSG( from <= to, _T("RefreshLines(): empty range") );

    // clump the range to just the visible lines -- it is useless to refresh
    // the other ones
    if ( from < GetVisibleBegin() )
        from = GetVisibleBegin();

    if ( to >= GetVisibleEnd() )
        to = GetVisibleEnd();
    else
        to++;

    // calculate the rect occupied by these lines on screen
    wxRect rect;
    rect.width = GetClientSize().x;
    for ( size_t nBefore = GetVisibleBegin(); nBefore < from; nBefore++ )
    {
        rect.y += OnGetLineHeight(nBefore);
    }

    for ( size_t nBetween = from; nBetween < to; nBetween++ )
    {
        rect.height += OnGetLineHeight(nBetween);
    }

    // do refresh it
    RefreshRect(rect);
}
Esempio n. 6
0
void ProsodyDisplay::RefreshLine(int line)
{//=====================================
	int x,y;

	CalcScrolledPosition(0,line*FRAMEHEIGHT,&x,&y);
	RefreshRect(wxRect(0,y,linewidth,FRAMEHEIGHT));
}
Esempio n. 7
0
void wxStatusBarUniv::DoUpdateStatusText(int i)
{
    wxRect rect;
    if ( GetFieldRect(i, rect) )
    {
        RefreshRect(rect);
    }
}
void CardViewer::redraw(const ValueViewer& v) {
	// Don't refresh if we OR ANOTHER CardViewer is drawing
	// drawing another viewer causes styles to be updated for its active card, which may be different,
	// causing the two viewers to continously refresh.
	if (drawing_card()) return;
	up_to_date = false;
	RefreshRect(getRotation().trRectToBB(v.boundingBox()), false);
}
Esempio n. 9
0
void wxStatusBarUniv::RefreshField(int i)
{
    wxRect rect;
    if ( GetFieldRect(i, rect) )
    {
        RefreshRect(rect);
    }
}
Esempio n. 10
0
void wxHeaderCtrl::RefreshCol(unsigned int idx)
{
    wxRect rect = GetClientRect();
    rect.x += GetColStart(idx);
    rect.width = GetColumn(idx).GetWidth();

    RefreshRect(rect);
}
Esempio n. 11
0
void
JXTable::TableRefreshRect
	(
	const JRect& rect
	)
{
	RefreshRect(rect);
}
Esempio n. 12
0
void wxSVGCtrlBase::Refresh(const wxSVGRect* rect) {
	if (!rect || rect->IsEmpty())
		Refresh(true, NULL);
	else {
		wxRect winRect((int) (rect->GetX() * GetScaleX()), (int) (rect->GetY() * GetScaleY()),
				(int) (rect->GetWidth() * GetScaleX()), (int) (rect->GetHeight() * GetScaleY()));
		RefreshRect(winRect);
	}
}
Esempio n. 13
0
void wxHeaderCtrl::RefreshColsAfter(unsigned int idx)
{
    wxRect rect = GetClientRect();
    const int ofs = GetColStart(idx);
    rect.x += ofs;
    rect.width -= ofs;

    RefreshRect(rect);
}
Esempio n. 14
0
void SpectDisplay::RefreshFrame(int frame)
{//=======================================
	int frame_x, frame_y;

	CalcScrolledPosition(0,int(frame*FRAME_HEIGHT*zoomy),
			&frame_x,&frame_y);

	RefreshRect(wxRect(0,frame_y,int(1000*zoomx),int(FRAME_HEIGHT*zoomy)));
}
Esempio n. 15
0
void CodeView::OnPopUpMenuArgStyleHex(wxCommandEvent& event)
{
	if (line_info.argSelected == 1)
		line_info.dasmitem->SetStyleArgument(0, ast_bytehex);

	if (line_info.argSelected == 2)
		line_info.dasmitem->SetStyleArgument(1, ast_bytehex);

		RefreshRect(CalcCursorRfshRect());
}
Esempio n. 16
0
/// Select or deselect an item
void InstanceCtrl::Select( VisualCoord n, bool select )
{
	VisualCoord oldFocusItem = m_focusItem;
	m_focusItem = n;
	m_selectedItem = n;
	
	if (m_freezeCount == 0)
	{
		wxRect rect;
		GetItemRect(n, rect);
		RefreshRect(rect);
		
		if (!oldFocusItem.isVoid() && oldFocusItem != n)
		{
			GetItemRect(oldFocusItem, rect);
			RefreshRect(rect);
		}
	}
}
Esempio n. 17
0
// Show a specific button
bool wxRadioBox::Show(unsigned int item, bool show)
{
    wxRadioButton *btn = GetRadioButton(item);
    if(btn)
    {
        bool ret = btn->Show(show);
        RefreshRect(btn->GetRect());
        return ret;
    }
    return false;
}
Esempio n. 18
0
void CDragBar::OnUpdateUI(wxUpdateUIEvent& evt)
{
  UNREFERENCED_PARAMETER(evt);
  for (size_t idx = 0; idx < m_items.size(); ++idx) {
    const bool status = m_provider->IsEnabled(m_items[idx].id);
    if (status != m_items[idx].enabled) {
      m_items[idx].enabled = status;
      RefreshRect( wxRect( wxPoint(GetToolX(idx), GetToolY(idx)), wxSize(m_bmpWidth, m_bmpHeight)), false );
    }
  }
}
Esempio n. 19
0
void CCardio::Update(float dt)
{
	m_XFreq += dt;
	if((m_XFreq < 1))//&&(m_ForceRefresh==0))
		return;

	RefreshRect();
	//if(m_ForceRefresh == 0)
		m_XFreq -= 1.0f;
	//m_ForceRefresh = 0;
}
Esempio n. 20
0
void CDragBar::SetToolBitmaps(int id, const wxBitmap& bmp, const wxBitmap& bmpDisabled /*= wxNullBitmap*/)
{
  for (size_t idx = 0; idx < m_items.size(); ++idx) {
    if (m_items[idx].id == id) {
      m_items[idx].bmp = bmp;
      m_items[idx].bmpDisabled = bmpDisabled;
      RefreshRect( wxRect( wxPoint(GetToolX(idx), GetToolY(idx)), wxSize(m_bmpWidth, m_bmpHeight)), true );
      break;
    }
  }
}
Esempio n. 21
0
void WxGraphs::OnIdle(wxIdleEvent & event)
{
	if (m_invalid_region.IsEmpty())
		return;

	wxRect rect = m_invalid_region.GetBox();
	wxLogInfo(_T("Idle triggers refresh of rectange %d %d, %d %d"),
		  rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight());

	RefreshRect(rect);
	m_invalid_region.Clear();
}
Esempio n. 22
0
void AudioDisplay::OnStyleRangesChanged()
{
	if (!controller->GetTimingController()) return;

	AudioStyleRangeMerger asrm;
	controller->GetTimingController()->GetRenderingStyles(asrm);

	style_ranges.clear();
	style_ranges.insert(asrm.begin(), asrm.end());

	RefreshRect(wxRect(0, audio_top, GetClientSize().GetWidth(), audio_height), false);
}
Esempio n. 23
0
void CQueueViewBase::RefreshItem(const CQueueItem* pItem)
{
	wxASSERT(pItem);
	int index = GetItemIndex(pItem);

#ifdef __WXMSW__
	wxRect rect;
	GetItemRect(index, rect);
	RefreshRect(rect, false);
#else
	wxListCtrl::RefreshItem(index);
#endif
}
Esempio n. 24
0
void CSimpleGUIPanel::NoticesViewed() {
	CMainDocument* pDoc = wxGetApp().GetDocument();

    wxASSERT(pDoc);

	m_bNewNoticeAlert = false;
    m_bNoticesButtonIsRed = false;
    wxRect r = m_NoticesButton->GetRect();
    r.Inflate(4, 4);
    RefreshRect(r, true);
    m_bNoticesButtonIsRed = !m_bNoticesButtonIsRed;
	pDoc->UpdateUnreadNoticeState();
	checkForNewNoticesTimer->Start();
}
Esempio n. 25
0
void InstanceCtrl::HighlightGroup(const VisualCoord& coord)
{
	VisualCoord prevHighlight = highlightedGroup;

	if (coord.isGroup())
	{
		highlightedGroup = coord;

		wxRect gRect;
		GetGroupRect(coord.groupIndex, gRect);
		RefreshRect(gRect);
	}
	else
	{
		highlightedGroup.makeVoid();
	}

	if (prevHighlight.isGroup())
	{
		wxRect gRect;
		GetGroupRect(prevHighlight.groupIndex, gRect);
		RefreshRect(gRect);
	}
}
Esempio n. 26
0
void CodeView::OnScrollPageUp(wxScrollWinEvent& event)
{
    int page;

    if (GetFirstLine() > 0)
    {
        page = line_info.cursorPosition;
        Scroll(-1,GetFirstLine() - m_linesShown);
        UpdateLastCursorRect();
        line_info.cursorLastPosition = GetFirstLine();
        line_info.cursorPosition = line_info.cursorLastPosition;
        page -= line_info.cursorPosition;
        if (page < static_cast<int>(m_linesShown))
            RefreshRect(*LastCursorRect);
    }
}
Esempio n. 27
0
void BaseGrid::OnSubtitlesCommit(int type) {
	if (type == AssFile::COMMIT_NEW)
		UpdateMaps(true);
	else if (type & AssFile::COMMIT_ORDER || type & AssFile::COMMIT_DIAG_ADDREM)
		UpdateMaps(false);

	if (type & AssFile::COMMIT_DIAG_META) {
		SetColumnWidths();
		Refresh(false);
		return;
	}
	if (type & AssFile::COMMIT_DIAG_TIME)
		Refresh(false);
		//RefreshRect(wxRect(time_cols_x, 0, time_cols_w, GetClientSize().GetHeight()), false);
	else if (type & AssFile::COMMIT_DIAG_TEXT)
		RefreshRect(wxRect(text_col_x, 0, text_col_w, GetClientSize().GetHeight()), false);
}
Esempio n. 28
0
void wxGenericComboControl::OnMouseEvent( wxMouseEvent& event )
{
    bool isOnButtonArea = m_btnArea.Inside(event.m_x,event.m_y);
    int handlerFlags = isOnButtonArea ? wxCC_MF_ON_BUTTON : 0;

    // Preprocessing fabricates double-clicks and prevents
    // (it may also do other common things in future)
    if ( PreprocessMouseEvent(event,handlerFlags) )
        return;

#ifdef __WXMSW__
    const bool ctrlIsButton = true;
#else
    const bool ctrlIsButton = false;
#endif

    if ( ctrlIsButton &&
         (m_windowStyle & (wxCC_SPECIAL_DCLICK|wxCB_READONLY)) == wxCB_READONLY )
    {
        // if no textctrl and no special double-click, then the entire control acts
        // as a button
        handlerFlags |= wxCC_MF_ON_BUTTON;
        if ( HandleButtonMouseEvent(event,handlerFlags) )
            return;
    }
    else
    {
        if ( isOnButtonArea || HasCapture() )
        {
            if ( HandleButtonMouseEvent(event,handlerFlags) )
                return;
        }
        else if ( m_btnState )
        {
            // otherwise need to clear the hover status
            m_btnState = 0;
            RefreshRect(m_btnArea);
        }
    }

    //
    // This will handle left_down and left_dclick events outside button in a Windows/GTK-like manner.
    // See header file for further information on this method.
    HandleNormalMouseEvent(event);

}
void EDA_DRAW_PANEL::RefreshDrawingRect( const EDA_RECT& aRect, bool aEraseBackground )
{
    INSTALL_UNBUFFERED_DC( dc, this );

    wxRect rect = aRect;

    rect.x = dc.LogicalToDeviceX( rect.x );
    rect.y = dc.LogicalToDeviceY( rect.y );
    rect.width = dc.LogicalToDeviceXRel( rect.width );
    rect.height = dc.LogicalToDeviceYRel( rect.height );

    wxLogTrace( kicadTraceCoords,
                wxT( "Refresh area: drawing (%d, %d, %d, %d), device (%d, %d, %d, %d)" ),
                aRect.GetX(), aRect.GetY(), aRect.GetWidth(), aRect.GetHeight(),
                rect.x, rect.y, rect.width, rect.height );

    RefreshRect( rect, aEraseBackground );
}
Esempio n. 30
0
void wxGenericComboCtrl::OnMouseEvent( wxMouseEvent& event )
{
    int mx = event.m_x;
    bool isOnButtonArea = m_btnArea.Contains(mx,event.m_y);
    int handlerFlags = isOnButtonArea ? wxCC_MF_ON_BUTTON : 0;

    if ( PreprocessMouseEvent(event,handlerFlags) )
        return;

    const bool ctrlIsButton = wxPlatformIs(wxOS_WINDOWS);

    if ( ctrlIsButton &&
         (m_windowStyle & (wxCC_SPECIAL_DCLICK|wxCB_READONLY)) == wxCB_READONLY )
    {
        // if no textctrl and no special double-click, then the entire control acts
        // as a button
        handlerFlags |= wxCC_MF_ON_BUTTON;
        if ( HandleButtonMouseEvent(event,handlerFlags) )
            return;
    }
    else
    {
        if ( isOnButtonArea || HasCapture() ||
             (m_widthCustomPaint && mx < (m_tcArea.x+m_widthCustomPaint)) )
        {
            handlerFlags |= wxCC_MF_ON_CLICK_AREA;

            if ( HandleButtonMouseEvent(event,handlerFlags) )
                return;
        }
        else if ( m_btnState )
        {
            // otherwise need to clear the hover status
            m_btnState = 0;
            RefreshRect(m_btnArea);
        }
    }

    //
    // This will handle left_down and left_dclick events outside button in a Windows/GTK-like manner.
    // See header file for further information on this method.
    HandleNormalMouseEvent(event);

}