Interface Object |
|
For those of use who hate to use winset. [More] |
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 |
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) 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) |
Forum_account: (Mar 27 2012, 3: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, 2:55 pm)
Forum_account wrote:
Yep, all you have to do is this: > var/Label/label = new("window", "label", client) 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, 2:47 pm)
Yep, all you have to do is this:
var/Label/label = new("window", "label", client) 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, 2: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, 2: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. 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. |
Copyright © 2024 BYOND Software.
All rights reserved.