Ejemplo n.º 1
0
void CSPDReaderView::DoFind(void)
{
	m_nFindPosition++;
	int cnt=(int)GetDoc()->m_llSortedFunctions.size();
	if(cnt==0)
	{
		wxMessageBox(wxT("No matches found."),wxT("Find"),wxOK|wxICON_INFORMATION);
		return;
	}
	if(m_nFindPosition>=cnt)
	{
		m_nFindPosition=0;
	}

	int nStartPosition=m_nFindPosition;
	bool bFound=false;

	do
	{
		int fidx=GetDoc()->m_llSortedFunctions[m_nFindPosition];
		if(GetDoc()->m_arrFunctionData[fidx].Desc.strBaseName.Contains(m_strFindText))
		{
			SetSelectedFunction(fidx,true);
			return;
		}
		
		m_nFindPosition++;
		if(m_nFindPosition==cnt)
		{
			m_nFindPosition=0;
		}
	} while(m_nFindPosition!=nStartPosition);
		
	wxMessageBox(wxT("No matches found."),wxT("Find"),wxOK|wxICON_INFORMATION);
}
Ejemplo n.º 2
0
FX_BOOL CXFA_FFTextEdit::GetSuggestWords(const CFX_ByteStringC& sWord,
                                         CFX_ByteStringArray& sSuggest) {
  if (m_pDataAcc->GetUIType() != XFA_ELEMENT_TextEdit) {
    return FALSE;
  }
  return GetDoc()->GetDocProvider()->GetSuggestWords(GetDoc(), sWord, sSuggest);
}
Ejemplo n.º 3
0
bool AtomMetaField::Read() {
	if (GetSize() >= 8) {
		if (!GetDoc()->GetMediaFile().SeekAhead(4)) {
			FATAL("Unable to seek 4 bytes");
			return false;
		}
		uint32_t type;
		if (!ReadUInt32(type, false)) {
			FATAL("Unable to read type");
			return false;
		}
		if (type != A_DATA) {
			if (!GetDoc()->GetMediaFile().SeekBehind(4)) {
				FATAL("Unable to go back 4 bytes");
				return false;
			}
			if (!ReadString(_stringData, GetSize() - 8 - 4)) {
				FATAL("Unable to read string");
				return false;
			}
			return true;
		} else {
			if (!GetDoc()->GetMediaFile().SeekBehind(8)) {
				FATAL("Unable to go back 8 bytes");
				return false;
			}
			return BoxAtom::Read();
		}
	} else {
		return BoxAtom::Read();
	}
}
Ejemplo n.º 4
0
BOOL CMainFrame::SaveRegistrySettings()
{
	CFrame::SaveRegistrySettings();
	GetDoc()->SaveDocRegistry(GetRegistryKeyName().c_str());

	return TRUE;
}
Ejemplo n.º 5
0
csRef<iDocumentNodeIterator> csXmlReadNode::GetNodes (const char* value)
{
  csRef<iDocumentNodeIterator> it;
  it = csPtr<iDocumentNodeIterator> (new csXmlReadNodeIterator (
  	GetDoc(), use_contents_value ? 0 : node_children, value));
  return it;
}
Ejemplo n.º 6
0
void CMainFrame::OnFileSave()
{
	if (m_PathName == _T(""))
		OnFileSaveAs();
	else
		GetDoc().FileSave(m_PathName);
}
Ejemplo n.º 7
0
bool CXFA_FFComboBox::OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) {
  if (!CXFA_FFField::OnRButtonUp(dwFlags, fx, fy))
    return false;

  GetDoc()->GetDocEnvironment()->PopupMenu(this, CFX_PointF(fx, fy));
  return true;
}
Ejemplo n.º 8
0
void CSemanticStrView::OnDraw(CDC* pDC)
{
	CSemanticStrDoc* pDoc = GetDoc();
	ASSERT_VALID(pDoc);

	// TODO: add draw code for native data here
}
Ejemplo n.º 9
0
bool CXFA_FFTextEdit::OnRButtonUp(uint32_t dwFlags, const CFX_PointF& point) {
  if (!CXFA_FFField::OnRButtonUp(dwFlags, point))
    return false;

  GetDoc()->GetDocEnvironment()->PopupMenu(this, point);
  return true;
}
Ejemplo n.º 10
0
BOOL CMainFrame::LoadRegistrySettings(LPCTSTR szKeyName)
{
	CFrame::LoadRegistrySettings(szKeyName);
	GetDoc()->LoadDocRegistry(GetRegistryKeyName().c_str());

	return TRUE;
}
Ejemplo n.º 11
0
bool CXFA_FFTextEdit::CommitData() {
  WideString wsText = ToEdit(m_pNormalWidget.get())->GetText();
  if (m_pNode->SetValue(XFA_VALUEPICTURE_Edit, wsText)) {
    m_pNode->UpdateUIDisplay(GetDoc()->GetDocView(), this);
    return true;
  }
  ValidateNumberField(wsText);
  return false;
}
Ejemplo n.º 12
0
FX_BOOL CXFA_FFComboBox::OnRButtonUp(FX_DWORD dwFlags,
                                     FX_FLOAT fx,
                                     FX_FLOAT fy) {
  if (!CXFA_FFField::OnRButtonUp(dwFlags, fx, fy))
    return FALSE;

  GetDoc()->GetDocProvider()->PopupMenu(this, CFX_PointF(fx, fy), nullptr);
  return TRUE;
}
Ejemplo n.º 13
0
bool XGlobalVal::OnDidFinishLoad()
{
	XTRACE( "loaded global.xml" );
	// 루트노드를 구해놓는다.
	m_pRoot = GetDoc().FirstChild( "global" );
	m_nodeRoot.SetpRoot( m_pRoot->ToElement() );
	XBREAKF( m_pRoot == NULL, "global node not found" );
	return true;
}
Ejemplo n.º 14
0
void csXmlReadNode::DecRef ()
{
  csXmlReadDocument* doc = GetDoc();
  /* In case we're freed the doc's node pool will be accessed; to make sure
     it's valid keep a ref to the doc while we're (potentially) destructed */
  doc->csXmlReadDocument::IncRef();
  scfPooledImplementationType::DecRef();
  doc->csXmlReadDocument::DecRef();
}
Ejemplo n.º 15
0
csRef<iDocumentNode> csXmlReadNode::GetNode (const char* value)
{
  if (!node_children || use_contents_value) return 0;
  csRef<iDocumentNode> child;
  TrDocumentNode* c = node_children->FirstChild (value);
  if (!c) return child;
  child = csPtr<iDocumentNode> (GetDoc()->Alloc (c, false));
  return child;
}
Ejemplo n.º 16
0
void CMainFrame::OnUpdateRangeOfIds_Radio(UINT nID)
{
	UINT adjId = nID - ID_RADIO_A;
	UINT curRadio = GetDoc()->GetRadio();
	BOOL bCheck = (curRadio == adjId);
	int nFileItem = GetMenuItemPos(GetFrameMenu(), _T("Select"));
	CMenu* pRadioMenu = GetFrameMenu()->GetSubMenu(nFileItem);
	if (bCheck)  
		pRadioMenu->CheckMenuRadioItem(ID_RADIO_A, ID_RADIO_C, nID, 0);
}
Ejemplo n.º 17
0
void CMainFrame::MRUFileOpen(UINT nMRUIndex)
{
	CString strMRUText = GetMRUEntry(nMRUIndex);

	if (GetDoc().FileOpen(strMRUText))
		m_PathName = strMRUText;
	else
		RemoveMRUEntry(strMRUText);

	GetView().Invalidate();
}
Ejemplo n.º 18
0
FX_BOOL CXFA_FFTextEdit::OnRButtonUp(FX_DWORD dwFlags,
                                     FX_FLOAT fx,
                                     FX_FLOAT fy) {
  if (!CXFA_FFField::OnRButtonUp(dwFlags, fx, fy)) {
    return FALSE;
  }
  CFX_PointF pt;
  pt.Set(fx, fy);
  GetDoc()->GetDocProvider()->PopupMenu(this, pt, NULL);
  return TRUE;
}
Ejemplo n.º 19
0
void CMainFrame::OnInitialUpdate()
{
	// Here we process the command line arguments, and automatically load a file if one is specified.
	// GetCommandLineArgs retrieves our command line arguments and stores them in a vector of CString.

	std::vector<CString> args = GetCommandLineArgs();
	// The second argument (if any) contains our file name.
	if (args.size() > 1)
	{
		GetDoc().FileOpen(args[1]);
	}
}
Ejemplo n.º 20
0
void CSPDReaderView::OnSize(wxSizeEvent &evt)
{
	wxSize sz=g_theApp->GetMainFrame()->GetClientSize();
	m_pNotebook->SetSize(sz);

	if(m_pCloseButton)
	{
		wxSize nbsz=m_pNotebook->GetClientSize();
		m_pCloseButton->Move(nbsz.x-19,3);
	}

#ifdef SHOW_PROFILER_TIME
	double enterperc=100.0 * GetDoc()->m_PerfInfo.entertime / GetDoc()->m_PerfInfo.totalwallclocktime;
	double exitperc=100.0 * GetDoc()->m_PerfInfo.exittime / GetDoc()->m_PerfInfo.totalwallclocktime;
	double profperc=enterperc+exitperc;
	g_theApp->GetMainFrame()->GetStatusBar()->SetStatusText(
		wxString::Format(wxT("Profiling Time: %.5f%%, Enter Time: %.5f%%, Exit Time: %.5f%%"),
		profperc,enterperc,exitperc));
#endif

}
Ejemplo n.º 21
0
void CMainFrame::OnFileMRU(WPARAM wParam)
// Called when a MRU file is selected from the menu
{
	UINT nMRUIndex = LOWORD(wParam) - IDW_FILE_MRU_FILE1;
	CString strMRUText = GetMRUEntry(nMRUIndex);

	if (GetDoc().FileOpen(strMRUText))
		m_PathName = strMRUText;
	else
		RemoveMRUEntry(strMRUText);

	GetView().Invalidate();
}
Ejemplo n.º 22
0
void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget* pWidget,
                                          int32_t iYear,
                                          int32_t iMonth,
                                          int32_t iDay) {
  CFX_WideString wsPicture;
  m_pDataAcc->GetPictureContent(wsPicture, XFA_VALUEPICTURE_Edit);
  CXFA_LocaleValue date(XFA_VT_DATE, GetDoc()->GetXFADoc()->GetLocalMgr());
  CFX_Unitime dt;
  dt.Set(iYear, iMonth, iDay);
  date.SetDate(dt);
  CFX_WideString wsDate;
  date.FormatPatterns(wsDate, wsPicture, m_pDataAcc->GetLocal(),
                      XFA_VALUEPICTURE_Edit);
  CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)m_pNormalWidget;
  pDateTime->SetEditText(wsDate);
  pDateTime->Update();
  GetDoc()->GetDocEnvironment()->SetFocusWidget(GetDoc(), nullptr);
  CXFA_EventParam eParam;
  eParam.m_eType = XFA_EVENT_Change;
  eParam.m_pTarget = m_pDataAcc;
  m_pDataAcc->GetValue(eParam.m_wsNewText, XFA_VALUEPICTURE_Raw);
  m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam);
}
Ejemplo n.º 23
0
void CMainFrame::LoadFile(LPCTSTR str)
// Called by OnFileOpen and in response to a UWM_DROPFILE message
{
	// Retrieve the PlotPoint data
	if (GetDoc().FileOpen(str))
	{
		// Save the filename
		m_PathName = str;
		AddMRUEntry(str);
	}
	else
		m_PathName=_T("");

	GetView().Invalidate();
}
Ejemplo n.º 24
0
csRef<iDocumentNode> csXmlReadNode::GetParent ()
{
  csRef<iDocumentNode> child;
  if (use_contents_value)
  {
    // If we use contents value then the parent is actually this object.
    IncRef ();
    return csPtr<iDocumentNode> (this);
  }
  else
  {
    if (!node->Parent ()) return child;
    child = csPtr<iDocumentNode> (GetDoc()->Alloc (node->Parent (), false));
    return child;
  }
  
  return 0;
}
Ejemplo n.º 25
0
void CXFA_FFTextEdit::UpdateWidgetProperty() {
  CFWL_Edit* pWidget = ToEdit(m_pNormalWidget.get());
  if (!pWidget)
    return;

  uint32_t dwStyle = 0;
  uint32_t dwExtendedStyle =
      FWL_STYLEEXT_EDT_ShowScrollbarFocus | FWL_STYLEEXT_EDT_OuterScrollbar;
  dwExtendedStyle |= UpdateUIProperty();
  if (m_pNode->IsMultiLine()) {
    dwExtendedStyle |= FWL_STYLEEXT_EDT_MultiLine | FWL_STYLEEXT_EDT_WantReturn;
    if (!m_pNode->IsVerticalScrollPolicyOff()) {
      dwStyle |= FWL_WGTSTYLE_VScroll;
      dwExtendedStyle |= FWL_STYLEEXT_EDT_AutoVScroll;
    }
  } else if (!m_pNode->IsHorizontalScrollPolicyOff()) {
    dwExtendedStyle |= FWL_STYLEEXT_EDT_AutoHScroll;
  }
  if (!m_pNode->IsOpenAccess() || !GetDoc()->GetXFADoc()->IsInteractive()) {
    dwExtendedStyle |= FWL_STYLEEXT_EDT_ReadOnly;
    dwExtendedStyle |= FWL_STYLEEXT_EDT_MultiLine;
  }

  XFA_Element eType;
  int32_t iMaxChars;
  std::tie(eType, iMaxChars) = m_pNode->GetMaxChars();
  if (eType == XFA_Element::ExData)
    iMaxChars = 0;

  Optional<int32_t> numCells = m_pNode->GetNumberOfCells();
  if (!numCells) {
    pWidget->SetLimit(iMaxChars);
  } else if (*numCells == 0) {
    dwExtendedStyle |= FWL_STYLEEXT_EDT_CombText;
    pWidget->SetLimit(iMaxChars > 0 ? iMaxChars : 1);
  } else {
    dwExtendedStyle |= FWL_STYLEEXT_EDT_CombText;
    pWidget->SetLimit(*numCells);
  }

  dwExtendedStyle |= GetAlignment();
  m_pNormalWidget->ModifyStyles(dwStyle, 0xFFFFFFFF);
  m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF);
}
Ejemplo n.º 26
0
void CSPDReaderView::OnViewThreadFilter(wxCommandEvent &evt)
{
	CThreadFilterDlg dlg(g_theApp->GetMainFrame(),-1,wxT("Filter Threads"));

	for(size_t t=1;t<GetDoc()->m_arrThreadData.size();t++)
	{
		wxString strFuncName=wxT("<unknown>");
		if(GetDoc()->m_arrThreadData[t].TopLevelFunctions.size()==1)
		{
			strFuncName=GetDoc()->m_arrFunctionData[*(GetDoc()->m_arrThreadData[t].TopLevelFunctions.begin())].Desc.strBaseName;
		}
		else if(GetDoc()->m_arrThreadData[t].TopLevelFunctions.size()>1)
		{
			strFuncName=wxT("<multiple top-level functions>");
		}
		dlg.GetThreads()->Append(wxString::Format(wxT("%u: %s"),t,(const TCHAR *)strFuncName));
	}

	for(std::list<wxUint32>::iterator iter=GetDoc()->m_llFilterThreadSeqNums.begin();iter!=GetDoc()->m_llFilterThreadSeqNums.end();iter++)
	{
		dlg.GetThreads()->Check((*iter)-1,true);
	}

	if(dlg.ShowModal()==wxID_OK)
	{
		std::list<wxUint32> tids;
		for(size_t t=1;t<GetDoc()->m_arrThreadData.size();t++)
		{
			if(dlg.GetThreads()->IsChecked(t-1))
			{
				tids.push_back(t);
			}
		}

		m_nHistoryPosition=-1;
		m_llHistory.clear();
		GetDoc()->SetThreadFilter(tids);
		OnUpdate(this,NULL);
	}

}
Ejemplo n.º 27
0
bool BoxAtom::Read() {
	while (CurrentPosition() != _start + _size) {
		BaseAtom *pAtom = GetDoc()->ReadAtom(this);
		if (pAtom == NULL) {
			FATAL("Unable to read atom. Parent atom is %s",
					STR(GetTypeString()));
			return false;
		}
		if (!pAtom->IsIgnored()) {
			if (!AtomCreated(pAtom)) {
				FATAL("Unable to signal AtomCreated for atom %s (%"PRIx64")",
						STR(GetTypeString()), _start);
				return false;
			}
		}
		ADD_VECTOR_END(_subAtoms, pAtom);
	}
	return true;
}
Ejemplo n.º 28
0
void CMainFrame::OnFileSaveAs()
{
	CFileDialog FileDlg(FALSE, _T("dat"), 0, OFN_OVERWRITEPROMPT, _T("Scribble Files (*.dat)\0*.dat\0\0"));
	FileDlg.SetTitle(_T("Save File"));

	// Bring up the file open dialog retrieve the selected filename
	if (FileDlg.DoModal(*this) == IDOK)
	{
		CString str = FileDlg.GetPathName();

		// Save the file
		if (GetDoc().FileSave(str))
		{
			// Save the file name
			m_PathName = str;
			AddMRUEntry(m_PathName);
		}
	}

}
Ejemplo n.º 29
0
void CXFA_FFField::DrawHighlight(CFX_Graphics* pGS,
                                 CFX_Matrix* pMatrix,
                                 uint32_t dwStatus,
                                 FX_BOOL bEllipse) {
  if (m_rtUI.IsEmpty() || !m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
    return;
  }
  if ((dwStatus & XFA_WidgetStatus_Highlight) &&
      m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open) {
    CXFA_FFDoc* pDoc = GetDoc();
    CFX_Color crHighlight(pDoc->GetDocProvider()->GetHighlightColor(pDoc));
    pGS->SetFillColor(&crHighlight);
    CFX_Path path;
    path.Create();
    if (bEllipse) {
      path.AddEllipse(m_rtUI);
    } else {
      path.AddRectangle(m_rtUI.left, m_rtUI.top, m_rtUI.width, m_rtUI.height);
    }
    pGS->FillPath(&path, FXFILL_WINDING, pMatrix);
  }
}
Ejemplo n.º 30
0
void CMainFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) 
{
  //Let the base class do its thing
	CFrameWnd::OnActivate(nState, pWndOther, bMinimized);
	
  CString sText;
  INT_PTR nNum = GetDoc()->GetNumberMessages();
  if (nState == WA_INACTIVE && bMinimized && nNum)
  {
    if (nNum == 1)
      VERIFY(sText.LoadString(AFX_IDS_APP_TITLE3));
    else
    {
      CString sNum;
      sNum.Format(_T("%d"), nNum);
      AfxFormatString1(sText, AFX_IDS_APP_TITLE2, sNum);
    }
  }
  else
    VERIFY(sText.LoadString(AFX_IDS_APP_TITLE));

  SetWindowText(sText);
}