| | |
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 上部菜单标题的高度
|
| | | /// 菜单标题的高度
|
| | | /// </summary>
|
| | | public int topMenuHeight = 190;
|
| | | public int topTitleHeight = 63;
|
| | | /// <summary>
|
| | | /// 按钮的高度
|
| | | /// </summary>
|
| | |
| | | /// <summary>
|
| | | /// 输入框的宽度
|
| | | /// </summary>
|
| | | public int InputControlWidth = 800;
|
| | | public int InputControlWidth = 677;
|
| | | /// <summary>
|
| | | /// 确认按钮事件
|
| | | /// 确认按钮事件(由Text获取输入值,None模式除外)
|
| | | /// </summary>
|
| | | public delegate void _ComfirmClickEvent();
|
| | | /// <summary>
|
| | | /// 画面关闭事件(由InputText获取输入值,None模式除外)
|
| | | /// </summary>
|
| | | public _ComfirmClickEvent ComfirmClickEvent;
|
| | | public Action<string> ComfirmClickEvent;
|
| | | /// <summary>
|
| | | /// 输入框的文本信息
|
| | | /// </summary>
|
| | | public string InputText
|
| | | public string Text
|
| | | {
|
| | | get
|
| | | {
|
| | |
| | | {
|
| | | mainFrame.AddChidren(this);
|
| | | //初始化桌布控件
|
| | | this.InitframeControl(this.dialogFrameMode);
|
| | | this.InitframeControl();
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化桌布控件
|
| | | /// </summary>
|
| | | /// <param name="i_dialogFrameMode">窗体模式</param>
|
| | | public void InitframeControl(DialogFrameMode i_dialogFrameMode)
|
| | | public void InitframeControl()
|
| | | {
|
| | | if (this.frameLayout != null)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | //这是一个框
|
| | | //this.frameLayout = new SpecialFrameLayout(960, 620, buttonHeight);
|
| | | this.frameLayout = new FrameLayout();
|
| | | frameLayout.Height = Application.GetRealHeight(620);
|
| | | frameLayout.Width = Application.GetRealWidth(960);
|
| | | frameLayout.Height = Application.GetRealHeight(538);
|
| | | frameLayout.Width = Application.GetRealWidth(792);
|
| | | frameLayout.Gravity = Gravity.Center;
|
| | | frameLayout.Radius = 5;
|
| | | frameLayout.BackgroundColor = UserCenterColor.Current.BodyFrameLayout;
|
| | | frameLayout.Radius = 6;
|
| | | frameLayout.BackgroundColor = UserCenterColor.Current.White;
|
| | | base.AddChidren(frameLayout);
|
| | |
|
| | | //标题信息
|
| | | var btnTitle = new NormalViewControl(frameLayout.Width, Application.GetRealHeight(topMenuHeight), false);
|
| | | var btnTitle = new NormalViewControl(frameLayout.Width, Application.GetRealHeight(topTitleHeight), false);
|
| | | btnTitle.Y = Application.GetRealHeight(69);
|
| | | btnTitle.TextColor = UserCenterColor.Current.TextColor1;
|
| | | btnTitle.TextSize = 22;
|
| | | btnTitle.TextAlignment = TextAlignment.BottomCenter;
|
| | | btnTitle.TextSize = 16;
|
| | | btnTitle.TextAlignment = TextAlignment.Center;
|
| | | frameLayout.AddChidren(btnTitle);
|
| | | frameLayout.AddTag("btnTitle", btnTitle);
|
| | |
|
| | | //中间空白区域
|
| | | int midHeight = frameLayout.Height - Application.GetRealHeight(topMenuHeight + buttonHeight);
|
| | | //this.frameMiddle = new SpecialFrameLayout(frameLayout.Width, midHeight, buttonHeight, false);
|
| | | int midHeight = frameLayout.Height - Application.GetRealHeight(btnTitle.Bottom + buttonHeight);
|
| | | this.frameMiddle = new FrameLayout();
|
| | | frameMiddle.Height = midHeight;
|
| | | frameMiddle.Width = frameLayout.Width;
|
| | | frameMiddle.Y = btnTitle.Bottom;
|
| | | //frameMiddle.BackgroundColor = UserCenterColor.Current.BodyFrameLayout;
|
| | | frameLayout.AddChidren(frameMiddle);
|
| | |
|
| | | //取消(因为有可能要扩大中部高度,所以先声明)
|
| | | var btnCancel = new NormalClickButton(frameLayout.Width / 2 - 1, Application.GetRealHeight(buttonHeight));
|
| | | btnCancel.BackgroundColor = 0;
|
| | | var btnCancel = new NormalClickButton(frameLayout.Width / 2, Application.GetRealHeight(buttonHeight));
|
| | | btnCancel.BackgroundColor = 0x66cccccc;
|
| | | btnCancel.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnCancel.TextID = R.MyInternationalizationString.uCancel;
|
| | | btnCancel.TextSize = 18;
|
| | | frameLayout.AddTag("btnCancel", btnCancel);
|
| | |
|
| | | //确认(因为有可能要扩大中部高度,所以先声明)
|
| | | var btnOk = new NormalClickButton(frameLayout.Width / 2 - 1, Application.GetRealHeight(buttonHeight));
|
| | | btnOk.BackgroundColor = 0;
|
| | | var btnOk = new NormalClickButton(frameLayout.Width / 2, Application.GetRealHeight(buttonHeight));
|
| | | btnOk.TextID = R.MyInternationalizationString.OkMsg;
|
| | | btnOk.TextSize = 18;
|
| | | btnOk.TextColor = UserCenterColor.Current.TextBlueColor;
|
| | | frameLayout.AddTag("btnOk", btnOk);
|
| | |
|
| | | if (dialogFrameMode == DialogFrameMode.None)
|
| | | {
|
| | | return;
|
| | |
| | | var frameText = this.InitInputTextLine();
|
| | | this.frameMiddle.AddChidren(frameText);
|
| | | //输入框
|
| | | this.txtInput = this.InitInputControl(frameText);
|
| | | //frameText.AddChidren(txtInput, HeightAutoMode.IncreaseAll);
|
| | | this.txtInput = this.InitInputControl();
|
| | | frameText.AddChidren(txtInput);
|
| | | }
|
| | |
|
| | |
| | | //初始化边框
|
| | | var frameText = this.InitInputTextLine();
|
| | | this.frameMiddle.AddChidren(frameText);
|
| | | frameText.Radius = 8;
|
| | |
|
| | | //输入框
|
| | | this.txtInput = this.InitInputControl(frameText);
|
| | | this.txtInput = this.InitInputControl();
|
| | | this.txtInput.SecureTextEntry = true;
|
| | | //frameText.AddChidren(txtInput, HeightAutoMode.IncreaseAll);
|
| | | frameText.AddChidren(txtInput);
|
| | | }
|
| | |
|
| | |
| | | //初始化边框
|
| | | var frameText = this.InitInputTextLine();
|
| | | this.frameMiddle.AddChidren(frameText);
|
| | | frameText.Radius = 8;
|
| | |
|
| | | //输入框
|
| | | this.txtInput = this.InitInputControl(frameText);
|
| | | this.txtInput = this.InitInputControl();
|
| | | this.txtInput.SecureTextEntry = true;
|
| | | //frameText.AddChidren(txtInput, HeightAutoMode.IncreaseAll);
|
| | | frameText.AddChidren(txtInput);
|
| | | this.txtInput.Gravity = Gravity.Frame;
|
| | |
|
| | |
| | | /// </summary>
|
| | | public FrameLayout InitInputTextLine()
|
| | | {
|
| | | //var frameText = new SpecialFrameLayout(this.InputControlWidth, 110, 20);
|
| | | var frameText = new FrameLayout();
|
| | | frameText.Width = Application.GetRealWidth(this.InputControlWidth);
|
| | | frameText.Height = Application.GetRealHeight(110);
|
| | | frameText.Gravity = Gravity.Center;
|
| | | frameText.BorderColor = UserCenterColor.Current.TextFrameColor;
|
| | | frameText.Height = Application.GetRealHeight(100);
|
| | | frameText.Y = Application.GetRealHeight(81);
|
| | | frameText.Gravity = Gravity.CenterHorizontal;
|
| | | frameText.BorderColor = 0xff676767;
|
| | | frameText.BorderWidth = 1;
|
| | | frameText.Radius = 8;
|
| | |
|
| | |
| | | /// <summary>
|
| | | /// 初始化输入框控件
|
| | | /// </summary>
|
| | | /// <param name="frameLine"></param>
|
| | | public TextInputControl InitInputControl(FrameLayout frameLine)
|
| | | public TextInputControl InitInputControl()
|
| | | {
|
| | | var txtText = new TextInputControl(Application.CurrentWidth);
|
| | | txtText.InitSize(frameLine.Width - Application.GetRealHeight(10), ControlCommonResourse.NormalControlHeight, false);
|
| | | var txtText = new TextInputControl(this.InputControlWidth - 20, 69, true);
|
| | | txtText.TextAlignment = TextAlignment.Center;
|
| | | txtText.Gravity = Gravity.Center;
|
| | |
|
| | |
| | | this.RemoveFromParent();
|
| | | return;
|
| | | }
|
| | | this.ComfirmClickEvent();
|
| | | this.ComfirmClickEvent(this.Text);
|
| | | };
|
| | |
|
| | | //灰线
|
| | | var btnLine1 = new NormalViewControl(1, Application.GetRealHeight(buttonHeight), false);
|
| | | btnLine1.X = btnCancel.Right;
|
| | | btnLine1.Y = btnCancel.Y;
|
| | | btnLine1.BackgroundColor = UserCenterColor.Current.Line;
|
| | | frameLayout.AddChidren(btnLine1);
|
| | |
|
| | | //灰线
|
| | | var btnLine2 = new NormalViewControl(frameLayout.Width, 1, false);
|
| | | btnLine2.Y = btnOk.Y - 1;
|
| | | btnLine2.BackgroundColor = UserCenterColor.Current.Line;
|
| | | frameLayout.AddChidren(btnLine2);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 添加子控件
|
| | | /// </summary>
|
| | | /// <param name="view"></param>
|
| | | /// <param name="heightAutoMode">高度变更模式</param>
|
| | | public void AddChidren(View view, HeightAutoMode heightAutoMode = HeightAutoMode.None)
|
| | | /// <param name="heightAutoMode">高度变更模式(非None的时候都同一自动调整)</param>
|
| | | /// <param name="bottomSpace">中间空白区域里面最底部的控件与底部按钮的间距(非真实值)</param>
|
| | | public void AddChidren(View view, HeightAutoMode heightAutoMode = HeightAutoMode.None, int bottomSpace = 0)
|
| | | {
|
| | | //this.frameMiddle.AddChidren(view, heightAutoMode);
|
| | | this.frameMiddle.AddChidren(view);
|
| | | if (heightAutoMode != HeightAutoMode.None)
|
| | | {
|
| | | //获取最底部控件的坐标
|
| | | int realHeight = 0;
|
| | | for (int i = 0; i < this.frameMiddle.ChildrenCount; i++)
|
| | | {
|
| | | var myView = this.frameMiddle.GetChildren(i);
|
| | | if (myView.Bottom > realHeight)
|
| | | {
|
| | | realHeight = myView.Bottom;
|
| | | }
|
| | | }
|
| | | int value = realHeight + Application.GetRealHeight(bottomSpace) - this.frameMiddle.Height;
|
| | | if (value > 0)
|
| | | {
|
| | | //底部控件已经超出了目前的高度,则扩大控件
|
| | | this.frameMiddle.Height += value;
|
| | | this.frameLayout.Height += value;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// </summary>
|
| | | public void CloseDialog()
|
| | | {
|
| | | this.ComfirmClickEvent = null;
|
| | | this.RemoveFromParent();
|
| | | }
|
| | |
|