Example #1
0
LRESULT CGraphPanel::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
{
    if (message == WM_COMMAND && (wParam>GRAPH_RBMC_FIRST && wParam<GRAPH_RBMC_LAST))
    {//this is right button menu commands
	EnumerateParentWindows(OnRBMenuCommandForAllParents, (void*)wParam);
    };

    if (message == CM_GRAPH_NOTIFICATION)
    {
	switch (wParam)
	{
	    case GRAPH_GRAPH_CLEARED:
	    case GRAPH_GRAPH_REMOVED:
	    case GRAPH_POINT_REMOVED:
	    case GRAPH_POINT_CHANGED:
	    {
		SGraphChange* sgc = (SGraphChange*)lParam;
		if (sgc->bRedraw)
		{
		    UpdateGraphWindow(NULL);
		};
	    }; break;
	    case GRAPH_POINT_ADDED:
	    {
		AddPoint((SGraphChange*)lParam);
		return NULL;
	    }; break;
	    case GRAPH_GRAPH_ADDED:
	    {
	    }; break;
	    case GRAPH_GRAPHIX_PROP:
	    {
		SGraphixProps* sgp = (SGraphixProps*)lParam;
		SetGraphixFlags(sgp->flags, sgp->bRedraw);
		SetWorldCoords(sgp->x1, sgp->x2, sgp->y1, sgp->y2, sgp->bRedraw);
	    }; break;
	    case GRAPH_GRAPHIX_AXISPROPS:
	    {
		SAxisPropsChange* sapc = (SAxisPropsChange*)lParam;
		UpdateTitles(sapc->bXAxis, sapc->bRedraw);
	    }; break;
	    case GRAPH_GRAPHIX_UPDATE:
	    {
		if ((lParam & GRAPH_WUV_GRAPH) != 0)
		{
		    UpdateGraphWindow(NULL);
		};
		if ((lParam & GRAPH_WUV_RULERS) != 0)
		{
		    hruler->RedrawWindow();
		    vruler->RedrawWindow();
		};
	    }; break;
	};
    };	
    return CWnd::WindowProc(message, wParam, lParam);
}
Example #2
0
void PaintViews( HDC hdc, RECT region )				// paint the screen from either front or blended views 
{
	bool frontUpdate, backUpdate;								// keep track of regeneration

	if ( FrontView )											// first regenerate the front view (if needed)
		{
		frontUpdate = FrontView->Regenerate( region, CurrSeries->pixel_size, CurrSeries->offset_x,
																	CurrSeries->offset_y, CurrSeries->useProxies );

		if ( BlendView && BackView )							// only have blend view when have back view
			{													// blend view depends also on back view so regenerate it also
			backUpdate = BackView->Regenerate( region, CurrSeries->pixel_size, CurrSeries->offset_x,
																	CurrSeries->offset_y, CurrSeries->useProxies );
			if ( frontUpdate || backUpdate ) UpdateBlendView();	// regenerate the blend of front and back views
			BlendView->Display( hdc, region );					// blt to screen dc (since BlendView exists its displayed)
			}
		else FrontView->Display( hdc, region );					// otherwise just blt front view to screen dc
		UpdateMenus();
		UpdateTitles();
		}
}