/// <summary>
        /// Izvrsava se neposredno pre renderinga
        /// </summary>
        public override void resetContent()
        {
            base.resetContent();

            pageManager = new textPageManager <String>(this);
            pageManager.refresh(content);

            //setupFieldFormat("{0}", 10, 30);
            cursor.moveToCorner(textCursorZoneCorner.UpLeft);

            #region PAGINATED CONTENT DISPLAY

            var   items = pageManager.getPageElements(content);
            Int32 c     = 0;
            foreach (string it in items)
            {
                writeLine(it, -1, false);
                c++;
            }
            cursor.nextLine(pageManager.pageCapacaty - c);

            #endregion PAGINATED CONTENT DISPLAY

            // insertLine("[HOME] First page | [END] Last page");
            insertSplitLine();

            writeLine("[HOME][END][PgUp][PgDn] Page selection | Page ".add(pageManager.getPageString()), -1, false);

            cutSectionAtCursor();
        }
Пример #2
0
        public void setObject(Object __editorTarget)
        {
            editorTarget = __editorTarget;
            settingSpecs = new settingsEntriesForObject(editorTarget, true);

            menu.Remove(propertyMenuItems);

            propertyMenuItems.Clear();
            if (settingSpecs != null)
            {
                foreach (var _spec in settingSpecs.spes)
                {
                    aceMenuItem specItem = new aceMenuItem(_spec.Value.displayName, "", _spec.Value.description, "",
                                                           _spec.Value);
                    specItem.group = aceMenuItemGroup.mainItems;
                    propertyMenuItems.Add(specItem);
                    menu.setItem(specItem);
                }
            }
            menu.selected = menu.getFirstSafe() as aceMenuItem;

            menu.menuTitle = settingSpecs.targetType.Name + " variables";
            pageManager    = new textPageManager <aceMenuItem>(10);

            pageManager.refresh(menu);
        }
        public void refresh()
        {
            IEnumerable items = target.value as IEnumerable;

            menu = new aceMenu();

            menu.menuTitle       = "Inside " + target.pi.DeclaringType.Name + "->" + target.displayName + " collection";
            menu.menuDescription = "Collection type [" + target.pi.PropertyType.ToString() + "]";

            pageManager = new textPageManager <aceMenuItem>(10, 100, 1);

            itemSettings = null;

            Int32 c = 0;

            foreach (var t in items)
            {
                if (itemSettings == null)
                {
                    itemSettings = new settingsEntriesForObject(t);
                }
                var mi = new aceMenuItem(t.ToString(), c.ToString(), t.GetType().Name, "", t);
                menu.setItem(mi);
            }
        }
Пример #4
0
 public smartFilePathSelector(String __path, dialogSelectFileMode __mode, String __ext, int _height, int __width, int __leftRightMargin = 0, int __leftRightPadding = 0) : base(new aceMenu(), _height, __width, __leftRightMargin, __leftRightPadding)
 {
     path          = __path;
     selectMode    = __mode;
     extension     = __ext;
     margin.top    = 1;
     margin.bottom = 2;
     pageManager   = new textPageManager <aceMenuItem>();
     refresh();
 }
Пример #5
0
        /// <summary>
        /// Izvrsava se svaki put kad treba azurirati strukturu sadrzaja prema DataModel izvoru
        /// </summary>
        public void refresh()
        {
            if (String.IsNullOrEmpty(path))
            {
                path = "";
            }

            if (File.Exists(path))
            {
                filename = Path.GetFileName(path);
                path     = Path.GetDirectoryName(path);
            }

            files = new fileSystemList(path, selectMode, extension);

            menu = new aceMenu();

            switch (selectMode)
            {
            case dialogSelectFileMode.selectPath:
                menu.menuTitle = "Select directory path";
                //items.AddRange(Directory.EnumerateDirectories(path));
                break;

            case dialogSelectFileMode.selectFileToOpen:
                menu.menuTitle = "Select file to load (".add(files.pattern, " ").add(")", " ");
                //items.AddRange(Directory.EnumerateDirectories(path, "*", SearchOption.TopDirectoryOnly));
                //items.AddRange(Directory.EnumerateFiles(path, pattern, SearchOption.TopDirectoryOnly));
                break;

            case dialogSelectFileMode.selectFileToSave:
                menu.menuTitle = "Select file or type filename (*".add(extension, ".") + ")";
                //items.AddRange(Directory.EnumerateDirectories(path, "*", SearchOption.TopDirectoryOnly));
                //items.AddRange(Directory.EnumerateFiles(path, pattern, SearchOption.TopDirectoryOnly));
                break;
            }

            foreach (var di in files.directories)
            {
                String      nm       = "";
                aceMenuItem menuItem = null;
                if (files.rootDirectory.Parent != null)
                {
                    if (di.FullName == files.rootDirectory.Parent.FullName)
                    {
                        nm                = "..";
                        menuItem          = new aceMenuItem(nm, "", "<dir>", "<lock>", di);
                        menuItem.helpLine = "Move to parent";
                    }
                }

                if (files.rootDirectory != null)
                {
                    if (di.FullName == files.rootDirectory.FullName)
                    {
                        nm                = ".";
                        menuItem          = new aceMenuItem(nm, "", "<dir>", "<lock>", di);
                        menuItem.helpLine = "This directory";
                    }
                }

                if (String.IsNullOrEmpty(nm))
                {
                    nm                = di.FullName.Replace(files.rootDirectory.FullName, "");
                    menuItem          = new aceMenuItem(nm, "", "<dir>", "<lock>", di);
                    menuItem.helpLine = di.FullName;
                }

                menu.setItem(menuItem);

                //if (path == di.FullName)
                //{
                //    menu.selected = menuItem;
                //}
            }

            foreach (var di in files.files)
            {
                aceMenuItem menuItem = new aceMenuItem(di.Name, "", di.LastWriteTime.ToShortDateString(), "", di);
                menuItem.helpLine = di.FullName;
                menu.setItem(menuItem);

                //if (path == di.FullName)
                //{
                //    menu.selected = menuItem;
                //}
            }

            pageManager = new textPageManager <aceMenuItem>(10);
            pageManager.refresh(menu);
        }