Пример #1
0
        SelectableText(
            string data,
            TextSpan textSpan,
            Key key                             = null,
            FocusNode focusNode                 = null,
            TextStyle style                     = null,
            StrutStyle strutStyle               = null,
            TextAlign?textAlign                 = null,
            TextDirection?textDirection         = null,
            float?textScaleFactor               = null,
            bool showCursor                     = false,
            bool autofocus                      = false,
            ToolbarOptions toolbarOptions       = null,
            int?minLines                        = null,
            int?maxLines                        = null,
            float cursorWidth                   = 2.0f,
            Radius cursorRadius                 = null,
            Color cursorColor                   = null,
            DragStartBehavior dragStartBehavior = DragStartBehavior.start,
            bool enableInteractiveSelection     = true,
            GestureTapCallback onTap            = null,
            ScrollPhysics scrollPhysics         = null,
            TextWidthBasis?textWidthBasis       = null
            ) : base(key: key)
        {
            D.assert(maxLines == null || maxLines > 0);
            D.assert(minLines == null || minLines > 0);
            D.assert(
                (maxLines == null) || (minLines == null) || (maxLines >= minLines),
                () => "minLines can\'t be greater than maxLines"
                );
            toolbarOptions = toolbarOptions ??
                             new ToolbarOptions(
                selectAll: true,
                copy: true
                );

            this.data                       = data;
            this.textSpan                   = textSpan;
            this.focusNode                  = focusNode;
            this.style                      = style;
            this.strutStyle                 = strutStyle;
            this.textAlign                  = textAlign;
            this.textDirection              = textDirection;
            this.textScaleFactor            = textScaleFactor;
            this.showCursor                 = showCursor;
            this.autofocus                  = autofocus;
            this.toolbarOptions             = toolbarOptions;
            this.minLines                   = minLines;
            this.maxLines                   = maxLines;
            this.cursorWidth                = cursorWidth;
            this.cursorRadius               = cursorRadius;
            this.cursorColor                = cursorColor;
            this.dragStartBehavior          = dragStartBehavior;
            this.enableInteractiveSelection = enableInteractiveSelection;
            this.onTap                      = onTap;
            this.scrollPhysics              = scrollPhysics;
            this.textWidthBasis             = textWidthBasis;
        }
Пример #2
0
        public static SelectableText rich(
            TextSpan textSpan,
            Key key                             = null,
            FocusNode focusNode                 = null,
            TextStyle style                     = null,
            StrutStyle strutStyle               = null,
            TextAlign?textAlign                 = null,
            TextDirection?textDirection         = null,
            float?textScaleFactor               = null,
            bool showCursor                     = false,
            bool autofocus                      = false,
            ToolbarOptions toolbarOptions       = null,
            int?minLines                        = null,
            int?maxLines                        = null,
            float cursorWidth                   = 2.0f,
            Radius cursorRadius                 = null,
            Color cursorColor                   = null,
            DragStartBehavior dragStartBehavior = DragStartBehavior.start,
            bool enableInteractiveSelection     = true,
            GestureTapCallback onTap            = null,
            ScrollPhysics scrollPhysics         = null,
            TextWidthBasis?textWidthBasis       = null
            )
        {
            D.assert(
                textSpan != null,
                () => "A non-null TextSpan must be provided to a SelectableText.rich widget."
                );

            return(new SelectableText(
                       data: null,
                       textSpan: textSpan,
                       key: key,
                       focusNode: focusNode,
                       style: style,
                       strutStyle: strutStyle,
                       textAlign: textAlign,
                       textDirection: textDirection,
                       textScaleFactor: textScaleFactor,
                       showCursor: showCursor,
                       autofocus: autofocus,
                       toolbarOptions: toolbarOptions,
                       minLines: minLines,
                       maxLines: maxLines,
                       cursorWidth: cursorWidth,
                       cursorRadius: cursorRadius,
                       cursorColor: cursorColor,
                       dragStartBehavior: dragStartBehavior,
                       enableInteractiveSelection: enableInteractiveSelection,
                       onTap: onTap,
                       scrollPhysics: scrollPhysics,
                       textWidthBasis: textWidthBasis
                       ));
        }
Пример #3
0
    void Awake()
    {
        refurbishmentTab = controller.transform.FindChild ("RefurbishmentCTR").gameObject.GetComponent<Refurbishment>();
        staffMenu = GameObject.FindGameObjectWithTag ("StaffingController").GetComponent<StaffMenu> ();
        bankingTab = controller.transform.FindChild ("BankingController").gameObject.GetComponent<BankingReport>();
        emsTab = controller.transform.FindChild("EMSController").gameObject.GetComponent<EMSReport>();
        revenueManagementTab = controller.transform.FindChild("RevenueManagerCTR").GetComponent<RevenueManagement>();
        randomEvent = controller.transform.FindChild("EventController").GetComponent<RandomEvent>();
        rateSetup = controller.transform.FindChild("RatesSetUp").GetComponent<RatesSetup>();
        groupController = controller.transform.FindChild("GroupBooking").GetComponent<GroupBookController>();
        calendarController = controller.transform.FindChild("CalendarController").GetComponent<CalendarController>();
        feedbackController = controller.transform.FindChild("FeedBackController").GetComponent<FeedbackController>();
        dataProcessor = GameObject.Find("DataCollection").GetComponent<Serializer_Deserializer>();
        assetSwapper = controller.transform.FindChild("AssetController").GetComponent<AssetSwapper>();
        toolbar = GameObject.FindGameObjectWithTag("UI").transform.FindChild("OverWorld").GetComponent<ToolbarOptions>();
        adController = controller.transform.FindChild("AdvertController").gameObject.GetComponent<Advertisment>();

        SingletonCheck();
        if(monthlyReports == null){
            monthlyReports = new List<MonthlyReport>();//create list on first run.
        }
        //Ensure there's a log for this week (special case for 1st time run)
        if (receptionLogs == null) {
            receptionLogs = new List<ReceptionLog> ();
        }
        if(restaurantBooks == null){
            restaurantBooks = new List<RestaurantBook>();//create a new list on first run.
        }
        //Ensure there's a log for this week (special case for 1st time run)
        if (staffingLogs == null) {
            staffingLogs = new List<StaffingLog> ();
        }
        //create the log once.
        if(balanceSheets == null){
            balanceSheets = new List<BalanceSheet>();//create new balance sheet list on first run.
        }
        GenerateNewMonthReports ();
        firstGeneration = true;

        medianRoomCostWD = rateSetup.medianRoomCostWD;
        medianRoomCostWE = rateSetup.medianRoomCostWE;
    }
Пример #4
0
 public bool GetToolbarOptions(ref ToolbarOptions Options)
 {
     return(QuickLinkDotNet.QuickLinkAPI.GetToolbarOptions(ref Options));
 }
Пример #5
0
 public bool SetToolbarOptions(ToolbarOptions Options)
 {
     return(QuickLinkDotNet.QuickLinkAPI.SetToolbarOptions(Options));
 }
Пример #6
0
 public virtual void SetOptions(ToolbarOptions options)
 {
     Options = options;
     m_Transform.sizeDelta = new Vector2(options.Width, options.Height);
     m_Image.color         = new Color(options.R, options.G, options.B, 1.0f);
 }
Пример #7
0
 public override void SetOptions(ToolbarOptions options)
 {
     base.SetOptions(options);
     m_TextField.text         = options.Content;
     m_TextField.interactable = options.Interactable;
 }
Пример #8
0
        public CupertinoTextField(
            Key key = null,
            TextEditingController controller = null,
            FocusNode focusNode        = null,
            BoxDecoration decoration   = null,
            EdgeInsets padding         = null,
            string placeholder         = null,
            TextStyle placeholderStyle = null,
            Widget prefix = null,
            OverlayVisibilityMode prefixMode = OverlayVisibilityMode.always,
            Widget suffix = null,
            OverlayVisibilityMode suffixMode      = OverlayVisibilityMode.always,
            OverlayVisibilityMode clearButtonMode = OverlayVisibilityMode.never,
            TextInputType keyboardType            = null,
            TextInputAction?textInputAction       = null,
            TextCapitalization textCapitalization = TextCapitalization.none,
            TextStyle style       = null,
            StrutStyle strutStyle = null,
            TextAlign textAlign   = TextAlign.left,
            TextAlignVertical textAlignVertical = null,
            bool readOnly = false,
            ToolbarOptions toolbarOptions = null,
            bool?showCursor  = null,
            bool autofocus   = false,
            bool obscureText = false,
            bool autocorrect = true,
            SmartDashesType?smartDashesType = null,
            SmartQuotesType?smartQuotesType = null,
            bool enableSuggestions          = true,
            int?maxLines                              = 1,
            int?minLines                              = null,
            bool expands                              = false,
            int?maxLength                             = null,
            bool maxLengthEnforced                    = true,
            ValueChanged <string> onChanged           = null,
            VoidCallback onEditingComplete            = null,
            ValueChanged <string> onSubmitted         = null,
            List <TextInputFormatter> inputFormatters = null,
            bool?enabled                              = null,
            float cursorWidth                         = 2.0f,
            Radius cursorRadius                       = null,
            Color cursorColor                         = null,
            ui.BoxHeightStyle selectionHeightStyle    = ui.BoxHeightStyle.tight,
            ui.BoxWidthStyle selectionWidthStyle      = ui.BoxWidthStyle.tight,
            Brightness?keyboardAppearance             = null,
            EdgeInsets scrollPadding                  = null,
            DragStartBehavior dragStartBehavior       = DragStartBehavior.start,
            bool enableInteractiveSelection           = true,
            GestureTapCallback onTap                  = null,
            ScrollController scrollController         = null,
            ScrollPhysics scrollPhysics               = null
            ) : base(key: key)
        {
            this.smartDashesType = smartDashesType ?? (obscureText ? SmartDashesType.disabled : SmartDashesType.enabled);
            this.smartQuotesType = smartQuotesType ?? (obscureText ? SmartQuotesType.disabled : SmartQuotesType.enabled);
            D.assert(maxLines == null || maxLines > 0);
            D.assert(minLines == null || minLines > 0);
            D.assert(maxLines == null || minLines == null || maxLines >= minLines,
                     () => "minLines can't be greater than maxLines");
            D.assert(!expands || (maxLines == null && minLines == null),
                     () => "minLines and maxLines must be null when expands is true.");
            D.assert(maxLength == null || maxLength > 0);

            this.controller       = controller;
            this.focusNode        = focusNode;
            this.decoration       = decoration ?? CupertinoTextFieldUtils._kDefaultRoundedBorderDecoration;
            this.padding          = padding ?? EdgeInsets.all(6.0f);
            this.placeholder      = placeholder;
            this.placeholderStyle = placeholderStyle ?? new TextStyle(
                fontWeight: FontWeight.w400,
                color: CupertinoColors.placeholderText
                );
            this.prefix             = prefix;
            this.prefixMode         = prefixMode;
            this.suffix             = suffix;
            this.suffixMode         = suffixMode;
            this.clearButtonMode    = clearButtonMode;
            this.textInputAction    = textInputAction;
            this.textCapitalization = textCapitalization;
            this.style                      = style;
            this.strutStyle                 = strutStyle;
            this.textAlign                  = textAlign;
            this.textAlignVertical          = textAlignVertical;
            this.readOnly                   = readOnly;
            this.showCursor                 = showCursor;
            this.autofocus                  = autofocus;
            this.obscureText                = obscureText;
            this.autocorrect                = autocorrect;
            this.enableSuggestions          = enableSuggestions;
            this.maxLines                   = maxLines;
            this.minLines                   = minLines;
            this.expands                    = expands;
            this.maxLength                  = maxLength;
            this.maxLengthEnforced          = maxLengthEnforced;
            this.onChanged                  = onChanged;
            this.onEditingComplete          = onEditingComplete;
            this.onSubmitted                = onSubmitted;
            this.inputFormatters            = inputFormatters;
            this.enabled                    = enabled;
            this.cursorWidth                = cursorWidth;
            this.cursorRadius               = cursorRadius ?? Radius.circular(2.0f);
            this.cursorColor                = cursorColor;
            this.selectionHeightStyle       = selectionHeightStyle;
            this.selectionWidthStyle        = selectionWidthStyle;
            this.keyboardAppearance         = keyboardAppearance;
            this.scrollPadding              = scrollPadding ?? EdgeInsets.all(20.0f);
            this.dragStartBehavior          = dragStartBehavior;
            this.enableInteractiveSelection = enableInteractiveSelection;
            this.scrollPhysics              = scrollPhysics;
            this.onTap                      = onTap;
            this.scrollController           = scrollController;
            this.keyboardType               = keyboardType ?? (maxLines == 1 ? TextInputType.text : TextInputType.multiline);
            this.toolbarOptions             = toolbarOptions ?? (obscureText
                ? new ToolbarOptions(
                                                                     selectAll: true,
                                                                     paste: true
                                                                     )
                : new ToolbarOptions(
                                                                     copy: true,
                                                                     cut: true,
                                                                     selectAll: true,
                                                                     paste: true
                                                                     ));
        }
Пример #9
0
 public override void SetOptions(ToolbarOptions options)
 {
     base.SetOptions(options);
     m_Button.interactable = options.Interactable;
     m_Button.GetComponentInChildren <TextMeshProUGUI>().text = options.Content;
 }
Пример #10
0
 public override void SetOptions(ToolbarOptions options)
 {
     base.SetOptions(options);
     StartCoroutine(GetTexture(options.Content, new Vector2(options.Width, options.Height)));
 }
Пример #11
0
        public TextField(Key key = null,
                         TextEditingController controller = null,
                         FocusNode focusNode                   = null,
                         InputDecoration decoration            = null,
                         bool noDecoration                     = false,
                         TextInputType keyboardType            = null,
                         TextInputAction?textInputAction       = null,
                         TextCapitalization textCapitalization = TextCapitalization.none,
                         TextStyle style       = null,
                         StrutStyle strutStyle = null,
                         TextAlign textAlign   = TextAlign.left,
                         TextAlignVertical textAlignVertical = null,
                         TextDirection textDirection         = TextDirection.ltr,
                         bool readOnly = false,
                         ToolbarOptions toolbarOptions = null,
                         bool?showCursor  = null,
                         bool autofocus   = false,
                         bool obscureText = false,
                         bool autocorrect = false,
                         SmartDashesType?smartDashesType = null,
                         SmartQuotesType?smartQuotesType = null,
                         bool enableSuggestions          = true,
                         int?maxLines                              = 1,
                         int?minLines                              = null,
                         bool expands                              = false,
                         int?maxLength                             = null,
                         bool maxLengthEnforced                    = true,
                         ValueChanged <string> onChanged           = null,
                         VoidCallback onEditingComplete            = null,
                         ValueChanged <string> onSubmitted         = null,
                         List <TextInputFormatter> inputFormatters = null,
                         bool?enabled                              = null,
                         float?cursorWidth                         = 2.0f,
                         Radius cursorRadius                       = null,
                         Color cursorColor                         = null,
                         BoxHeightStyle selectionHeightStyle       = BoxHeightStyle.tight,
                         BoxWidthStyle selectionWidthStyle         = BoxWidthStyle.tight,
                         Brightness?keyboardAppearance             = null,
                         EdgeInsets scrollPadding                  = null,
                         DragStartBehavior dragStartBehavior       = DragStartBehavior.start,
                         bool enableInteractiveSelection           = true,
                         GestureTapCallback onTap                  = null,
                         InputCounterWidgetBuilder buildCounter    = null,
                         ScrollController scrollController         = null,
                         ScrollPhysics scrollPhysics               = null
                         ) : base(key: key)
        {
            D.assert(maxLines == null || maxLines > 0);
            D.assert(minLines == null || minLines > 0);
            D.assert((maxLines == null) || (minLines == null) || (maxLines >= minLines),
                     () => "minLines can't be greater than maxLines");
            D.assert(!expands || (maxLines == null && minLines == null),
                     () => "minLines and maxLines must be null when expands is true.");
            D.assert(maxLength == null || maxLength == noMaxLength || maxLength > 0);
            D.assert(!obscureText || maxLines == 1, () => "Obscured fields cannot be multiline.");

            this.smartDashesType =
                smartDashesType ?? (obscureText ? SmartDashesType.disabled : SmartDashesType.enabled);
            this.smartQuotesType =
                smartQuotesType ?? (obscureText ? SmartQuotesType.disabled : SmartQuotesType.enabled);

            this.controller         = controller;
            this.focusNode          = focusNode;
            this.decoration         = noDecoration ? null : (decoration ?? new InputDecoration());
            this.textInputAction    = textInputAction;
            this.textCapitalization = textCapitalization;
            this.style                      = style;
            this.strutStyle                 = strutStyle;
            this.textAlign                  = textAlign;
            this.textAlignVertical          = textAlignVertical;
            this.textDirection              = textDirection;
            this.readOnly                   = readOnly;
            this.showCursor                 = showCursor;
            this.autofocus                  = autofocus;
            this.obscureText                = obscureText;
            this.autocorrect                = autocorrect;
            this.enableSuggestions          = enableSuggestions;
            this.maxLines                   = maxLines;
            this.minLines                   = minLines;
            this.expands                    = expands;
            this.maxLength                  = maxLength;
            this.maxLengthEnforced          = maxLengthEnforced;
            this.onChanged                  = onChanged;
            this.onEditingComplete          = onEditingComplete;
            this.onSubmitted                = onSubmitted;
            this.inputFormatters            = inputFormatters;
            this.enabled                    = enabled;
            this.cursorWidth                = cursorWidth;
            this.cursorColor                = cursorColor;
            this.selectionHeightStyle       = selectionHeightStyle;
            this.selectionWidthStyle        = selectionWidthStyle;
            this.cursorRadius               = cursorRadius;
            this.onSubmitted                = onSubmitted;
            this.keyboardAppearance         = keyboardAppearance;
            this.enableInteractiveSelection = enableInteractiveSelection;
            this.onTap                      = onTap;
            this.keyboardType               = keyboardType ?? (maxLines == 1 ? TextInputType.text : TextInputType.multiline);
            this.toolbarOptions             = toolbarOptions ?? (obscureText
                                      ? new ToolbarOptions(
                                                                     selectAll: true,
                                                                     paste: true
                                                                     )
                                      : new ToolbarOptions(
                                                                     copy: true,
                                                                     cut: true,
                                                                     selectAll: true,
                                                                     paste: true
                                                                     ));

            this.scrollPadding              = scrollPadding ?? EdgeInsets.all(20.0f);
            this.dragStartBehavior          = dragStartBehavior;
            this.enableInteractiveSelection = enableInteractiveSelection;
            this.buildCounter     = buildCounter;
            this.scrollPhysics    = scrollPhysics;
            this.scrollController = scrollController;
        }
Пример #12
0
        public TextFormField(
            Key key = null,
            TextEditingController controller = null,
            string initialValue                   = null,
            FocusNode focusNode                   = null,
            InputDecoration decoration            = null,
            TextInputType keyboardType            = null,
            TextCapitalization textCapitalization = TextCapitalization.none,
            TextInputAction?textInputAction       = null,
            TextStyle style                     = null,
            StrutStyle strutStyle               = null,
            TextDirection?textDirection         = null,
            TextAlign textAlign                 = TextAlign.left,
            TextAlignVertical textAlignVertical = null,
            bool autofocus = false,
            bool readOnly  = false,
            ToolbarOptions toolbarOptions = null,
            bool?showCursor  = null,
            bool obscureText = false,
            bool autocorrect = true,
            SmartDashesType?smartDashesType = null,
            SmartQuotesType?smartQuotesType = null,
            bool enableSuggestions          = true,
            bool autovalidate                         = false,
            bool maxLengthEnforced                    = true,
            int?maxLines                              = 1,
            int?minLines                              = null,
            bool expands                              = false,
            int?maxLength                             = null,
            ValueChanged <string> onChanged           = null,
            GestureTapCallback onTap                  = null,
            VoidCallback onEditingComplete            = null,
            ValueChanged <string> onFieldSubmitted    = null,
            FormFieldSetter <string> onSaved          = null,
            FormFieldValidator <string> validator     = null,
            List <TextInputFormatter> inputFormatters = null,
            bool enabled                              = true,
            float cursorWidth                         = 2.0f,
            Radius cursorRadius                       = null,
            Color cursorColor                         = null,
            Brightness?keyboardAppearance             = null,
            EdgeInsets scrollPadding                  = null,
            bool enableInteractiveSelection           = true,
            InputCounterWidgetBuilder buildCounter    = null,
            ScrollPhysics scrollPhysics               = null
            ) : base(
                key: key,
                initialValue: controller != null ? controller.text : (initialValue ?? ""),
                onSaved: onSaved,
                validator: validator,
                autovalidate: autovalidate,
                enabled: enabled,
                builder: (FormFieldState <string> field) => {
            _TextFormFieldState state           = (_TextFormFieldState)field;
            InputDecoration effectiveDecoration = (decoration ?? new InputDecoration())
                                                  .applyDefaults(Theme.of(field.context).inputDecorationTheme);

            void onChangedHandler(string value)
            {
                if (onChanged != null)
                {
                    onChanged(value);
                }

                field.didChange(value);
            }

            return(new TextField(
                       controller: state._effectiveController,
                       focusNode: focusNode,
                       decoration: effectiveDecoration.copyWith(errorText: field.errorText),
                       keyboardType: keyboardType,
                       textInputAction: textInputAction,
                       style: style,
                       strutStyle: strutStyle,
                       textAlign: textAlign,
                       textAlignVertical: textAlignVertical,
                       textDirection: textDirection ?? TextDirection.ltr,
                       textCapitalization: textCapitalization,
                       autofocus: autofocus,
                       toolbarOptions: toolbarOptions,
                       readOnly: readOnly,
                       showCursor: showCursor,
                       obscureText: obscureText,
                       autocorrect: autocorrect,
                       smartDashesType: smartDashesType ??
                       (obscureText ? SmartDashesType.disabled : SmartDashesType.enabled),
                       smartQuotesType: smartQuotesType ??
                       (obscureText ? SmartQuotesType.disabled : SmartQuotesType.enabled),
                       enableSuggestions: enableSuggestions,
                       maxLengthEnforced: maxLengthEnforced,
                       maxLines: maxLines,
                       minLines: minLines,
                       expands: expands,
                       maxLength: maxLength,
                       onChanged: onChangedHandler,
                       onTap: onTap,
                       onEditingComplete: onEditingComplete,
                       onSubmitted: onFieldSubmitted,
                       inputFormatters: inputFormatters,
                       enabled: enabled,
                       cursorWidth: cursorWidth,
                       cursorRadius: cursorRadius,
                       cursorColor: cursorColor,
                       scrollPadding: scrollPadding ?? EdgeInsets.all(20.0f),
                       scrollPhysics: scrollPhysics,
                       keyboardAppearance: keyboardAppearance,
                       enableInteractiveSelection: enableInteractiveSelection,
                       buildCounter: buildCounter
                       ));
        }
                ) {
            D.assert(initialValue == null || controller == null);
            D.assert(maxLines > 0);
            D.assert(maxLines == null || maxLines > 0);
            D.assert(minLines == null || minLines > 0);
            D.assert((maxLines == null) || (minLines == null) || (maxLines >= minLines),
                     () => "minLines can't be greater than maxLines");
            D.assert(!expands || (maxLines == null && minLines == null),
                     () => "minLines and maxLines must be null when expands is true.");
            D.assert(!obscureText || maxLines == 1, () => "Obscured fields cannot be multiline.");
            D.assert(maxLength == null || maxLength > 0);
            this.controller = controller;
        }