Jump to content
  • Advertisement
  • entries
    359
  • comments
    237
  • views
    189178

More dumb UI tricks.

Sign in to follow this  
Telastyn

80 views

Last night I went through and developed a basicish vertical listbox. Takes arbitrary types, and a generator to convert the arbitrary type into an arbitrary renderable. Has two modes of operation: resize mode, where the rectangle represented by the list is the sum of all contents, and contrain mode, where the list stops if it exits the listbox's rectangle.

I also got a basicish scrollbar, which wraps anything supporting an Up/Down interface.

Here's the new screenie then, with the two boxes on the right being a resizing listbox and a constrained listbox respectively. Both are string lists, with a basic text generator. Both the scroll buttons and the border support texturing, though I've no textures to test them with... (perhaps later today. [edit: eh, here's the scrollbuttons; the border texture had some nasty looking artifacts])



[edit:]

Ah yes, code for gen'd lists:


VerticalList<string> testList = new VerticalList<string>();
testList.Generator = new TextGen("Arial12");
testList.Color = System.Drawing.Color.SkyBlue.ToArgb();
testList.ReRect(new DynamicRect(new System.Drawing.Rectangle(testBorder2.tblr.Fetch().Right + 6, 1, 0, 0)));
testList.Push("1");
testList.Append("2");
testList.Append("3");
testList.Append("moocow!");

testList.PushOnto(RORoot.GUIRoot);

Border testBorder3 = Border.Around(testList, "solid", "solid", 1);
testList.BorderColor = System.Drawing.Color.SkyBlue.ToArgb();

VerticalList<string> testList2 = new VerticalList<string>(VerticalList<string>.RectBehavior.Constrain);
testList2.Generator = new TextGen("Arial24");
testList2.Color = testList.Color;
testList2.ReRect(new StaticRect(new System.Drawing.Rectangle(0,0,56,28)));
TiedRect.Tie(testList2,testList,TiedRect.TiePoints.LeftTop,TiedRect.TiePoints.LeftBottom,3,5);
testList2.Push("1");
testList2.Append("2");
testList2.Append("3");
testList2.Append("moocow!");

testList2.PushOnto(RORoot.GUIRoot);

VerticalScroll testScroll=Graphics.basero.Renderable.VerticalScroll.Around(testList2,"TestArrow",8,2,Border.SizingBehavior.InnerControlled,true,true);
testScroll.BorderColor=System.Drawing.Color.SeaGreen.ToArgb();
testScroll.ReRect(new IdenticalRect(testList2.tblr));

Border testBorder4 = Border.Around(testScroll, "solid", "solid", 2, 2);
testBorder4.BorderColor = System.Drawing.Color.SkyBlue.ToArgb();




Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!