Class Joyau::HorizontalMsgSelecter
In: Drawable.cpp
Parent: Joyau::Drawable

This drawable allows to select between one or more messages, disposed horizontally.

Methods

<<   conf   conf=   focus   focus=   focusConf   focusConf=   index   item   new   resize   select   selected   size  

Public Class methods

Creates a new message selecter.

[Source]

/*
  call-seq: new()

  Creates a new message selecter. 
*/
VALUE wrap<HorizontalMsgSelecter>(int argc, VALUE *argv, VALUE info)
{
   HorizontalMsgSelecter *ptr = new HorizontalMsgSelecter;
   ptr->setClass("HorizontalMsgSelecter");
   VALUE tdata = Data_Wrap_Struct(info, 0, 
                                  wrapped_free<HorizontalMsgSelecter>, ptr);
   return tdata;
}

Public Instance methods

Adds an object to the selecter.

[Source]

/*
  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.

[Source]

/*
  Returns the message's config.
*/
VALUE MsgSelecter_conf(VALUE self)
{
   T &ref = getRef<T>(self);
   MsgConfig &conf = ref.getConf();

   return conf.toRuby();
}

Sets the MsgConfig object used when drawing any object.

[Source]

/*
  call-seq: conf=(val)

  Sets the MsgConfig object used when drawing any object.
*/
VALUE MsgSelecter_setConf(VALUE self, VALUE val)
{
   T &ref = getRef<T>(self);
   MsgConfig &arg = getRef<MsgConfig>(self);
   
   ref.setConf(arg);
   return val;
}

Returns whether the object has focus.

[Source]

/*
  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.

[Source]

/*
  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;
}

Returns the MsgConfig object used on the focused item.

[Source]

/*
  Returns the MsgConfig object used on the focused item.
*/
VALUE MsgSelecter_focusConf(VALUE self)
{
   T &ref = getRef<T>(self);
   MsgConfig &conf = ref.getFocusConf();

   return conf.toRuby();
}

Sets the MsgConfig object used when drawing the focused object.

[Source]

/*
  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.

[Source]

/*
  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.

[Source]

/*
  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.

[Source]

/*
  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.

[Source]

/*
  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;
}

Returns the selected item.

[Source]

/*
  Returns the selected item.
*/
VALUE GenericSelecter_selected(VALUE self)
{
   T &ref = getRef<T>(self);
   return ref.getSelected().toRuby();
}

Returns how many items are present in the selecter.

[Source]

/*
  Returns how many items are present in the selecter.
*/
VALUE GenericSelecter_size(VALUE self)
{
   T &ref = getRef<T>(self);
   return INT2FIX(ref.getSize());
}

[Validate]