Interface Object

by ExPixel
[Share] [Zip]
To download this library for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://ExPixel.InterfaceObject##version=5

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://ExPixel.InterfaceObject##version=5

382 downloads
Version 1.5
Date added: Jul 24 2011
Last updated: Jul 25 2011
0 fans
For those of use who hate to use winset. [More]
I created this library because the us of winset was never very appealing to me. I wanted to share this with everyone else who had this little problem. It's not as complicated as forum_account's library (click the link if it's what you want) but it can be used without have code pre-generated. You simply have to bind this object to a client and a control.

DOCUMENTATION YEAH!!!!

IMPORTANT NOTE: Leaving the arguments blank in the Parameter Proc called will make the proc return the
value of the parameter of the control

IMPORTANT NOTE 2: The return values are going to be either numbers, text, or a boolean(true or false, 0 or 1). So calling Control.FontSize() will return a number.

Naming Convention For Parameter's Proc:

The naming convention used isn't very complicated. All spaces and dashes(-) are removed,
instead the character that comes after them are capitalized. The first letter of the paremeter
is also capitalized. So to change the text on a label you would do something like so:
var/LabelControl/L = new("default.label1", client)
L.Text("blah")//sets the text to "blah"
var/v = L.Text()//L.Text() returns the label's text and sets the variable 'v' to the labe's text



Control Types:

CONTROL - Highest level of controls, does not include Macro or menu

MacroControl - Macros

MenuControl - Menus

LabelControl - Labels

BrowserControl - Browsers

WindowControl - Windows

TabControl - Tabs

ButtonControl - Buttons

InfoControl - Infos

InputControl - Inputs

OutputControl - Outputs

BarControl - Bars

ChildControl - Childs

GridControl - Grids


How it works:

- You may initialize a control by simply calling the bind(control, client) proc
The first argument is the control and the second is the client/mob(with a client)
- You can also initialize a control by supplying the arguments of bind in the control's
New proc e.g. var/LabelControl/L = new("somewindow.somecontrol", src)

Advertisement

Comments

Forum_account: (Mar 27 2012, 5:00 pm)
It looks like the biggest difference is that you can use your library to create a single control object, then bind it to different clients as you need to change things on their interface. With my library each control object has an owner, so you'd create one instance of a control object per client (since it caches values, the cache is specific to a single client and can't be shared).
ExPixel: (Mar 27 2012, 4:55 pm)
Forum_account wrote:
Yep, all you have to do is this:

> var/Label/label = new("window", "label", client)
> label.Text("hello, world!")
>
> // you could also do this:
> label = new("window.label", client)
>
> // or this:
> label = new(client, "window.label")
>

The library's code was generated and it can also generate code from a .dmf file - it creates the control definitions for every control on a window. These steps aren't necessary though.

OH! I may have misunderstood the way your library works then.
Forum_account: (Mar 27 2012, 4:47 pm)
Yep, all you have to do is this:

var/Label/label = new("window", "label", client)
label.Text("hello, world!")

// you could also do this:
label = new("window.label", client)

// or this:
label = new(client, "window.label")

The library's code was generated and it can also generate code from a .dmf file - it creates the control definitions for every control on a window. These steps aren't necessary though.
Kaiochao: (Mar 27 2012, 4:45 pm)
ExPixel wrote:
With Forum_Account's you generate the code.

I saw you said this at least twice already, but I have no clue what you mean by this.

I can't find any documentation for the Interface library, but it appears that all you need to do to "bind a control to a client" is make a variable with the appropriate type and initialize it by calling new(window, control, player).
ExPixel: (Mar 27 2012, 4:25 pm)
Galactic Soldier wrote:
It's a slightly more ineffective way to produce the same results; tunneling one procedure through another. Maybe an improvement in conventional coding mannerisms (shouldn't matter, the other way of doing it is quite self-explanatory), but nothing more than that.

Forum_account wrote:
The Interface library works the same way =)

In other words, this library isn't needed or beneficial also since something of the same assent predates it. He also seems to be very fond of your library that in your words "works the same way"; could be some plagiarism involved.

Forum_account wrote:
Users don't have to remember all of the details of using winset, winget, browse, browse_rsc, output, etc.

Then look at the reference; that's why it's there. It's no different from searching through this library's procedures.

There is a difference between his and my library. With mine you create the object representing a control on the interface and you user the bind() proc to bind that object to the interface. With Forum_Account's you generate the code. Mine is easier to get started with and use. Forum_Account's offers more functionality.