예제 #1
0
LONG CuDlgDBEventPane02::OnDbeventTraceIncoming (WPARAM wParam, LPARAM lParam)
{
    LPRAISEDDBE lpStruct = (LPRAISEDDBE)lParam;
    CView*  pView = (CView*)GetParent();
    ASSERT  (pView);
    CDbeventDoc* pDoc = (CDbeventDoc*)pView->GetDocument();
    ASSERT  (pDoc);
    CSplitterWnd* pSplitter = (CSplitterWnd*)pView->GetParent();
    ASSERT (pSplitter);
    CDbeventFrame*  pFrame = (CDbeventFrame*)pSplitter->GetParent();
    ASSERT  (pFrame);
    if (!pFrame->GetPaneRegisteredDBEvent()->Find ((LPCTSTR)lpStruct->DBEventName, (LPCTSTR)lpStruct->DBEventOwner))
    {
        IncomingDBEvent (
            pDoc, 
            "r",
            (LPCTSTR)lpStruct->StrTimeStamp, 
            (LPCTSTR)lpStruct->DBEventName, 
            (LPCTSTR)lpStruct->DBEventOwner, 
            (LPCTSTR)lpStruct->DBEventText,
            "*");
    }
    else
    {
        IncomingDBEvent (
            pDoc, 
            "r",
            (LPCTSTR)lpStruct->StrTimeStamp, 
            (LPCTSTR)lpStruct->DBEventName, 
            (LPCTSTR)lpStruct->DBEventOwner, 
            (LPCTSTR)lpStruct->DBEventText);
    }
    if (pDoc->m_bPopupOnRaise)
    {
        CString strMsg;
        strMsg.GetBuffer (520);
        TCHAR tchszAll [80];

        StringWithOwner ((LPUCHAR)lpStruct->DBEventName, (LPUCHAR)lpStruct->DBEventOwner, (LPUCHAR)tchszAll);
        //"%s: Database Event %s '%s' was raised on node %s."
            strMsg.Format (IDS_I_DB_EVENT_RAISED,
            (LPCTSTR)lpStruct->StrTimeStamp,
            (LPCTSTR)tchszAll,
            (LPCTSTR)lpStruct->DBEventText,
            (LPCTSTR)GetVirtNodeName (pDoc->m_hNode));
        BfxMessageBox (strMsg);
    }
    return RES_SUCCESS;
}
예제 #2
0
void CDbeventView::OnInitialUpdate() 
{
    CView::OnInitialUpdate();
    CDbeventDoc* pDoc        = (CDbeventDoc*)GetDocument();
    CSplitterWnd*  pSplitter = (CSplitterWnd*)GetParent ();
    CDbeventFrame* pFrame    = (CDbeventFrame*)pSplitter->GetParent();
    
    ASSERT (pDoc);

    // toolbar caption according to doc caption
    CString docTitle = pDoc->GetTitle();
    pFrame->GetDialogBar()->SetWindowText(docTitle);

    if (pDoc->IsLoadedDoc()) {
      // frame window placement
      BOOL bResult = pFrame->SetWindowPlacement(pDoc->GetWPLJ());
      ASSERT (bResult);

      // splitbar placement
      int cxCur = pDoc->GetSplitterCxCur();
      int cxMin = pDoc->GetSplitterCxMin();
      pSplitter->SetColumnInfo(0, cxCur, cxMin);
      pSplitter->RecalcLayout();

      // set full state of all toolbars in the frame
      CDockState& ToolbarsState = pDoc->GetToolbarState();
      pFrame->SetDockState(ToolbarsState);
    
      // Set frame toolbar visibility state according to load info
      if (pDoc->m_bToolbarVisible)
        SetToolbarVisible(pFrame, TRUE);      // force immediate update
      else
        SetToolbarInvisible(pFrame, TRUE);    // force immediate update
    }
    else
    {
        //
        // The left pane (Register DBEvent pane) is 30% of the Frame Client erea.
        CRect rcClient;
        pFrame->GetClientRect (rcClient);
        pSplitter->SetColumnInfo(0, (int) (0.3 * (double)rcClient.Width()), 10);
        pSplitter->RecalcLayout();
    }
    //
    // Initialize the MaxLine Edit Box
    CuDbeDlgBar* pDlgBar = pFrame->GetDialogBar ();
    CEdit* pEdit = pDlgBar->GetEditMaxLine();
    if (pEdit && IsWindow (pEdit->m_hWnd))
    {
        CString strFormat;
        strFormat.Format ("%d", pDoc->m_nMaxLine);
        pEdit->SetLimitText  (4);
        pEdit->SetWindowText (strFormat);
    }
    //
    // Initialize the Sys DBEvent Check Box.
    CButton* pButton = pDlgBar->GetSysDBEventButton ();
    pButton->SetCheck (pDoc->m_bSysDBEvent);
    //
    // Initialize the Popup On Raise Check Box.
    pButton = pDlgBar->GetPopupButton ();
    pButton->SetCheck (pDoc->m_bPopupOnRaise);
    //
    // Initialize the Clear First Check Box.
    pButton = pDlgBar->GetClearFirstButton ();
    pButton->SetCheck (pDoc->m_bClearFirst);

    //
    // Initialize the ComboBox of Databases.
    CString strNone;
    CComboBox* pCombo =  pDlgBar->GetComboDatabase ();
    if (strNone.LoadString (IDS_DATABASE_NONE) == 0)
        strNone = "<None>";
    pCombo->AddString (strNone);
    if (pDoc->m_strDBName == "" || pDoc->m_strDBName == strNone)
    {
        pCombo->SetCurSel (0);
        return;
    }
    pCombo->AddString (pDoc->m_strDBName);
    pCombo->SelectString (-1, pDoc->m_strDBName);
}