🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

More dumb UI tricks.

Published August 01, 2006
Advertisement
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();
Previous Entry Sigh.
Next Entry Oot n aboot!
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement