コード例 #1
0
        public lSearchCtrl crtSearchCtrl(lTableInfo tblInfo, int iCol, Point pos, Size size, lSearchCtrl.SearchMode mode)
        {
            lTableInfo.lColInfo col = tblInfo.m_cols[iCol];
            switch (col.m_type)
            {
            case lTableInfo.lColInfo.lColType.text:
            case lTableInfo.lColInfo.lColType.uniqueText:
                lSearchCtrlText textCtrl = new lSearchCtrlText(col.m_field, col.m_alias, lSearchCtrl.ctrlType.text, pos, size);
                textCtrl.m_mode    = mode;
                textCtrl.m_colInfo = col;
                return(textCtrl);

            case lTableInfo.lColInfo.lColType.dateTime:
                lSearchCtrlDate dateCtrl = new lSearchCtrlDate(col.m_field, col.m_alias, lSearchCtrl.ctrlType.dateTime, pos, size);
                return(dateCtrl);

            case lTableInfo.lColInfo.lColType.num:
                lSearchCtrlNum numCtrl = new lSearchCtrlNum(col.m_field, col.m_alias, lSearchCtrl.ctrlType.num, pos, size);
                return(numCtrl);

            case lTableInfo.lColInfo.lColType.currency:
                lSearchCtrlCurrency currencyCtrl = new lSearchCtrlCurrency(col.m_field, col.m_alias, lSearchCtrl.ctrlType.currency, pos, size);
                return(currencyCtrl);
            }
            return(null);
        }
コード例 #2
0
        public lSearchCtrl crtSearchCtrl(lTableInfo tblInfo, string colName, Point pos, Size size, lSearchCtrl.SearchMode mode)
        {
            int iCol = tblInfo.getColIndex(colName);

            if (iCol != -1)
            {
                return(crtSearchCtrl(tblInfo, iCol, pos, size, mode));
            }
            return(null);
        }