src/console/win32/ControlPanel.h -text
src/console/win32/EventBrowser.cpp -text
src/console/win32/EventBrowser.h -text
+src/console/win32/EventEditor.cpp -text
+src/console/win32/EventEditor.h -text
src/console/win32/LoginDialog.cpp -text
src/console/win32/LoginDialog.h -text
src/console/win32/MainFrm.cpp -text
src/console/win32/res/Toolbar.bmp -text
src/console/win32/res/login.bmp -text
src/console/win32/res/nxcon.ico -text
+src/console/win32/res/nxcon.rc2 -text
src/console/win32/resource.h -text
src/libnxcl/comm.cpp -text
src/libnxcl/eventdb.cpp -text
static char THIS_FILE[] = __FILE__;
#endif
-/////////////////////////////////////////////////////////////////////////////
+
+//
+// Control panel items
+//
+
+#define CP_ITEM_EPP 0
+#define CP_ITEM_USERS 1
+#define CP_ITEM_EVENTS 2
+
+
+//
// CControlPanel
+//
IMPLEMENT_DYNCREATE(CControlPanel, CMDIChildWnd)
ON_WM_DESTROY()
ON_WM_SIZE()
ON_WM_SETFOCUS()
+ ON_NOTIFY(NM_DBLCLK, ID_LIST_VIEW, OnListViewDoubleClick)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
m_pImageList->Create(32, 32, ILC_COLOR8 | ILC_MASK, 8, 8);
m_pImageList->Add(AfxGetApp()->LoadIcon(IDI_USERS));
m_pImageList->Add(AfxGetApp()->LoadIcon(IDI_RULEMGR));
+ m_pImageList->Add(AfxGetApp()->LoadIcon(IDI_EVENT));
m_wndListCtrl.SetImageList(m_pImageList, LVSIL_NORMAL);
// Populate list with items
- m_wndListCtrl.InsertItem(0, "Event Processing Policy", 1);
- m_wndListCtrl.InsertItem(1, "Users", 0);
+ m_wndListCtrl.InsertItem(CP_ITEM_EPP, "Event Processing Policy", 1);
+ m_wndListCtrl.InsertItem(CP_ITEM_USERS, "Users", 0);
+ m_wndListCtrl.InsertItem(CP_ITEM_EVENTS, "Events", 2);
((CConsoleApp *)AfxGetApp())->OnViewCreate(IDR_CTRLPANEL, this);
return 0;
m_wndListCtrl.SetFocus();
}
+
+
+//
+// Process double click on list control
+//
+
+void CControlPanel::OnListViewDoubleClick(NMITEMACTIVATE *pInfo, LRESULT *pResult)
+{
+ switch(pInfo->iItem)
+ {
+ case CP_ITEM_EVENTS:
+ PostMessage(WM_COMMAND, ID_CONTROLPANEL_EVENTS, 0);
+ break;
+ case CP_ITEM_USERS:
+ PostMessage(WM_COMMAND, ID_CONTROLPANEL_USERS, 0);
+ break;
+ default:
+ break;
+ }
+}
// Implementation
protected:
+ void OnListViewDoubleClick(NMITEMACTIVATE *pInfo, LRESULT* pResult);
CImageList *m_pImageList;
CListCtrl m_wndListCtrl;
virtual ~CControlPanel();
--- /dev/null
+// EventEditor.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "nxcon.h"
+#include "EventEditor.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CEventEditor
+
+IMPLEMENT_DYNCREATE(CEventEditor, CMDIChildWnd)
+
+CEventEditor::CEventEditor()
+{
+}
+
+CEventEditor::~CEventEditor()
+{
+}
+
+
+BEGIN_MESSAGE_MAP(CEventEditor, CMDIChildWnd)
+ //{{AFX_MSG_MAP(CEventEditor)
+ ON_WM_CREATE()
+ ON_WM_DESTROY()
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+//
+// CEventEditor message handlers
+//
+
+int CEventEditor::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+ RECT rect;
+ HREQUEST hRequest;
+
+ if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
+ return -1;
+
+ // Create list view control
+ GetClientRect(&rect);
+ m_wndListCtrl.Create(WS_CHILD | WS_VISIBLE | LVS_REPORT, rect, this, ID_LIST_VIEW);
+ m_wndListCtrl.SetExtendedStyle(LVS_EX_TRACKSELECT | LVS_EX_UNDERLINEHOT |
+ LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
+ m_wndListCtrl.SetHoverTime(0x7FFFFFFF);
+
+ // Setup columns
+ m_wndListCtrl.InsertColumn(0, "ID", LVCFMT_LEFT, 40);
+ m_wndListCtrl.InsertColumn(1, "Name", LVCFMT_LEFT, 100);
+ m_wndListCtrl.InsertColumn(2, "Severity", LVCFMT_LEFT, 70);
+ m_wndListCtrl.InsertColumn(3, "Flags", LVCFMT_LEFT, 40);
+ m_wndListCtrl.InsertColumn(4, "Message", LVCFMT_LEFT, 150);
+ m_wndListCtrl.InsertColumn(5, "Description", LVCFMT_LEFT, 300);
+
+ ((CConsoleApp *)AfxGetApp())->OnViewCreate(IDR_EVENT_EDITOR, this);
+
+ hRequest = NXCOpenEventDB();
+ if (hRequest != INVALID_REQUEST_HANDLE)
+ ((CConsoleApp *)AfxGetApp())->RegisterRequest(hRequest, this);
+ return 0;
+}
+
+
+//
+// WM_DESTROY message handler
+//
+
+void CEventEditor::OnDestroy()
+{
+ NXCCloseEventDB();
+ ((CConsoleApp *)AfxGetApp())->OnViewDestroy(IDR_EVENT_EDITOR, this);
+ CMDIChildWnd::OnDestroy();
+}
--- /dev/null
+#if !defined(AFX_EVENTEDITOR_H__A45B4A38_99BC_4277_B600_742C39D58310__INCLUDED_)
+#define AFX_EVENTEDITOR_H__A45B4A38_99BC_4277_B600_742C39D58310__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// EventEditor.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CEventEditor frame
+
+class CEventEditor : public CMDIChildWnd
+{
+ DECLARE_DYNCREATE(CEventEditor)
+protected:
+ CEventEditor(); // protected constructor used by dynamic creation
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+ // ClassWizard generated virtual function overrides
+ //{{AFX_VIRTUAL(CEventEditor)
+ //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+ CListCtrl m_wndListCtrl;
+ virtual ~CEventEditor();
+
+ // Generated message map functions
+ //{{AFX_MSG(CEventEditor)
+ afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+ afx_msg void OnDestroy();
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_EVENTEDITOR_H__A45B4A38_99BC_4277_B600_742C39D58310__INCLUDED_)
#define MAX_PASSWORD_LEN 64
+//
+// Custom windows messages
+//
+
+#define WM_REQUEST_COMPLETED (WM_USER + 1)
+
+
//
// Variables
//
[General Info]
Version=1
-LastClass=CObjectPropDlg
-LastTemplate=CDialog
+LastClass=CEventEditor
+LastTemplate=CMDIChildWnd
NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "nxcon.h"
LastPage=0
-ClassCount=13
+ClassCount=14
Class1=CConsoleApp
Class3=CMainFrame
Class4=CChildFrame
Class9=CMapView
ResourceCount=20
-Resource1=IDR_MAPFRAME
-Resource2=IDR_MAINFRAME
-Resource3=IDR_CTRLPANEL
-Resource4=IDD_LOGIN
-Resource5=IDR_OBJECTS
+Resource1=IDR_CTRLPANEL
+Resource2=IDD_DUMMY (English (U.S.))
+Resource3=IDR_MAPFRAME
+Resource4=IDD_PROGRESS
+Resource5=IDR_EVENTS
Class2=CChildView
Class5=CAboutDlg
Class6=CControlPanel
Class8=CMapFrame
Class10=CLoginDialog
-Resource6=IDD_ABOUTBOX
+Resource6=IDD_LOGIN
Class11=CProgressDialog
-Resource7=IDR_EVENTS
+Resource7=IDR_OBJECTS
Class12=CObjectBrowser
-Resource8=IDD_PROGRESS
+Resource8=IDD_OBJECT_PROPERTIES
Class13=CObjectPropDlg
-Resource9=IDD_OBJECT_PROPERTIES
-Resource10=IDD_DUMMY
+Resource9=IDR_MAINFRAME
+Resource10=IDD_ABOUTBOX
Resource11=IDD_OBJECT_PROPERTIES (English (U.S.))
Resource12=IDR_MAPFRAME (English (U.S.))
Resource13=IDR_OBJECTS (English (U.S.))
Resource17=IDD_ABOUTBOX (English (U.S.))
Resource18=IDD_LOGIN (English (U.S.))
Resource19=IDD_PROGRESS (English (U.S.))
-Resource20=IDD_DUMMY (English (U.S.))
+Class14=CEventEditor
+Resource20=IDD_DUMMY
[CLS:CConsoleApp]
Type=0
Command7=ID_VIEW_TOOLBAR
Command8=ID_VIEW_STATUS_BAR
Command9=ID_VIEW_REFRESH
-Command10=ID_APP_ABOUT
-CommandCount=10
+Command10=ID_CONTROLPANEL_EVENTS
+Command11=ID_CONTROLPANEL_USERS
+Command12=ID_APP_ABOUT
+CommandCount=12
[TB:IDR_MAINFRAME]
Type=1
[DLG:IDD_ABOUTBOX (English (U.S.))]
Type=1
-Class=?
+Class=CAboutDlg
ControlCount=4
Control1=IDC_STATIC,static,1342177283
Control2=IDC_STATIC,static,1342308480
[DLG:IDD_LOGIN (English (U.S.))]
Type=1
-Class=?
+Class=CLoginDialog
ControlCount=11
Control1=IDC_EDIT_SERVER,edit,1350631552
Control2=IDC_EDIT_LOGIN,edit,1350631552
[DLG:IDD_PROGRESS (English (U.S.))]
Type=1
-Class=?
+Class=CProgressDialog
ControlCount=2
Control1=IDC_STATIC_TITLE,button,1342177287
Control2=IDC_STATIC_TEXT,static,1342308865
[DLG:IDD_OBJECT_PROPERTIES (English (U.S.))]
Type=1
-Class=?
+Class=CObjectPropDlg
ControlCount=1
Control1=IDC_LIST_VIEW,SysListView32,1342275613
Control2=IDCANCEL,button,1342242816
Control3=IDC_TREE_VIEW,SysTreeView32,1350631424
+[CLS:CEventEditor]
+Type=0
+HeaderFile=EventEditor.h
+ImplementationFile=EventEditor.cpp
+BaseClass=CMDIChildWnd
+Filter=M
+VirtualFilter=mfWC
+
ON_COMMAND(ID_VIEW_MAP, OnViewMap)
ON_COMMAND(ID_CONNECT_TO_SERVER, OnConnectToServer)
ON_COMMAND(ID_VIEW_OBJECTBROWSER, OnViewObjectbrowser)
+ ON_COMMAND(ID_CONTROLPANEL_EVENTS, OnControlpanelEvents)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
{
m_bCtrlPanelActive = FALSE;
m_bEventBrowserActive = FALSE;
+ m_bEventEditorActive = FALSE;
m_bObjectBrowserActive = FALSE;
m_dwClientState = STATE_DISCONNECTED;
+ m_pRqWaitList = NULL;
}
//
m_bObjectBrowserActive = TRUE;
m_pwndObjectBrowser = pWnd;
break;
+ case IDR_EVENT_EDITOR:
+ m_bEventEditorActive = TRUE;
+ m_pwndEventEditor = (CEventEditor *)pWnd;
+ break;
default:
break;
}
case IDR_OBJECTS:
m_bObjectBrowserActive = FALSE;
break;
+ case IDR_EVENT_EDITOR:
+ m_bEventEditorActive = FALSE;
+ break;
default:
break;
}
MemFree(pArg);
// Sleep(0);
break;
+ case NXC_EVENT_REQUEST_COMPLETED:
+ break;
default:
break;
}
}
+
+void CConsoleApp::OnControlpanelEvents()
+{
+ CMainFrame* pFrame = STATIC_DOWNCAST(CMainFrame, m_pMainWnd);
+
+ // create a new MDI child window or open existing
+ if (m_bEventEditorActive)
+ m_pwndEventEditor->BringWindowToTop();
+ else
+ pFrame->CreateNewChild(
+ RUNTIME_CLASS(CEventEditor), IDR_OBJECTS, m_hCtrlPanelMenu, m_hCtrlPanelAccel);
+}
+
+
+//
+// Register callback for request completion
+//
+
+void CConsoleApp::RegisterRequest(HREQUEST hRequest, CWnd *pWnd)
+{
+
+}
# End Source File
# Begin Source File
+SOURCE=.\EventEditor.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\globals.cpp
# End Source File
# Begin Source File
# End Source File
# Begin Source File
-SOURCE=.\globals.h
+SOURCE=.\EventEditor.h
# End Source File
# Begin Source File
-SOURCE=.\id.h
+SOURCE=.\globals.h
# End Source File
# Begin Source File
#include "globals.h" // Global symbols
#include "ControlPanel.h"
#include "EventBrowser.h"
+#include "EventEditor.h"
#include "ObjectBrowser.h"
#include "MapFrame.h"
#include "ProgressDialog.h" // Added by ClassView
+//
+// Request waiting structure
+//
+
+struct RQ_WAIT_INFO
+{
+ HREQUEST hRequest;
+ CWnd *pWnd;
+};
+
+
/////////////////////////////////////////////////////////////////////////////
// CConsoleApp:
// See nxcon.cpp for the implementation of this class
protected:
DWORD m_dwClientState;
CEventBrowser *m_pwndEventBrowser;
+ CEventEditor *m_pwndEventEditor;
CWnd* m_pwndObjectBrowser;
CWnd *m_pwndCtrlPanel;
HMENU m_hCtrlPanelMenu;
HACCEL m_hMDIAccel;
BOOL m_bAuthFailed;
CProgressDialog m_dlgProgress;
-
+ RQ_WAIT_INFO *m_pRqWaitList;
public:
+ void RegisterRequest(HREQUEST hRequest, CWnd *pWnd);
void EventHandler(DWORD dwEvent, DWORD dwCode, void *pArg);
void OnViewDestroy(DWORD dwView, CWnd *pWnd);
void OnViewCreate(DWORD dwView, CWnd *pWnd);
afx_msg void OnViewMap();
afx_msg void OnConnectToServer();
afx_msg void OnViewObjectbrowser();
+ afx_msg void OnControlpanelEvents();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
BOOL m_bEventBrowserActive;
+ BOOL m_bEventEditorActive;
BOOL m_bObjectBrowserActive;
BOOL m_bCtrlPanelActive;
};
MENUITEM SEPARATOR
MENUITEM "&Refresh\tF5", ID_VIEW_REFRESH
END
+ POPUP "Control Panel"
+ BEGIN
+ MENUITEM "&Events\tCtrl+F2", ID_CONTROLPANEL_EVENTS
+ MENUITEM "&Users\tCtrl+F3", ID_CONTROLPANEL_USERS
+ END
POPUP "&Help"
BEGIN
MENUITEM "&About nxcon...", ID_APP_ABOUT
--- /dev/null
+//
+// NXCON.RC2 - resources Microsoft Visual C++ does not edit directly
+//
+
+#ifdef APSTUDIO_INVOKED
+ #error this file is not editable by Microsoft Visual C++
+#endif //APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Add manually edited resources here...
+
+/////////////////////////////////////////////////////////////////////////////
#define ID_LIST_VIEW 102
#define ID_CONNECT_TO_SERVER 103
#define IDP_SOCKETS_INIT_FAILED 104
+#define IDR_EVENT_EDITOR 104
#define IDR_MAINFRAME 128
#define IDR_NXCONTYPE 129
#define IDI_ALARM 130
#define ID_VIEW_MAP 32776
#define ID_VIEW_OBJECTBROWSER 32779
#define ID_VIEW_REFRESH 32783
+#define ID_CONTROLPANEL_EVENTS 32784
+#define ID_CONTROLPANEL_USERS 32785
// Next default values for new objects
//
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 151
-#define _APS_NEXT_COMMAND_VALUE 32784
+#define _APS_NEXT_COMMAND_VALUE 32786
#define _APS_NEXT_CONTROL_VALUE 1007
-#define _APS_NEXT_SYMED_VALUE 104
+#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif