Provides a better way to interact with interface controls than the built-in winset/winget procs. [More]
To download this library for your Linux/Mac installation, enter this on your command line:
DreamDownload byond://Forum_account.Interface##version=10Emulator users, in the BYOND pager go to File | Open Location and enter this URL:
Version 2.7 (posted 07-12-2012)
Version 2.5 Posted!
Version 2.4.1 Posted!
I also added the List proc for grid controls. This is just a shortcut for displaying a list.
About the Library
This library started as a way to abstract out the details of calling winset and winget to create a better API but quickly grew. The library also introduces some shortcut functions for dealing with certain controls. For example, here's how you set the contents of a cell in a grid control with and without the library:
// without the library this is what you have to do:
You can store a reference to the grid control on the mob so you can always easily update their interface.
I created a demo that is separate from the library. It uses the library to handle interaction between a jQuery plugin and the DM program. download the demo
Also added the Browser.Cache proc to eliminate use of browse_rsc. If you pass only a filename as the argument it will be cached by that name. If you pass an icon and icon state as arguments it will cache a .png image of that icon. For example:
// This puts the file icons.mob.png in the client's cache so you can reference it in HTML.
Two demos were added showing how to implement Lesson 2 and Lesson 4 of Lummox's skin tutorials. Some features were added to accommodate these new demos:
• The Grid.Cell(x,y,value) proc was added to handle the details of setting the value of a single cell.
• The Output.Output proc was added to handle outputting text. It takes two parameters. One is the text to output, the other is who you want to output to (src, world, view, etc.). If the target is omitted it defaults to the control's owner.
• Support for the Child type of control was added.
Version 2 adds some neat features for browser controls. To output HTML to a browser control you can do this:
var/Browser/browser = new("window1","browser",src)
This library provides a layer of abstraction between you and the awful winset/winget procs. Instead of commands like this:
winset(player, "window1.label1", "text=Hello+world!")
You can do this:
These procs handle the details of generating and parsing the parameter strings that winset/winget use. They also create objects to represent data when appropriate (for colors, positions, sizes, and lists).
The library does make some sacrifices. To speed things up it caches the values of certain properties. If you use a client-side command to update a property the server won't know about it and won't request the new value. Because client-side commands are ugly to deal with, I've sacrificed them to create a decent interface API.
Copyright © 2016 BYOND Software. All rights reserved.