Vyzor
Author
- Name
- Erik Pettis
- Forum Name
- Oneymus
About
- Link
- Mudlet Forums
- Beta Release
- January 8th, 2012
- Download
- vyzor.mpackage
- Source Code
- Github
Vyzor is a GUI framework that provides an object-oriented interface for Mudlet's Labels and Qt's Stylesheets. It provides Frames (Vyzor's container object) mapped to Mudlet's borders, which update dynamically or maintain a size specified by the user. Users creates Frames, and can define them using values relative to parent Frames; in this way, you can have widgets that properly map to, say, the right side of the main console. All Frames can be filled with Components, which map directly to Stylesheet Properties.
References
Project
Known Issues
- Overwriting the Chat Compound breaks switching between channels. This is a result of overwriting the global functions.
ToDo
- Implement Component inheritance to mimic Stylesheet cascading.
- Nested Labels (see GeyserLabel.lua)
- Allow Adding Frames to and Removing Frames from Box Compound
- The idea here is for run-time editing, but since you can't change Label layering post-creation, is this even feasible? In fact, I should assess the feasibility of ANY run-time modifications to GUI state.
- Options.ConsoleHeight should accept scalar values.
- Should be able to supply Components for the MiniConsole portion of Chat. Also, should expose a Frame for the Tab Box.
- Implement an AspectRatio Property for Frames.
- Provide a configurable BoxMode for the Boxes to allow for non-square layouts (2x16, 4x18, ...).
Updates
2012-01-18
- Additions
- Added MiniConsole support.
- Added Map support.
- Added Gauge support via new type: Compound.
- Fixes
- Solved a previously unknown problem with top and bottom Border Frames maximizing.
2012-01-23
- Additions
- A new alias, "vyzor help|vyhelp|vyh". In theory, would open the documentation in a browser. Didn't work for me.
- Fixes
- Gradients now work properly. The change to LuaJIT required a change in variable arguments.
- Options.DrawOrder now functions. Border Frames (and children) will now be drawn in the specified order.
- Borders and Backgrounds should now function without content (Brush or Image).
2012-02-06
- Additions
- Gauges:
- Can now supply a table of Frames as the last argument to the Gauge constructor. These Frames will be used when current values exceed the maximum value. If there are no overflow gauges (or current exceeds overflow), the final Gauge will properly draw at 100%.
- Gauges now have an internally generated caption Frame. This can be echoed to using <gauge>:Echo(text). If no text is supplied, the Gauge will echo according to a supplied TextFormat (should be string.format compatible, with two values).
- Gauges are now created with AutoEcho true, meaning they will echo to the Gauge every time Update is called. This can be turned off with <gauge>.AutoEcho = false
- Frames and MiniConsoles now possess wrappers for the remaining relevant Mudlet functions:
- Echo
- CEcho
- DEcho
- HEcho
- EchoLink
- EchoPopup
- Paste
- Clear
- Additionally, Frames possess two new Properties:
- Callback - Used to set a callback function. Must be a string.
- CallbackArguments - Used to pass arguments to a callback function. Should be a table.
- MiniConsoles also have AppendBuffer(), but functionality seems identical to Paste().
- Fixes
- Frames should now be guaranteed to draw in the correct order, thanks to the addition of a custom OrderedTable() function. See vyzor/lib for details.
2012-02-26
- Additions
- Created a Vyzor page on the Mudlet Wiki. In order to maintain brevity of this post, the Known Issues, ToDo, and Update lists will be maintained there. Additionally, there will some day be a usage guide and (possibly) documentation there. There will, however, always be the last update on this post for easy reference.
- Added a Box Compound that automatically arranges Frames.
- Boxes can be Horizontal (left->right), Vertical (top->bottom), or in a Grid (left->right, top->bottom).
- This is set via BoxMode Enum.
- This will lead to a Chat Compound and a Nested Labels (fly-out) Compound.
- Fixes
- Resolved an issue with setting MiniConsole properties post-creation. I had put the function in the wrong place. =p
2012-05-24
- Additions
- Chat Compound
- Can now create a handy-dandy tabbed chat Compound.
- Can have any number of windows to which text can be sent, switched via clicking on tabs.
- The Chat Compound itself uses a Background Frame that the user provides, allowing for customization.
- A table of Components can be passed to Compound which will be applied to all created tabs.
- If one of the channels is "All", it's used as a bucket. This is optional.
- Convenient shortcuts to the Border Frames. Instead of Vyzor.HUD.Frames[...], Border Frames can now be accessed with Vyzor.Top, Vyzor.Right, Vyzor.Bottom, and Vyzor.Left.
- Events
- VyzorDrawnEvent is raised after Vyzor has finished drawing everything.
- VyzorResizedEvent is raised after Vyzor has successfully resized everything. Be warned, this can happen a lot when resizing.
- VyzorLoadEvent is raised after Mudlet successfully loads the Vyzor package. This should be used to initialize GUI scripts.
- VyzorInitializeGauges: A global event handler for VyzorDrawnEvent. Initializes the Gauges (basically an update call).
- Vyzor no longer assumes control of Mudlet's borders on start-up. By setting Options.HandleBorders to one of three options, you can control how Vyzor assumes control.
- true - Vyzor will always control Mudlet's borders. This is how it currently functions.
- "auto" - Vyzor will assume control upon a Vyzor.HUD:Draw() call.
- false - Vyzor will never assume control of Mudlet's borders.
- Fixes
- Removed improper echo functions from Frames.
- Changed Hover functions to reflect similar Frame functions (Add, Remove).
- Top and Bottom Border Frames can no longer go negative. This should prevent the main console from appearing outside of your visible space.
- The Box Compound now accepts a background Frame instead of dimensions. This change brought Boxes in line with other Compounds, and also allows you to pass a customized Frame to the entire Box.
- Alias "vyzor help" now works. Turns out, on Windows, you need to call gsub("\\", "/") on getMudletHomeDir() to make things work. Same thing for my SampleGui.
- Also, "vyzor help" will use openWebPage() if it exists.
- Fixed a bug that prevented Borders from working without Content.
- Gradients now use tables for their stop/Color pairs. This should make it easier to pass a long list of stops to gradients.
- Also, I figured out what cx/cy and fx/fy mean for radial Gradients. c* = the center of the circle. f* = the point from which the colors radiate.
2012-07-25
- Fixes
- Uploaded a small bug fix for Grid Boxes.
- Certain size Grids would exceed the boundary the container Frame due to a math error on my part.
2013-01-06
- Fixes
- Fixed a nil error for Font Components.
- Font sizes actually work, because I'm no longer doing them wrong.
- I did not realize that appending "px" or "pt" was a requirement.
- Additions
- The Font constructor has been changed to allow specifying font-family. This breaks some backwards compatibility.
- Added a corresponding Family Property to the Font object.
2013-02-27
- Fixes
- Fixed the HUD not properly drawing Frames that are added outside of a Border Frame.
- Fixed the Chat Compound improperly positioning and sizing MiniConsoles when using Left and Right Tabs.
2013-03-31
- Fixes
- The VyzorLoadEvent will now be raised via tempTimer, to defer execution until after all Scripts have been loaded. This should make it more useful.
- Additions
- Added a boolean argument to the Frame functions Hide() and Show(); setting this to true will skip the children, meaning they won't be hidden or shown, depending.
Documentation
- API Reference
- [Reference]
- This is comprehensive reference to Vyzor's API. Everything necessary to work with Vyzor should be contained herein.
License
Vyzor, UI Manager for Mudlet Copyright (c) 2014 Erik Pettis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.