コード例 #1
0
        public TextNDropTestDialog()
            : base("TextField and DropList Test", 200, 200, 320, 200)
        {
            girdLayout = new GirdLayout(4, 1);
            girdLayout.Right = 16;
            girdLayout.Left = 16;
            girdLayout.Top = 8;
            girdLayout.Bottom = 8;
            girdLayout.Spacer = 4;

            girdLayout.SetHorizontalAlignment(1, 0, EHAlignment.HLeft);
            girdLayout.SetHorizontalAlignment(2, 0, EHAlignment.HCenter);
            girdLayout.SetHorizontalAlignment(3, 0, EHAlignment.HRight);

            closeButton = new Button("Close");
            //textField=new TextField(160);
            dropList = new DropList();
            option1 = new DropListItem("Option one");
            option2 = new DropListItem("Option Two");
            option3 = new DropListItem("Option Three");
            dropList.Add(option1);
            dropList.Add(option2);
            dropList.Add(option3);

            textLabel = new Label("Text input here:");
            optionLabel = new Label("Drop List test:");

            Layout = girdLayout;

            Add(textLabel);
            //Add(textField);
            Add(optionLabel);
            Add(dropList);
            Add(closeButton);

            Pack();

            closeButton.MouseReleasedEvent += new MouseReleasedHandler(closeButton_MouseReleasedEvent);
        }
コード例 #2
0
 public override Size GetDropListItemPreferedSize(DropListItem component)
 {
     UI.Instance.CurrentTheme.defaultTextFont.MeasureString(component.Text, out w, out h);
     return new Size(component.Right + component.Left + (uint)w, 20);
 }
コード例 #3
0
		public override void PaintDropListItem(DropListItem component)
		{
			Position origin= UI.Instance.GetOrigin();

            if(component.GetStatus()== EButtonStatus.Hover)
			{
                GL.Color3((byte)175, (byte)200, (byte)28);
                GL.Begin(BeginMode.Quads);
                GL.Vertex2(origin.X + component.Position.X, origin.Y + component.Position.Y);
                GL.Vertex2(origin.X + component.Position.X + component.Size.width, origin.Y + component.Position.Y);
                GL.Vertex2(origin.X + component.Position.X + component.Size.width,
                           origin.Y+component.Position.Y+component.Size.height);
                GL.Vertex2(origin.X + component.Position.X, origin.Y + component.Position.Y + component.Size.height);
                GL.End();
            }
            GL.Color3(0, 0, 0);
            component.textFont.PosX = (int)(component.Position.X + component.Left + origin.X);
            component.textFont.PosY = (int)(component.Top + origin.Y + component.Position.Y - 2);
            component.textFont.Render(true);
		}
コード例 #4
0
ファイル: Theme.cs プロジェクト: RobertCL/MissionPlanner
 public abstract void PaintDropListItem(DropListItem component);
コード例 #5
0
 public void SetSelection(DropListItem selected)
 {
     SelectedItem = selected;
 }
コード例 #6
0
ファイル: Theme.cs プロジェクト: RobertCL/MissionPlanner
 public abstract Size GetDropListItemPreferedSize(DropListItem component);
コード例 #7
0
 public void SetSelection(int index)
 {
     SelectedItem = ItemList_[index];
 }
コード例 #8
0
 public void Add(DropListItem item)
 {
     ItemList_.Add(item);
     Size = GetPreferedSize();
 }
コード例 #9
0
 public void SetSelection(DropListItem selected)
 {
     SelectedItem = selected;
 }
コード例 #10
0
 public void SetSelection(int index)
 {
     SelectedItem = ItemList_[index];
 }
コード例 #11
0
 public void Add(DropListItem item)
 {
     ItemList_.Add(item);
     Size = GetPreferedSize();
 }