コード例 #1
0
LONG CuDlgSqlQueryPageXML::OnFetchRows (WPARAM wParam, LPARAM lParam)
{
	int nStatus = (int)wParam;
	switch (nStatus)
	{
	case CaExecParamQueryRows::FETCH_NORMAL_ENDING:
		// LPARAM = (Total number of rows fetched)
		break;
	case CaExecParamQueryRows::FETCH_REACH_LIMIT:
		break;
	case CaExecParamQueryRows::FETCH_ERROR:
		break;
	case CaExecParamQueryRows::FETCH_TRACEINFO:
		{
			CaExecParamQueryRows* pQueryRowParam = (CaExecParamQueryRows*)lParam;
			CfSqlQueryFrame* pFrame = (CfSqlQueryFrame*)GetParentFrame();
			if (pFrame && pQueryRowParam)
			{
				CuDlgSqlQueryResult* pDlgResult = pFrame->GetDlgSqlQueryResult();
				if (pDlgResult)
				{
					CuDlgSqlQueryPageRaw* pRawPage = pDlgResult->GetRawPage();
					ASSERT (pRawPage);
					CString strNew = (LPCTSTR)lParam;
					pDlgResult->DisplayTraceLine (strNew, NULL);
				}
			}
		}
		break;

	default:
		break;
	}
	return 0;
}
コード例 #2
0
void CdSqlQuery::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		CfSqlQueryFrame* pFrame = GetFrameWindow();
		if (!pFrame)
			return;
		ar << m_strNode;
		ar << m_strServer;
		ar << m_strUser;
		ar << m_strDatabase;
		ar << m_nDbFlag;

		ar << m_SeqNum;
		ar << m_nNodeHandle;
		ar << GetTitle();
		ar << m_IngresVersion;

		BOOL bToolBarVisible = FALSE;
		CToolBar* pTbar = GetToolBar();
		if (pTbar && IsWindowVisible(pTbar->m_hWnd))
			bToolBarVisible = TRUE;
		ar << bToolBarVisible;
		//
		// Full state of all toolbars in the frame
		pFrame->GetDockState(m_toolbarState);
		m_toolbarState.Serialize(ar);
		//
		// Frame window placement
		memset(&m_wplj, 0, sizeof(m_wplj));
		BOOL bResult = pFrame->GetWindowPlacement(&m_wplj);
		ASSERT (bResult);
		ar.Write(&m_wplj, sizeof(m_wplj));
	}
	else
	{
		CString strTitle;
		m_bLoaded = TRUE;
		ar >> m_strNode;
		ar >> m_strServer;
		ar >> m_strUser;
		ar >> m_strDatabase;
		ar >> m_nDbFlag;

		ar >> m_SeqNum;
		ar >> m_nNodeHandle;
		ar >> strTitle; SetTitle(strTitle);
		ar >> m_IngresVersion;

		ar >> m_bToolbarVisible;
		//
		// Full state of all toolbars in the frame
		m_toolbarState.Serialize(ar);
		//
		// Frame window placement
		ar.Read(&m_wplj, sizeof(m_wplj));
	}
	SerializeSqlControl(ar);
}
コード例 #3
0
CToolBar* CdSqlQuery::GetToolBar()
{
	CfSqlQueryFrame* pFrame = GetFrameWindow();
	ASSERT (pFrame);
	if (pFrame)
		return pFrame->GetToolBar();
	return NULL;
}
コード例 #4
0
void CvSqlQueryRichEditView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	if (nChar == VK_F5)
	{
		CfSqlQueryFrame* pFrame  = (CfSqlQueryFrame*)GetParentFrame();
		if (pFrame && pFrame->IsRunEnable())
			pFrame->Execute();
	}

	CRichEditView::OnKeyDown(nChar, nRepCnt, nFlags);
}
コード例 #5
0
void CvSqlQueryRichEditView::OnInitialUpdate() 
{
	CRichEditView::OnInitialUpdate();
	HFONT hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
	if (hFont == NULL)
		hFont = (HFONT)GetStockObject(ANSI_VAR_FONT);
	if (hFont)
		SendMessage(WM_SETFONT, (WPARAM)hFont);

	CdSqlQueryRichEditDoc* pDoc =(CdSqlQueryRichEditDoc*)GetDocument();
	CfSqlQueryFrame* pFrame  = (CfSqlQueryFrame*)GetParentFrame();
	CuDlgSqlQueryResult* pDlgResult = pFrame->GetDlgSqlQueryResult();
	CaSqlQueryProperty& property = pDoc->GetProperty();
	if (pDlgResult && property.IsTraceActivated() && property.IsTraceToTop())
	{
		pDlgResult->SelectRawPage();
	}
}
コード例 #6
0
BOOL CuDlgSqlQueryPageXML::OnInitDialog() 
{
	CDialog::OnInitDialog();
	CfSqlQueryFrame* pFrame = (CfSqlQueryFrame*)GetParentFrame();
	CdSqlQueryRichEditDoc* pDoc = (CdSqlQueryRichEditDoc*)pFrame->GetActiveDocument();
	if (pDoc)
		m_bXMLSource = !(pDoc->GetProperty().GetXmlDisplayMode() == 1);
	else
		m_bXMLSource = FALSE;
	m_pQueryRowParam->SetMode(m_bXMLSource);
	m_strPreview.LoadString (IDS_PREVIEW);
	m_cButtonXML.GetWindowText (m_strXmlSource);
	if (m_bXMLSource)
		m_cButtonXML.SetWindowText (m_strPreview);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
コード例 #7
0
LONG CuDlgSqlQueryPageXML::OnHighlightStatement (WPARAM wParam, LPARAM lParam)
{
	CfSqlQueryFrame* pParent = (CfSqlQueryFrame*)GetParentFrame();
	ASSERT_VALID (pParent);
	if (!pParent)
		return 0L;
	CvSqlQueryRichEditView* pView2 = pParent->GetRichEditView();
	CdSqlQueryRichEditDoc*  pDoc = pParent->GetSqlDocument();
	ASSERT (pDoc);
	if (!pDoc)
		return 0L;

	pView2->SetColor (-1,  0, pDoc->m_crColorText);
	if (m_bShowStatement)
		return 0L;
	pView2->SetColor (m_nStart, m_nEnd, pDoc->m_crColorSelect);
	return 0L;
}
コード例 #8
0
void CuDlgSqlQueryPageXML::NotifyLoad (CaQueryXMLPageData* pData)
{
	ASSERT (pData);
	if (!pData)
		return;

	CfSqlQueryFrame* pParent = (CfSqlQueryFrame*)GetParentFrame();
	ASSERT_VALID (pParent);
	if (!pParent)
		return;
	CdSqlQueryRichEditDoc*  pDoc = pParent->GetSqlDocument();

	m_bShowStatement = pData->m_bShowStatement;
	m_nStart         = pData->m_nStart;
	m_nEnd           = pData->m_nEnd;
	m_strStatement   = pData->m_strStatement;
	m_strDatabase    = pData->m_strDatabase;
	m_bXMLSource     = pData->m_pParam->GetMode();
	m_bXMLSource     = !m_bXMLSource; // Because OnButtonXML() will invert this value.
	m_pQueryRowParam->Copy(*(pData->m_pParam));

	UpdateData (FALSE);
	OnButtonXML();
}
コード例 #9
0
void CvSqlQueryRichEditView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
{
	int nHint = (int)lHint;
	CdSqlQueryRichEditDoc* pDoc =(CdSqlQueryRichEditDoc*)GetDocument();
	switch (nHint)
	{
	case UPDATE_HINT_LOAD:
		if (pHint && pHint == pDoc)
		{
			// Load document from the serialization:
			if (!pDoc->IsLoadedDoc())
				return;
			//
			// Put the global statement.
			CRichEditCtrl& redit = GetRichEditCtrl();
			LONG oldEventMask = redit.SetEventMask(ENM_NONE); // Do not send EN_CHANGE.
			redit.SetWindowText (pDoc->m_strStatement);
			// Set the highlight statement.
			if (pDoc->m_bHighlight)
			{
				redit.SetSel (0, -1);
				OnColorPick (pDoc->m_crColorText);
				redit.SetSel (pDoc->m_nStart, pDoc->m_nEnd);
				OnColorPick (pDoc->m_crColorSelect);
				redit.SetSel (-1, 0);
			}
			redit.SetEventMask(oldEventMask);// Restore the old event mask
			pDoc->SetTitle (pDoc->m_strTitle);
			//
			// Splitbar placement
			CfSqlQueryFrame* pFrame  = (CfSqlQueryFrame*)GetParentFrame();
			CSplitterWnd* pNestSplitter = pFrame->GetNestSplitterWnd();
			ASSERT (pNestSplitter); 
			CSplitterWnd* pMainSplitter = pFrame->GetMainSplitterWnd();
			ASSERT (pMainSplitter); 
			if (!(pMainSplitter && pNestSplitter))
				return;

			pMainSplitter->SetRowInfo(0, pDoc->GetSplitterCyCurMainSplit(), pDoc->GetSplitterCyMinMainSplit());
			pMainSplitter->RecalcLayout();
			pNestSplitter->SetRowInfo(0, pDoc->GetSplitterCyCurNestSplit(), pDoc->GetSplitterCyMinNestSplit());
			pNestSplitter->RecalcLayout();
		}
		break;
	case UPDATE_HINT_SETTINGCHANGE:
/*UKS
		if (pHint && pHint == pDoc && pDoc->GetSetting().GetFont())
		{
			long nStart;
			long nEnd;
			GetRichEditCtrl().GetSel(nStart, nEnd);
			//
			// The control simply uses the WM_SETFONT message to change the font.
			// There is no need to use the member:
			//    SetSelectionCharFormat,
			//    SetDefaultCharFormat,
			//    SetParaFormat,
			//    SetCharFormat,
			// because the control does not manage the text in different font.
			CString strText;
			GetRichEditCtrl().GetWindowText (strText);
			LONG oldEventMask = GetRichEditCtrl().SetEventMask(ENM_NONE); // Do not send EN_CHANGE.
			GetRichEditCtrl().Clear();
			SendMessage(WM_SETFONT, (WPARAM)pDoc->GetSetting().GetFont());
			Invalidate();
			GetRichEditCtrl().SetWindowText(strText);
			if (pDoc->m_bHighlight)
			{
				GetRichEditCtrl().SetSel (pDoc->m_nStart, pDoc->m_nEnd);
				OnColorPick (pDoc->m_crColorSelect);
				GetRichEditCtrl().SetSel (nStart, nEnd);
			}
			GetRichEditCtrl().SetEventMask(oldEventMask); 
		}
*/
		break;

	default:
		break;
	}
}