예제 #1
0
        public SearchCtrl CrtSearchCtrl(TableInfo tblInfo, int iCol, Point pos, Size size, SearchCtrl.SearchMode mode)
        {
            TableInfo.ColInfo col = tblInfo.m_cols[iCol];
            switch (col.m_type)
            {
            case TableInfo.ColInfo.ColType.text:
            case TableInfo.ColInfo.ColType.uniq:
                SearchCtrlText textCtrl = new SearchCtrlText(col.m_field, col.m_alias, SearchCtrl.CtrlType.text, pos, size);
                textCtrl.m_mode    = mode;
                textCtrl.m_colInfo = col;
                return(textCtrl);

            case TableInfo.ColInfo.ColType.dateTime:
                lSearchCtrlDate dateCtrl = new lSearchCtrlDate(col.m_field, col.m_alias, SearchCtrl.CtrlType.dateTime, pos, size);
                return(dateCtrl);

            case TableInfo.ColInfo.ColType.num:
                lSearchCtrlNum numCtrl = new lSearchCtrlNum(col.m_field, col.m_alias, SearchCtrl.CtrlType.num, pos, size);
                return(numCtrl);

            case TableInfo.ColInfo.ColType.currency:
                lSearchCtrlCurrency currencyCtrl = new lSearchCtrlCurrency(col.m_field, col.m_alias, SearchCtrl.CtrlType.currency, pos, size);
                return(currencyCtrl);

            case TableInfo.ColInfo.ColType.map:
                SearchCtrlEnum srchCtrl = new SearchCtrlEnum(col.m_field, col.m_alias, SearchCtrl.CtrlType.map, pos, size);
                srchCtrl.m_colInfo = col;
                return(srchCtrl);
            }
            return(null);
        }
예제 #2
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);
        }