public ImagePanel(Base parent)
            : base(parent)
        {
            /* Normal */
            {
                Control.ImagePanel img = new Control.ImagePanel(this);
                img.ImageName = "gwen.png";
                img.SetPosition(10, 10);
				img.SetSize(100, 100);
            }

            /* Missing */
            {
                Control.ImagePanel img = new Control.ImagePanel(this);
                img.ImageName = "missingimage.png";
                img.SetPosition(120, 10);
				img.SetSize(100, 100);
            }

			/* Clicked */
			{
				Control.ImagePanel img = new Control.ImagePanel(this);
				img.ImageName = "gwen.png";
				img.SetPosition(10, 120);
				img.SetSize(100, 100);
				img.Clicked += Image_Clicked;
			}
        }
Beispiel #2
0
        public TutorialMenu (Application application, Base parent)
        {
            this.application = application;
            this.parent = parent;

            window = new WindowControl (parent);
            window.DisableResizing();
            window.Title = Localizer.Instance.GetValueForName("tutorial");
            window.IsMoveable = false;
            window.Hide();
            window.Height = parent.Height - (int) (parent.Height * 0.35);
            window.Y = (int) (parent.Height * 0.35) - 20;
            window.Width = parent.Width - 320;
            window.X = 280;

            scrollFrame = new ScrollControl (window);
            scrollFrame.AutoHideBars = true;
            scrollFrame.EnableScroll (false, true);
            scrollFrame.Width = window.Width - 12;
            scrollFrame.Height = window.Height - 32;

            updateTutorialText(Localizer.Instance.GetValueForName("tutorial_text"));

            ValidMessages = new[] { (int) MessageId.WindowResize, (int) MessageId.UpdateLocale };
            application.MessageManager += this;
        }
Beispiel #3
0
        public static bool OnMouseButton(Base hoveredControl, int x, int y, bool down)
        {
            if (!down)
            {
                m_LastPressedControl = null;

                // Not carrying anything, allow normal actions
                if (CurrentPackage == null)
                    return false;

                // We were carrying something, drop it.
                OnDrop(x, y);
                return true;
            }

            if (hoveredControl == null)
                return false;
            if (!hoveredControl.DragAndDrop_Draggable())
                return false;

            // Store the last clicked on control. Don't do anything yet,
            // we'll check it in OnMouseMoved, and if it moves further than
            // x pixels with the mouse down, we'll start to drag.
            m_LastPressedPos = new Point(x, y);
            m_LastPressedControl = hoveredControl;

            return false;
        }
        public TextureRefBox(Base parent, FSTextureReference Texture)
            : base(parent)
        {
            this.Texture = Texture;
            this.SetSize(160, 75);

            TextureName = new Label(this);
            TextureName.AutoSizeToContents = true;
            TextureName.SetPosition(10, 0);

            Defined = new LabeledCheckBox(this);
            Defined.Text = "Defined";
            Defined.SetPosition(10, 20);
            Defined.CheckChanged += new GwenEventHandler<EventArgs>(Defined_CheckChanged);

            panel = new GLImpTexturePanel(this);
            panel.SetSize(50, 50);
            panel.SetPosition(85, 0);
            panel.Clicked += delegate(Base sender, ClickedEventArgs args) {
                OpenTextureWindow otw = new OpenTextureWindow(SetTexture);
                otw.Show();
            };

            RefreshAll();
        }
Beispiel #5
0
        public static void OnMouseMoved(Base hoveredControl, int x, int y)
        {
            // Always keep these up to date, they're used to draw the dragged control.
            m_MouseX = x;
            m_MouseY = y;

            // If we're not carrying anything, then check to see if we should
            // pick up from a control that we're holding down. If not, then forget it.
            if (CurrentPackage == null && !ShouldStartDraggingControl(x, y))
                return;

            // Swap to this new hovered control and notify them of the change.
            UpdateHoveredControl(hoveredControl, x, y);

            if (HoveredControl == null)
                return;

            // Update the hovered control every mouse move, so it can show where
            // the dropped control will land etc..
            HoveredControl.DragAndDrop_Hover(CurrentPackage, x, y);

            // Override the cursor - since it might have been set my underlying controls
            // Ideally this would show the 'being dragged' control. TODO
            Platform.Neutral.SetCursor(Cursors.Default);

            hoveredControl.Redraw();
        }
Beispiel #6
0
 //private bool m_DrawCheckers;
 /// <summary>
 /// Initializes a new instance of the <see cref="ColorDisplay"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public ColorDisplay(Base parent)
     : base(parent)
 {
     SetSize(32, 32);
     m_Color = Color.FromArgb(255, 255, 0, 0);
     //m_DrawCheckers = true;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MenuStrip"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public MenuStrip(Base parent)
     : base(parent)
 {
     SetBounds(0, 0, 200, 22);
     Dock = Pos.Top;
     m_InnerPanel.Padding = new Padding(5, 0, 0, 0);
 }
Beispiel #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScrollControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public ScrollControl(Base parent)
            : base(parent)
        {
            MouseInputEnabled = false;

            m_VerticalScrollBar = new VerticalScrollBar(this);
            m_VerticalScrollBar.Dock = Pos.Right;
            m_VerticalScrollBar.BarMoved += VBarMoved;
            m_CanScrollV = true;
            m_VerticalScrollBar.NudgeAmount = 30;

            m_HorizontalScrollBar = new HorizontalScrollBar(this);
            m_HorizontalScrollBar.Dock = Pos.Bottom;
            m_HorizontalScrollBar.BarMoved += HBarMoved;
            m_CanScrollH = true;
            m_HorizontalScrollBar.NudgeAmount = 30;

            m_InnerPanel = new Base(this);
            m_InnerPanel.SetPosition(0, 0);
            m_InnerPanel.Margin = Margin.Five;
            m_InnerPanel.SendToBack();
            m_InnerPanel.MouseInputEnabled = false;

            m_AutoHideBars = false;
        }
Beispiel #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CheckBox"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public CheckBox(Base parent)
     : base(parent)
 {
     SetSize(15, 15);
     //m_Checked = true; // [omeg] why?!
     //Toggle();
 }
Beispiel #10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeNode"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TreeNode(Base parent)
            : base(parent)
        {
            m_ToggleButton = new TreeToggleButton(this);
            m_ToggleButton.SetBounds(0, 0, 15, 15);
            m_ToggleButton.Toggled += OnToggleButtonPress;

            m_Title = new TreeNodeLabel(this);
            m_Title.Dock = Pos.Top;
            m_Title.Margin = new Margin(16, 0, 0, 0);
            m_Title.DoubleClicked += OnDoubleClickName;
            m_Title.Clicked += OnClickName;

            m_InnerPanel = new Base(this);
            m_InnerPanel.Dock = Pos.Top;
            m_InnerPanel.Height = 100;
            m_InnerPanel.Margin = new Margin(TreeIndentation, 1, 0, 0);
            m_InnerPanel.Hide();

            IsRoot = parent is TreeControl;
            m_Selected = false;
            IsSelectable = true;

            Dock = Pos.Top;
        }
Beispiel #11
0
        private void OnCitationContinueClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
        {
            Check();
            Game.LogTrivial("Citation page 1 submission begin...");
            using (StreamWriter Information = new StreamWriter("Plugins/LSPDFR/ComputerPlus/citations/completedcitations.txt", true))
            {
                Information.WriteLine(" ");
                Information.WriteLine(" ");
                Information.WriteLine("---INFORMATION---");
                Information.WriteLine("Citation Number: " + CitationNumberBox.Text);
                Information.WriteLine("Related Report Number: " + CitationRelatedBox.Text);
                Information.WriteLine("Date of incident: " + CitationDateBox.Text);
                Information.WriteLine("Time of incident: " + CitationTimeBox.Text);
                Information.WriteLine("Offender Full Name: " + SuspectFirstBox.Text + " " + SuspectLastBox.Text);
                Information.WriteLine("Offender DOB: " + CitationPerpDOBBox.Text);
                Information.WriteLine("Offender Residence: " + CitationPerpStreetBox.Text);
                Information.WriteLine("Issuing Officer #: " + CitationIssuedOfficerBox.Text);
                Information.WriteLine("Issuing Officer Name: " + CitationIssuedOfficerNameBox.Text);
            }
            Game.LogTrivial("Citation page 1 submission success!");
            Game.DisplayNotification("Citation page 1 of 2 complete...");

            this.Window.Close();
            form_citationviolation = new GameFiber(OpenCitationViolationForm);
            form_citationviolation.Start();
        }
Beispiel #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RadioButton"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public RadioButton(Base parent)
     : base(parent)
 {
     SetSize(15, 15);
     MouseInputEnabled = true;
     IsTabable = false;
 }
Beispiel #13
0
        private int m_ZoomedSection; // 0-3

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="CrossSplitter"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public CrossSplitter(Base parent)
            : base(parent)
        {
            m_Sections = new Base[4];

            m_VSplitter = new SplitterBar(this);
            m_VSplitter.SetPosition(0, 128);
            m_VSplitter.Dragged += OnVerticalMoved;
            m_VSplitter.Cursor = Cursors.SizeNS;

            m_HSplitter = new SplitterBar(this);
            m_HSplitter.SetPosition(128, 0);
            m_HSplitter.Dragged += OnHorizontalMoved;
            m_HSplitter.Cursor = Cursors.SizeWE;

            m_CSplitter = new SplitterBar(this);
            m_CSplitter.SetPosition(128, 128);
            m_CSplitter.Dragged += OnCenterMoved;
            m_CSplitter.Cursor = Cursors.SizeAll;

            m_HVal = 0.5f;
            m_VVal = 0.5f;

            SetPanel(0, null);
            SetPanel(1, null);
            SetPanel(2, null);
            SetPanel(3, null);

            SplitterSize = 5;
            SplittersVisible = false;

            m_ZoomedSection = -1;
        }
Beispiel #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextBox"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TextBox(Base parent)
            : base(parent)
        {
            AutoSizeToContents = false;
            SetSize(200, 20);

            MouseInputEnabled = true;
            KeyboardInputEnabled = true;

            Alignment = Pos.Left | Pos.CenterV;
            TextPadding = new Padding(4, 2, 4, 2);

            m_CursorPos = 0;
            m_CursorEnd = 0;
            m_SelectAll = false;

            TextColor = Color.FromArgb(255, 50, 50, 50); // TODO: From Skin

            IsTabable = true;

            AddAccelerator("Ctrl + C", OnCopy);
            AddAccelerator("Ctrl + X", OnCut);
            AddAccelerator("Ctrl + V", OnPaste);
            AddAccelerator("Ctrl + A", OnSelectAll);
        }
Beispiel #15
0
        /// <summary>
        /// Centers the control vertically inside its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void CenterVertically(Base control)
        {
            Base parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(control.X, (parent.Height - control.Height) / 2);
        }
        internal bool m_Alt; // for alternate coloring

        /// <summary>
        /// Initializes a new instance of the <see cref="CategoryButton"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public CategoryButton(Base parent) : base(parent)
        {
            Alignment = Pos.Left | Pos.CenterV;
            m_Alt = false;
            IsToggle = true;
            TextPadding = new Padding(3, 0, 3, 0);
        }
Beispiel #17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NumericUpDown"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public NumericUpDown(Base parent)
            : base(parent)
        {
            SetSize(100, 20);

            m_Splitter = new Splitter(this);
            m_Splitter.Dock = Pos.Right;
            m_Splitter.SetSize(13, 13);

            m_Up = new UpDownButton_Up(m_Splitter);
            m_Up.Clicked += OnButtonUp;
            m_Up.IsTabable = false;
            m_Splitter.SetPanel(0, m_Up, false);

            m_Down = new UpDownButton_Down(m_Splitter);
            m_Down.Clicked += OnButtonDown;
            m_Down.IsTabable = false;
            m_Down.Padding = new Padding(0, 1, 1, 0);
            m_Splitter.SetPanel(1, m_Down, false);

            m_Max = 100;
            m_Min = 0;
            m_Value = 0f;
            Text = "0";
        }
Beispiel #18
0
 private void OnSaveButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
 {
     using (StreamWriter Information = new StreamWriter("LSPDFR/Police Notebook/Notebook.txt", true))
     {
         Information.WriteLine(MainBox.Text);
     }
 }
Beispiel #19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Base"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public Base(Base parent = null)
        {
            m_Children = new List<Base>();
            m_Accelerators = new Dictionary<string, GwenEventHandler>();

            Parent = parent;

            m_Hidden = false;
            Bounds = new Rectangle(0, 0, 10, 10);
            m_Padding = Padding.Zero;
            m_Margin = Margin.Zero;

            RestrictToParent = false;

            MouseInputEnabled = true;
            KeyboardInputEnabled = false;

            Invalidate();
            Cursor = Cursors.Default;
            //ToolTip = null;
            IsTabable = false;
            ShouldDrawBackground = true;
            m_Disabled = false;
            m_CacheTextureDirty = true;
            m_CacheToTexture = false;

            BoundsOutlineColor = Color.Red;
            MarginOutlineColor = Color.Green;
            PaddingOutlineColor = Color.Blue;

            m_UserData = new UserData();
        }
Beispiel #20
0
        public CheckBox(Base parent)
            : base(parent)
        {

            Control.CheckBox check = new Control.CheckBox(this);
            check.SetPosition(10, 10);
            check.Checked += OnChecked;
            check.UnChecked += OnUnchecked;
            check.CheckChanged += OnCheckChanged;

            Control.LabeledCheckBox labeled = new Control.LabeledCheckBox(this);
            labeled.Text = "Labeled CheckBox";
            labeled.Checked += OnChecked;
            labeled.UnChecked += OnUnchecked;
            labeled.CheckChanged += OnCheckChanged;
            Align.PlaceDownLeft(labeled, check, 10);

            Control.LabeledCheckBox labeled2 = new Control.LabeledCheckBox(this);
            labeled2.Text = "I'm autosized";
            labeled2.SizeToChildren();
            Align.PlaceDownLeft(labeled2, labeled, 10);

            Control.CheckBox check2 = new Control.CheckBox(this);
            check2.IsDisabled = true;
            Align.PlaceDownLeft(check2, labeled2, 20);
        }
Beispiel #21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TabControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TabControl(Base parent)
            : base(parent)
        {
            m_Scroll = new ScrollBarButton[2];
            m_ScrollOffset = 0;

            m_TabStrip = new TabStrip(this);
            m_TabStrip.StripPosition = Pos.Top;

            // Make this some special control?
            m_Scroll[0] = new ScrollBarButton(this);
            m_Scroll[0].SetDirectionLeft();
            m_Scroll[0].Clicked += ScrollPressedLeft;
            m_Scroll[0].SetSize(14, 16);

            m_Scroll[1] = new ScrollBarButton(this);
            m_Scroll[1].SetDirectionRight();
            m_Scroll[1].Clicked += ScrollPressedRight;
            m_Scroll[1].SetSize(14, 16);

            m_InnerPanel = new TabControlInner(this);
            m_InnerPanel.Dock = Pos.Fill;
            m_InnerPanel.SendToBack();

            IsTabable = false;
        }
Beispiel #22
0
 public static void Add(Base control, Animation animation)
 {
     animation.m_Control = control;
     if (!m_Animations.ContainsKey(control))
         m_Animations[control] = new List<Animation>();
     m_Animations[control].Add(animation);
 }
Beispiel #23
0
        /// <summary>
        /// Enables tooltip display for the specified control.
        /// </summary>
        /// <param name="control">Target control.</param>
        public static void Enable(Base control)
        {
            if (null == control.ToolTip)
                return;

            g_ToolTip = control;
        }
Beispiel #24
0
		void OpenMsgbox(Base control, EventArgs args)
        {
            MessageBox window = new MessageBox(GetCanvas(), String.Format("Window {0}   MessageBox window = new MessageBox(GetCanvas(), String.Format(  MessageBox window = new MessageBox(GetCanvas(), String.Format(", m_WindowCount));
            window.SetPosition(rand.Next(700), rand.Next(400));

            m_WindowCount++;
        }
Beispiel #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RadioButtonGroup"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 /// <param name="label">Label for the outlining GroupBox.</param>
 public RadioButtonGroup(Base parent) : base(parent)
 {
     AutoSizeToContents = true;
     IsTabable = false;
     KeyboardInputEnabled = true;
     Text = String.Empty;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ColorSlider"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public ColorSlider(Base parent)
     : base(parent)
 {
     SetSize(32, 128);
     MouseInputEnabled = true;
     m_Depressed = false;
 }
Beispiel #27
0
 internal void OnFIContinueButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
 {
     GameFiber.StartNew(delegate
     {
         Check();
         Game.LogTrivial("FI personal info saving for: " + SuspectLastBox.Text.ToString() + " " + SuspectFirstBox.Text.ToString());
         Game.DisplayNotification("Page 2 of 3 saved. Continuing Field Interaction form...");
         using (StreamWriter Information = new StreamWriter("Plugins/LSPDFR/ComputerPlus/field interviews/" + SuspectLastBox.Text.ToLower() + SuspectFirstBox.Text.ToLower() + ".txt", true))
         {
             // 13 lines
             Information.WriteLine("---PERSONAL INFORMATION---");
             Information.WriteLine("DOB: " + SuspectDOBBox.Text);
             Information.WriteLine(SuspectSSNBox.Text);
             Information.WriteLine("Occupation: " + SuspectOccupationBox.Text);
             Information.WriteLine("Address: " + SuspectAddressBox.Text + " " + SuspectCityBox.Text);
             Information.WriteLine("Sex: " + SuspectSexBox.Text);
             Information.WriteLine("Race: " + SuspectRaceBox.Text);
             Information.WriteLine("Hair: " + SuspectHairBox.Text);
             Information.WriteLine("Eyes: " + SuspectEyesBox.Text);
             Information.WriteLine("Scars/Tattoos: " + SuspectMarkBox.Text);
             Information.WriteLine("License Status: " + SuspectLicenseBox.Text);
             Information.WriteLine("Vehicle Make, Model, Color: " + SuspectVehicleBox.Text);
             Information.WriteLine("Vehicle Plate: " + SuspectPlateBox.Text);
         }
         Game.LogTrivial("Successfully written to .txt");
     });
     state = SubmitCheck.submitted;
     FIComplete();
     this.Window.Close();
     form_firemarks = new GameFiber(OpenFIRemarksForm);
     form_firemarks.Start();
 }
Beispiel #28
0
        public void Initialize()
        {
            WindowControl rightpanel = new WindowControl(MainCanvas.Instance);
            rightpanel.Dock = Gwen.Pos.Right;
            rightpanel.Width = (GraphicsManager.WindowWidth / 2) - 20;
            rightpanel.IsClosable = false;
            rightpanel.DisableResizing();

            Base dummy = new Base(MainCanvas.Instance);
            dummy.Dock = Gwen.Pos.Fill;

            bottompanel = new WindowControl(dummy);
            bottompanel.Dock = Gwen.Pos.Bottom;
            bottompanel.Height = (GraphicsManager.WindowHeight / 2) - 20;
            bottompanel.IsClosable = false;
            bottompanel.DisableResizing();

            Gameview = new Camera3D();
            Gameview.Layer = 1;
            Gameview.FieldOfView = 60;
            Gameview.EnableViewport(10, 10, GraphicsManager.WindowWidth / 2, GraphicsManager.WindowHeight / 2);
            Gameview.OnRender += GameRender;

            if (GameInfo.Me.IsServer) {
                ScriptManager.Initialize();
                foreach (var p in GameInfo.Players.Values){
                    InitializePlayer(p);
                }
            }
        }
Beispiel #29
0
        public RadioButton(Base parent)
            : base(parent)
        {
            Control.RadioButtonGroup rbg = new Control.RadioButtonGroup(this, "Sample radio group");
            rbg.SetPosition(10, 10);

            rbg.AddOption("Option 1");
            rbg.AddOption("Option 2");
            rbg.AddOption("Option 3");
            rbg.AddOption("\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631");
            //rbg.SizeToContents(); // it's auto

            rbg.SelectionChanged += OnChange;

            Control.LabeledRadioButton rb1 = new LabeledRadioButton(this);
            rb1.Text = "Option 1";
            rb1.SetPosition(300, 10);

            Control.LabeledRadioButton rb2 = new LabeledRadioButton(this);
            rb2.Text = "Option 2222222222222222222222222222222222";
            rb2.SetPosition(300, 30);

            Control.LabeledRadioButton rb3 = new LabeledRadioButton(this);
            rb3.Text = "\u0627\u0644\u0622\u0646 \u0644\u062D\u0636\u0648\u0631";
            rb3.SetPosition(300, 50);

            //this.DrawDebugOutlines = true;
        }
Beispiel #30
0
        /// <summary>
        /// Moves the control to the left of its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void AlignLeft(Base control)
        {
            Base parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(parent.Padding.Left, control.Y);
        }
Beispiel #31
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CollapsibleList"/> class.
 /// </summary>
 /// <param name="parent">Parent control.</param>
 public CollapsibleList(Base parent)
     : base(parent)
 {
     MouseInputEnabled = true;
     EnableScroll(false, true);
     AutoHideBars = true;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public TreeControl(Base parent)
            : base(parent)
        {
            m_TreeControl = this;

            RemoveChild(m_ToggleButton, true);
            m_ToggleButton = null;
            RemoveChild(m_Title, true);
            m_Title = null;
            RemoveChild(m_InnerPanel, true);
            m_InnerPanel = null;

            m_MultiSelect = false;

            m_ScrollControl = new ScrollControl(this);
            m_ScrollControl.Dock = Pos.Fill;
            m_ScrollControl.EnableScroll(false, true);
            m_ScrollControl.AutoHideBars = true;
            m_ScrollControl.Margin = Margin.One;

            m_InnerPanel = m_ScrollControl;

            m_ScrollControl.SetInnerSize(1000, 1000); // todo: why such arbitrary numbers?

			Dock = Pos.None;
        }
Beispiel #33
0
 /// <summary>
 /// Disables tooltip display for the specified control.
 /// </summary>
 /// <param name="control">Target control.</param>
 public static void Disable(Base control)
 {
     if (g_ToolTip == control)
     {
         g_ToolTip = null;
     }
 }
Beispiel #34
0
        internal void OnFISubmitButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
        {
            Game.LogTrivial("FI remarks saving for: " + SuspectLastBox.Text.ToString() + " " + SuspectFirstBox.Text.ToString());
            using (StreamWriter Information = new StreamWriter("Plugins/LSPDFR/ComputerPlus/field interviews/" + SuspectLastBox.Text.ToLower() + SuspectFirstBox.Text.ToLower() + ".txt", true))
            {
                // 3 lines
                Information.WriteLine("---REMARKS---");
                Information.WriteLine("Remarks: " + RemarkBox.Text);
                Information.WriteLine("Date & Time Submitted: " + System.DateTime.Now.ToShortDateString() + System.DateTime.Now.ToShortTimeString());
            }
            Game.DisplayNotification("Page 3 of 3 saved.  Field interaction for: ~r~" + SuspectLastBox.Text.ToString() + ", " + SuspectFirstBox.Text.ToString() + " ~w~ completed successfully!");

            this.Window.Close();
            ComputerMain.form_report = new GameFiber(ComputerMain.OpenReportMenuForm);
            ComputerMain.form_report.Start();
        }
Beispiel #35
0
        internal void OnShowFIButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
        {
            string Exists = "Plugins/LSPDFR/ComputerPlus/field interviews/" + SuspectLastBox.Text.ToLower() + SuspectFirstBox.Text.ToLower() + ".txt";

            if (File.Exists(Exists))
            {
                FIBox.Show();
                FIBackButton.Show();
                string FILines = File.ReadAllText("Plugins/LSPDFR/ComputerPlus/field interviews/" + SuspectLastBox.Text.ToLower() + SuspectFirstBox.Text.ToLower() + ".txt");
                FIBox.Text = FILines;
            }
            else
            {
                Game.DisplayNotification("~r~Please check your spelling, as there are no records found");
            }
        }
Beispiel #36
0
        //ImportExport.Base*		m_Exporter;
        //ImportExport::Base*		m_Importer;

        public Document(Gwen.Control.Base parent, string name)
            : base(parent)
        {
            Dock    = Pos.Fill;
            Padding = new Padding(1, 1, 1, 1);

            // The main horizontal splitter separates the document from the tree/properties
            var pSplitter = new Gwen.Control.VerticalSplitter(this);

            pSplitter.Dock = Pos.Fill;
            //pSplitter.SetScaling( true, 200 );

            // The white background
            DocumentInner pInner = new DocumentInner(pSplitter);

            pInner.Dock = Pos.Fill;

            // The vertical splitter on the right containing the tree/properties
            var pRightSplitter = new Gwen.Control.HorizontalSplitter(pSplitter);

            pRightSplitter.Dock = Pos.Fill;
            pRightSplitter.SetSize(200, 200);
            //pRightSplitter.SetScaling( false, 200 );

            pSplitter.SetPanel(0, pInner);
            pSplitter.SetPanel(1, pRightSplitter);


            // The actual canvas onto which we drop controls
            Canvas                   = new DocumentCanvas(pInner);
            Canvas.Dock              = Pos.Fill;
            Canvas.HierachyChanged  += OnHierachyChanged;
            Canvas.SelectionChanged += OnSelectionChanged;


            // The controls on the right
            Hierarchy = new Hierarchy(pRightSplitter);
            Hierarchy.WatchCanvas(Canvas);
            Hierarchy.Dock = Pos.Fill;

            m_pPropreties = new ReflectionProperties(pRightSplitter); //new Properties( pRightSplitter );
            m_pPropreties.Setup(Canvas);
            m_pPropreties.Dock = Pos.Fill;

            pRightSplitter.SetPanel(0, Hierarchy);
            pRightSplitter.SetPanel(1, m_pPropreties);
        }
Beispiel #37
0
 private void OnYesButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
 {
     GameFiber.StartNew(delegate
     {
         Sure.Hide();
         NoButton.Hide();
         YesButton.Hide();
         File.WriteAllText("LSPDFR/Police Notebook/Notebook.txt", String.Empty);
         GameFiber.Sleep(0500);
         string Exists = "LSPDFR/Police Notebook/Notebook.txt";
         if (File.Exists(Exists))
         {
             string Notes = File.ReadAllText("LSPDFR/Police Notebook/Notebook.txt");
             MainBox.Text = Notes;
         }
     });
 }
Beispiel #38
0
        private void OnFIButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
        {
            GameFiber.StartNew(delegate
            {
                GameFiber.Sleep(0500);
                Game.LogTrivial("Loading FIs -- Based on CitationForm");
                GwenForm FIForm = new FIEnvironmentCode2();
                Game.IsPaused   = true;
                FIForm.Show();
                FIForm.Position = new System.Drawing.Point(500, 250);
                while (FIForm.Window.IsVisible)
                {
                    GameFiber.Yield();
                }

                Game.IsPaused = true;
            });
        }
Beispiel #39
0
 private void OnPoliceNotebookClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
 {
     Game.LogTrivial("Loading Police Notebook via MDT");
     GameFiber.StartNew(delegate
     {
         GameFiber.Sleep(0500);
         Rage.Forms.GwenForm PNotebook = new NotebookCode2();
         Game.IsPaused = true;
         PNotebook.Show();
         PNotebook.Position = new System.Drawing.Point(900, 100);
         while (PNotebook.Window.IsVisible)
         {
             Game.IsPaused = true;
             GameFiber.Yield();
         }
         Game.IsPaused = false;
     });
 }
 private void OnCitationSubmitClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
 {
     Game.LogTrivial("Citation page 2 submission begin...");
     using (StreamWriter Information = new StreamWriter("Plugins/LSPDFR/ComputerPlus/citations/completedcitations.txt", true))
     {
         Information.WriteLine("---VIOLATIONS---");
         Information.WriteLine("The above defendent operated a:");
         Information.WriteLine("Passenger: " + VehCheck1.IsChecked);
         Information.WriteLine("Commercial: " + VehCheck2.IsChecked);
         Information.WriteLine("Cycle: " + VehCheck3.IsChecked);
         Information.WriteLine("Bus: " + VehCheck4.IsChecked);
         Information.WriteLine("Other: " + VehCheck5.IsChecked);
         Information.WriteLine("Vehicle Make, Model, Color, Style: " + VehInfoBox.Text);
         Information.WriteLine("License Plate: " + VehPlateBox.Text);
         Information.WriteLine("Upon the public highway: " + StreetBox.Text + " in the city: " + CityBox.Text);
         Information.WriteLine("In the following conditions:");
         Information.WriteLine("Street Condition: " + CitationStreetConditionBox.Text);
         Information.WriteLine("Light Condition: " + CitationLightConditionBox.Text);
         Information.WriteLine("Traffic Condition: " + CitationTrafficConditionBox.Text);
         Information.WriteLine("And committed the following offenses:");
         Information.WriteLine("Accident: " + AccidentCheck.IsChecked);
         Information.WriteLine("Speed: " + SpeedCheck.IsChecked + " and was traveling " + SpeedBox.Text + " in a speed limit of " + InABox.Text);
         Information.WriteLine("Speed Device Used: " + CitationSpeedDeviceBox.Text);
         Information.WriteLine("In a:");
         Information.WriteLine("Commercial Vehicle: " + InCommCheck.IsChecked);
         Information.WriteLine("Construction Zone: " + InConstCheck.IsChecked);
         Information.WriteLine("Area: " + Area.Text);
         Information.WriteLine("Violations: " + Violations.Text);
         Information.WriteLine("Additional Information: " + ExtraInfo.Text);
         Information.WriteLine("And is summoned to appear in court on: " + DateBox.Text + " at " + TimeBox.Text);
         Information.WriteLine(" ");
         Information.WriteLine("Citation Submitted " + System.DateTime.Now.ToString());
         Information.WriteLine("---END CITATION---");
     }
     Game.LogTrivial("Citation page 2 submission success!");
     Game.DisplayNotification("Citation ~b~successfully~w~ submitted!");
     vehplate = VehPlateBox.Text.ToLower();
     CitationComplete();
     state = SubmitCheck.submitted;
     this.Window.Close();
     ComputerMain.form_report = new GameFiber(ComputerMain.OpenReportMenuForm);
     ComputerMain.form_report.Start();
 }
Beispiel #41
0
        private void OnOpenMDTButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
        {
            Game.LogTrivial("Loading MDT via Notebook");
            GameFiber.StartNew(delegate
            {
                GameFiber.Sleep(1000);
                Rage.Forms.GwenForm form11 = new ReportMain();
                Game.IsPaused = true;
                form11.Show();
                form11.Position = new System.Drawing.Point(500, 250);
                while (form11.Window.IsVisible)
                {
                    Game.IsPaused = true;
                    GameFiber.Yield();
                }

                Game.IsPaused = false;
            });
        }
        internal void OnFIContinueButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
        {
            GameFiber.StartNew(delegate
            {
                Game.DisplayNotification("Page 1 of 3 saved. Continuing Field Interaction form...");
                using (StreamWriter Information = new StreamWriter("Plugins/LSPDFR/ComputerPlus/field interviews/" + SuspectLastBox.Text.ToLower() + SuspectFirstBox.Text.ToLower() + ".txt", true))
                {
                    // 8 Lines
                    Information.WriteLine(" ");
                    Information.WriteLine(" ");
                    Information.WriteLine("---ENVIRONMENT---");
                    Information.WriteLine("Date: " + FIDateBox.Text);
                    Information.WriteLine("Time: " + FITimeBox.Text);
                    Information.WriteLine("Location: " + FILocation.Text);
                    Information.WriteLine("Officer Name and Number: " + FIOfficerNameBox.Text + " " + FIOfficerNumberBox.Text);
                    Information.WriteLine("Individual Full Name: " + SuspectFirstBox.Text + " " + SuspectLastBox.Text);
                }
                Game.LogTrivial("Successfully written to .txt");
            });

            this.Window.Close();
            form_fipersonal = new GameFiber(OpenFIPersonalForm);
            form_fipersonal.Start();
        }
Beispiel #43
0
 /*virtual void Initialize( Gwen.Control.TabButton pTab );
  *
  * virtual void DoSaveAs( ImportExport::Base* exporter );
  * virtual void DoSave( ImportExport::Base* exporter );
  * virtual void LoadFromFile( const Gwen::String& str, ImportExport::Base* exporter );
  *
  * virtual void Command( const Gwen::String& str );
  *
  *
  * void DoSaveFromDialog( Event::Info info );*/
 void OnHierachyChanged(Gwen.Control.Base caller)
 {
     Hierarchy.CompleteRefresh();
 }
Beispiel #44
0
 private void OnEraseButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
 {
     Sure.Show();
     YesButton.Show();
     NoButton.Show();
 }
 private void OnBackButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
 {
     this.Window.Close();
     ComputerMain.form_report = new GameFiber(ComputerMain.OpenReportMenuForm);
     ComputerMain.form_report.Start();
 }
Beispiel #46
0
 public void OnHomeButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
 {
     this.Window.Close();
     form_main = new GameFiber(OpenMainMenuForm);
     form_main.Start();
 }
Beispiel #47
0
 private void OnReportArrestClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
 {
     // In progress
 }
Beispiel #48
0
 private void OnNoButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
 {
     Sure.Hide();
     NoButton.Hide();
     YesButton.Hide();
 }
Beispiel #49
0
 internal void OnFIBackButtonClick(Gwen.Control.Base sender, Gwen.Control.ClickedEventArgs e)
 {
     FIBox.Hide();
     FIBackButton.Hide();
 }