Пример #1
0
        public virtual void Factor(ConceptUsecase useCase)
        {
            if (AboutWindow == null)
            {
                AboutWindow = new Vindow();
            }

            var splitViewBackend = useCase.SplitView.Backend.ToXwt();

            StatusLabel = new Label {
                HeightRequest = 20,
                Text          = "starting...",
                TextColor     = Colors.Black,
                TextAlignment = Alignment.Start,
            };

            var box = new VBox {
                Spacing = 2
            };

            box.PackStart(splitViewBackend, true);
            box.PackEnd(StatusLabel);

            (MainWindow.Backend as Window).Content = box;

            OnShow += () => (splitViewBackend as Paned).PositionFraction = 0.50;// WindowSize.Width / 2;
        }
Пример #2
0
        public void ShowQuadTree(IGraphScene <IVisual, IVisualEdge> scene)
        {
            var vindow = new Vindow {
                Size = new Size(800, 600)
            };
            var display = new VisualsDisplay();

            vindow.Content = display;

            var quadTreeVisualizer = new QuadTreeVisualizer();

            quadTreeVisualizer.VisualsDisplay = display;
            quadTreeVisualizer.Data           = (scene.SpatialIndex as VisualsQuadTreeIndex).GeoIndex;

            vindow.Show();
        }
Пример #3
0
        public ConceptUsecase CreateUseCase( )
        {
            var vindow = new Vindow();

            var mainform = vindow.Backend.ToSwf() as Form;

            Xwt.SwfBackend.SwfEngine.SwfApplicationContext.MainForm = mainform;

            Limaki.Iconerias.Iconery.Compose();
            mainform.Icon       = Limaki.View.Properties.GdiIconery.LimadaIcon;
            mainform.ClientSize = new System.Drawing.Size(800, 600);

            var backendComposer = new SwfConceptUseCaseComposer {
                MainWindow = vindow
            };

            var factory = new UsecaseFactory <ConceptUsecase>();

            factory.Composer        = new ConceptUsecaseComposer();
            factory.BackendComposer = backendComposer;

            var useCase = factory.Create();

            useCase.MainWindow = vindow;

            factory.Compose(useCase);

            backendComposer.FinalizeCompose?.Invoke();

            CallPlugins(factory, useCase);

            useCase.Start();

            if (useCase.ApplicationQuitted)
            {
                Application.Exit();
                Environment.Exit(0);
            }

            return(useCase);
        }
Пример #4
0
        public void ShowClipboardContent(ConceptUsecase useCase)
        {
            var vindow = new Vindow {
                Size = new Size(800, 600)
            };
            var textbox = new PlainTextBox();

            vindow.Content = textbox;
            var cbcontent = new StringBuilder();
            var data      = Clipboard.GetTransferData(Clipboard.GetTypesAvailable());

            foreach (var f in data.DataTypes)
            {
                cbcontent.AppendLine();
                cbcontent.AppendLine(f.Id);
                var ct   = data.GetValue(f);
                var text = ct as string;
                if (text != null)
                {
                    cbcontent.AppendLine(text);
                    continue;
                }
                var bytes = ct as byte [];
                if (bytes != null)
                {
                    for (var i = 0; i < bytes.Length; i++)
                    {
                        if (i % (4 * 8) == 0)
                        {
                            cbcontent.AppendLine();
                        }
                        cbcontent.Append($"{bytes[i]:N0} ");
                    }
                    continue;
                }
                cbcontent.AppendLine($"{(ct!=null?ct.GetType():null)}");
            }
            textbox.Text = cbcontent.ToString();
            vindow.Show();
        }
Пример #5
0
        public void ViewInWindow(IVidget vidget, Action onClose)
        {
            if (vidget != null)
            {
                var parent = SplitContainer.ParentWindow;
                var vindow = new Vindow();
                vindow.Content = vidget;
                var window = vindow.Backend as Window;

                window.Icon            = Iconerias.Iconery.SubWinIcon;
                window.InitialLocation = WindowLocation.Manual;
                window.Title           = Frontend.CurrentDisplay.Info.Name + " - *";
                // Decorated = false,
                window.Resizable    = true;
                window.Size         = new Size(parent.Size.Width / 3, parent.Size.Height / 3);
                window.TransientFor = parent;


                window.Location =
                    new Point(this.SplitContainer.ScreenBounds.X, this.SplitContainer.ScreenBounds.Y + (this.Size.Height - window.Height) / 2);

                Func <Point> calcOffset = () =>
                                          new Point(window.Location.X - parent.Location.X, window.Location.Y - parent.Location.Y);
                var offset       = calcOffset();
                var parentMoving = true;
                window.BoundsChanged += (s, e) => {
                    if (!parentMoving)
                    {
                        offset = calcOffset();
                    }
                };
                parent.BoundsChanged += (s, e) => {
                    parentMoving    = true;
                    window.Location = new Point(parent.Location.X + offset.X, parent.Location.Y + offset.Y);
                    parentMoving    = false;
                };
                window.Show();
                parentMoving = false;
            }
        }
        protected virtual IXwtBackendConceptUseCaseComposer CreateUseCase()
        {
            var vindow = new Vindow(new MainWindowBackend());

            var mainWindowBackend = vindow.Backend as MainWindowBackend;

            Iconerias.Iconery.Compose();
            mainWindowBackend.Icon    = Iconerias.Iconery.LimadaLogo;
            mainWindowBackend.Size    = new Size(800, 600);
            mainWindowBackend.Padding = 2;

            var backendComposer = Registry.Create <IXwtBackendConceptUseCaseComposer> ();

            backendComposer.MainWindow = vindow;

            var factory = new UsecaseFactory <ConceptUsecase> ();

            factory.Composer        = new ConceptUsecaseComposer();
            factory.BackendComposer = backendComposer;

            var useCase = factory.Create();

            useCase.MainWindow = vindow;

            factory.Compose(useCase);

            backendComposer.FinalizeCompose?.Invoke();

            CallPlugins(factory, useCase);

            useCase.Start();

            if (useCase.ApplicationQuitted)
            {
                Application.Exit();
            }
            return(backendComposer);
        }
Пример #7
0
        public void ShowFileExplorer(ConceptUsecase useCase)
        {
            var vindow = new Vindow {
                Size = new Size(800, 600)
            };
            var fileDisplay = new VisualsDisplay();

            vindow.Content = fileDisplay;

            var fileExplorer = new FileExplorerComposer();

            fileExplorer.ComposeDisplay(fileDisplay);
            fileExplorer.FileSelected = f => {
            };
            var docFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal);

            fileExplorer.FileFilter  = "*.limo";
            fileExplorer.ShowCurrent = true;
            fileExplorer.ShowDir(docFolder);

            fileDisplay.DataChanged();

            vindow.Show();
        }