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

Displays a menu as a Circle. Its picture has to dispose the icons vertically.

Methods

alpha   alpha=   angle   angle=   changeSelection   change_selection   dist   dist=   getIndex   index   load   setAlpha   setAngle   setDist  

Constants

RIGHT = INT2FIX(0)
LEFT = INT2FIX(1)

Public Instance methods

Returns the menu’s alpha value.

[Source]

/*
  Returns the menu's alpha value.
*/
VALUE CircleMenu_alpha(VALUE self)
{
   CircleMenu &ref = getRef<CircleMenu>(self);
   return INT2FIX(ref.getAlpha());
}
alpha=(p1)

Alias for setAlpha

Returns the menu’s angle.

[Source]

/*
  Returns the menu's angle.
 */
VALUE CircleMenu_angle(VALUE self)
{
   CircleMenu &ref = getRef<CircleMenu>(self);
   return INT2FIX(ref.getAngle());
}
angle=(p1)

Alias for setAngle

Changes the selected item. 0 for the right, 1 for the left.

[Source]

/*
  call-seq: changeSelection(dir)

  Changes the selected item. 0 for the right, 1 for the left.
*/
VALUE CircleMenu_changeSelection(VALUE self, VALUE dir)
{
   CircleMenu &ref = getRef<CircleMenu>(self);
   int _dir = FIX2INT(dir);

   ref.changeSelection(_dir);
   return Qnil;
}
change_selection(p1)

Alias for changeSelection

Returns the menu’s distance

[Source]

/*
  Returns the menu's distance
*/
VALUE CircleMenu_dist(VALUE self)
{
   CircleMenu &ref = getRef<CircleMenu>(self);
   return INT2FIX(ref.getDist());
}
dist=(p1)

Alias for setDist

Returns the menu’s index.

[Source]

/*
  Returns the menu's index.
*/
VALUE CircleMenu_getIndex(VALUE self)
{
   CircleMenu &ref = getRef<CircleMenu>(self);
   int ret = ref.getIndex();

   return INT2FIX(ret);
}
index()

Alias for getIndex

Loads the menu.

[Source]

/*
  call-seq: load(filename, nb_icons, dist, w, h, x, y, icon_width, icon_height)
  
  Loads the menu.
*/
VALUE CircleMenu_load(VALUE self, VALUE str, VALUE nbIcons, VALUE dist, VALUE w, 
                      VALUE h, VALUE x, VALUE y, VALUE iconW, VALUE iconH)
{
   CircleMenu &ref = getRef<CircleMenu>(self);
   
   char *_str = StringValuePtr(str);
   int _nbIcons = FIX2INT(nbIcons);
   int _dist = FIX2INT(dist);
   int _w = FIX2INT(w);
   int _h = FIX2INT(h);
   int _x = FIX2INT(x);
   int _y = FIX2INT(y);
   int _iconW = FIX2INT(iconW);
   int _iconH = FIX2INT(iconH);

   ref.load(_str, _nbIcons, _dist, _w, _h, _x, _y, _iconW, _iconH);
   return Qnil;
}

Sets the menu’s alpha value.

[Source]

/*
  call-seq: alpha=(alpha)

  Sets the menu's alpha value.
*/
VALUE CircleMenu_setAlpha(VALUE self, VALUE alpha)
{
   CircleMenu &ref = getRef<CircleMenu>(self);
   int _alpha = FIX2INT(alpha);

   ref.setAlpha(_alpha);
   return alpha;
}

Sets the menu’s angle.

[Source]

/*
  call-seq: angle=(angle)
 
  Sets the menu's angle.
*/
VALUE CircleMenu_setAngle(VALUE self, VALUE angle)
{
   CircleMenu &ref = getRef<CircleMenu>(self);
   int _angle = FIX2INT(angle);
   
   ref.setDist(_angle);
   return angle;
}

Sets the menu’s distance.

[Source]

/*
  call-seq: dist=(dist)
 
  Sets the menu's distance.
*/
VALUE CircleMenu_setDist(VALUE self, VALUE dist)
{
   CircleMenu &ref = getRef<CircleMenu>(self);
   int _dist = FIX2INT(dist);
   
   ref.setDist(_dist);
   return dist;
}

[Validate]