- Object browser improved
authorVictor Kirhenshtein <victor@netxms.org>
Fri, 7 May 2004 15:11:43 +0000 (15:11 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Fri, 7 May 2004 15:11:43 +0000 (15:11 +0000)
- Added processing of NXC_EVENT_OBJECT_CHANGED

19 files changed:
.gitattributes
src/console/win32/MainFrm.cpp
src/console/win32/MainFrm.h
src/console/win32/ObjectBrowser.cpp
src/console/win32/ObjectBrowser.h
src/console/win32/ObjectInfoBox.cpp
src/console/win32/ObjectInfoBox.h
src/console/win32/ObjectPreview.cpp
src/console/win32/ObjectPreview.h
src/console/win32/ObjectSearchBox.cpp [new file with mode: 0644]
src/console/win32/ObjectSearchBox.h [copied from src/console/win32/ObjectInfoBox.h with 54% similarity]
src/console/win32/ToolBox.cpp
src/console/win32/globals.cpp
src/console/win32/globals.h
src/console/win32/nxcon.clw
src/console/win32/nxcon.cpp
src/console/win32/nxcon.dsp
src/console/win32/nxcon.h
src/console/win32/resource.h

index 600fe9d..4909f00 100644 (file)
@@ -50,6 +50,8 @@ src/console/win32/ObjectPreview.cpp -text
 src/console/win32/ObjectPreview.h -text
 src/console/win32/ObjectPropDlg.cpp -text
 src/console/win32/ObjectPropDlg.h -text
+src/console/win32/ObjectSearchBox.cpp -text
+src/console/win32/ObjectSearchBox.h -text
 src/console/win32/ProgressDialog.cpp -text
 src/console/win32/ProgressDialog.h -text
 src/console/win32/StdAfx.cpp -text
index ff30a94..191daed 100644 (file)
@@ -23,6 +23,7 @@ BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
        ON_WM_DESTROY()
        //}}AFX_MSG_MAP
    ON_UPDATE_COMMAND_UI(ID_INDICATOR_STATE, OnUpdateState)
+   ON_MESSAGE(WM_OBJECT_CHANGE, OnObjectChange)
 END_MESSAGE_MAP()
 
 static UINT indicators[] =
@@ -145,3 +146,31 @@ void CMainFrame::OnUpdateState(CCmdUI *pCmdUI)
    pCmdUI->Enable();
    pCmdUI->SetText(pszStateText[theApp.GetClientState()]);
 }
+
+
+//
+// Broadcast message to all MDI child windows
+//
+
+void CMainFrame::BroadcastMessage(UINT msg, WPARAM wParam, LPARAM lParam)
+{
+   CWnd *pWnd;
+
+   pWnd = MDIGetActive();
+   while(pWnd != NULL)
+   {
+      pWnd->PostMessage(msg, wParam, lParam);
+      pWnd = pWnd->GetNextWindow();
+   }
+   theApp.DebugPrintf("CMainFrame::BroadcastMessage(%d, %d, %d)", msg, wParam, lParam);
+}
+
+
+//
+// Handler for WM_OBJECT_CHANGE message
+//
+
+void CMainFrame::OnObjectChange(WPARAM wParam, LPARAM lParam)
+{
+   BroadcastMessage(WM_OBJECT_CHANGE, wParam, lParam);
+}
index be45604..6621437 100644 (file)
@@ -29,6 +29,7 @@ public:
 
 // Implementation
 public:
+       void BroadcastMessage(UINT msg, WPARAM wParam, LPARAM lParam);
        virtual ~CMainFrame();
 #ifdef _DEBUG
        virtual void AssertValid() const;
@@ -46,6 +47,7 @@ protected:
        afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
        afx_msg void OnDestroy();
    afx_msg void OnUpdateState(CCmdUI *pCmdUI);
+   afx_msg void OnObjectChange(WPARAM wParam, LPARAM lParam);
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 };
index b08f4b4..7daa4e9 100644 (file)
@@ -16,7 +16,7 @@ static char THIS_FILE[] = __FILE__;
 // Constants
 //
 
-#define PREVIEW_PANE_WIDTH    200
+#define PREVIEW_PANE_WIDTH    230
 
 
 //
@@ -47,6 +47,7 @@ BEGIN_MESSAGE_MAP(CObjectBrowser, CMDIChildWnd)
        ON_WM_GETMINMAXINFO()
        ON_COMMAND(ID_OBJECT_VIEW_SHOWPREVIEWPANE, OnObjectViewShowpreviewpane)
    ON_NOTIFY(TVN_SELCHANGED, IDC_TREE_VIEW, OnTreeViewSelChange)
+   ON_MESSAGE(WM_OBJECT_CHANGE, OnObjectChange)
        //}}AFX_MSG_MAP
 END_MESSAGE_MAP()
 
@@ -174,6 +175,9 @@ void CObjectBrowser::AddObjectToTree(NXC_OBJECT *pObject, HTREEITEM hParent)
       if (pChildObject != NULL)
          AddObjectToTree(pChildObject, hItem);
    }
+
+   // Sort childs
+   m_wndTreeCtrl.SortChildren(hItem);
 }
 
 BOOL CObjectBrowser::PreCreateWindow(CREATESTRUCT& cs) 
@@ -197,8 +201,8 @@ void CObjectBrowser::OnRclickTreeView(NMHDR* pNMHDR, LRESULT* pResult)
 void CObjectBrowser::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) 
 {
        CMDIChildWnd::OnGetMinMaxInfo(lpMMI);
-   lpMMI->ptMinTrackSize.x = 300;
-   lpMMI->ptMinTrackSize.y = 100;
+   lpMMI->ptMinTrackSize.x = 350;
+   lpMMI->ptMinTrackSize.y = 250;
 }
 
 
@@ -240,3 +244,20 @@ void CObjectBrowser::OnTreeViewSelChange(LPNMTREEVIEW lpnmt)
    pObject = NXCFindObjectById(lpnmt->itemNew.lParam);
    m_wndPreviewPane.SetCurrentObject(pObject);
 }
+
+
+//
+// WM_OBJECT_CHANGE message handler
+//
+
+void CObjectBrowser::OnObjectChange(WPARAM wParam, LPARAM lParam)
+{
+   NXC_OBJECT *pObject = (NXC_OBJECT *)lParam;
+
+   if (pObject->bIsDeleted)
+   {
+   }
+   else
+   {
+   }
+}
index d0470f3..88796bc 100644 (file)
@@ -48,6 +48,7 @@ protected:
        afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
        afx_msg void OnObjectViewShowpreviewpane();
    afx_msg void OnTreeViewSelChange(LPNMTREEVIEW lpnmt);
+   afx_msg void OnObjectChange(WPARAM wParam, LPARAM lParam);
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 private:
index 536b78c..80232e0 100644 (file)
@@ -15,8 +15,8 @@ static char THIS_FILE[] = __FILE__;
 // Constants
 //
 
-#define X_MARGIN     3
-#define Y_MARGIN     3
+#define X_MARGIN     4
+#define Y_MARGIN     4
 
 
 /////////////////////////////////////////////////////////////////////////////
@@ -25,6 +25,7 @@ static char THIS_FILE[] = __FILE__;
 CObjectInfoBox::CObjectInfoBox()
 {
    m_pCurrObject = NULL;
+   memset(m_hIconList, 0, sizeof(HICON) * 8);
 }
 
 CObjectInfoBox::~CObjectInfoBox()
@@ -64,15 +65,15 @@ void CObjectInfoBox::OnPaint()
    if (m_pCurrObject != NULL)
    {
       RECT rect;
-      int cy, step;
+      int cy, step, w;
       char szBuffer[64], szTemp[32];
 
       // Draw icon and objet's name right to it
       dc.FillSolidRect(X_MARGIN - 1, Y_MARGIN - 1, 34, 34, g_statusColorTable[m_pCurrObject->iStatus]);
-      dc.DrawIcon(X_MARGIN, Y_MARGIN, theApp.LoadIcon(IDI_INTERFACE));
+      dc.DrawIcon(X_MARGIN, Y_MARGIN, m_hIconList[m_pCurrObject->iClass]);
       dc.SelectObject(m_fontNormal);
       dc.SetBkColor(RGB(255, 255, 255));
-      GetWindowRect(&rect);
+      GetClientRect(&rect);
       rect.left = X_MARGIN + 37;
       rect.top = Y_MARGIN;
       rect.bottom = Y_MARGIN + 40;
@@ -84,10 +85,11 @@ void CObjectInfoBox::OnPaint()
       step = dc.GetTextExtent("X", 1).cy + 2;
 
       // Display object's status
-      dc.TextOut(X_MARGIN, cy, "Status: ", 8);
+      dc.TextOut(X_MARGIN, cy, "Status:", 7);
       dc.SetTextColor(g_statusColorTable[m_pCurrObject->iStatus]);
+      w = dc.GetTextExtent("Status: ", 8).cx;
       dc.SelectObject(m_fontBold);
-      dc.TextOut(X_MARGIN + dc.GetTextExtent("Status: ", 8).cx, cy, 
+      dc.TextOut(X_MARGIN + w, cy, 
                  g_szStatusText[m_pCurrObject->iStatus], 
                  strlen(g_szStatusText[m_pCurrObject->iStatus]));
       dc.SetTextColor(RGB(0, 0, 0));
@@ -119,13 +121,43 @@ void CObjectInfoBox::OnPaint()
             cy += step;
             break;
          case OBJECT_NODE:
+            if (m_pCurrObject->node.dwFlags & NF_IS_SNMP)
+            {
+               dc.TextOut(X_MARGIN, cy, "SNMP supported", 14);
+               cy += step;
+
+               sprintf(szBuffer, "OID: %s", m_pCurrObject->node.szObjectId);
+               dc.TextOut(X_MARGIN, cy, szBuffer, strlen(szBuffer));
+               cy += step;
+            }
             break;
          case OBJECT_INTERFACE:
+            if (m_pCurrObject->dwIpAddr != 0)
+            {
+               sprintf(szBuffer, "IP NetMask: %s", IpToStr(m_pCurrObject->iface.dwIpNetMask, szTemp));
+               dc.TextOut(X_MARGIN, cy, szBuffer, strlen(szBuffer));
+               cy += step;
+            }
+
+            sprintf(szBuffer, "Index: %d", m_pCurrObject->iface.dwIfIndex);
+            dc.TextOut(X_MARGIN, cy, szBuffer, strlen(szBuffer));
+            cy += step;
+
+            sprintf(szBuffer, "Type: %s", m_pCurrObject->iface.dwIfType > MAX_INTERFACE_TYPE ?
+                                 "Unknown" : g_szInterfaceTypes[m_pCurrObject->iface.dwIfType]);
+            dc.TextOut(X_MARGIN, cy, szBuffer, strlen(szBuffer));
+            cy += step;
             break;
          default:
             break;
       }
    }
+   else
+   {
+      dc.SelectObject(m_fontNormal);
+      dc.SetBkColor(RGB(255, 255, 255));
+      dc.TextOut(X_MARGIN, Y_MARGIN, "No object selected", 18);
+   }
 }
 
 
@@ -138,15 +170,22 @@ int CObjectInfoBox::OnCreate(LPCREATESTRUCT lpCreateStruct)
        if (CToolBox::OnCreate(lpCreateStruct) == -1)
                return -1;
        
-   m_fontNormal.CreateFont(-MulDiv(8, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 72),
+   // Create fonts
+   m_fontNormal.CreateFont(-MulDiv(7, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 72),
                           0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
                           OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY,
-                          VARIABLE_PITCH | FF_DONTCARE, "Verdana");
-   m_fontBold.CreateFont(-MulDiv(8, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 72),
+                          VARIABLE_PITCH | FF_DONTCARE, "MS Sans Serif");
+   m_fontBold.CreateFont(-MulDiv(7, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 72),
                           0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
                           OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY,
-                          VARIABLE_PITCH | FF_DONTCARE, "Verdana");
+                          VARIABLE_PITCH | FF_DONTCARE, "MS Sans Serif");
        
+   // Load icons for different object classes
+   m_hIconList[1] = theApp.LoadIcon(IDI_SUBNET);      // Subnet
+   m_hIconList[2] = theApp.LoadIcon(IDI_NODE);        // Node
+   m_hIconList[3] = theApp.LoadIcon(IDI_INTERFACE);   // Interface
+   m_hIconList[4] = theApp.LoadIcon(IDI_NETMAP);      // Network
+
        return 0;
 }
 
index 3330cd2..73da27d 100644 (file)
@@ -45,6 +45,7 @@ protected:
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 private:
+       HICON m_hIconList[8];
        NXC_OBJECT *m_pCurrObject;
 };
 
index 42b55a1..3aefb82 100644 (file)
@@ -35,6 +35,7 @@ CObjectPreview::~CObjectPreview()
 BEGIN_MESSAGE_MAP(CObjectPreview, CWnd)
        //{{AFX_MSG_MAP(CObjectPreview)
        ON_WM_CREATE()
+       ON_WM_PAINT()
        //}}AFX_MSG_MAP
 END_MESSAGE_MAP()
 
@@ -72,8 +73,14 @@ int CObjectPreview::OnCreate(LPCREATESTRUCT lpCreateStruct)
    rect.left += TOOLBOX_X_MARGIN;
    rect.right -= TOOLBOX_X_MARGIN * 2;
    rect.top += TOOLBOX_Y_MARGIN;
-   rect.bottom = 250;
-   m_wndObjectPreview.Create("Object Details", WS_CHILD | WS_VISIBLE, rect, this, IDC_TOOLBOX_OBJECT_DETAILS);
+   rect.bottom = 100;
+   m_wndObjectSearch.Create("Search", WS_CHILD | WS_VISIBLE,
+                             rect, this, IDC_TOOLBOX_OBJECT_DETAILS);
+
+   rect.top = rect.bottom + TOOLBOX_X_MARGIN;
+   rect.bottom = rect.top + 250;
+   m_wndObjectPreview.Create("Object Details", WS_CHILD | WS_VISIBLE,
+                             rect, this, IDC_TOOLBOX_OBJECT_DETAILS);
 
        return 0;
 }
@@ -87,3 +94,20 @@ void CObjectPreview::SetCurrentObject(NXC_OBJECT *pObject)
 {
    m_wndObjectPreview.SetCurrentObject(pObject);
 }
+
+void CObjectPreview::OnPaint() 
+{
+   CPaintDC dc(this); // device context for painting
+   RECT rect;
+   CPen pen;
+
+   pen.CreatePen(PS_SOLID, 0, RGB(127, 127, 127));
+   dc.SelectObject(&pen);
+
+   GetClientRect(&rect);
+   
+   dc.MoveTo(rect.right - 1, 0);
+   dc.LineTo(rect.right - 1, rect.bottom);
+
+   pen.DeleteObject();
+}
index 38b0a81..425fbf3 100644 (file)
@@ -7,8 +7,8 @@
 // ObjectPreview.h : header file
 //
 
-#include "ToolBox.h"
 #include "ObjectInfoBox.h"
+#include "ObjectSearchBox.h"
 
 
 /////////////////////////////////////////////////////////////////////////////
@@ -25,6 +25,7 @@ public:
 
 protected:
    CObjectInfoBox m_wndObjectPreview;
+   CObjectSearchBox m_wndObjectSearch;
 
 // Operations
 public:
@@ -48,6 +49,7 @@ public:
 protected:
        //{{AFX_MSG(CObjectPreview)
        afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+       afx_msg void OnPaint();
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 };
diff --git a/src/console/win32/ObjectSearchBox.cpp b/src/console/win32/ObjectSearchBox.cpp
new file mode 100644 (file)
index 0000000..8deeffe
--- /dev/null
@@ -0,0 +1,104 @@
+// ObjectSearchBox.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "nxcon.h"
+#include "ObjectSearchBox.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
+//
+// Constants
+//
+
+#define X_MARGIN     4
+#define Y_MARGIN     4
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CObjectSearchBox
+
+CObjectSearchBox::CObjectSearchBox()
+{
+}
+
+CObjectSearchBox::~CObjectSearchBox()
+{
+}
+
+
+BEGIN_MESSAGE_MAP(CObjectSearchBox, CToolBox)
+       //{{AFX_MSG_MAP(CObjectSearchBox)
+       ON_WM_CREATE()
+       ON_WM_CTLCOLOR()
+       //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+//
+// WM_CREATE message handler
+//
+
+int CObjectSearchBox::OnCreate(LPCREATESTRUCT lpCreateStruct) 
+{
+   RECT rect;
+
+       if (CToolBox::OnCreate(lpCreateStruct) == -1)
+               return -1;
+
+   // Create font
+   m_fontNormal.CreateFont(-MulDiv(7, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 72),
+                          0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
+                          OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY,
+                          VARIABLE_PITCH | FF_DONTCARE, "MS Sans Serif");
+
+   // Create static text
+   GetClientRect(&rect);
+   rect.left += X_MARGIN;
+   rect.right -= X_MARGIN;
+   rect.top += Y_MARGIN;
+   rect.bottom = rect.top + 12;
+   m_wndStatic.Create("Enter object name or IP address:", WS_CHILD | WS_VISIBLE, rect, this);
+   m_wndStatic.SetFont(&m_fontNormal);
+
+   // Create edit box
+   rect.top = rect.bottom + Y_MARGIN;
+   rect.bottom = rect.top + 18;
+   m_wndEditBox.Create(WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL,
+                       rect, this, IDC_EDIT_SEARCH_STRING);
+   m_wndEditBox.SetFont(&m_fontNormal);
+   m_wndEditBox.SetLimitText(255);
+
+   // Create button
+   rect.top = rect.bottom + Y_MARGIN * 2;
+   rect.bottom = rect.top + 18;
+   rect.left = rect.right - 70;
+   m_wndButton.Create("&Find", WS_CHILD | WS_VISIBLE, rect, this, ID_FIND_OBJECT);
+   m_wndButton.SetFont(&m_fontNormal);
+
+       return 0;
+}
+
+
+//
+// WM_CTLCOLOR message handler
+//
+
+HBRUSH CObjectSearchBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
+{
+   HBRUSH hbr;
+
+   // Static control
+   if (pWnd->m_hWnd == m_wndStatic.m_hWnd)
+   {
+          hbr = CreateSolidBrush(RGB(255, 255, 255));
+      pDC->SetBkColor(RGB(255, 255, 255));
+   }
+       
+       return hbr;
+}
similarity index 54%
copy from src/console/win32/ObjectInfoBox.h
copy to src/console/win32/ObjectSearchBox.h
index 3330cd2..b20f2ce 100644 (file)
@@ -1,22 +1,23 @@
-#if !defined(AFX_OBJECTINFOBOX_H__F4B7071C_AA6F_4CDF_A528_0E3AE5B66E02__INCLUDED_)
-#define AFX_OBJECTINFOBOX_H__F4B7071C_AA6F_4CDF_A528_0E3AE5B66E02__INCLUDED_
+#if !defined(AFX_OBJECTSEARCHBOX_H__D1D524BC_CD12_44D3_97CF_A780ADAC0657__INCLUDED_)
+#define AFX_OBJECTSEARCHBOX_H__D1D524BC_CD12_44D3_97CF_A780ADAC0657__INCLUDED_
 
 #if _MSC_VER > 1000
 #pragma once
 #endif // _MSC_VER > 1000
-// ObjectInfoBox.h : header file
+// ObjectSearchBox.h : header file
 //
 
 #include "ToolBox.h"
 
+
 /////////////////////////////////////////////////////////////////////////////
-// CObjectInfoBox window
+// CObjectSearchBox window
 
-class CObjectInfoBox : public CToolBox
+class CObjectSearchBox : public CToolBox
 {
 // Construction
 public:
-       CObjectInfoBox();
+       CObjectSearchBox();
 
 // Attributes
 public:
@@ -26,26 +27,24 @@ public:
 
 // Overrides
        // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CObjectInfoBox)
+       //{{AFX_VIRTUAL(CObjectSearchBox)
        //}}AFX_VIRTUAL
 
 // Implementation
 public:
-       void SetCurrentObject(NXC_OBJECT *pObject);
-       virtual ~CObjectInfoBox();
+       virtual ~CObjectSearchBox();
 
        // Generated message map functions
 protected:
        CFont m_fontNormal;
-       CFont m_fontBold;
-       //{{AFX_MSG(CObjectInfoBox)
-       afx_msg void OnPaint();
+       CButton m_wndButton;
+       CEdit m_wndEditBox;
+       CStatic m_wndStatic;
+       //{{AFX_MSG(CObjectSearchBox)
        afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
-       afx_msg void OnDestroy();
+       afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
-private:
-       NXC_OBJECT *m_pCurrObject;
 };
 
 /////////////////////////////////////////////////////////////////////////////
@@ -53,4 +52,4 @@ private:
 //{{AFX_INSERT_LOCATION}}
 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
 
-#endif // !defined(AFX_OBJECTINFOBOX_H__F4B7071C_AA6F_4CDF_A528_0E3AE5B66E02__INCLUDED_)
+#endif // !defined(AFX_OBJECTSEARCHBOX_H__D1D524BC_CD12_44D3_97CF_A780ADAC0657__INCLUDED_)
index e53326a..9c8fe4a 100644 (file)
@@ -74,10 +74,15 @@ void CToolBox::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
    }
    else
    {
-      lpncsp->rgrc[0].left++;
-      lpncsp->rgrc[0].right--;
-      lpncsp->rgrc[0].top += 21;
-      lpncsp->rgrc[0].bottom--;
+      int iBorderWidth = 0;
+
+      if (GetWindowLong(m_hWnd, GWL_STYLE) & WS_BORDER)
+         iBorderWidth++;
+
+      lpncsp->rgrc[0].left += iBorderWidth;
+      lpncsp->rgrc[0].right -= iBorderWidth;
+      lpncsp->rgrc[0].top += 19 + iBorderWidth;
+      lpncsp->rgrc[0].bottom -= iBorderWidth;
    }
 }
 
@@ -90,6 +95,10 @@ void CToolBox::OnNcPaint()
 {
    CDC *dc;
    RECT rect;
+   int iBorderWidth = 0;
+
+   // Get device context for entire window
+   dc = GetWindowDC();
 
    // Calculate coordinates of lower right window corner
    GetWindowRect(&rect);
@@ -97,12 +106,16 @@ void CToolBox::OnNcPaint()
    rect.right -= rect.left;
 
    // Draw border
-   dc = GetWindowDC();
-   dc->Draw3dRect(0, 0, rect.right, rect.bottom, TOOLBOX_TITLE_COLOR, TOOLBOX_TITLE_COLOR);
+   if (GetWindowLong(m_hWnd, GWL_STYLE) & WS_BORDER)
+   {
+      dc->Draw3dRect(0, 0, rect.right, rect.bottom, TOOLBOX_TITLE_COLOR, TOOLBOX_TITLE_COLOR);
+      iBorderWidth++;
+   }
 
    // Draw title
    dc->SelectObject(&m_fontTitle);
-   dc->FillSolidRect(1, 1, rect.right - 2, 20, TOOLBOX_TITLE_COLOR);
+   dc->FillSolidRect(iBorderWidth, iBorderWidth, rect.right - (iBorderWidth * 2), 
+                     19, TOOLBOX_TITLE_COLOR);
    dc->SetTextColor(RGB(255, 255, 255));
    dc->SetBkColor(TOOLBOX_TITLE_COLOR);
    dc->TextOut(5, 3, m_szTitle, strlen(m_szTitle));
@@ -122,9 +135,9 @@ int CToolBox::OnCreate(LPCREATESTRUCT lpCreateStruct)
                return -1;
 
    m_fontTitle.CreateFont(-MulDiv(8, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 72),
-                          0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
+                          0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
                           OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY,
-                          VARIABLE_PITCH | FF_DONTCARE, "Verdana");
+                          VARIABLE_PITCH | FF_DONTCARE, "MS Sans Serif");
        
        return 0;
 }
index 347ccad..5d48431 100644 (file)
@@ -42,6 +42,40 @@ char g_szPassword[MAX_PASSWORD_LEN] = "";
 char *g_szStatusText[] = { "NORMAL", "MINOR", "WARNING", "MAJOR", "CRITICAL", "UNKNOWN", "UNMANAGED" };
 char *g_szStatusTextSmall[] = { "Normal", "Minor", "Warning", "Major", "Critical", "Unknown", "Unmanaged" };
 char *g_szObjectClass[] = { "Generic", "Subnet", "Node", "Interface", "Network", "Location", "Zone" };
+char *g_szInterfaceTypes[] = {
+   "Unknown",
+   "Other",
+   "Regular 1822",
+   "HDH 1822",
+   "DDN X.25",
+   "RFC877 X.25",
+   "Ethernet CSMA/CD",
+   "ISO 802.3 CSMA/CD",
+   "ISO 802.4 Token Bus",
+   "ISO 802.5 Token Ring",
+   "ISO 802.6 MAN",
+   "StarLan",
+   "PROTEON 10 Mbps",
+   "PROTEON 80 Mbps",
+   "Hyper Channel",
+   "FDDI",
+   "LAPB",
+   "SDLC",
+   "DS1",
+   "E1",
+   "ISDN BRI",
+   "ISDN PRI",
+   "Proprietary Serial Pt-to-Pt",
+   "PPP",
+   "Software Loopback",
+   "EON (CLNP over IP)",
+   "Ethernet 3 Mbps",
+   "NSIP (XNS over IP)",
+   "SLIP",
+   "DS3",
+   "SMDS",
+   "Frame Relay"
+};
 
 
 //
index 61b02c8..22f381b 100644 (file)
@@ -40,6 +40,7 @@ extern CConsoleApp theApp;
 #define MAX_SERVER_NAME_LEN   64
 #define MAX_LOGIN_NAME_LEN    64
 #define MAX_PASSWORD_LEN      64
+#define MAX_INTERFACE_TYPE    32
 
 
 //
@@ -48,6 +49,7 @@ extern CConsoleApp theApp;
 
 #define WM_REQUEST_COMPLETED     (WM_USER + 1)
 #define WM_CLOSE_STATUS_DLG      (WM_USER + 2)
+#define WM_OBJECT_CHANGE         (WM_USER + 3)
 
 
 //
@@ -69,5 +71,6 @@ extern char *g_szStatusTextSmall[];
 extern DWORD g_dwFlags;
 extern COLORREF g_statusColorTable[];
 extern char *g_szObjectClass[];
+extern char *g_szInterfaceTypes[];
 
 #endif
index 3265fdb..714d70e 100644 (file)
@@ -2,13 +2,13 @@
 
 [General Info]
 Version=1
-LastClass=CObjectInfoBox
+LastClass=CObjectSearchBox
 LastTemplate=generic CWnd
 NewFileInclude1=#include "stdafx.h"
 NewFileInclude2=#include "nxcon.h"
 LastPage=0
 
-ClassCount=19
+ClassCount=20
 Class1=CConsoleApp
 Class3=CMainFrame
 Class4=CChildFrame
@@ -17,10 +17,10 @@ Class9=CMapView
 
 ResourceCount=23
 Resource1=IDM_VIEW_SPECIFIC (English (U.S.))
-Resource2=IDR_MAINFRAME (English (U.S.))
+Resource2=IDD_EDIT_EVENT
 Resource3=IDD_LOGIN
 Resource4=IDA_MDI_DEFAULT
-Resource5=IDA_OBJECT_BROWSER
+Resource5=IDA_MDI_DEFAULT (English (U.S.))
 Class2=CChildView
 Class5=CAboutDlg
 Class6=CControlPanel
@@ -28,13 +28,13 @@ Class8=CMapFrame
 Class10=CLoginDialog
 Resource6=IDD_OBJECT_PROPERTIES
 Class11=CProgressDialog
-Resource7=IDD_PROGRESS (English (U.S.))
+Resource7=IDD_LOGIN (English (U.S.))
 Class12=CObjectBrowser
 Resource8=IDD_ABOUTBOX
 Class13=CObjectPropDlg
 Resource9=IDM_VIEW_SPECIFIC
 Resource10=IDR_MAINFRAME
-Resource11=IDD_ABOUTBOX (English (U.S.))
+Resource11=IDA_OBJECT_BROWSER
 Resource12=IDR_CTRLPANEL (English (U.S.))
 Resource13=IDR_EVENTS (English (U.S.))
 Resource14=IDR_MAPFRAME (English (U.S.))
@@ -45,14 +45,15 @@ Class15=CEditEventDlg
 Resource17=IDA_OBJECT_BROWSER (English (U.K.))
 Class16=CDebugFrame
 Resource18=IDD_PROGRESS
-Resource19=IDA_MDI_DEFAULT (English (U.S.))
-Resource20=IDD_OBJECT_PROPERTIES (English (U.S.))
+Resource19=IDR_MAINFRAME (English (U.S.))
+Resource20=IDD_PROGRESS (English (U.S.))
 Class17=CObjectPreview
-Resource21=IDD_LOGIN (English (U.S.))
+Resource21=IDD_ABOUTBOX (English (U.S.))
 Class18=CToolBox
-Resource22=IDD_EDIT_EVENT (English (U.S.))
+Resource22=IDD_OBJECT_PROPERTIES (English (U.S.))
 Class19=CObjectInfoBox
-Resource23=IDD_EDIT_EVENT
+Class20=CObjectSearchBox
+Resource23=IDD_EDIT_EVENT (English (U.S.))
 
 [CLS:CConsoleApp]
 Type=0
@@ -568,3 +569,10 @@ ImplementationFile=ObjectInfoBox.cpp
 BaseClass=CToolBox
 Filter=W
 
+[CLS:CObjectSearchBox]
+Type=0
+HeaderFile=ObjectSearchBox.h
+ImplementationFile=ObjectSearchBox.cpp
+BaseClass=CToolBox
+Filter=W
+
index 023db4b..36fd674 100644 (file)
@@ -352,7 +352,8 @@ void CConsoleApp::OnViewMap()
        CMainFrame* pFrame = STATIC_DOWNCAST(CMainFrame, m_pMainWnd);
 
        // create a new MDI child window
-       pFrame->CreateNewChild(RUNTIME_CLASS(CMapFrame), IDR_MAPFRAME, m_hMDIMenu, m_hMDIAccel);
+//     pFrame->CreateNewChild(RUNTIME_CLASS(CMapFrame), IDR_MAPFRAME, m_hMDIMenu, m_hMDIAccel);
+pFrame->BroadcastMessage(WM_OBJECT_CHANGE, 1, 0);
 }
 
 void CConsoleApp::OnConnectToServer() 
@@ -463,11 +464,13 @@ void CConsoleApp::EventHandler(DWORD dwEvent, DWORD dwCode, void *pArg)
          if (m_bEventBrowserActive)
             m_pwndEventBrowser->AddEvent((NXC_EVENT *)pArg);
          MemFree(pArg);
-//         Sleep(0);
          break;
       case NXC_EVENT_REQUEST_COMPLETED:
          OnRequestComplete(dwCode, (DWORD)pArg);
          break;
+      case NXC_EVENT_OBJECT_CHANGED:
+         ((CMainFrame *)m_pMainWnd)->PostMessage(WM_OBJECT_CHANGE, dwCode, (LPARAM)pArg);
+         break;
       default:
          break;
    }
@@ -538,3 +541,23 @@ void CConsoleApp::OnViewDebug()
           pFrame->CreateNewChild(
                   RUNTIME_CLASS(CDebugFrame), IDR_DEBUG_WINDOW, m_hMDIMenu, m_hMDIAccel);      
 }
+
+
+//
+// Print debug information
+//
+
+void CConsoleApp::DebugPrintf(char *szFormat, ...)
+{
+   if (m_bDebugWindowActive)
+   {
+      char szBuffer[1024];
+      va_list args;
+
+      va_start(args, szFormat);
+      vsprintf(szBuffer, szFormat, args);
+      va_end(args);
+
+      m_pwndDebugWindow->AddMessage(szBuffer);
+   }
+}
index fd12e86..13289fc 100644 (file)
@@ -160,6 +160,10 @@ SOURCE=.\ObjectPropDlg.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\ObjectSearchBox.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=.\ProgressDialog.cpp
 # End Source File
 # Begin Source File
@@ -217,6 +221,10 @@ SOURCE=.\MapView.h
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\..\include\nms_common.h
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\..\include\nms_util.h
 # End Source File
 # Begin Source File
@@ -245,6 +253,10 @@ SOURCE=.\ObjectPropDlg.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\ObjectSearchBox.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\ProgressDialog.h
 # End Source File
 # Begin Source File
index 61f5048..21430b1 100644 (file)
@@ -115,6 +115,7 @@ private:
 
    // Inline functions
 public:
+       void DebugPrintf(char *szFormat, ...);
    void DebugCallback(char *pszMsg)
    {
       if (m_bDebugWindowActive)
index 58f48e6..0c944c0 100644 (file)
@@ -10,6 +10,8 @@
 #define IDR_EVENT_EDITOR                104
 #define IDC_PREVIEW_PANE                105
 #define IDC_TOOLBOX_OBJECT_DETAILS      106
+#define IDC_EDIT_SEARCH_STRING          107
+#define ID_FIND_OBJECT                  108
 #define IDR_MAINFRAME                   128
 #define IDR_NXCONTYPE                   129
 #define IDI_ALARM                       130
@@ -81,6 +83,6 @@
 #define _APS_NEXT_RESOURCE_VALUE        155
 #define _APS_NEXT_COMMAND_VALUE         32801
 #define _APS_NEXT_CONTROL_VALUE         1013
-#define _APS_NEXT_SYMED_VALUE           107
+#define _APS_NEXT_SYMED_VALUE           109
 #endif
 #endif