Beispiel #1
0
        /// <summary>
        ///   creates control according to the type
        /// </summary>
        /// <param name = "commandType"></param>
        /// <param name = "mgControl"></param>
        /// <param name = "containerControl"></param>
        /// <returns></returns>
        private static LogicalControl createControl(CommandType commandType, GuiMgControl guiMgControl,
                                                    Control containerControl)
        {
            switch (commandType)
            {
            case CommandType.CREATE_LABEL:
                return(new LgLabel(guiMgControl, containerControl));

            case CommandType.CREATE_EDIT:
                return(new LgText(guiMgControl, containerControl));

            case CommandType.CREATE_LINE:
                return(new Line(guiMgControl, containerControl));

            case CommandType.CREATE_IMAGE:
                return(new LgImage(guiMgControl, containerControl));

            case CommandType.CREATE_BUTTON:
                if (guiMgControl.IsHyperTextButton())
                {
                    return(new LgLinkLabel(guiMgControl, containerControl));
                }
                else
                {
                    return(new LgButton(guiMgControl, containerControl));
                }

            case CommandType.CREATE_CHECK_BOX:
                return(new LgCheckBox(guiMgControl, containerControl));

            case CommandType.CREATE_RADIO_CONTAINER:
                return(new LgRadioContainer(guiMgControl, containerControl));

            case CommandType.CREATE_COMBO_BOX:
                return(new LgCombo(guiMgControl, containerControl));

            case CommandType.CREATE_RICH_EDIT:
            case CommandType.CREATE_RICH_TEXT:
                return(new LgRich(guiMgControl, containerControl));

            default:
                Debug.Assert(false);
                return(null);
            }
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="control"></param>
        internal override void setSpecificControlProperties(Control control)
        {
            MgControlType type = GuiMgControl.Type;

            ControlUtils.SetContentAlignment(control, ContentAlignment);
            if (Text != null)
            {
                GuiUtilsBase.setText(control, Text);
            }
            if (GuiMgControl.IsHyperTextButton())
            {
                MgLinkLabel mgLinkLabel = ((MgLinkLabel)control);

                mgLinkLabel.SetHoveringColor(HoveringFGColor, HoveringBGColor);
                mgLinkLabel.SetVisitedColor(VisitedFGColor, VisitedBGColor);
                mgLinkLabel.LinkVisited = Visited;
                mgLinkLabel.RefreshLinkColor();
            }
        }