Ejemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="cc">Object for holding any displayed dialogs</param>
 /// <param name="action">The action that initiated this command</param>
 /// <param name="start">Point initially selected at start of command</param>
 internal NewLineUI(IControlContainer cc, IUserAction action, PointFeature start)
     : base(cc, action)
 {
     m_Start        = start;
     m_End          = null;
     m_CurrentPoint = start;
 }
Ejemplo n.º 2
0
        private static IFilter[] GetFilters(IConfiguration configuration, bool dim, IControlContainer container)
        {
            var arr = new List <IFilter>();

            if (dim && Installer.RootHasPermission())
            {
                arr.Add(new PowerFilter(container, Display.Instance(container)));
            }
            else if (dim && !Installer.RootHasPermission())
            {
                Console.Error.WriteLine(
                    "Root doesn't have permission to see your DPMS state, to give it permission run as your user: xhost si:localuser:root");
            }

            foreach (var setting in configuration.GetChildren())
            {
                switch (setting.Value)
                {
                case "WashedOut":
                    arr.Add(new WashedOut());
                    break;

                case "BlackWhite":
                    arr.Add(new BlackWhite());
                    break;

                default:
                    ParseError("Filters",
                               "Filter contains an invalid filter. Please check your spelling and try again.");
                    break;
                }
            }

            return(arr.ToArray());
        }
Ejemplo n.º 3
0
 public static TextGrid AddActionGrid(this IControlContainer container, float x, float y, int gridWidth, Action <Control, UpdateParameters> action, IEnumerable <string> options, int fontIndex = 0)
 => container.AddControlPassThrough(new TextGrid(container, x, y, gridWidth, options)
 {
     Action     = action,
     SelectMode = SelectMode.None,
     FontIndex  = fontIndex,
 });
Ejemplo n.º 4
0
 private Display(IControlContainer container) : base(container)
 {
     UpdateMode = Mode.PercentageSmooth;
     Container.RegisterActiveMonitor(this);
     _lastUpdate  = DateTime.Now;
     _lastReading = 100D;
 }
Ejemplo n.º 5
0
    public TeamSelectionWindow(Action <Team?> action, IControlContainer container, Texture2D santaPicture, Texture2D krampusPicture)
        : base(container, 0, 0, 960, 800)
    {
        Action = action;

        BackgroundDrawingMode = BackgroundDrawingMode.None;

        this.AddLabel(0, 0, "Choose your team!", 5, Color.Yellow, strokeSize: 3);
        var labelSize = MeasureString("Choose your team!", 5) + new Vector2(3, 3);

        Height = labelSize.Y + 500;
        Width  = labelSize.X;
        var selectionPanel = this.AddStackPanel(0, 0, labelSize.X, 320, BackgroundDrawingMode.None, padding: (int)labelSize.X - 576);

        santaWindow   = selectionPanel.AddPanel(0, 0, 288, 288);
        krampusWindow = selectionPanel.AddPanel(0, 0, 288, 288);

        santaWindow.AddPicture(5, 5, santaPicture, 14);
        santaLabel = santaWindow.AddLabel(1, 232, "Nicholas", 6, hightlightOnHover: true);

        krampusWindow.AddPicture(5, 5, krampusPicture, 14);
        krampusLabel = krampusWindow.AddLabel(1, 257, "Krampus", 4, hightlightOnHover: true);

        var button = this.AddButton(0, 0, "Back", (_, __) => Action.Invoke(null), 1);

        button.BackgroundDrawingMode = BackgroundDrawingMode.Texture;
        button.LabelOffset           = new(7, 4);
    }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="cc">Object for holding any displayed dialogs</param>
 /// <param name="action">The action that initiated this command</param>
 /// <param name="start">Point initially selected at start of command</param>
 internal NewLineUI(IControlContainer cc, IUserAction action, PointFeature start)
     : base(cc, action)
 {
     m_Start = start;
     m_End = null;
     m_CurrentPoint = start;
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Creates new <c>CommandUI</c> for use during an editing update. This doesn't refer to
        /// the UpdateUI itself, it refers to a command that is the subject of the update.
        /// </summary>
        /// <param name="editId">The ID of the edit this command deals with.</param>
        /// <param name="updcmd">The update command (not null) that is controlling this command.</param>
        protected CommandUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
        {
            if (updcmd == null)
            {
                throw new ArgumentNullException();
            }

            m_Container = cc;
            m_EditId    = editId;
            m_UpdCmd    = updcmd;
            m_Draw      = updcmd.ActiveDisplay;
            //m_Update = updcmd.SelectedObject;
            m_Recall = null;

            /*
             * this.Update = update;
             *
             * if (update==null)
             * {
             *  m_Draw = EditingController.Current.ActiveDisplay;
             *  m_Recall = null;
             * }
             */

            Debug.Assert(m_Draw != null);
        }
Ejemplo n.º 8
0
 public Monitor(IControlContainer container, IConfiguration configuration) : base(container)
 {
     _monitorConfiguration = configuration == null
         ? new MonitorConfiguration()
         : configuration.GetSection("Monitor").Get <MonitorConfiguration>();
     Init(container);
 }
Ejemplo n.º 9
0
        private void openForm(Control form, bool modal = false)
        {
            if (!modal)
            {
                using (new WaitCursor())
                {
                    IControlContainer cc = mainForm as IControlContainer;
                    if (typeof(Form).IsAssignableFrom(form.GetType()))
                    {
                        ((Form)form).TopLevel        = false;
                        ((Form)form).FormBorderStyle = FormBorderStyle.None;
                        //((Form)form).WindowState = FormWindowState.Maximized;
                        var rec = cc.GetClientRectagle();
                        ((Form)form).Location = new System.Drawing.Point(0, 0);
                        ((Form)form).Size     = new System.Drawing.Size(rec.Width, rec.Height);
                        ((Form)form).Dock     = DockStyle.Fill;
                    }


                    if (cc != null)
                    {
                        var col = cc.GetControlCollection();
                        int idx = col.Add(form);
                        //((Control)form).Show();
                    }
                }
            }
            else
            {
                ((Form)form).StartPosition = FormStartPosition.CenterParent;
                lastDialogResult           = ((Form)form).ShowDialog();
            }
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="cc">Object for holding any displayed dialogs</param>
 /// <param name="action">The action that initiated this command</param>
 /// <param name="start">Point initially selected at start of command</param>
 internal NewCircularArcUI(IControlContainer cc, IUserAction action, PointFeature start)
     : base(cc, action, start)
 {
     m_IsShortArc = true;
     m_Circles = null;
     m_NewArcCircle = null;
     m_Geom = null;
 }
Ejemplo n.º 11
0
        /// <summary>
        /// Creates a new <c>MoveTextUI</c>
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        /// <param name="text">The text to move (not null)</param>
        internal MoveTextUI(IControlContainer cc, IUserAction action, TextFeature text)
            : base(cc, action)
        {
            if (text == null)
                throw new ArgumentNullException();

            m_Text = text;
        }
Ejemplo n.º 12
0
 public void ShowInContainer(IControlContainer viewContainer, GVControlAlign align)
 {
     ViewContainer = viewContainer;
     if (viewContainer != null)
     {
         viewContainer.AddControl(this, align);
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="cc">Object for holding any displayed dialogs</param>
 /// <param name="action">The action that initiated this command</param>
 /// <param name="start">Point initially selected at start of command</param>
 internal NewCircularArcUI(IControlContainer cc, IUserAction action, PointFeature start)
     : base(cc, action, start)
 {
     m_IsShortArc   = true;
     m_Circles      = null;
     m_NewArcCircle = null;
     m_Geom         = null;
 }
Ejemplo n.º 14
0
        public MenuItem(IControlContainer owner)
        {
            Owner   = owner;
            Height  = 1;
            TabStop = true;

            FocusBackgroundColor = ConsoleColor.Red;
            FocusForegroundColor = ConsoleColor.White;
        }
Ejemplo n.º 15
0
        public MenuItem(IControlContainer owner)
        {
            Owner = owner;
            Height = 1;
            TabStop = true;

            FocusBackgroundColor = ConsoleColor.Red;
            FocusForegroundColor = ConsoleColor.White;
        }
Ejemplo n.º 16
0
 private static IMonitor MonitorFromBreakpoint(IControlContainer container, Breakpoints p)
 {
     return(p.Name switch
     {
         Name.Cpu => Cpu.Instance(container),
         Name.Memory => Memory.Instance(container),
         Name.Disk => Disk.Instance(container),
         _ => throw new Exception($"Unable to location monitor for {p.Name}")
     });
Ejemplo n.º 17
0
 /// <summary>
 /// Creates a new <c>AddLabelUI</c>
 /// </summary>
 /// <param name="cc">The container for any dialogs</param>
 /// <param name="action">The action that initiated this command</param>
 protected AddLabelUI(IControlContainer cc, IUserAction action)
     : base(cc, action)
 {
     m_Entity = null;
     m_Width = 0.0;
     m_Height = 0.0;
     m_LastPos = null;
     m_Rotation = CadastralMapModel.Current.DefaultTextRotation;
 }
Ejemplo n.º 18
0
 public static Label AddActionLabel(this IControlContainer container, float x, float y, string text, Action <Control, UpdateParameters>?action, int fontIndex = 0)
 => container.AddControlPassThrough(new Label(container, x, y)
 {
     Text             = text,
     Action           = action,
     FontIndex        = fontIndex,
     HighlightOnHover = true,
     Enabled          = action != null,
 });
Ejemplo n.º 19
0
        /// <summary>
        /// Constructor for a new line subdivision.
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        /// <exception cref="InvalidOperationException">If a specific line is not currently selected</exception>
        internal LineSubdivisionUI(IControlContainer cc, IUserAction action)
            : base(cc, action)
        {
            LineFeature selLine = EditingController.SelectedLine;
            if (selLine == null)
                throw new InvalidOperationException("You must initially select the line you want to subdivide.");

            m_Parent = selLine;
        }
Ejemplo n.º 20
0
 /// <summary>
 /// Creates a new <c>AddLabelUI</c>
 /// </summary>
 /// <param name="cc">The container for any dialogs</param>
 /// <param name="action">The action that initiated this command</param>
 protected AddLabelUI(IControlContainer cc, IUserAction action)
     : base(cc, action)
 {
     m_Entity   = null;
     m_Width    = 0.0;
     m_Height   = 0.0;
     m_LastPos  = null;
     m_Rotation = CadastralMapModel.Current.DefaultTextRotation;
 }
        /// <summary>
        /// Creates a new <c>MovePolygonPositionUI</c>
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        /// <param name="text">The text to move (not null)</param>
        internal MovePolygonPositionUI(IControlContainer cc, IUserAction action, TextFeature text)
            : base(cc, action)
        {
            if (text == null)
                throw new ArgumentNullException();

            m_Text = text;
            m_LastPolygon = m_Text.Container;
        }
        /// <summary>
        /// Constructor to subdivide the currently selected line.
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        internal SimpleLineSubdivisionUI(IControlContainer cc, IUserAction action)
            : base(cc, action)
        {
            LineFeature line = EditingController.SelectedLine;
            if (line == null)
                throw new InvalidOperationException("You must initially select the line you want to subdivide.");

            SetInitialValues();
            m_Line = line;
        }
Ejemplo n.º 23
0
 public static Label AddLabel(this IControlContainer container, string text, float x = 0, float y = 0, int fontIndex = 0, Color?color = null, int strokeSize = 0, Color?strokeColor = null, bool hightlightOnHover = false)
 => container.AddControlPassThrough(new Label(container, x, y)
 {
     Text             = text,
     FontIndex        = fontIndex,
     TextColor        = color,
     StrokeSize       = strokeSize,
     StrokeColor      = strokeColor ?? container.Theme.TextBorderColor,
     HighlightOnHover = hightlightOnHover,
 });
Ejemplo n.º 24
0
        /// <summary>
        /// Creates a new <c>MoveTextUI</c>
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        /// <param name="text">The text to move (not null)</param>
        internal MoveTextUI(IControlContainer cc, IUserAction action, TextFeature text)
            : base(cc, action)
        {
            if (text == null)
            {
                throw new ArgumentNullException();
            }

            m_Text = text;
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Constructor for doing an update.
        /// </summary>
        /// <param name="editId">The ID of the edit this command deals with.</param>
        /// <param name="updcmd">The update command.</param>
        internal LineSubdivisionUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
            : base(cc, editId, updcmd)
        {
            // The dialog will be created by Run()
            m_Dialog = null;
            m_UpDial = null;

            // The line being subdivided is known via the update.
            m_Parent = null;
        }
Ejemplo n.º 26
0
        /// <summary>
        /// Constructor for performing a sideshot from the currently selected point.
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        /// <exception cref="InvalidOperationException">If a specific point is not currently selected</exception>
        internal RadialUI(IControlContainer cc, IUserAction action)
            : base(cc, action)
        {
            PointFeature from = EditingController.SelectedPoint;
            if (from == null)
                throw new InvalidOperationException("You must initially select the point the sideshot radiates from.");

            m_Dialog = null;
            m_From = from;
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Constructor for doing an update.
        /// </summary>
        /// <param name="editId">The ID of the edit this command deals with.</param>
        /// <param name="updcmd">The update command.</param>
        internal LineSubdivisionUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
            : base(cc, editId, updcmd)
        {
            // The dialog will be created by Run()
            m_Dialog = null;
            m_UpDial = null;

            // The line being subdivided is known via the update.
            m_Parent = null;
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Creates a new <c>MovePolygonPositionUI</c>
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        /// <param name="text">The text to move (not null)</param>
        internal MovePolygonPositionUI(IControlContainer cc, IUserAction action, TextFeature text)
            : base(cc, action)
        {
            if (text == null)
            {
                throw new ArgumentNullException();
            }

            m_Text        = text;
            m_LastPolygon = m_Text.Container;
        }
Ejemplo n.º 29
0
        public MenuBar(IControlContainer owner)
        {
            Owner   = owner;
            Height  = 1;
            TabStop = true;

            FocusBackgroundColor = ConsoleColor.Black;
            FocusForegroundColor = ConsoleColor.Gray;
            ForegroundColor      = ConsoleColor.Black;
            BackgroundColor      = ConsoleColor.Gray;
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Creates a new <c>NewTextUI</c>
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        internal NewTextUI(IControlContainer cc, IUserAction action)
            : base(cc, action)
        {
            m_NewText = String.Empty;

            // Get the map's current rotation angle to see if we are
            // adding horizontal text or not. Remember the value so that
            // we can restore it when the command finishes.
            m_Rotation     = CadastralMapModel.Current.DefaultTextRotation;
            m_IsHorizontal = (Math.Abs(m_Rotation) < MathConstants.TINY);
        }
Ejemplo n.º 31
0
        public MenuBar(IControlContainer owner)
        {
            Owner = owner;
            Height = 1;
            TabStop = true;

            FocusBackgroundColor = ConsoleColor.Black;
            FocusForegroundColor = ConsoleColor.Gray;
            ForegroundColor = ConsoleColor.Black;
            BackgroundColor = ConsoleColor.Gray;
        }
Ejemplo n.º 32
0
        /// <summary>
        /// Creates a new <c>NewTextUI</c>
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        internal NewTextUI(IControlContainer cc, IUserAction action)
            : base(cc, action)
        {
            m_NewText = String.Empty;

            // Get the map's current rotation angle to see if we are
            // adding horizontal text or not. Remember the value so that
            // we can restore it when the command finishes.
            m_Rotation = CadastralMapModel.Current.DefaultTextRotation;
            m_IsHorizontal = (Math.Abs(m_Rotation) < MathConstants.TINY);
        }
Ejemplo n.º 33
0
 private void Init(IControlContainer container)
 {
     Sides = new[]
     {
         new RainbowSide(Time.Instance(container), _configuration.RedPhase, _configuration.GreenPhase,
                         _configuration.BluePhase, 0),
         new RainbowSide(Time.Instance(container), _configuration.RedPhase, _configuration.GreenPhase,
                         _configuration.BluePhase, _configuration.Step),
         new RainbowSide(Time.Instance(container), _configuration.RedPhase, _configuration.GreenPhase,
                         _configuration.BluePhase, _configuration.Step * 2)
     };
 }
Ejemplo n.º 34
0
        /// <summary>
        /// Constructor for a new line subdivision.
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        /// <exception cref="InvalidOperationException">If a specific line is not currently selected</exception>
        internal LineSubdivisionUI(IControlContainer cc, IUserAction action)
            : base(cc, action)
        {
            LineFeature selLine = EditingController.SelectedLine;

            if (selLine == null)
            {
                throw new InvalidOperationException("You must initially select the line you want to subdivide.");
            }

            m_Parent = selLine;
        }
Ejemplo n.º 35
0
 /// <summary>
 /// Creates a new <c>NewLabelUI</c>
 /// </summary>
 /// <param name="cc">The container for any dialogs</param>
 /// <param name="action">The action that initiated this command</param>
 internal NewLabelUI(IControlContainer cc, IUserAction action)
     : base(cc, action)
 {
     m_Schema       = null;
     m_Template     = null;
     m_LastRow      = null;
     m_Polygon      = null;
     m_PolygonId    = new IdHandle();
     m_IsAutoPos    = Settings.Default.AutoPosition;
     m_IsAutoAngle  = Settings.Default.AutoAngle;
     m_Orient       = null;
     m_AutoPosition = null;
 }
Ejemplo n.º 36
0
        /// <summary>
        /// Constructor to subdivide the currently selected line.
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        internal SimpleLineSubdivisionUI(IControlContainer cc, IUserAction action)
            : base(cc, action)
        {
            LineFeature line = EditingController.SelectedLine;

            if (line == null)
            {
                throw new InvalidOperationException("You must initially select the line you want to subdivide.");
            }

            SetInitialValues();
            m_Line = line;
        }
Ejemplo n.º 37
0
        /// <summary>
        /// Constructor for performing a sideshot from the currently selected point.
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        /// <exception cref="InvalidOperationException">If a specific point is not currently selected</exception>
        internal RadialUI(IControlContainer cc, IUserAction action)
            : base(cc, action)
        {
            PointFeature from = EditingController.SelectedPoint;

            if (from == null)
            {
                throw new InvalidOperationException("You must initially select the point the sideshot radiates from.");
            }

            m_Dialog = null;
            m_From   = from;
        }
Ejemplo n.º 38
0
        public Menu(IControlContainer owner)
        {
            Owner   = owner;
            Height  = 1;
            TabStop = true;

            FocusBackgroundColor = ConsoleColor.Black;
            FocusForegroundColor = ConsoleColor.Gray;
            ForegroundColor      = ConsoleColor.Black;
            BackgroundColor      = ConsoleColor.Gray;

            rectangle       = new Rectangle();
            rectangle.Owner = owner;
        }
Ejemplo n.º 39
0
        /// <summary>
        /// Constructor for doing an update.
        /// </summary>
        /// <param name="editId">The ID of the edit this command deals with.</param>
        /// <param name="updcmd">The update command.</param>
        internal LineExtensionUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
            : base(cc, editId, updcmd)
        {
            // The dialog will be created by Run().
            m_Dialog = null;

            // The line we extended is known via the update.
            m_ExtendLine = null;

            // And initialize the parameters for the operation's Execute() call.
            m_Length          = null;
            m_IsExtendFromEnd = true;
            m_LineType        = null;
        }
Ejemplo n.º 40
0
        public Menu(IControlContainer owner)
        {
            Owner = owner;
            Height = 1;
            TabStop = true;

            FocusBackgroundColor = ConsoleColor.Black;
            FocusForegroundColor = ConsoleColor.Gray;
            ForegroundColor = ConsoleColor.Black;
            BackgroundColor = ConsoleColor.Gray;

            rectangle = new Rectangle();
            rectangle.Owner = owner;
        }
Ejemplo n.º 41
0
        public Window GetParentWindow()
        {
            IControlContainer parent = Parent;

            while (parent != null)
            {
                if (parent is Window)
                {
                    return(parent as Window);
                }
                parent = parent.Parent;
            }
            return(null);
        }
Ejemplo n.º 42
0
        /// <summary>
        /// Constructor for generating a line that is parallel to the currently selected line.
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        /// <exception cref="InvalidOperationException">If a specific line is not currently selected</exception>
        internal ParallelLineUI(IControlContainer cc, IUserAction action)
            : base(cc, action)
        {
            LineFeature from = EditingController.SelectedLine;

            if (from == null)
            {
                throw new InvalidOperationException("You must initially select the reference line for the parallel.");
            }

            // Set initial values.
            SetZeroValues();

            // Remember the reference line.
            m_Line = from;
        }
Ejemplo n.º 43
0
        /// <summary>
        /// Constructor to extend the currently selected line.
        /// </summary>
        /// <param name="cc">The container for any dialogs</param>
        /// <param name="action">The action that initiated this command</param>
        /// <exception cref="InvalidOperationException">If a line is not currently selected</exception>
        internal LineExtensionUI(IControlContainer cc, IUserAction action)
            : base(cc, action)
        {
            LineFeature line = EditingController.SelectedLine;
            if (line == null)
                throw new InvalidOperationException("You must initially select the line you want to extend.");

            // The dialog will be created by Run().
            m_Dialog = null;

            // Remember the line that is being extended.
            m_ExtendLine = line;

            // And initialize the parameters for the operation's Execute() call.
            m_Length = null;
            m_IsExtendFromEnd = true;
            m_LineType = null;
        }
Ejemplo n.º 44
0
    public PauseMenu(Action <string> action, IControlContainer container)
        : base(container, 0, 0, 0, 0)
    {
        Action = action;
        BackgroundDrawingMode = BackgroundDrawingMode.None;

        var logo      = this.AddLabel(0, 0, "Paused", 5, Color.Yellow, 3);
        var logoSize  = MeasureString("Paused", 5) + new Vector2(3, 3);
        var width     = 320;
        var menuPanel = this.AddStackPanel(logoSize.X / 2 - width / 2, logoSize.Y + 3, width, 135, BackgroundDrawingMode.Texture, StackDirection.Horizontal);

        menuPanel.Padding = -3;
        menuPanel.AddActionLabel(0, 0, "Resume", Emit, 1);
        menuPanel.AddActionLabel(0, 0, "Settings", null, 1);
        menuPanel.AddActionLabel(0, 0, "Quit", Emit, 1);

        Size = container.Theme.CalculateNewSize(new(logoSize.X, menuPanel.Size.Y + logoSize.Y + 16));
    }
Ejemplo n.º 45
0
 /// <summary>
 /// Creates new <c>SimpleCommandUI</c> that isn't an update.
 /// </summary>
 /// <param name="cc">The container that may be used to display any sort of
 /// user dialog (null if no dialog is involved)</param>
 /// <param name="cmdId">The item used to invoke the command.</param>
 /// <param name="update">The object (if any) that was selected for update</param>
 /// <param name="recall">An operation that is being recalled (null if this is an update).</param>
 protected SimpleCommandUI(IControlContainer cc, IUserAction cmdId, ISpatialObject update, Operation recall)
     : base(cc, cmdId, update, recall)
 {
 }
Ejemplo n.º 46
0
        /// <summary>
        /// Constructor for doing an update.
        /// </summary>
        /// <param name="editId">The ID of the edit this command deals with.</param>
        /// <param name="updcmd">The update command.</param>
        internal LineExtensionUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
            : base(cc, editId, updcmd)
        {
            // The dialog will be created by Run().
            m_Dialog = null;

            // The line we extended is known via the update.
            m_ExtendLine = null;

            // And initialize the parameters for the operation's Execute() call.
            m_Length = null;
            m_IsExtendFromEnd = true;
            m_LineType = null;
        }
Ejemplo n.º 47
0
        /// <summary>
        /// Creates new <c>CommandUI</c> for use during an editing update. This doesn't refer to
        /// the UpdateUI itself, it refers to a command that is the subject of the update.
        /// </summary>
        /// <param name="editId">The ID of the edit this command deals with.</param>
        /// <param name="updcmd">The update command (not null) that is controlling this command.</param>
        protected CommandUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
        {
            if (updcmd==null)
                throw new ArgumentNullException();

            m_Container = cc;
            m_EditId = editId;
            m_UpdCmd = updcmd;
            m_Draw = updcmd.ActiveDisplay;
            //m_Update = updcmd.SelectedObject;
            m_Recall = null;
            /*
            this.Update = update;

            if (update==null)
            {
                m_Draw = EditingController.Current.ActiveDisplay;
                m_Recall = null;
            }
             */

            Debug.Assert(m_Draw!=null);
        }
Ejemplo n.º 48
0
 /// <summary>
 /// Creates new <c>CommandUI</c> that isn't an update or a command recall.
 /// </summary>
 /// <param name="cmdId">The item used to invoke the command.</param>
 protected CommandUI(IControlContainer cc, IUserAction cmdId)
     : this(cc, cmdId, null, null)
 {
 }
Ejemplo n.º 49
0
 /// <summary>
 /// Creates new <c>SimpleCommandUI</c> for use during an editing update. This doesn't refer to
 /// the UpdateUI itself, it refers to a command that is the subject of the update.
 /// </summary>
 /// <param name="editId">The ID of the edit this command deals with.</param>
 /// <param name="updcmd">The update command (not null) that is controlling this command.</param>
 protected SimpleCommandUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
     : base(cc, editId, updcmd)
 {
 }
Ejemplo n.º 50
0
        /// <summary>
        /// Creates new <c>CommandUI</c> that isn't an update.
        /// </summary>
        /// <param name="cc">The container that may be used to display any sort of
        /// user dialog (null if no dialog is involved)</param>
        /// <param name="cmdId">The item used to invoke the command.</param>
        /// <param name="update">The object (if any) that was selected for update</param>
        /// <param name="recall">An operation that is being recalled (null if this is an update).</param>
        protected CommandUI(IControlContainer cc, IUserAction cmdId, ISpatialObject update, Operation recall)
        {
            m_Container = cc;
            m_Draw = EditingController.Current.ActiveDisplay;
            //m_Update = update;
            m_UpdCmd = null;
            m_Recall = recall;

            if (cmdId is EditingAction)
                m_EditId = (cmdId as EditingAction).EditId;
            else
                m_EditId = EditingActionId.Null;

            if (cmdId is RecalledEditingAction)
                m_Recall = (cmdId as RecalledEditingAction).RecalledEdit;

            Debug.Assert(m_Draw!=null);
        }
Ejemplo n.º 51
0
 /// <summary>
 /// Constructor for command recall.
 /// </summary>
 /// <param name="cc">The container for any dialog controls</param>
 /// <param name="action">The action that initiated this command</param>
 /// <param name="op">The operation that's being recalled.</param>
 internal PathUI(IControlContainer cc, IUserAction action, Operation op)
     : base(cc, action, null, op)
 {
     Zero();
 }
Ejemplo n.º 52
0
 /// <summary>
 /// Constructor for a new connection path.
 /// </summary>
 /// <param name="cc">The container for any dialog controls</param>
 /// <param name="action">The action that initiated this command</param>
 internal PathUI(IControlContainer cc, IUserAction action)
     : base(cc, action)
 {
     Zero();
 }
Ejemplo n.º 53
0
 /// <summary>
 /// Constructor for doing an update.
 /// </summary>
 /// <param name="cc">The container for any dialog controls</param>
 /// <param name="editId">The ID of the edit this command deals with.</param>
 /// <param name="updcmd">The update command.</param>
 internal PathUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
     : base(cc, editId, updcmd)
 {
     Zero();
 }
Ejemplo n.º 54
0
 /// <summary>
 /// Creates a new <c>SimpleCommandUI</c> that has a user dialog.
 /// </summary>
 /// <param name="cc">The container for any dialog controls</param>
 /// <param name="action">The action that initiated this command</param>
 protected SimpleCommandUI(IControlContainer cc, IUserAction action)
     : base(cc, action)
 {
 }
Ejemplo n.º 55
0
 /// <summary>
 /// Creates a new <c>NewLabelUI</c>
 /// </summary>
 /// <param name="cc">The container for any dialogs</param>
 /// <param name="action">The action that initiated this command</param>
 internal NewLabelUI(IControlContainer cc, IUserAction action)
     : base(cc, action)
 {
     m_Schema = null;
     m_Template = null;
     m_LastRow = null;
     m_Polygon = null;
     m_PolygonId = new IdHandle();
     m_IsAutoPos = Settings.Default.AutoPosition;
     m_IsAutoAngle = Settings.Default.AutoAngle;
     m_Orient = null;
     m_AutoPosition = null;
 }
Ejemplo n.º 56
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="action">The action that initiated this command</param>
 internal NewPointUI(IControlContainer cc, IUserAction action)
     : base(cc, action)
 {
     m_Dialog = null;
 }
Ejemplo n.º 57
0
 /// <summary>
 /// Constructor for doing an update.
 /// </summary>
 /// <param name="cc">The container for any dialogs</param>
 /// <param name="editId">The ID of the edit this command deals with.</param>
 /// <param name="updcmd">The update command.</param>
 internal ParallelLineUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
     : base(cc, editId, updcmd)
 {
     // Just set zero values for everything (we'll pick up stuff in Run).
     SetZeroValues();
 }
Ejemplo n.º 58
0
 /// <summary>
 /// Constructor for command recall.
 /// </summary>
 /// <param name="action">The action that initiated this command</param>
 /// <param name="op">The operation that's being recalled.</param>
 internal NewPointUI(IControlContainer cc, IUserAction action, Operation op)
     : base(cc, action, null, op)
 {
     m_Dialog = null;
 }
Ejemplo n.º 59
0
 /// <summary>
 /// Constructor for doing an update.
 /// </summary>
 /// <param name="editId">The ID of the edit this command deals with.</param>
 /// <param name="updcmd">The update command.</param>
 internal NewPointUI(IControlContainer cc, EditingActionId editId, UpdateUI updcmd)
     : base(cc, editId, updcmd)
 {
     m_Dialog = null;
 }
Ejemplo n.º 60
0
 /// <summary>
 /// Creates a new <c>TextRotationUI</c>
 /// </summary>
 /// <param name="cc">The container for any dialogs</param>
 /// <param name="action">The action that initiated this command</param>
 internal TextRotationUI(IControlContainer cc, IUserAction action)
     : base(cc, action)
 {
     m_Point1 = null;
 }