Wide Studio Object Reference

Wide Studio Home
Up to


Class Name

WSCgrid

Specification of methods



getCellGeometry Function Description

Form
long getCellGeometry(WSCulong cx,WSCulong cy, short* x,short* y, WSCushort* w,WSCushort* h)
Function
Obtain a specified sell size
Description
Obtain sell size specified by row:cx and line:cy in a grid instance's coordinate system
Parameters
(in)long cx Sell horizontal position
(in)long cy Sell vertical position
(out)short* x X coordinate
(out)short* y Y coordinate
(out)WSCshort* w Width
(out)WSCshort* h Height
Return value
WS_NO_ERR= Normal, other is an error.
Notice
Samples
#include <WSCgrid.h>
void sample_proc(WSCbase* object){
  WSCgrid* grid = (WSCgrid*)object->cast("WSCgrid");
  if (grid == NULL){
    return;
  }
  //Obtain the number of sells and display each sell size
  short xcells = grid->getHColumns();
  short ycells = grid->getVColumns();
  short cx,cy;
  for(cx=0; cx < xcells; cx++){
    for(cy=0; cy < ycells; cy++){
      short x,y;
      WSCushort w,h;
      //Obtain size
      grid->getCellGeometry(cx,cy,&x,&y,&w,&h);
      //Obtain a value
      WSCvariant val = grid->getItem(cx,cy);
      printf("cell(%d,%d):  x,y=%d,%d w,h=%d,%d val=%s\n",cx,cy,x,y,w,h,
                                                         (char*)val);
    }
  }
}



getHColumns Function Description

Form
long getHColumns();
Function
Obtain the number of sell in the horizontal direction
Description
Parameters
None
Return value
The number of sells
Notice
Samples
Refer to getCellGeometry()



getVColumns Function Description

Form
long getVColumns();
Function
Obtainn the number of sell in the vertical direction
Description
Parameters
None
Return value
The number of sells
Notice
Samples
Refer to getCellGeometry()



setItem Function Description

Form
long setItem(WSCulong cx,WSCulong,cy,WSCvariant val);
Function
Set a value in a specified sell
Description
Specify a WSCvariant type value in a sell specified by row:cx, line:cy
Parameters
(in)long cx Sell horizontal position
(in)long cy Sell vertical position
(in)WSCvariant val Value
Return value
WS_NO_ERR= Normal, other is an error.
Notice
Samples
Refer to getCellGeometry()



setCellForeColor Function Description

Form
long setCellForeColor(WSCulong cx,WSCulong cy,short color);
Function
Set foreground color in a specified sell
Description
Sepecify foreground color by the color number at a sell specified by row:cx, line:cy
Parameters
(in)long cx Sell horizontal position
(in)long cy Sell vertical position
(in)short color Color number
Return value
WS_NO_ERR= Normal, other is an error.
Samples
  //Obtain the black color number and set it to the foreground color of a upper left sell
  short cno = WSGIappColorSet()->getColorNo("#000000");
  newgrid_000->setCellForeColor(0,0,cno);
Notice



setCellForeColor Function Description

Form
long setCellForeColor(WSCulong cx,WSCulong cy,char* cname);
Function
Set foreground color in a specified sell
Description
Sepecify foreground color by a color name at a sell specified by row:cx, line:cy
Parameters
(in)long cx Sell horizontal position
(in)long cy Sell vertical position
(in)char* cname Color name

Color names are specified by the following format
#RRGGBB
RR: Specify the red brightness in hexadecimal numbers (00-ff)
GG: Specify the green brightness in hexadecimal numbers (00-ff)
BB: Specify the blue brightness in hexadecimal numbers (00-ff)
Return value
WS_NO_ERR= Normal, other is an error.
Notice
Samples
  //Set black foreground color in an upper left sell
  newgrid_000->setCellForeColor(0,0,"#ffffff");



setCellBackColor Function Description

Form
long setCellBackColor(WSCulong cx,WSCulong cy,short color);
Function
Set background color in a specified sell
Description
Sepecify background color by the color number at a sell specified by row:cx, line:cy
Parameters
(in)long cx Sell horizontal position
(in)long cy Sell vertical position
(in)short color Color number
Return value
WS_NO_ERR= Normal, other is an error.
Notice
Samples
  //Obtain the white color number and set it to the background color of a upper left sell
  short cno = WSGIappColorSet()->getColorNo("#ffffff");
  newgrid_000->setCellBackColor(0,0,cno);



setCellBackColor Function Description

Form
long setCellBackColor(WSCulong cx,WSCulong cy,char* cname);
Function
Set foreground color in a specified sell
Description
Sepecify foreground color by a color name at a sell specified by row:cx, line:cy
Parameters
(in)long cx Sell horizontal position
(in)long cy Sell vertical position
(in)char* cname Color name

Color names are specified by the following format
#RRGGBB
RR: Specify the red brightness in hexadecimal numbers (00-ff)
GG: Specify the green brightness in hexadecimal numbers (00-ff)
BB: Specify the blue brightness in hexadecimal numbers (00-ff)
Return value
WS_NO_ERR= Normal, other is an error.
Notice
  //Set white background color in an upper left sell
  newgrid_000->setCellBackColor(0,0,"#000000");



getItemAlignment Function Description

Form
long getItemAlignment(WSCulong cx,WSCulong cy);
Function
Obtain specified sell alignment
Description
Obtain sell alignment of specifed row:cx, line:cy
Parameters
(in)long cx Sell horizontal position
(in)long cy Sell vertical position
Return value
Alignment
The following alignments are supported
Value Meaning
WS_LEFT Left
WS_RIGHT Right
WS_CENTER Center
WS_TOP Top
WS_BOTTOM Bottom
WS_LEFT_TOP Upper left
WS_LEFT_BOTTOM Lower left
WS_RIGHT_TOP Upper right
WS_RIGHT_BOTTOM Lower right

Notice
Samples
  //Obtain upper left sell alignment
  WSCuchar alignment = newgrid_000->getItemAlignment(0,0);



getItem Function Description

Form
WSCvariant getItem(WSCulong cx,WSCulong cy);
Function
Obtain a specified sell value
Description
Obtain a specified sell value specified by row:cx, line:cy
Parameters
(in)long cx Sell horizontal position
(in)long cy Sell vertical position
Return value
A sell value
Samples
Refer to getCellGeometry()
Notice


Document Release 3.20

For Use with Wide Studio Release 3.20, Spring 2003


Wide Stuido Home | Up to

Copyright(C) T. Hirabayashi, 1999-2003 Last modified: February 3, 2003