예제 #1
0
 //============================================================
 // <T>保存资源。</T>
 //============================================================
 public void SaveResource()
 {
     // 检查参数
     if (_resource == null)
     {
         return;
     }
     // 保存属性
     _resource.OptionEnable  = chkOptionEnable.Checked;
     _resource.OptionVisible = chkOptionVisible.Checked;
     _resource.DockCd        = REnum.ToValue <ERcDock>(cbxDockCd.Text);
     _resource.Margin.Parse(txtMargin.Text);
     _resource.Padding.Parse(txtPadding.Text);
     _resource.ForeColor = qcpForeColor.SelectColorValue;
     qpeForeResource.SaveResource();
     _resource.BackColor = qcpBackColor.SelectColorValue;
     qpeBackResource.SaveResource();
     qUiInnerBorderProperty.SaveResource();
     qUiOuterBorderProperty.SaveResource();
     // 保存事件
     _resource.OnClick       = txtClick.Text;
     _resource.OnDoubleClick = txtDoubleClick.Text;
     _resource.OnMouseDown   = txtMouseDown.Text;
     _resource.OnMouseUp     = txtMouseUp.Text;
     _resource.OnMouseMove   = txtMouseMove.Text;
     _resource.OnMouseEnter  = txtMouseEnter.Text;
     _resource.OnMouseLeave  = txtMouseLeave.Text;
 }
예제 #2
0
        public override void LoadConfig(FXmlNode config)
        {
            base.LoadConfig(config);
            // Load type
            string type = config[PTY_TYPE];

            if (!RString.IsEmpty(type))
            {
                _dataType = REnum.ToValue <EAopParameterType>(type);
            }
            // Load component
            if (config.HasNode())
            {
                FXmlNode node = config.Nodes[0];
                if (node.IsName(XAopComponent.TAG))
                {
                    _dataType = EAopParameterType.Component;
                }
            }
            // Load value
            if (_dataType == EAopParameterType.String)
            {
                _dataValue = config.Text;
            }
        }
예제 #3
0
 //============================================================
 // <T>保存资源。</T>
 //============================================================
 public void SaveResource()
 {
     _resource.Code    = RInt.Parse(txtCode.Text);
     _resource.AlignCd = REnum.ToValue <ERcPictureAlign>(cboAlignCd.Text);
     _resource.Location.Parse(txtLocation.Text);
     _resource.Padding.Parse(txtPadding.Text);
 }
예제 #4
0
 //============================================================
 // <T>加载设置信息</T>
 //
 // @param xconfig 设置信息
 //============================================================
 public override void OnLoadConfig(FXmlNode xconfig)
 {
     base.OnLoadConfig(xconfig);
     // 加载属性
     _dataName      = xconfig.Get("data_name");
     _dataType      = REnum.ToValue <EDataType>(xconfig.Get("data_type"));
     _dataKey       = xconfig.GetBoolean("data_key");
     _dataRequire   = xconfig.GetBoolean("data_require");
     _dataValue     = xconfig.Get("data_value");
     _dataDefault   = xconfig.Get("data_default");
     _dataOrder     = xconfig.Get("data_order");
     _queryAble     = xconfig.GetBoolean("query_able");
     _insertAble    = xconfig.GetBoolean("insert_able");
     _updateAble    = xconfig.GetBoolean("update_able");
     _deleteAble    = xconfig.GetBoolean("delete_able");
     _displaySearch = xconfig.GetBoolean("display_search");
     _displayPicker = xconfig.GetBoolean("display_picker");
     _displayZoom   = xconfig.GetBoolean("display_zoom");
     _editInsert    = xconfig.GetBoolean("edit_insert");
     _editUpdate    = xconfig.GetBoolean("edit_update");
     _editDelete    = xconfig.GetBoolean("edit_delete");
     _validInsert   = xconfig.GetBoolean("valid_insert");
     _validUpdate   = xconfig.GetBoolean("valid_update");
     _validDelete   = xconfig.GetBoolean("valid_delete");
     _searchAble    = xconfig.GetBoolean("search_able");
     _searchValue   = xconfig.Get("search_value");
     _searchTypeCd  = REnum.ToValue <EDataSearch>(xconfig.Get("search_type_cd"));
     _searchLabel   = xconfig.Get("search_label");
 }
예제 #5
0
        //============================================================
        // <T>设置处理。</T>
        //============================================================
        public override void Setup()
        {
            FontWeight  fontWeight  = (FontWeight)REnum.ToValue(typeof(FontWeight), _fontWeight);
            FontStyle   fontStyle   = (FontStyle)REnum.ToValue(typeof(FontStyle), _fontStyle);
            FontStretch fontStretch = (FontStretch)REnum.ToValue(typeof(FontStretch), _fontStretch);

            _native = _device.WriteFactory.CreateTextFormat(_fontFamilyName, fontWeight, fontStyle, fontStretch, _fontSize, _localName);
        }
예제 #6
0
 //============================================================
 // <T>确定按钮事件处理。</T>
 //============================================================
 private void btnAccept_Click(object sender, System.EventArgs e)
 {
     _layer.ScrollCd    = REnum.ToValue <EMapLayerScroll>(cbxScrollCd.Text);
     _layer.TypeCd      = REnum.ToValue <EMapLayerType>(cbxTypeCd.Text);
     _layer.ScrollSpeed = RFloat.Parse(txtSpeed.Text);
     _layer.WrapCd      = REnum.ToValue <EMapLayerWrap>(cbxWrapCd.Text);
     Close();
 }
예제 #7
0
 //============================================================
 // <T>加载设置信息。</T>
 //
 // @param xconfig 设置信息
 //============================================================
 public override void OnLoadConfig(FXmlNode xconfig)
 {
     base.OnLoadConfig(xconfig);
     if (xconfig.Contains("text_align_cd"))
     {
         _textAlignCd = (ERcTextAlign)REnum.ToValue(typeof(ERcTextAlign), xconfig.Get("text_align_cd"));
     }
     _font.LoadConfig(xconfig, "font");
     _text = xconfig.Get("text", _text);
 }
예제 #8
0
 //============================================================
 // <T>加载设置信息。</T>
 //
 // @param xconfig 设置信息
 //============================================================
 public override void OnLoadConfig(FXmlNode xconfig)
 {
     base.OnLoadConfig(xconfig);
     _designItemCount = xconfig.GetInteger("design_item_count", 1);
     _spreadCd        = (ERcSpread)REnum.ToValue(typeof(ERcSpread), xconfig.Get("spread_cd", "None"));
     _horizontalCount = xconfig.GetInteger("horizontal_count", 1);
     _horizontalSpace = xconfig.GetInteger("horizontal_space", 0);
     _verticalCount   = xconfig.GetInteger("vertical_count", 1);
     _verticalSpace   = xconfig.GetInteger("vertical_space", 0);
     _initialCount    = xconfig.GetInteger("initial_count", 0);
 }
예제 #9
0
        public override void LoadConfig(FXmlNode config)
        {
            // Id
            _id = config[PTY_ID];
            // Face
            _faceName = config[PTY_FACE];
            // Type
            _typeName = config[PTY_TYPE];
            // Scope
            string scope = config[PTY_SCOPE];

            if (!RString.IsEmpty(scope))
            {
                _scope = REnum.ToValue <EScope>(scope);
            }
            // Load config
            if (config.HasNode())
            {
                foreach (FXmlNode node in config.Nodes)
                {
                    if (node.IsName(XAopConstructor.TAG))
                    {
                        // Constructor
                        if (_constructor != null)
                        {
                            throw new FFatalException("Constructor can't be duplicate.\n{1}", config.Dump());
                        }
                        _constructor = new XAopConstructor();
                        _constructor.LoadConfig(node);
                    }
                    else if (node.IsName(XAopProperty.TAG))
                    {
                        // Properties
                        XAopProperty property = new XAopProperty();
                        property.LoadConfig(node);
                        _properties.Push(property);
                    }
                    else if (node.IsName(XAopInitialize.TAG))
                    {
                        // Initializes
                        XAopInitialize method = new XAopInitialize();
                        method.LoadConfig(node);
                        _initializes.Push(method);
                    }
                    else if (node.IsName(XAopRelease.TAG))
                    {
                        // Releases
                        XAopRelease method = new XAopRelease();
                        method.LoadConfig(node);
                        _releases.Push(method);
                    }
                }
            }
        }
예제 #10
0
        //============================================================
        // <T>加载配置文件。</T>
        //============================================================
        public void LoadConfig(FXmlNode config)
        {
            if (config.Contains("cell_count"))
            {
                _cellCount.Parse(config.Get("cell_count"));
            }
            if (config.Contains("cell_size"))
            {
                _cellSize.Parse(config.Get("cell_size"));
            }
            if (config.Contains("type_cd"))
            {
                _typeCd = REnum.ToValue <EMapLayerType>(config.Get("type_cd"));
            }
            if (config.Contains("scroll_cd"))
            {
                _scrollCd = REnum.ToValue <EMapLayerScroll>(config.Get("scroll_cd"));
            }
            if (config.Contains("wrap_cd"))
            {
                _wrapCd = REnum.ToValue <EMapLayerWrap>(config.Get("wrap_cd"));
            }
            if (config.Contains("scroll_speed"))
            {
                _scrollSpeed = config.GetFloat("scroll_speed");
            }
            _tileNode = config.Find("Tiles");
            if (null == _tileNode)
            {
                return;
            }
            // 创建所有格子
            for (int m = 0; m < _cellCount.Height; m++)
            {
                for (int n = 0; n < _cellCount.Width; n++)
                {
                    FMbMapCell cell = new FMbMapCell();
                    cell.Index = new SIntPoint2(n, m);
                    _mapCell.Push(cell);
                }
            }

            // 加载格子资源图片编号
            foreach (FXmlNode cellNode in _tileNode.Nodes)
            {
                FDsMapCell cell = new FDsMapCell();
                cell.Resource.LoadConfig(cellNode);
                SIntPoint2 cellIndex = cell.Resource.Index;
                FMbMapCell c         = FingCellByIndex(cellIndex.X, cellIndex.Y);
                c.ResourceId = cell.Resource.ResourceId;
            }
        }
예제 #11
0
        //============================================================
        // <T>序列化内容到输出流。</T>
        //
        // @param output 输出流
        //============================================================
        public virtual void OnSerialize(IOutput output)
        {
            int flags = MakeSerializeFlags();

            output.WriteInt16((short)REnum.ToValue <ERcComponent>(_typeName));
            output.WriteString(_className);
            output.WriteUint32((uint)flags);
            output.WriteString(_name);
            output.WriteWideString(_label);
            // 保存属性
            //if(!_properties.IsEmpty()) {
            //   _properties.Serialize(output);
            //}
        }
예제 #12
0
 public virtual void LoadConfig(FXmlNode config)
 {
     if (config.Contains(PTY_TYPE))
     {
         _type = REnum.ToValue <EScheduleConditionType>(config[PTY_TYPE]);
     }
     if (config.Contains(PTY_VALID))
     {
         _valid = config.GetBoolean(PTY_VALID);
     }
     if (config.Contains(PTY_FILE))
     {
         _fileName = config[PTY_FILE];
     }
 }
예제 #13
0
 //============================================================
 // <T>加载设置信息</T>
 //
 // @param xconfig 设置信息
 //============================================================
 public override void OnLoadConfig(FXmlNode xconfig)
 {
     base.OnLoadConfig(xconfig);
     // 加载配置
     _optionVisible = xconfig.GetBoolean("option_visible", _optionVisible);
     _optionEnable  = xconfig.GetBoolean("option_enable", _optionEnable);
     // 加载属性
     if (xconfig.Contains("dock_cd"))
     {
         _dockCd = (ERcDock)REnum.ToValue(typeof(ERcDock), xconfig.Get("dock_cd"));
     }
     // 加载位置
     if (xconfig.Contains("location"))
     {
         _location.Parse(xconfig.Get("location"));
     }
     // 加载尺寸
     if (xconfig.Contains("size"))
     {
         _size.Parse(xconfig.Get("size"));
     }
     // 加载空白
     if (xconfig.Contains("margin"))
     {
         _margin.Parse(xconfig.Get("margin"));
     }
     if (xconfig.Contains("padding"))
     {
         _padding.Parse(xconfig.Get("padding"));
     }
     // 加载边框
     _borderInner.LoadConfig(xconfig, "border_inner");
     _borderOuter.LoadConfig(xconfig, "border_outer");
     // 加载前景
     _foreColor = xconfig.GetHex("fore_color", _foreColor);
     _foreResource.LoadConfig(xconfig, "fore");
     // 加载后景
     _backColor = xconfig.GetHex("back_color", _backColor);
     _backResource.LoadConfig(xconfig, "back");
     // 加载事件
     _onClick       = xconfig.Get("on_click", null);
     _onDoubleClick = xconfig.Get("on_double_click", null);
     _onMouseDown   = xconfig.Get("on_mouse_down", null);
     _onMouseUp     = xconfig.Get("on_mouse_up", null);
     _onMouseEnter  = xconfig.Get("on_mouse_enter", null);
     _onMouseMove   = xconfig.Get("on_mouse_move", null);
     _onMouseLeave  = xconfig.Get("on_mouse_leave", null);
 }
예제 #14
0
        public void LoadConfig(FXmlNode config)
        {
            _config = config;
            // get type
            string type = config[PTY_TYPE];

            _type = (ECsvWorkType)REnum.ToValue(typeof(ECsvWorkType), type);
            // get validator
            string formator = config[PTY_CLASS];

            try {
                //_formator = (IFormator)RClass.CreateInstance(formator);
            } catch (Exception e) {
                throw new FFatalException(e, "Create formator class failure. (class={0})", formator);
            }
        }
예제 #15
0
 //============================================================
 // <T>加载设置信息。</T>
 //
 // @param xconfig 设置信息
 //============================================================
 public override void OnLoadConfig(FXmlNode xconfig)
 {
     base.OnLoadConfig(xconfig);
     // 读取数据
     _optionHand    = xconfig.GetBoolean("option_hand", _optionHand);
     _validInterval = xconfig.GetInteger("valid_interval", _validInterval);
     if (xconfig.Contains("text_align_cd"))
     {
         _textAlignCd = (ERcTextAlign)REnum.ToValue(typeof(ERcTextAlign), xconfig.Get("text_align_cd"));
     }
     _font.LoadConfig(xconfig, "font");
     _text = xconfig.Get("text", _text);
     _groundResource.LoadConfig(xconfig, "ground");
     // 读取事件
     _onClickControl = xconfig.Get("on_click_control", _onClickControl);
 }
예제 #16
0
        //============================================================
        // <T>解析字符串内容。</T>
        //
        // @param value 字符串内容
        //============================================================
        public bool Parse(string value)
        {
            // 获得编号
            int index = value.IndexOf(",");

            if (index == -1)
            {
                return(false);
            }
            _code = RInt.Parse(value.Substring(0, index));
            value = value.Substring(index + 1);
            // 获得对齐方式
            index = value.IndexOf(",");
            if (index == -1)
            {
                return(false);
            }
            _alignCd = REnum.ToValue <ERcPictureAlign>(value.Substring(0, index));
            value    = value.Substring(index + 1);
            // 获得位置
            int start = value.IndexOf('(');
            int end   = value.IndexOf(')');

            if ((start == -1) || (end == -1))
            {
                return(false);
            }
            if (!_location.Parse(value.Substring(start + 1, end - start - 1)))
            {
                return(false);
            }
            value = value.Substring(end + 1);
            // 获得空白
            start = value.IndexOf('(');
            end   = value.IndexOf(')');
            if ((start == -1) || (end == -1))
            {
                return(false);
            }
            if (!_padding.Parse(value.Substring(start + 1, end - start - 1)))
            {
                return(false);
            }
            return(true);
        }
예제 #17
0
 //============================================================
 // <T>确定按钮事件处理。</T>
 //============================================================
 private void btnAccept_Click(object sender, System.EventArgs e)
 {
     // 左
     _border.Left.Color = qcpLColor.SelectColorValue;
     _border.Left.Width = RInt.Parse(txtLWidth.Text);
     _border.Left.Style = REnum.ToValue <ERcLineStyle>(cbxLStyle.Text);
     // 上
     _border.Top.Color = qcpTColor.SelectColorValue;
     _border.Top.Width = RInt.Parse(txtTWidth.Text);
     _border.Top.Style = REnum.ToValue <ERcLineStyle>(cbxTStyle.Text);
     // 右
     _border.Right.Color = qcpRColor.SelectColorValue;
     _border.Right.Width = RInt.Parse(txtRWidth.Text);
     _border.Right.Style = REnum.ToValue <ERcLineStyle>(cbxRStyle.Text);
     // 下
     _border.Bottom.Color = qcpBColor.SelectColorValue;
     _border.Bottom.Width = RInt.Parse(txtBWidth.Text);
     _border.Bottom.Style = REnum.ToValue <ERcLineStyle>(cbxBStyle.Text);
     // 完成后隐藏窗体
     Hide();
 }
예제 #18
0
 //============================================================
 // <T>加载设置信息</T>
 //
 // @param xconfig 设置信息
 //============================================================
 public override void OnLoadConfig(FXmlNode xconfig)
 {
     base.OnLoadConfig(xconfig);
     // 加载配置
     _optionScrollAuto = xconfig.GetBoolean("option_scroll_auto", _optionScrollAuto);
     //_optionScrollHorizontal = xconfig.GetBoolean("option_scroll_horizontal", _optionScrollHorizontal);
     //_optionScrollVertical = xconfig.GetBoolean("option_scroll_vertical", _optionScrollVertical);
     // 加载类型
     if (xconfig.Contains("scroll_style_cd"))
     {
         _scrollStyleCd = (ERcScrollStyle)REnum.ToValue(typeof(ERcScrollStyle), xconfig.Get("scroll_style_cd"));
     }
     if (xconfig.Contains("horizontal_dock"))
     {
         _horizontalDockCd = (ERcHorizontalDock)REnum.ToValue(typeof(ERcHorizontalDock), xconfig.Get("horizontal_dock"));
     }
     if (xconfig.Contains("vertical_dock"))
     {
         _verticalDockCd = (ERcVerticalDock)REnum.ToValue(typeof(ERcVerticalDock), xconfig.Get("vertical_dock"));
     }
 }
예제 #19
0
 public virtual void LoadConfig(FXmlNode config)
 {
     // Type
     if (config.Contains(PTY_TYPE))
     {
         _type = REnum.ToValue <EScheduleTaskType>(config[PTY_TYPE]);
     }
     // Valid
     if (config.Contains(PTY_VALID))
     {
         _valid = config.GetBoolean(PTY_VALID);
     }
     // Day Interval
     if (config.Contains(PTY_DAY_INTERVAL))
     {
         _dayInterval = RInt.Parse(config[PTY_DAY_INTERVAL]);
     }
     // Week Interval
     if (config.Contains(PTY_WEEK_INTERVAL))
     {
         _weekInterval = RInt.Parse(config[PTY_WEEK_INTERVAL]);
     }
     // Month Interval
     if (config.Contains(PTY_MONTH_INTERVAL))
     {
         _monthInterval = RInt.Parse(config[PTY_MONTH_INTERVAL]);
     }
     // WeekDays
     if (config.Contains(PTY_WEEKDAYS))
     {
         string weekDays = config[PTY_WEEKDAYS];
         if (!RString.IsEmpty(weekDays))
         {
             _weekDays = (EScheduleWeekDay)RInt.Parse(weekDays);
         }
     }
     // Month type
     if (config.Contains(PTY_MONTH_TYPE))
     {
         string monthType = config[PTY_MONTH_TYPE];
         if (!RString.IsEmpty(monthType))
         {
             _monthType = (EScheduleMonthType)RInt.Parse(monthType);
         }
     }
     // Month day
     if (config.Contains(PTY_MONTH_DAY))
     {
         _monthDay = RInt.Parse(config[PTY_MONTH_DAY]);
     }
     // Month week
     if (config.Contains(PTY_MONTH_WEEK))
     {
         string monthWeek = config[PTY_MONTH_WEEK];
         if (!RString.IsEmpty(monthWeek))
         {
             _monthWeek = (EScheduleMonthWeek)RInt.Parse(monthWeek);
         }
     }
     // Month week day
     if (config.Contains(PTY_MONTH_WEEK_DAY))
     {
         _monthWeekDay = RInt.Parse(config[PTY_MONTH_WEEK_DAY]);
     }
     // Months
     if (config.Contains(PTY_MONTHS))
     {
         string months = config[PTY_MONTHS];
         if (!RString.IsEmpty(months))
         {
             _months = (EScheduleMonth)RInt.Parse(months);
         }
     }
     // Once date
     if (config.Contains(PTY_ONCE_DATE))
     {
         _onceDate = RDate.Parse(config[PTY_ONCE_DATE]);
     }
     // Begin date
     if (config.Contains(PTY_BEGIN_DATE))
     {
         _beginDate = RDate.Parse(config[PTY_BEGIN_DATE]);
     }
     // End valid
     if (config.Contains(PTY_END_VALID))
     {
         _endValid = config.GetBoolean(PTY_END_VALID);
     }
     // End date
     if (config.Contains(PTY_END_DATE))
     {
         _endDate = RDate.Parse(config[PTY_END_DATE]);
     }
     // Time
     if (config.Contains(PTY_TIME))
     {
         _time = RDate.Parse(config[PTY_TIME]);
     }
 }
예제 #20
0
        //============================================================
        // <T>根据类型名称创建界面组件。</T>
        //
        // @param typeName 类型名称
        //============================================================
        public FUiComponent CreateComponent(string typeName)
        {
            FUiComponent component   = null;
            ERcComponent componentCd = REnum.ToValue <ERcComponent>(typeName);

            switch (componentCd)
            {
            case ERcComponent.StaticLabel:
                component = new FUiStaticLabel(this);
                break;

            case ERcComponent.Label:
                component = new FUiLabel(this);
                break;

            case ERcComponent.Radio:
                component = new FUiRadio(this);
                break;

            case ERcComponent.Check:
                component = new FUiCheck(this);
                break;

            case ERcComponent.Number:
                component = new FUiNumber(this);
                break;

            case ERcComponent.Edit:
                component = new FUiEdit(this);
                break;

            case ERcComponent.RichEdit:
                component = new FUiRichEdit(this);
                break;

            case ERcComponent.Button:
                component = new FUiButton(this);
                break;

            case ERcComponent.Slider:
                component = new FUiSlider(this);
                break;

            case ERcComponent.ScrollBar:
                component = new FUiScrollBar(this);
                break;

            case ERcComponent.ProgressBar:
                component = new FUiProgressBar(this);
                break;

            case ERcComponent.Calendar:
                component = new FUiLabel(this);
                break;

            case ERcComponent.PictureBox:
                component = new FUiPictureBox(this);
                break;

            case ERcComponent.FontBox:
                component = new FUiFontBox(this);
                break;

            case ERcComponent.MovieBox:
                component = new FUiMovieBox(this);
                break;

            case ERcComponent.SlotItem:
                component = new FUiSlotItem(this);
                break;

            case ERcComponent.Slot:
                component = new FUiSlot(this);
                break;

            case ERcComponent.Panel:
                component = new FUiPanel(this);
                break;

            case ERcComponent.Page:
                component = new FUiPage(this);
                break;

            case ERcComponent.PageControl:
                component = new FUiPageControl(this);
                break;

            case ERcComponent.SelectItem:
                component = new FUiSelectItem(this);
                break;

            case ERcComponent.Select:
                component = new FUiSelect(this);
                break;

            case ERcComponent.MenuItem:
                component = new FUiMenuItem(this);
                break;

            case ERcComponent.Menu:
                component = new FUiMenu(this);
                break;

            case ERcComponent.ListItem:
                component = new FUiListItem(this);
                break;

            case ERcComponent.ListView:
                component = new FUiListView(this);
                break;

            case ERcComponent.TreeNodeType:
                component = new FUiTreeNodeType(this);
                break;

            case ERcComponent.TreeNodeLevel:
                component = new FUiTreeNodeLevel(this);
                break;

            case ERcComponent.TreeNode:
                component = new FUiTreeNode(this);
                break;

            case ERcComponent.TreeView:
                component = new FUiTreeView(this);
                break;

            case ERcComponent.GridCell:
                component = new FUiGridCell(this);
                break;

            case ERcComponent.GridCellCheck:
                component = new FUiGridCellCheck(this);
                break;

            case ERcComponent.GridCellNumber:
                component = new FUiGridCellNumber(this);
                break;

            case ERcComponent.GridCellText:
                component = new FUiGridCellText(this);
                break;

            case ERcComponent.GridRow:
                component = new FUiGridRow(this);
                break;

            case ERcComponent.GridColumn:
                component = new FUiLabel(this);
                break;

            case ERcComponent.GridColumnCheck:
                component = new FUiGridColumnCheck(this);
                break;

            case ERcComponent.GridColumnNumber:
                component = new FUiGridColumnNumber(this);
                break;

            case ERcComponent.GridColumnText:
                component = new FUiGridColumnText(this);
                break;

            case ERcComponent.GridView:
                component = new FUiGridView(this);
                break;

            case ERcComponent.Widget:
                component = new FUiWidget(this);
                break;

            case ERcComponent.Bar:
                component = new FUiBar(this);
                break;

            case ERcComponent.Form:
                component = new FUiForm(this);
                break;

            case ERcComponent.Table:
                component = new FUiTable(this);
                break;

            case ERcComponent.Window:
                component = new FUiWindow(this);
                break;
            }
            if (component == null)
            {
                throw new FFatalException("Unknown componment type. (type_name={1})", typeName);
            }
            return(component);
        }
예제 #21
0
        //============================================================
        // <T>根据类型名称创建界面组件。</T>
        //
        // @param typeName 类型名称
        //============================================================
        public FRcComponent CreateComponent(string typeName)
        {
            ERcComponent componentCd = REnum.ToValue <ERcComponent>(typeName);
            FRcComponent component   = null;

            // 创建对象
            switch (componentCd)
            {
            case ERcComponent.StaticLabel:
                component = new FRcStaticLabel(this);
                break;

            case ERcComponent.Label:
                component = new FRcLabel(this);
                break;

            case ERcComponent.Radio:
                component = new FRcRadio(this);
                break;

            case ERcComponent.Check:
                component = new FRcCheck(this);
                break;

            case ERcComponent.Number:
                component = new FRcNumber(this);
                break;

            case ERcComponent.Edit:
                component = new FRcEdit(this);
                break;

            case ERcComponent.RichEdit:
                component = new FRcRichEdit(this);
                break;

            case ERcComponent.Button:
                component = new FRcButton(this);
                break;

            case ERcComponent.Slider:
                component = new FRcSlider(this);
                break;

            case ERcComponent.ScrollBar:
                component = new FRcScrollBar(this);
                break;

            case ERcComponent.ProgressBar:
                component = new FRcProgressBar(this);
                break;

            case ERcComponent.Calendar:
                component = new FRcLabel(this);
                break;

            case ERcComponent.PictureBox:
                component = new FRcPictureBox(this);
                break;

            case ERcComponent.FontBox:
                component = new FRcFontBox(this);
                break;

            case ERcComponent.MovieBox:
                component = new FRcMovieBox(this);
                break;

            case ERcComponent.SlotItem:
                component = new FRcSlotItem(this);
                break;

            case ERcComponent.Slot:
                component = new FRcSlot(this);
                break;

            case ERcComponent.Panel:
                component = new FRcPanel(this);
                break;

            case ERcComponent.Page:
                component = new FRcPage(this);
                break;

            case ERcComponent.PageControl:
                component = new FRcPageControl(this);
                break;

            case ERcComponent.SelectItem:
                component = new FRcSelectItem(this);
                break;

            case ERcComponent.Select:
                component = new FRcSelect(this);
                break;

            case ERcComponent.MenuItem:
                component = new FRcMenuItem(this);
                break;

            case ERcComponent.Menu:
                component = new FRcMenu(this);
                break;

            case ERcComponent.ListItem:
                component = new FRcListItem(this);
                break;

            case ERcComponent.ListView:
                component = new FRcListView(this);
                break;

            case ERcComponent.TreeNodeType:
                component = new FRcTreeNodeType(this);
                break;

            case ERcComponent.TreeNodeLevel:
                component = new FRcTreeNodeLevel(this);
                break;

            case ERcComponent.TreeNode:
                component = new FRcTreeNode(this);
                break;

            case ERcComponent.TreeView:
                component = new FRcTreeView(this);
                break;

            case ERcComponent.GridCell:
                component = new FRcGridCell(this);
                break;

            case ERcComponent.GridCellCheck:
                component = new FRcGridCellCheck(this);
                break;

            case ERcComponent.GridCellNumber:
                component = new FRcGridCellNumber(this);
                break;

            case ERcComponent.GridCellText:
                component = new FRcGridCellText(this);
                break;

            case ERcComponent.GridRow:
                component = new FRcGridRow(this);
                break;

            case ERcComponent.GridColumn:
                component = new FRcLabel(this);
                break;

            case ERcComponent.GridColumnCheck:
                component = new FRcGridColumnCheck(this);
                break;

            case ERcComponent.GridColumnNumber:
                component = new FRcGridColumnNumber(this);
                break;

            case ERcComponent.GridColumnText:
                component = new FRcGridColumnText(this);
                break;

            case ERcComponent.GridView:
                component = new FRcGridView(this);
                break;

            case ERcComponent.Widget:
                component = new FRcWidget(this);
                break;

            case ERcComponent.Bar:
                component = new FRcBar(this);
                break;

            case ERcComponent.Form:
                component = new FRcForm(this);
                break;

            case ERcComponent.Table:
                component = new FRcTable(this);
                break;

            case ERcComponent.Window:
                component = new FRcWindow(this);
                break;
            }
            // 设置内容
            if (component != null)
            {
                component.LoadStyle();
            }
            else
            {
                throw new FFatalException("Unknown componment type. (type_name={1})", typeName);
            }
            // 返回对象
            return(component);
        }