Пример #1
0
        /// <summary>
        /// Renders the currently visible tooltip.
        /// </summary>
        /// <param name="skin"></param>
        public static void RenderToolTip(Skin.Base skin)
        {
            if (null == g_ToolTip)
            {
                return;
            }

            Renderer.Base render = skin.Renderer;

            Point     oldRenderOffset = render.RenderOffset;
            Point     mousePos        = Input.InputHandler.Instance.MousePosition;
            Rectangle bounds          = g_ToolTip.ToolTip.Bounds;

            Rectangle offset = Util.FloatRect(mousePos.X - bounds.Width * 0.5f, mousePos.Y - bounds.Height - 10,
                                              bounds.Width, bounds.Height);

            offset = Util.ClampRectToRect(offset, g_ToolTip.GetCanvas().Bounds);

            //Calculate offset on screen bounds
            render.AddRenderOffset(offset);
            render.EndClip();

            skin.DrawToolTip(g_ToolTip.ToolTip);
            g_ToolTip.ToolTip.DoRender(skin);

            render.RenderOffset = oldRenderOffset;
        }
Пример #2
0
        protected override void Layout(GwenSkin.Base skin)
        {
            base.Layout(skin);
            if (this.Parent == null && headerSection == null)
            {
                return;
            }
            BindDataFromReport();
            headerSection.SizeWidthWith().AlignTopWith().AlignLeftWith().SizeToChildrenBlock();

            arresteeInformationSection
            .AddContentChild(arrestInformationContent)
            .PlaceBelowOf(headerSection)
            .SizeWidthWith();


            labeled_last_name.PlaceRightOf(labeled_first_name);
            labeled_dob.PlaceRightOf(labeled_last_name);
            labeled_home_address.PlaceBelowOf(labeled_first_name);

            arrestInformationContent.SizeToChildren(false, true);
            arresteeInformationSection.SizeToChildren(false, true);

            arrestLocationSection
            .AddContentChild(arrestLocationContent)
            .PlaceBelowOf(arresteeInformationSection)
            .SizeWidthWith();

            labeled_arrest_date.PlaceRightOf(labeled_arrest_street_address, Configs.BaseFormControlSpacingDouble);
            labeled_arrest_city.PlaceBelowOf(labeled_arrest_street_address, Configs.BaseFormControlSpacingDouble);
            labeled_arrest_time.Align(labeled_arrest_date, labeled_arrest_city);


            arrestLocationContent.SizeToChildren(false, true);
            arrestLocationSection.SizeToChildren(false, true);


            labeledCharges.PlaceBelowOf(arrestLocationSection).SizeWidthWith().SizeChildrenWidth();
            labeledAdditionalParties.PlaceBelowOf(labeledCharges).SizeWidthWith().SizeChildrenWidth();
            tb_report_details.PlaceBelowOf(labeledAdditionalParties).SizeFull().SizeChildrenWidth().SizeChildrenHeight();
            tb_report_details.SizeToChildrenBlock();
        }
Пример #3
0
        protected override void Layout(GwenSkin.Base skin)
        {
            base.Layout(skin);
            if (!mLayoutRequired)
            {
                return;
            }
            mLayoutRequired = false;

            mLabel.TextColorOverride = LabelColor;
            mLabel.Font = LabelFont;
            mLabel.UpdateColors();
            mLabel.SizeToContents();

            //mLabel.FitChildrenToSize();

            switch (LabelPosition)
            {
            case RelationalPosition.LEFT:
                Component.PlaceRightOf(mLabel, mSpaceBetweenLabelAndComponent);
                break;

            case RelationalPosition.RIGHT:
                mLabel.PlaceRightOf(Component, mSpaceBetweenLabelAndComponent);
                break;

            case RelationalPosition.TOP:
                Component.PlaceBelowOf(mLabel, mSpaceBetweenLabelAndComponent);

                break;

            case RelationalPosition.BOTTOM:
                mLabel.PlaceBelowOf(Component, mSpaceBetweenLabelAndComponent);
                break;
            }


            this.SizeToChildren();
        }
Пример #4
0
 protected override void Layout(GwenSkin.Base skin)
 {
     base.Layout(skin);
     cb_action.PlaceInsideRightOf(this, Configs.BaseFormControlSpacing);
     lbl_first_name.PlaceBelowOf(cb_action, Configs.BaseFormControlSpacingHalf);
     text_first_name.SetPosition(this.X + Configs.BaseFormControlSpacing, this.Y + Configs.BaseFormControlSpacing);
     text_first_name.NormalSize();
     Gwen.Align.PlaceDownLeft(lbl_first_name, text_first_name);
     lbl_last_name.SizeToContents();
     text_last_name.NormalSize();
     Gwen.Align.PlaceRightBottom(text_last_name, text_first_name, Configs.BaseFormControlSpacing); //Place textbox last name to the right of first name
     lbl_last_name.SetPosition(text_last_name.X, lbl_first_name.Y);                                //Line up last name label with the last name text box (x) and the first name label (y)
     lbl_age.SizeToContents();
     text_age.SmallSize();
     Gwen.Align.PlaceRightBottom(text_age, text_last_name, Configs.BaseFormControlSpacing);
     Gwen.Align.PlaceDownLeft(lbl_age, text_age);
     //lbl_age.SetPosition(text_age.X, lbl_last_name.Y);
     Gwen.Align.PlaceDownLeft(lbl_home_address, text_first_name, Configs.BaseFormControlSpacingDouble); //Place Home Address label below first name, align left with first name text
     text_home_address.LongSize();
     Gwen.Align.PlaceDownLeft(text_home_address, lbl_home_address);
     lbl_dob.SizeToContents();
     text_dob.SmallSize();
     text_dob.SetPosition(text_age.X, text_home_address.Y);
     lbl_dob.SetPosition(text_dob.X, lbl_home_address.Y);
     Gwen.Align.PlaceDownLeft(lbl_license_status, text_home_address, Configs.BaseFormControlSpacingTriple);
     text_license_status.SmallSize();
     Gwen.Align.PlaceRightBottom(text_license_status, lbl_license_status, Configs.BaseFormControlSpacing);
     Gwen.Align.PlaceDownLeft(lbl_wanted_status, lbl_license_status, Configs.BaseFormControlSpacing);
     text_wanted_status.SmallSize();
     Gwen.Align.PlaceRightBottom(text_wanted_status, lbl_wanted_status, Configs.BaseFormControlSpacing);
     Gwen.Align.PlaceDownLeft(lbl_times_stopped, lbl_wanted_status, Configs.BaseFormControlSpacing);
     text_times_stopped.SmallSize();
     text_times_stopped.SetPosition(text_wanted_status.X, lbl_times_stopped.Y);
     ped_image_holder.RegularSizeVertical();
     ped_image_holder.SetPosition(text_age.Right + Configs.BaseFormControlSpacingDouble, text_age.Y + Configs.BaseFormControlSpacingDouble);
 }
Пример #5
0
    public void Init(GameWindow gamewindow)
    {
        renderer = new Gwen.Renderer.OpenTK();
        skin = new Gwen.Skin.TexturedBase (renderer, "DefaultSkin.png");
        canvas = new Gwen.Control.Canvas (skin);
        canvas.SetSize (gamewindow.Width, gamewindow.Height);
        canvas.ShouldDrawBackground = true;
        canvas.BackgroundColor = System.Drawing.Color.FromArgb (255, 225, 225, 225);

        input = new Gwen.Input.OpenTK (gamewindow);
        input.Initialize (canvas);

        gamewindow.Keyboard.KeyDown += (s, e) =>
        {
            input.ProcessKeyDown (e);
        };
        gamewindow.Keyboard.KeyUp += (s, e) =>
        {
            input.ProcessKeyUp (e);
        };

        gamewindow.Mouse.ButtonDown += (s, e) =>
        {
            input.ProcessMouseMessage (e);
        };
        gamewindow.Mouse.ButtonUp += (s, e) =>
        {
            input.ProcessMouseMessage (e);
        };
        gamewindow.Mouse.Move += (s, e) =>
        {
            input.ProcessMouseMessage (e);
        };
        gamewindow.Mouse.WheelChanged += (s, e) =>
        {
            input.ProcessMouseMessage (e);
        };

        gamewindow.Load += (s, e) =>
        {
            PreLoad();

            gamewindow.VSync = VSyncMode.On;

            PostLoad();
        };

        gamewindow.Resize += (s, e) =>
        {
            GL.Viewport (0, 0, gamewindow.Width, gamewindow.Height);
            GL.MatrixMode (MatrixMode.Projection);
            GL.LoadIdentity();
            GL.Ortho (0, gamewindow.Width, gamewindow.Height, 0, -1, 1);

            canvas.SetSize (gamewindow.Width, gamewindow.Height);
        };

        gamewindow.UpdateFrame += (s, e) =>
        {
            PreUpdate();

            if (renderer.TextCacheSize > 1000)
                renderer.FlushTextCache();

            PostUpdate();
        };

        gamewindow.RenderFrame += (s, e) =>
        {
            gamewindow.MakeCurrent();

            PreRender();

            canvas.RenderCanvas();

            PostRender();

            gamewindow.SwapBuffers();
        };
    }
        protected override void Layout(GwenSkin.Base skin)
        {
            base.Layout(skin);

            BindData();
            cb_action.SetSize(200, cb_action.Height);
            cb_action.PlaceLeftOf();
            cb_action.LogPositionAndSize();

            registrationInformation
            .AddContentChild(registrationContent)
            .PlaceBelowOf(cb_action)
            .AlignLeftWith()
            .SizeWidthWith();

            labeled_vehicle_license.Component.SmallSize();
            labeled_vehicle_model.Component.SmallSize();
            labeled_vehicle_insurance_status.Component.SmallSize();
            labeled_vehicle_insurance_status.Component.SmallSize();
            labeled_vehicle_registration_status.Component.SmallSize();



            labeled_vehicle_license
            .PlaceRightOf(labeled_vehicle_model, Configs.BaseFormControlSpacingTriple)
            .AlignTopWith(labeled_vehicle_model);

            labeled_vehicle_insurance_status
            .PlaceBelowOf(labeled_vehicle_model)
            .AlignLeftWith(labeled_vehicle_model);

            labeled_vehicle_registration_status
            .PlaceBelowOf(labeled_vehicle_insurance_status)
            .AlignLeftWith(labeled_vehicle_insurance_status);

            labeled_vehicle_insurance_status.Component.AlignLeftWith(labeled_vehicle_license);
            labeled_vehicle_registration_status.Component.AlignLeftWith(labeled_vehicle_insurance_status.Component);

            if (ComputerPlusEntity.PersonaType == PersonaTypes.BPS)
            {
                labeled_vehicle_extra_1.Component.SmallSize();
                labeled_vehicle_extra_2.Component.SmallSize();
                labeled_vehicle_extra_1.PlaceBelowOf(labeled_vehicle_registration_status);
                labeled_vehicle_extra_1.Component.AlignLeftWith(labeled_vehicle_registration_status.Component);
                labeled_vehicle_extra_2.PlaceBelowOf(labeled_vehicle_extra_1);
                labeled_vehicle_extra_2.Component.AlignLeftWith(labeled_vehicle_extra_1.Component);
            }

            //labeled_vehicle_registration_status.Component.AlignLeftWith(labeled_vehicle_insurance_status.Component);

            image_vehicle_image_holder
            .PlaceLeftOf();

            labeled_alpr
            .PlaceBelowOf(image_vehicle_image_holder)
            .AlignLeftWith(image_vehicle_image_holder)
            .SizeWidthWith(image_vehicle_image_holder);

            labeled_owner_alert
            .Align(labeled_vehicle_registration_status, labeled_alpr)
            .SizeWidthWith(labeled_vehicle_registration_status);

            registrationContent.SizeToChildrenBlock();
            registrationInformation.SizeToChildrenBlock();


            ownerInformation
            .AddContentChild(ownerContent)
            .PlaceBelowOf(registrationInformation)
            .SizeWidthWith();

            labeled_first_name.Component.MediumSize();
            labeled_last_name.Component.MediumSize();
            labeled_times_stopped.Component.SmallSize();
            labeled_wanted_status.Component.SmallSize();
            labeled_license_status.Component.SmallSize();
            labeled_age.Component.SmallSize();
            labeled_dob.Component.SmallSize();

            labeled_last_name
            .PlaceRightOf(labeled_first_name, Configs.BaseFormControlSpacingDouble)
            .AlignTopWith(labeled_first_name);

            labeled_age
            .PlaceRightOf(labeled_last_name, Configs.BaseFormControlSpacingDouble)
            .AlignTopWith(labeled_last_name);

            labeled_home_address
            .PlaceBelowOf(labeled_first_name, Configs.BaseFormControlSpacingDouble)
            .AlignLeftWith(labeled_first_name);

            labeled_dob
            .Align(labeled_age, labeled_home_address);

            labeled_license_status
            .PlaceBelowOf(labeled_home_address, Configs.BaseFormControlSpacingDouble)
            .AlignLeftWith(labeled_home_address);

            labeled_times_stopped
            .AlignRightWith(labeled_dob)
            .AlignTopWith(labeled_license_status);

            if (ComputerPlusEntity.PersonaType == PersonaTypes.BPS)
            {
                labeled_ped_extra_1.Component.SmallSize();
                labeled_ped_extra_1.PlaceBelowOf(labeled_times_stopped)
                .AlignLeftWith(labeled_times_stopped);

                //Adjust left for labeled_times_stopped
                labeled_times_stopped.Component.AlignLeftWith(labeled_ped_extra_1.Component);
            }


            labeled_wanted_status
            .PlaceBelowOf(labeled_license_status)
            .AlignLeftWith(labeled_license_status);

            image_ped_image_holder
            .PlaceLeftOf();

            ownerInformation.SizeToChildrenBlock();
            ownerContent.SizeToChildrenBlock();
        }
Пример #7
0
 protected override void Render(GwenSkin.Base skin)
 {
     base.Render(skin);
     CheckButtonState();
 }
Пример #8
0
 protected override void Layout(GwenSkin.Base skin)
 {
     base.Layout(skin);
     this.SizeFull();
     PositionControls();
 }
Пример #9
0
        protected override void Layout(GwenSkin.Base skin)
        {
            base.Layout(skin);

            BindData();
            cb_action.SetSize(200, cb_action.Height);
            cb_action.PlaceLeftOf();
            cb_action.LogPositionAndSize();

            pedInformation
            .AddContentChild(pedContent)
            .PlaceBelowOf(cb_action)
            .AlignLeftWith()
            .SizeWidthWith();

            text_first_name.Component.NormalSize();
            text_last_name.Component.NormalSize();
            text_age.Component.SmallSize();
            text_times_stopped.Component.SmallSize();
            text_wanted_status_false.Component.SmallSize();
            text_wanted_status_true.Component.SetSize(332, 90);
            text_license_status.Component.SetSize(150, 21);
            text_dob.Component.SmallSize();
            text_home_address.Component.LongSize();

            text_last_name
            .PlaceRightOf(text_first_name, Configs.BaseFormControlSpacingDouble)
            .AlignTopWith(text_first_name);

            text_age
            .PlaceRightOf(text_last_name, Configs.BaseFormControlSpacingDouble)
            .AlignTopWith(text_last_name);

            text_home_address
            .PlaceBelowOf(text_first_name, Configs.BaseFormControlSpacingDouble)
            .AlignLeftWith(text_first_name);

            text_dob
            .Align(text_age, text_home_address);

            text_license_status
            .PlaceBelowOf(text_home_address, Configs.BaseFormControlSpacingDouble)
            .AlignLeftWith(text_home_address);

            text_times_stopped
            .PlaceBelowOf(text_license_status)
            .AlignLeftWith(text_license_status);

            text_wanted_status_false
            .PlaceBelowOf(text_times_stopped)
            .AlignLeftWith(text_times_stopped);

            text_wanted_status_true
            .PlaceBelowOf(text_times_stopped)
            .AlignLeftWith(text_times_stopped);

            ped_image_holder
            .PlaceLeftOf();

            pedInformation.SizeToChildrenBlock();
            pedContent.SizeToChildrenBlock();
        }
Пример #10
0
        protected override void Layout(GwenSkin.Base skin)
        {
            base.Layout(skin);
            if (this.Parent == null && headerSection == null)
            {
                return;
            }

            BindDataFromCitation();

            labeled_citation_report_id.Component.SmallSize();
            if (btn_finish != null)
            {
                btn_finish.AlignRightWith().AlignTopWith(labeled_citation_report_id);
            }
            if (btn_finish_new != null)
            {
                btn_finish_new.PlaceLeftOf(btn_finish, Configs.BaseFormControlSpacingDouble * 2).AlignTopWith(btn_finish);
            }
            headerSection.SizeWidthWith().AlignTopWith().AlignLeftWith().SizeToChildrenBlock();

            /* Persons Information */

            citationeeInformationSection
            .AddContentChild(citationInformationContent)
            .PlaceBelowOf(headerSection)
            .SizeWidthWith();

            labeled_last_name.PlaceRightOf(labeled_first_name, Configs.BaseFormControlSpacingHalf);
            labeled_dob.PlaceRightOf(labeled_last_name, Configs.BaseFormControlSpacingHalf);
            labeled_dob.Component.SmallSize();
            labeled_home_address.PlaceBelowOf(labeled_first_name);

            citationInformationContent.SizeToChildren(false, true);
            citationeeInformationSection.SizeToChildren(false, true);

            /* Vehicle Information */

            vehicleInformationSection
            .AddContentChild(vehicleInformationContent)
            .PlaceBelowOf(citationeeInformationSection)
            .SizeWidthWith();

            labeled_vehicle_model.Component.SmallSize();
            labeled_vehicle_color.Component.SmallSize();
            labeled_vehicle_tag.Component.SmallSize();

            labeled_vehicle_model.PlaceRightOf(labeled_vehicle_type, Configs.BaseFormControlSpacingHalf);
            labeled_vehicle_color.PlaceRightOf(labeled_vehicle_model, Configs.BaseFormControlSpacingHalf);
            labeled_vehicle_tag.PlaceRightOf(labeled_vehicle_color, Configs.BaseFormControlSpacingHalf);

            vehicleInformationContent.SizeToChildren(false, true);
            vehicleInformationSection.SizeToChildren(false, true);

            /* Location Information */

            citationLocationSection
            .AddContentChild(citationLocationContent)
            .PlaceBelowOf(vehicleInformationSection)
            .SizeWidthWith();

            labeled_citation_date.Component.SmallSize();
            labeled_citation_time.Component.SmallSize();
            labeled_citation_city.Component.MediumSize();

            labeled_citation_date.PlaceRightOf(labeled_citation_street_address, Configs.BaseFormControlSpacingTriple * 2);
            labeled_citation_city.PlaceBelowOf(labeled_citation_street_address);
            labeled_citation_time.Align(labeled_citation_date, labeled_citation_city);

            citationLocationContent.SizeToChildren(false, true);
            citationLocationSection.SizeToChildren(false, true);

            /* Citation Details */

            violationSection
            .AddContentChild(violationContent)
            .PlaceBelowOf(citationLocationSection)
            .SizeWidthWith();


            labeled_available_citation_reasons
            .SizeWidthWith()
            .SetHeight(150)
            .SizeChildrenWidth()
            .SizeChildrenHeight(null, 30);

            labeled_citation_details
            .PlaceBelowOf(labeled_available_citation_reasons)
            .SizeWidthWith()
            .SetHeight(120)
            .SizeChildrenWidth()
            .SizeChildrenHeight(null, 30);

            violationContent.SizeToChildren(false, true);
            violationSection.SizeToChildren(false, true);
        }
 protected override void PostLayout(GwenSkin.Base skin)
 {
     base.PostLayout(skin);
 }