Beispiel #1
0
UINT _lambda_OnEditExtractTo(CProgressMonitor *pMonitor, LPVOID pParam)
{
	pMonitor->BeginTask(TEXT("解压到:") + path, -1);
	CLeftView *pLeftView = (CLeftView*) pParam;
	pLeftView->ExtractTo(pFolder, path + TEXT("\\") + pFolder->m_strName, pMonitor);
	return 0;
}
Beispiel #2
0
void CLineDiffBar::OnPaint()
{
	CPaintDC dc(this); // device context for painting
	CRect rect;
	GetClientRect(rect);
	int height = rect.Height();
	int width = rect.Width();

	CDC cacheDC;
	VERIFY(cacheDC.CreateCompatibleDC(&dc));
	cacheDC.FillSolidRect(&rect, ::GetSysColor(COLOR_WINDOW));
	if (m_pCacheBitmap == NULL)
	{
		m_pCacheBitmap = new CBitmap;
		VERIFY(m_pCacheBitmap->CreateCompatibleBitmap(&dc, width, height));
	}
	CBitmap *pOldBitmap = cacheDC.SelectObject(m_pCacheBitmap);

	CRect upperrect = CRect(rect.left, rect.top, rect.right, rect.bottom/2);
	CRect lowerrect = CRect(rect.left, rect.bottom/2, rect.right, rect.bottom);

	if ((m_pMainFrm)&&(m_pMainFrm->m_pwndLeftView)&&(m_pMainFrm->m_pwndRightView))
	{
		CLeftView* leftView = m_pMainFrm->m_pwndLeftView;
		CRightView* rightView = m_pMainFrm->m_pwndRightView;
		if ((leftView->IsWindowVisible())&&(rightView->IsWindowVisible()))
		{
			BOOL bViewWhiteSpace = leftView->m_bViewWhitespace;
			BOOL bInlineDiffs = leftView->m_bShowInlineDiff;
			
			leftView->m_bViewWhitespace = TRUE;
			leftView->m_bShowInlineDiff = TRUE;
			leftView->m_bShowSelection = false;
			rightView->m_bViewWhitespace = TRUE;
			rightView->m_bShowInlineDiff = TRUE;
			rightView->m_bShowSelection = false;

			// Use left and right view to display lines next to each other
			leftView->DrawSingleLine(&cacheDC, &upperrect, m_nLineIndex);
			rightView->DrawSingleLine(&cacheDC, &lowerrect, m_nLineIndex);

			leftView->m_bViewWhitespace = bViewWhiteSpace;
			leftView->m_bShowInlineDiff = bInlineDiffs;
			leftView->m_bShowSelection = true;
			rightView->m_bViewWhitespace = bViewWhiteSpace;
			rightView->m_bShowInlineDiff = bInlineDiffs;
			rightView->m_bShowSelection = true;
		}
	} 

	VERIFY(dc.BitBlt(rect.left, rect.top, width, height, &cacheDC, 0, 0, SRCCOPY));

	cacheDC.SelectObject(pOldBitmap);
	cacheDC.DeleteDC();
}
Beispiel #3
0
void IAction::update (bool updateLeftView, TUpdateRightView rightViewFlag, CGeorgesEditDoc &doc, const char *_FormName)
{
	// Right and left view
	CGeorgesEditView *rightView = doc.getRightView ();
	nlassert (rightView);
	CLeftView *leftView = doc.getLeftView ();
	nlassert (leftView);

	// Update left view ?
	if (updateLeftView)
		doc.updateDocumentStructure ();

	// Set the current view..
	uint subSelection = leftView->getCurrentSelectionId ();
	if (subSelection != _SelId)
	{
		doc.changeSubSelection (_SelId, NULL);
		return;
	}

	if (leftView->getCurrentSelectionId () == 1)
	{
		rightView->HeaderDialog.getFromDocument (*doc.getHeaderPtr ());
	}
	else if (doc.isType ())
	{
		rightView->TypeDialog.getFromDocument (*(doc.getTypePtr()));
	}
	else if (doc.isDfn ())
	{
		rightView->DfnDialog.getFromDocument (*(doc.getDfnPtr()));
	}
	else if (doc.isForm ())
	{
		if (rightViewFlag == DoNothing)
		{
		}
		else if (rightViewFlag == UpdateLabels)
		{
			rightView->FormDialog.updateLabels ();
		}
		else if (rightViewFlag == UpdateValues)
		{
			rightView->FormDialog.updateValues ();
		}
		else if (rightViewFlag == Redraw)
		{
			rightView->FormDialog.getFromDocument ();
		}
	}
}
//==============================================================================
void CMainFrame::OnArchiveUpdate() 
{
  EnableControls( false );

  if( checksBeforeUpdate() <= OPR_WARNINGS )
    if( theApp.m_UIfactory.initProgressDialog() <= OPR_WARNINGS )
      g_TheArchive.update();

  if( m_pFilesToArcFrame != NULL )
  {
    CLeftView* pView = m_pFilesToArcFrame->GetLeftPane(); 
    pView->TrackSelChange();
  }

  EnableControls( true );
}
Beispiel #5
0
CGeorgesEditDocSub *CGeorgesEditDoc::getSelectedObject ()
{
	CLeftView *leftView = getLeftView ();
	return leftView->getSelectedObject ();
}
Beispiel #6
0
void CGeorgesEditDoc::updateDocumentStructure ()
{
	RootObject.clean ();

	// Get left view
	CLeftView *leftView = getLeftView ();

	// Backup current selection
	uint selection = 0xffffffff;
	if (IsWindow (*leftView))
		selection = leftView->getCurrentSelectionId ();

	// Read the file
	if (isType())
	{
		// Setup sub object tree 
		RootObject.create (CGeorgesEditDocSub::Null, "Type", 0xffffffff, "NULL", 0xffffffff);
		RootObject.add (CGeorgesEditDocSub::Header, "Header", 0xffffffff, "NULL", 0xffffffff);
		RootObject.add (CGeorgesEditDocSub::Type, "Content", 0xffffffff, "NULL", 0xffffffff);
	}
	else if (isDfn ())
	{
		// Setup sub object tree 
		RootObject.create (CGeorgesEditDocSub::Null, "Dfn", 0xffffffff, "NULL", 0xffffffff);
		RootObject.add (CGeorgesEditDocSub::Header, "Header", 0xffffffff, "NULL", 0xffffffff);
		RootObject.add (CGeorgesEditDocSub::Dfn, "Content", 0xffffffff, "NULL", 0xffffffff);
	}
	else
	{
		// Setup sub object tree 
		RootObject.create (CGeorgesEditDocSub::Null, "Form", 0xffffffff, "NULL", 0xffffffff);
		RootObject.add (CGeorgesEditDocSub::Header, "Header", 0xffffffff, "NULL", 0xffffffff);

		// Get the parents
		CFormElmStruct *rootstruct = &((CForm*)(UForm*)Form)->Elements;
		addStruct (&RootObject, rootstruct, rootstruct->FormDfn, "Content", 0xffffffff, "", 0);

		// Get held objects

		// Write held elements
		uint i;
		for (i=0; i<CForm::HeldElementCount; i++)
		{
			rootstruct = ((CForm*)(UForm*)Form)->HeldElements[i];
			addStruct (&RootObject, rootstruct, rootstruct->FormDfn, ("Hold " + toString (1+i)).c_str (), 0xffffffff, "", i+1);
		}
	}

	// Update left view structure
	leftView->getFromDocument ();

	// Set the old selction flag
	if (selection != 0xffffffff)
	{
		// Reselect backuped node
		leftView->setCurrentSelectionId (selection);
	}
	else
	{
		// Select the content
		leftView->setCurrentSelectionId (2);
	}
}