Beispiel #1
0
        /// <summary>
        /// CTOR
        /// </summary>
        static Manager()
        {
            _fontsTable  = new FontsTable();
            _colorsTable = new ColorsTable();

            MenuManager = new MenuManager();

            TextMaskEditor = new TextMaskEditor();

            UtilImeJpn = (UtilStrByteMode.isLocaleDefLangJPN()
                         ? new UtilImeJpn()
                         : null);

            ImageUtils.ImageLoader = new ImageLoader();
        }
Beispiel #2
0
        /// <summary>
        ///   CTOR
        /// </summary>
        private EnvControlsPersistencyPath()
        {
#if PocketPC
            _defaultPath = OSEnvironment.getAssemblyFolder();
#else
            //1.	If the path is not defined (default) then the files will be created in the (same folder as the form state persistency file.)
            //•	In xp: C:\Documents and Settings\<user>\Application Data\MSE\<APP GUI ID>\
            //•	In Win 7 and Win 8:  C:\Users\<user>\AppData\Roaming\MSE\<APP GUI ID>
            _defaultPath = OSEnvironment.get("APPDATA")
                           + Path.DirectorySeparatorChar
                           + (UtilStrByteMode.isLocaleDefLangJPN()
                          ? "MSJ"
                          : "MSE")
                           + Path.DirectorySeparatorChar;
#endif
        }
Beispiel #3
0
        /// <summary>
        /// compute range  values of the fields
        /// </summary>
        /// <returns></returns>
        internal RangeData ComputeRangeData()
        {
            //tsk_vee_rng
            RangeData rangeData = new RangeData()
            {
                FieldIndex = IndexInView
            };

            Range.compute(false);

            //check this :
            char maxChar = UtilStrByteMode.isLocaleDefLangJPN() ? (char)0xFFEE : (char)0x7FFF;

            rangeData.Min = BuildBoundaryValue(Range.hasMinExp(), Range.MaxEqualsMin, Range.MinExpVal, Char.MinValue, Range.DiscardMin);
            rangeData.Max = BuildBoundaryValue(Range.hasMaxExp(), Range.MaxEqualsMin, Range.MaxExpVal, maxChar, Range.DiscardMax);
            return(rangeData);
        }
Beispiel #4
0
        /// <summary>
        ///   CTOR
        /// </summary>
        private FormUserState()
        {
            IsDisabled = false;

#if PocketPC
            _dirPath = OSEnvironment.getAssemblyFolder();
#else
            _dirPath = OSEnvironment.get("APPDATA")
                       + Path.DirectorySeparatorChar
                       + (UtilStrByteMode.isLocaleDefLangJPN()
                          ? "MSJ"
                          : "MSE")
                       + Path.DirectorySeparatorChar
                       + Manager.Environment.GetGUID()
                       + Path.DirectorySeparatorChar;
#endif
        }
Beispiel #5
0
        /// <summary>
        /// compute locate values of the fields
        /// </summary>
        /// <returns></returns>
        internal RangeData ComputeLocateData()
        {
            RangeData locateData = new RangeData()
            {
                FieldIndex = IndexInView
            };

            // Compute of locate should search for the range of data only if it done on the main datasource and not for link.
            // Locate on link is actually a range.
            Locate.compute(!IsLink);

            //check this :
            char maxChar = UtilStrByteMode.isLocaleDefLangJPN() ? (char)0xFFEE : (char)0x7FFF;

            locateData.Min = BuildBoundaryValue(Locate.hasMinExp(), Locate.MaxEqualsMin, Locate.MinExpVal, Char.MinValue, Locate.DiscardMin);
            locateData.Max = BuildBoundaryValue(Locate.hasMaxExp(), Locate.MaxEqualsMin, Locate.MaxExpVal, maxChar, Locate.DiscardMax);
            return(locateData);
        }
Beispiel #6
0
        /// <summary>
        ///   select all the text in the control, but do it immediately using guiInteractive (not the queue).
        /// </summary>
        /// <param name = "ctrl"> </param>
        public static void SetSelect(MgControlBase ctrl)
        {
            if (ctrl.isTextOrTreeEdit())
            {
                // if the control is modifiable, select the whole text in the control,
                // otherwise, unselect all.
                if (ctrl.isModifiable())
                {
                    PIC pic = ctrl.getPIC();
                    if ((UtilStrByteMode.isLocaleDefLangJPN() && !pic.isAttrBlob() && pic.getMaskChars() > 0 && !ctrl.isMultiline()) ||
                        (pic.isAttrDateOrTime() && ctrl.isAllBlanks(ctrl.Value)))
                    {
                        String strText  = ctrl.Value;
                        int    startPos = 0;
                        int    endPos   = strText.Length;

                        while (startPos < endPos)
                        {
                            if (strText[startPos] == ' ')
                            {
                                break;
                            }
                            else
                            {
                                if (!charIsMask(pic, strText, startPos))
                                {
                                    break;
                                }
                            }
                            startPos++;
                        }

                        while (startPos < endPos)
                        {
                            if (strText[endPos - 1] != ' ')
                            {
                                if (!charIsMask(pic, strText, endPos - 1))
                                {
                                    break;
                                }
                            }
                            endPos--;
                        }

                        SetSelection(ctrl, 0, 0, 0); // Cancel the selection to prevent the caret moving to the end of the field.
                        if (endPos != 0)
                        {
                            SetSelection(ctrl, startPos, endPos, 0); // Select the input text exclude the mask characters.
                        }
                    }
                    else
                    {
                        SetSelection(ctrl, 0, -1, -1);
                    }
                }
                else
                {
                    SetSelection(ctrl, 0, 0, 0);
                }
            }
        }