- Search string now assumed with * at the ends in object browser
authorVictor Kirhenshtein <victor@netxms.org>
Sat, 20 Nov 2004 08:07:25 +0000 (08:07 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Sat, 20 Nov 2004 08:07:25 +0000 (08:07 +0000)
- Added "single selection" option to object selection dialog

ChangeLog
TODO
src/console/win32/CreateObjectDlg.cpp
src/console/win32/NodePropsGeneral.cpp
src/console/win32/NodePropsGeneral.h
src/console/win32/ObjectSearchBox.cpp
src/console/win32/ObjectSelDlg.cpp
src/console/win32/ObjectSelDlg.h
src/console/win32/nxcon.clw
src/console/win32/nxcon.rc

index 2ad7ef7..14303d9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,8 @@
 - Agent: Fixed bug in interface operational status detection under Windows
 - Added server version checking in client connection procedure. If versions
   mismatch, client will not connect to server.
+- Windows console: when searching object in object browser, '*' characters
+  assumed at the beginning and the end of search string
 
 
 *
diff --git a/TODO b/TODO
index a980f90..746f968 100644 (file)
--- a/TODO
+++ b/TODO
@@ -57,7 +57,6 @@ WINDOWS CONSOLE:
   selected parameter
 - Add parameter selection for native agents in DCI configuration dialog
 - Find good graph creation library
-- In object browser, automatically enclose search string in * when searching
 - Enlarge 16x16 status overlay icons
 - Add primary IP address selection 
 
index 736469e..1e7a71c 100644 (file)
@@ -67,6 +67,7 @@ void CCreateObjectDlg::OnSelectParent()
    CObjectSelDlg dlg;
 
    dlg.m_dwAllowedClasses = SCL_CONTAINER | SCL_SERVICEROOT;
+   dlg.m_bSingleSelection = TRUE;
    if (dlg.DoModal() == IDOK)
    {
       m_pParentObject = NXCFindObjectById(dlg.m_pdwObjectList[0]);
index cfda90a..6f13582 100644 (file)
@@ -75,6 +75,7 @@ BEGIN_MESSAGE_MAP(CNodePropsGeneral, CPropertyPage)
        ON_CBN_SELCHANGE(IDC_COMBO_AUTH, OnSelchangeComboAuth)
        ON_BN_CLICKED(IDC_RADIO_VERSION_2C, OnRadioVersion2c)
        ON_BN_CLICKED(IDC_RADIO_VERSION1, OnRadioVersion1)
+       ON_BN_CLICKED(IDC_SELECT_IP, OnSelectIp)
        //}}AFX_MSG_MAP
 END_MESSAGE_MAP()
 
@@ -172,3 +173,12 @@ void CNodePropsGeneral::OnOK()
          break;
       }
 }
+
+
+//
+// Select primary IP address for node
+//
+
+void CNodePropsGeneral::OnSelectIp() 
+{
+}
index fa47208..a18c4b3 100644 (file)
@@ -56,6 +56,7 @@ protected:
        afx_msg void OnSelchangeComboAuth();
        afx_msg void OnRadioVersion2c();
        afx_msg void OnRadioVersion1();
+       afx_msg void OnSelectIp();
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 
index 1c1d54f..8dee766 100644 (file)
@@ -112,9 +112,11 @@ HBRUSH CObjectSearchBox::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
 
 void CObjectSearchBox::OnFindObject()
 {
-   char szBuffer[256];
+   TCHAR szBuffer[256];
 
-   m_wndEditBox.GetWindowText(szBuffer, 255);
+   szBuffer[0] = _T('*');
+   m_wndEditBox.GetWindowText(&szBuffer[1], 255);
+   _tcscat(szBuffer, _T("*"));
    GetParent()->SendMessage(WM_FIND_OBJECT, 0, (LPARAM)szBuffer);
 }
 
index 3e8298d..3207771 100644 (file)
@@ -24,6 +24,7 @@ CObjectSelDlg::CObjectSelDlg(CWnd* pParent /*=NULL*/)
    m_dwNumObjects = 0;
    m_pdwObjectList = NULL;
    m_dwAllowedClasses = 0xFFFF;  // Allow all classes by default
+   m_bSingleSelection = FALSE;
 }
 
 
@@ -79,6 +80,11 @@ BOOL CObjectSelDlg::OnInitDialog()
    m_wndListCtrl.InsertColumn(1, "Class", LVCFMT_LEFT, 
                               rect.right - 150 - GetSystemMetrics(SM_CXVSCROLL));
    m_wndListCtrl.SetExtendedStyle(LVS_EX_FULLROWSELECT);
+   if (m_bSingleSelection)
+   {
+      ::SetWindowLong(m_wndListCtrl.m_hWnd, GWL_STYLE, 
+         ::GetWindowLong(m_wndListCtrl.m_hWnd, GWL_STYLE) | LVS_SINGLESEL);
+   }
 
    // Fill in object list
    NXCLockObjectIndex();
index 00ccfbe..d144581 100644 (file)
@@ -27,6 +27,7 @@ class CObjectSelDlg : public CDialog
 {
 // Construction
 public:
+       BOOL m_bSingleSelection;
        DWORD m_dwAllowedClasses;
        DWORD m_dwNumObjects;
        DWORD *m_pdwObjectList;
index e257b74..531eb96 100644 (file)
@@ -2,7 +2,7 @@
 
 [General Info]
 Version=1
-LastClass=CTrapParamDlg
+LastClass=CNodePropsGeneral
 LastTemplate=CDialog
 NewFileInclude1=#include "stdafx.h"
 NewFileInclude2=#include "nxcon.h"
@@ -17,20 +17,20 @@ Class9=CMapView
 
 ResourceCount=92
 Resource1=IDD_THRESHOLD (English (U.S.))
-Resource2=IDD_CREATE_CONTAINER
+Resource2=IDD_OBJECT_GENERAL
 Resource3=IDM_VIEW_SPECIFIC (English (U.S.))
-Resource4=IDA_MDI_DEFAULT
-Resource5=IDD_EDIT_RULE_ALARM
+Resource4=IDD_DCI_THRESHOLDS
+Resource5=IDD_LOGIN
 Class2=CChildView
 Class5=CAboutDlg
 Class6=CControlPanel
 Class8=CMapFrame
 Class10=CLoginDialog
-Resource6=IDD_CREATE_TG
+Resource6=IDD_NEW_USER
 Class11=CProgressDialog
-Resource7=IDD_LOGIN
+Resource7=IDD_CP_GENERAL
 Class12=CObjectBrowser
-Resource8=IDD_OBJECT_GENERAL
+Resource8=IDD_CREATE_NODE
 Class13=CObjectPropDlg
 Resource9=IDD_CP_GENERAL (English (U.S.))
 Resource10=IDA_OBJECT_BROWSER (English (U.S.))
@@ -46,7 +46,7 @@ Resource17=IDD_SET_PASSWORD (English (U.S.))
 Class16=CDebugFrame
 Resource18=IDD_OBJECT_SECURITY (English (U.S.))
 Resource19=IDD_OBJECT_PROPERTIES (English (U.S.))
-Resource20=IDA_EPP
+Resource20=IDD_MIB_BROWSER
 Class17=CObjectPreview
 Resource21=IDD_DCI_TRANSFORM (English (U.S.))
 Class18=CToolBox
@@ -59,7 +59,7 @@ Class23=CNodePropsGeneral
 Resource23=IDD_LOGIN (English (U.S.))
 Class24=CObjectPropCaps
 Class25=CObjectPropSheet
-Resource24=IDA_EVENT_EDITOR
+Resource24=IDD_SELECT_EVENT
 Class26=CRequestProcessingDlg
 Resource25=IDD_EDIT_EVENT (English (U.S.))
 Resource26=IDD_PROGRESS (English (U.S.))
@@ -69,22 +69,22 @@ Class27=CObjectPropsGeneral
 Resource29=IDA_ALARM_BROWSER (English (U.S.))
 Class28=CObjectPropsSecurity
 Resource30=IDD_CREATE_NODE (English (U.S.))
-Resource31=IDA_NETMAP
+Resource31=IDD_CREATE_TG
 Resource32=IDM_VIEW_SPECIFIC
 Class29=CUserSelectDlg
-Resource33=IDA_TRAP_EDITOR
+Resource33=IDD_EDIT_RULE_SEVERITY
 Class30=CUserEditor
 Resource34=IDD_DCI_PROPERTIES
 Class31=CNewUserDlg
-Resource35=IDD_SELECT_USER
-Resource36=IDD_GROUP_PROPERTIES
+Resource35=IDD_EDIT_RULE_COMMENT
+Resource36=IDD_EDIT_TRAP
 Class32=CUserPropDlg
 Resource37=IDM_CONTEXT (English (U.S.))
-Resource38=IDD_EDIT_RULE_COMMENT
+Resource38=IDA_EVENT_EDITOR
 Class33=CGroupPropDlg
-Resource39=IDA_ACTION_EDITOR
-Resource40=IDA_OBJECT_BROWSER
-Resource41=IDD_OBJECT_PRESENTATION
+Resource39=IDD_OBJECT_PRESENTATION
+Resource40=IDD_THRESHOLD
+Resource41=IDA_TRAP_EDITOR
 Resource42=IDD_SELECT_OBJECT (English (U.S.))
 Class34=CPasswordChangeDlg
 Class35=CNodeSummary
@@ -100,55 +100,55 @@ Class41=CGraphFrame
 Class42=CDCIThresholdsPage
 Resource46=IDA_MDI_DEFAULT (English (U.S.))
 Resource47=IDD_OBJECT_CAPS (English (U.S.))
-Resource48=IDR_MAINFRAME
+Resource48=IDD_ACTION_PROPERTIES
 Class43=CThresholdDlg
 Resource49=IDD_SELECT_USER (English (U.S.))
-Resource50=IDD_EDIT_RULE_SEVERITY
+Resource50=IDD_ABOUTBOX
 Class44=CMIBBrowserDlg
 Class45=CEventPolicyEditor
 Class46=CRuleList
 Class47=CRuleHeader
 Resource51=IDR_MAINFRAME (English (U.S.))
-Resource52=IDD_MIB_BROWSER
+Resource52=IDA_ALARM_BROWSER
 Class48=CObjectSelDlg
-Resource53=IDD_SELECT_EVENT
-Resource54=IDA_ALARM_BROWSER
+Resource53=IDA_ACTION_EDITOR
+Resource54=IDD_SELECT_OBJECT
 Class49=CRuleCommentDlg
-Resource55=IDD_CREATE_TEMPLATE
+Resource55=IDD_USER_PROPERTIES
 Class50=CEventSelDlg
-Resource56=IDD_DCI_TRANSFORM
+Resource56=IDD_SELECT_USER
 Resource57=IDD_REQUEST_PROCESSING (English (U.S.))
-Resource58=IDD_NEW_USER
+Resource58=IDD_CREATE_TEMPLATE
 Resource59=IDD_ABOUTBOX (English (U.S.))
 Resource60=IDD_MIB_BROWSER (English (U.S.))
 Class51=CObjectPropsPresentation
 Resource61=IDD_OBJECT_PRESENTATION (English (U.S.))
-Resource62=IDD_THRESHOLD
+Resource62=IDA_EPP
 Class52=CRuleSeverityDlg
-Resource63=IDD_ABOUTBOX
+Resource63=IDD_EDIT_RULE_ALARM
 Class53=CRuleAlarmDlg
 Class54=CAlarmBrowser
 Resource64=IDD_SELECT_EVENT (English (U.S.))
-Resource65=IDD_OBJECT_CAPS
+Resource65=IDD_SELECT_ACTION
 Resource66=IDD_NEW_ACTION (English (U.S.))
 Resource67=IDD_DCI_COLLECTION (English (U.S.))
 Resource68=IDD_NEW_USER (English (U.S.))
 Class55=CConsolePropsGeneral
 Class56=CActionEditor
-Resource69=IDD_REQUEST_PROCESSING
-Resource70=IDD_SELECT_ACTION
+Resource69=IDD_CREATE_CONTAINER
+Resource70=IDD_REQUEST_PROCESSING
 Class57=CNewActionDlg
-Resource71=IDD_SELECT_OBJECT
+Resource71=IDA_NETMAP
 Class58=CEditActionDlg
-Resource72=IDD_DCI_COLLECTION
+Resource72=IDA_MDI_DEFAULT
 Class59=CActionSelDlg
-Resource73=IDD_OBJECT_NODE_GENERAL
+Resource73=IDD_DCI_COLLECTION
 Resource74=IDD_EDIT_RULE_COMMENT (English (U.S.))
 Resource75=IDD_EDIT_RULE_ALARM (English (U.S.))
-Resource76=IDD_CREATE_NODE
+Resource76=IDD_OBJECT_SECURITY
 Class60=CCreateObjectDlg
 Class61=CCreateContainerDlg
-Resource77=IDD_DATA_QUERY
+Resource77=IDD_GROUP_PROPERTIES
 Class62=CCreateNodeDlg
 Resource78=IDA_EPP (English (U.S.))
 Resource79=IDD_CREATE_CONTAINER (English (U.S.))
@@ -158,20 +158,20 @@ Resource81=IDD_ACTION_PROPERTIES (English (U.S.))
 Class64=CPollNodeDlg
 Resource82=IDD_POLL_NODE (English (U.S.))
 Class65=CNodePoller
-Resource83=IDD_SET_PASSWORD
-Resource84=IDD_OBJECT_SECURITY
+Resource83=IDR_MAINFRAME
+Resource84=IDD_DCI_TRANSFORM
 Class66=CCreateTemplateDlg
 Class67=CCreateTGDlg
-Resource85=IDD_USER_PROPERTIES
-Resource86=IDD_CP_GENERAL
+Resource85=IDD_DATA_QUERY
+Resource86=IDD_EDIT_EVENT
 Class68=CTrapEditor
-Resource87=IDD_DCI_THRESHOLDS
-Resource88=IDD_NEW_ACTION
-Resource89=IDD_EDIT_TRAP
+Resource87=IDA_OBJECT_BROWSER
+Resource88=IDD_OBJECT_NODE_GENERAL
+Resource89=IDD_SET_PASSWORD
 Class69=CDataQueryDlg
-Resource90=IDD_EDIT_EVENT
+Resource90=IDD_NEW_ACTION
 Class70=CTrapEditDlg
-Resource91=IDD_ACTION_PROPERTIES
+Resource91=IDD_OBJECT_CAPS
 Class71=CTrapParamDlg
 Resource92=IDD_EDIT_TRAP_ARG
 
index b0e902b..8de8c93 100644 (file)
@@ -724,7 +724,7 @@ CAPTION "General"
 FONT 8, "MS Sans Serif"
 BEGIN
     EDITTEXT        IDC_EDIT_NAME,51,33,107,14,ES_AUTOHSCROLL
-    PUSHBUTTON      "...",IDC_SELECT_IP,265,24,14,14
+    PUSHBUTTON      "...",IDC_SELECT_IP,265,25,14,14
     EDITTEXT        IDC_EDIT_OID,51,51,228,14,ES_AUTOHSCROLL | ES_READONLY
     COMBOBOX        IDC_COMBO_AUTH,14,103,126,120,CBS_DROPDOWNLIST | 
                     CBS_SORT | WS_VSCROLL | WS_TABSTOP