  | |  | Use Moi: Easy MUI | Use Moi: Easy MUI 2003-12-09 - By Pranav Negandhi
Back Hi listers,
I've been busy dusting off some of my old code lately, and ran into something very interesting. The scripts, labelled Use Moi, actually let you make use of the MUI Xtra from Macr. The wrapper lets you initialise dialog boxes quickly, exposes interfaces for adding widgets and modifying their properties and generates callbacks for user interactions that occur in the dialog box.
To create an empty dialog box, you need to only instantiate the dialog box script. This instance can then be used to modify the window properties, as well as add widgets to it. When creating the instance, you must also specify the callback object, which will be informed of the interaction events.
The wrapper exposes a simple interface that lets you add widgets to your dialog box easily. Widgets are grouped into six different categories - groups, buttons, text boxes, sliders, popups and decorative widgets. Of these, the groups category will be dropped off in the future as the system matures. Buttons, and sliders have sub-categories.
Buttons - #checkBox, #radioButton, #defaultPushButton, #cancelPushButton, #pushButton, #toggleButton Sliders - #integer, #float
The text box category contains two variations - editText & label. Rather than specifying the type, you can specify whether the text box is editable or not. The wrapper then creates the correct type of widget based on this parameter. Decorative widgets are bitmaps. I haven't read up about these and the popup widget types at all yet. So although you can create them, I'm sure they won't work.
The callback system is implemented in a manner similar to VB. Each widget needs a handler for each event that needs to be trapped. For example, if you have a text field labelled "username", every time the user changes the text in the field, the username_itemChanged event is triggered in the callback object. If the object contains the handler, then it is executed. Else the event is ignored.
Work is still pending in many places. Firstly, the groups widget category needs to be dropped. The system will still have groups ofcourse, but the definition and creation will be made easier. Sliders and popups are another front that need work. Since both these types of widgets require an attributes parameter, I'll probably change the creation interfaces for these categories.
The biggest limitation of this system is that at present, you can have only one MUI dialog box open. :( Sux, I know, but it fulfilled my immediate requirement back when I started this thing. If someone can suggest a way to make the system work with more than one dialog box at the same time, it'd be super!
Since the callback system is something very different from usual Director applications, I'm most concerned about how well it can be recieved. Are there any pitfalls in the system? The source code of this system is available on the following URLs - http://www.cimultimedia.com/trials/use_moi.dir & http://www.cimultimedia.com/trials/use_moi.cst. The movie contains a small working example that I whipped up during the day. Looking forward to hearing from ye.
Pranav Negandhi concept-I www.cimultimedia.com
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ dirGames-L mailing list - dirGames-L@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dirgames-l
Earn $52 per hosting referral at Lunarpages.
|
|
 |