| Class | Joyau::VerticalMsgSelecter |
| In: |
Drawable.cpp
|
| Parent: | Joyau::Drawable |
Creates a new message selecter.
/*
call-seq: new()
Creates a new message selecter.
*/
VALUE wrap<VerticalMsgSelecter>(int argc, VALUE *argv, VALUE info)
{
VerticalMsgSelecter *ptr = new VerticalMsgSelecter;
ptr->setClass("VerticalMsgSelecter");
VALUE tdata = Data_Wrap_Struct(info, 0,
wrapped_free<VerticalMsgSelecter>, ptr);
return tdata;
}
Adds an object to the selecter.
/*
call-seq: addItem(obj)
Adds an object to the selecter.
*/
VALUE GenericSelecter_addItem(VALUE self, VALUE obj)
{
T &ref = getRef<T>(self);
typename T::content_t &arg = getRef<typename T::content_t>(obj);
ref.addItem(arg);
return Qnil;
}
Returns the message’s config.
/*
Returns the message's config.
*/
VALUE MsgSelecter_conf(VALUE self)
{
T &ref = getRef<T>(self);
MsgConfig &conf = ref.getConf();
return conf.toRuby();
}
Returns whether the object has focus.
/*
Returns whether the object has focus.
*/
VALUE GenericSelecter_focus(VALUE self)
{
T &ref = getRef<T>(self);
return ref.getFocus() ? Qtrue : Qfalse;
}
Sets the focus on the selecter. When false, the focus effect is never applied.
/*
call-seq: focus=(val)
Sets the focus on the selecter. When false, the focus effect is never applied.
*/
VALUE GenericSelecter_setFocus(VALUE self, VALUE val)
{
T &ref = getRef<T>(self);
ref.setFocus(val == Qtrue);
return Qnil;
}
Sets the MsgConfig object used when drawing the focused object.
/*
call-seq: focusConf=(conf)
Sets the MsgConfig object used when drawing the focused object.
*/
VALUE MsgSelecter_setFocusConf(VALUE self, VALUE val)
{
T &ref = getRef<T>(self);
MsgConfig &arg = getRef<MsgConfig>(self);
ref.setFocusConf(arg);
return Qnil;
}
Returns the actual object’s index.
/*
Returns the actual object's index.
*/
VALUE GenericSelecter_index(VALUE self)
{
T &ref = getRef<T>(self);
return INT2FIX(ref.getIndex());
}
Changes the selected element, increasing the actual index by the given argument.
If index + id > size, nothing will happen.
/*
call-seq: select(id)
Changes the selected element, increasing the actual index by the given
argument.
If index + id > size, nothing will happen.
*/
VALUE GenericSelecter_select(VALUE self, VALUE dir)
{
T &ref = getRef<T>(self);
ref.select(FIX2INT(dir));
return Qnil;
}
Changes the selecter’s size. Everything will be drawn in a such rect, either by reducing or increasing the object’s size.
/*
call-seq: resize(w, h)
Changes the selecter's size. Everything will be drawn in a such rect,
either by reducing or increasing the object's size.
*/
VALUE GenericSelecter_resize(VALUE self, VALUE w, VALUE h)
{
T &ref = getRef<T>(self);
ref.resize(FIX2INT(w), FIX2INT(h));
return Qnil;
}
Changes the selected element, increasing the actual index by the given argument.
If index + id > size, nothing will happen.
/*
call-seq: select(id)
Changes the selected element, increasing the actual index by the given
argument.
If index + id > size, nothing will happen.
*/
VALUE GenericSelecter_select(VALUE self, VALUE dir)
{
T &ref = getRef<T>(self);
ref.select(FIX2INT(dir));
return Qnil;
}