void CMainFrame::OnPaint() {
  CPaintDC dc(this); // device context for painting
  TextView *view = getActiveTextView();
  if(view) {
    view->refreshBoth();
  }
}
void CMainFrame::OnEditPaste() {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }
  const String t = getClipboardText();
  CWinDiffDoc *doc = view->getDocument();

  doc->setDoc(view->getId(),DIFFDOC_BUF,t);
  view->refreshBoth();
}
void CMainFrame::refreshDoc(bool recomp) {
  TextView *view = getActiveTextView();
  if(view == NULL) {
    return;
  }

  CWinDiffDoc *doc = view->getDocument();
  if(recomp) {
    doc->recompare();
  }
  view->savePositionState();
  view->refreshBoth();
}