WideStudio/MWT Class Reference

WideStudio/MWT Home
Up to


Class Name

WSCsheet

Specification of methods



getRowCount 関数の説明

Form
long getRowCount()
Function
Get all lines. (Includes fixed cells)
Description
Parameters
None
Return value
The number of lines.
Notice
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get a number of cells and show each cell size
  long cols = ss->getColumnCount();
  long rows = ss->getRowCount();
  long col, row;
  for(col = 0; col < cols; col++){
    for(row = 0; row < rows; row++){
      WSCrect rect;
      //Get cell size
      ss->getCellRect(col, row, &rect);
      //Get value
      WSCstring val = ss->getText(col, row);
      printf("cell(%d,%d):  x,y=%d,%d w,h=%d,%d val=%s\n",
             col, row, rect.x, rect.y, rect.width, rect.height, val.getString());
    }
  }
}



setRowCount 関数の説明

Form
long setRowCount(long rows)
Function
Set total number of lines. (includes lines of fixed cells)
Description
Parameters
(in)long rows lines
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails
Notice
None
Samples
#include 
void sample_init(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  // Set a number of cells/lines
  ss->setColumnCount(52);
  ss->setRowCount(102);
  // Set a number of cells/lines for a fixed cell
  ss->setFixedColumnCount(2);
  ss->setFixedRowCount(2);
  //Get a number of cells and show each cell size
  long cols = ss->getColumnCount();
  long rows = ss->getRowCount();
  long col, row;
  for(col = 0; col < cols; col++){
    //Set cell width
    ss->setColumnWidth(100);
  }
  for(row = 0; row < rows; row++){
    //Set cell height
    ss->setRowHeight(25);
  }
}



getColumnCount 関数の説明

Form
long getColumnCount()
Function
Get a total number of rows
Description
Parameters
None
Return value
Number of rows
Notice
None
Samples
See getRowCount()



setColumnCount 関数の説明

Form
long setColumnCount(long cols)
Function
Set a total number of rows
Description
Parameters
(in)long cols Number of rows
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails
Notice
None
Samples
See setRowCount()



getRowHeight 関数の説明

Form
long getRowHeight(long row)
Function
Get height of a specified line
Description
Parameters
(in)long row line number
Return value
Returns height of a specified line, 0 means an error.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get a number of cells and show each cell size
  long cols = ss->getColumnCount();
  long rows = ss->getRowCount();
  long col, row;
  for(col = 0; col < cols; col++){
    long width;
    //Get cell width
    width = ss->getColumnWidth(col);
    printf("col(%d): width=%d\n", width);
  }
  for(row = 0; row < rows; row++){
    long height;
    //Get cell height
    height = ss->getRowHeight(row);
    printf("row(%d): height=%d\n", height);
  }
}



setRowHeight 関数の説明

Form
long setRowHeight(long row,long height)
Function
Set line height
Description
Parameters
(in)long row line number
(in)long height line height
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails
Notice
None
Samples
See setRowCount()



getColumnWidth 関数の説明

Form
long getColumnWidth(long col)
Function
Get row width
Description
Parameters
(in)long col row number
Return value
Returns a specified row width, 0 means an error
Notice
None
Samples
See getRowHeight()



setColumnWidth 関数の説明

Form
long setColumnWidth(long col, long width)
Function
Set row width
Description
Parameters
(in)long col row number
(in)long width row width
Return value
Return a specified row width, 0 means and error
Notice
None
Samples
See getRowCount()



getFixedRowCount 関数の説明

Form
long getFixedRowCount()
Function
Get a number of fixed lines
Description
Parameters
None
Return value
Number of fixed lines
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get a number of fixed cells and show each cell size
  long cols = ss->getFixedColumnCount();
  long rows = ss->getFixedRowCount();
  long col, row;
  for(col = 0; col < cols; col++){
    long width;
    //Get width
    width = ss->getFixedColumnWidth(col);
    printf("col(%d): width=%d\n", width);
  }
  for(row = 0; row < rows; row++){
    long height;
    //Get height
    height = ss->getFixedRowHeight(row);
    printf("row(%d): height=%d\n", height);
  }
}



setFixedRowCount 関数の説明

Form
long setFixedRowCount(long rows)
Function
Set a number of fixed lines
Description
Parameters
(in)long rows fixed line numbers
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails
Notice
None
Samples
See setRowCount()



getFixedColumnCount 関数の説明

Form
long getFixedColumnCount()
Function
Get a number of fixed rows
Description
Parameters
None
Return value
Number of fixed rows
Notice
None
Samples
See getFixedRowCount()



setFixedColumnCount 関数の説明

Form
long setFixedColumnCount(long cols)
Function
Set a number of fixed rows
Description
Parameters
(in)long cols fixed row numbers
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails
Notice
None
Samples
See setRowCount()



getFixedRowHeight 関数の説明

Form
long getFixedRowHeight(long row)
Function
Get height of fixed line
Description
Parameters
(in)long row line number
Return value
Returns a specified line height, 0 means an error
Notice
None
Samples
See getFixedRowCount()



setFixedRowHeight 関数の説明

Form
long setFixedRowHeight(long row,long height)
Function
Set fixed line height
Description
Parameters
(in)long row line number
(in)long height fixed line height
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails
Notice
None.
Samples



getFixedColumnWidth 関数の説明

Form
long getFixedColumnWidth(long col)
Function
Get row width
Description
Parameters
(in)long col row number
Return value
Returns a specified row width, 0 means an error
Notice
None
Samples
See getRowCount()



setFixedColumnWidth 関数の説明

Form
long setFixedColumnWidth(long col, long width)
Function
Set row width
Description
Parameters
(in)long col row number
(in)long width row width
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails
Notice
None.
Samples



setSheetBkColor 関数の説明

Form
long setSheetBkColor(char* cname)
Form
long setSheetBkColor(short color)
Function
Set background sheet color
Description
Parameters
(in)char* cname color name
(in)short color color number
Return value
color number
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Set background sheet color to white.
  ss->setSheetBkColor("#ffffff");
}



getSheetBkColor 関数の説明

Form
short getSheetBkColor()
Function
Get color number of sheet background color
Description
Parameters
None
Return value
color number
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get color number of sheet background color
  short color = ss->getSheetBkColor();
  printf("sheet backcolor no = %d\", color);
}



setCellDefBkColor 関数の説明

Form
long setCellDefBkColor(char* cname)
Form
long setCellDefBkColor(short color)
Function
可変セルのデフォルト背景色を設定します。
Description
Parameters
(in)char* cname color name
(in)short color color number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Set variable cell's default background color to white
  ss->setCellDefBkColor("#ffffff");
}



getCellDefBkColor 関数の説明

Form
short getCellDefBkColor()
Function
Get varialbe cell's default color number
Description
Parameters
None
Return value
color number
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get varialbe cell's default color number
  short color = ss->getCellDefBkColor();
  printf("cell default backcolor no = %d\", color);
}



setCellBkColor 関数の説明

Form
long setCellBkColor(char* cname)
Form
long setCellBkColor(long col,long row,char* cname)
Form
long setCellBkColor(short color)
Form
long setCellBkColor(long col,long row,short color)
Function
Set cell background color
Description
Parameters
(in)char* cname color name
(in)short color color number
(in)long col row number
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Set cell background color to white for line 1, row 1
  ss->setCol(1);
  ss->setRow(1);
  ss->setCellBkColor("#ffffff");

  //Set cell background color to white for line 1, from line 2 to row 2, to line 3
  ss->setStartCol(1);
  ss->setStartRow(2);
  ss->setEndCol(2);
  ss->setEndRow(3);
  ss->setSelectCell(True);
  ss->setCellBkColor("#ffffff");
  ss->setSelectCell(False);
}



getCellBkColor 関数の説明

Form
short getCellBkColor(long col, long row)
Function
Get cell background color
Description
Parameters
(in)long col row number
(in)long row line number
Return value
color number
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get cell background color
  short color = ss->getCellBkColor(1, 1);
  printf("cell(1, 1) backcolor no = %d\", color);
}



setCellDefTextColor 関数の説明

Form
long setCellDefTextColor(char* cname)
Form
long setCellDefTextColor(short color)
Function
Set default foreground color for variable cell
Description
Parameters
(in)char* cname color name
(in)short color color number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Set variable cell's foreground color to black
  ss->setCellDefTextColor("#000000");
}



getCellDefTextColor 関数の説明

Form
short getCellDefTextColor()
Function
Get variable cell's default foreground color
Description
Parameters
None
Return value
color number
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get variable cell's default foreground color
  short color = ss->getCellDefTextColor();
  printf("cell default textcolor no = %d\", color);
}



setCellTextColor 関数の説明

Form
long setCellTextColor(char* cname)
Form
long setCellTextColor(long col,long row,char* cname)
Form
long setCellTextColor(short color)
Form
long setCellTextColor(long col,long row,short color)
Function
セルの文字色を設定します。
Description
Parameters
(in)char* cname color name
(in)short color color number
(in)long col row number
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Set foreground color to black for line 1, row 1
  ss->setCol(1);
  ss->setRow(1);
  ss->setCellTextColor("#000000");

  //Set foreground color to black for line 1, from line 2 to row 2, line 3.
  ss->setStartCol(1);
  ss->setStartRow(2);
  ss->setEndCol(2);
  ss->setEndRow(3);
  ss->setSelectCell(True);
  ss->setCellTextColor("#000000");
  ss->setSelectCell(False);
}



getCellTextColor 関数の説明

Form
short getCellTextColor(long col, long row)
Function
Get cell foreground color
Description
Parameters
(in)long col row number
(in)long row line number
Return value
color number
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get cell foreground color
  short color = ss->getCellTextColor(1, 1);
  printf("cell(1,1) textcolor no = %d\", color);
}



setFixedBkColor 関数の説明

Form
long setFixedBkColor(char* cname)
Form
long setFixedBkColor(short color)
Function
Set fixed cell's background color
Description
Parameters
(in)char* cname color name
(in)short color color number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Set fixed cell's background color to white
  ss->setFixedBkColor("#ffffff");
}



getFixedBkColor 関数の説明

Form
short getFixedBkColor()
Function
Get fixed cell's background color number
Description
Parameters
None
Return value
color number
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get fixed cell's background color number
  short color = ss->getFixedBkColor();
  printf("fixed cell backcolor no = %d\", color);
}



setFixedTextColor 関数の説明

Form
long setFixedTextColor(char* cname)
Form
long setFixedTextColor(short color)
Function
固定セルの文字色を設定します。
Description
Parameters
(in)char* cname color name
(in)short color color number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Set fixed cell's foreground color to black
  ss->setFixedTextColor("#000000");
}



getFixedTextColor 関数の説明

Form
short getFixedTextColor()
Function
Get fixed cell's foreground color number
Description
Parameters
None
Return value
color number
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get fixed cell's foreground color number
  short color = ss->getFixedTextColor();
  printf("fixed cell textcolor no = %d\", color);
}



setGridColor 関数の説明

Form
long setGridColor(char* cname)
Form
long setGridColor(short color)
Function
Set grid line color
Description
Parameters
(in)char* cname color name
(in)short color color number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Set grid line color to white
  ss->setGridColor("#ffffff");
}



getGridColor 関数の説明

Form
short getGridColor()
Function
Get grid line color number
Description
Parameters
None
Return value
color number
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get grid line color number
  short color = ss->getGridColor();
  printf("grid line color no = %d\", color);
}



setGridLines 関数の説明

Form
long setGridLines(short glidLines)
Function
Configure grid line
Description
Parameters
(in)short glidLines grid line properties

Grid line has the following properties
Properties Description
WSCSHEET_NONE None
WSCSHEET_HORZ Horizon
WSCSHEET_VERT Vartical
WSCSHEET_BOTH Both
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Show grid line for both directions
  ss->setGridLines(WSCSHEET_BOTH);
}



getGridLines 関数の説明

Form
short getGridLines()
Function
Get grid line properties
Description
Parameters
None
Return value
Show grid line
Return values are as follows
Property Description
WSCSHEET_NONE None
WSCSHEET_HORZ Horizon
WSCSHEET_VERT Varitical
WSCSHEET_BOTH Both
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get grid line properties
  short lines = ss->getGridLines();
  printf("grid lines = %d\", lines);
}



setCellGridLines 関数の説明

Form
long setCellGridLines(short glidLines)
Form
long setCellGridLines(long col,log row,short glidLines)
Function
Set grid line properties
Description
Parameters
(in)short glidLines Property
(in)long col row number
(in)long row line number

See getGridLines() for more details
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  
  //Set grid line for line 1, row 1 to both directions
  ss->setCellGridLines(WSCSHEET_BOTH);

  //Set grid line for line 1, from line 2 to row 2, line 3 to both directions
  ss->setStartCol(1);
  ss->setStartRow(2);
  ss->setEndCol(2);
  ss->setEndRow(3);
  ss->setSelectCell(True);
  ss->setCellGridLines(WSCSHEET_BOTH);
  ss->setSelectCell(False);
}



getCellGridLines 関数の説明

Form
long getCellGridLines(long col,long row)
Function
Get grid line properties
Description
Parameters
(in)long col row number
(in)long row line number
Return value
Grid line property See getGridLines() for more details
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get grid line properties
  short lines = ss->getCellGridLines(1, 1);
  printf("cell(1,1) grid lines = %d\", lines);
}



setText 関数の説明

Form
long setText(short text)
Form
long setText(WSCushort text)
Form
long setText(long text)
Form
long setText(WSCulong text)
Form
long setText(float text)
Form
long setText(double text)
Form
long setText(const char* text)
Form
long setText(const WSCvariant& text)
Form
long setText(const WSCstring& text)
Form
long setText(long col,long row,short text)
Form
long setText(long col,long row,WSCushort text)
Form
long setText(long col,long row,long text)
Form
long setText(long col,long row,WSCulong text)
Form
long setText(long col,long row,float text)
Form
long setText(long col,long row,double text)
Form
long setText(long col,long row,const char* text)
Form
long setText(long col,long row,const WSCvariant& text)
Form
long setText(long col,long row,const WSCstring& text)
Function
SEt cell value
Description
Parameters
(in)Type text Value
(in)long col row number
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  
  //Set a value for line 1, row 1
  ss->setCol(1);
  ss->setRow(1);
  ss->setText("text");

  //Set values for line 1, from line 2 to row 2, line 3
  ss->setStartCol(1);
  ss->setStartRow(2);
  ss->setEndCol(2);
  ss->setEndRow(3);
  ss->setSelectCell(True);
  ss->setText("text");
  ss->setSelectCell(False);
}



getText 関数の説明

Form
WSCstring getText(long col,long row)
Function
Get cell value.
Description
Parameters
(in)long col row number
(in)long row line number
Return value
Cell value
Notice
None
Samples
See getRowCount()



setFixedText 関数の説明

Form
long setFixedText(long col,long row,short text)
Form
long setFixedText(long col,long row,WSCushort text)
Form
long setFixedText(long col,long row,long text)
Form
long setFixedText(long col,long row,WSCulong text)
Form
long setFixedText(long col,long row,float text)
Form
long setFixedText(long col,long row,double text)
Form
long setFixedText(long col,long row,const char* text)
Form
long setFixedText(long col,long row,const WSCvariant& text)
Form
long setFixedText(long col,long row,const WSCstring& text)
Function
Get fixed cell value
Description
Parameters
(in)Type text Value
(in)long col row number
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
See getFixedText()



getFixedText 関数の説明

Form
WSCstring getFixedText(long col,long row)
Function
Get fixed cell value
Description
Parameters
(in)long col row number
(in)long row line number
Return value
Cell value
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  ss->setFixedRowCount(1);
  //Set a value to row 1, line 0
  ss->setFixedText(0, 1, "fixed text");
  //Get a value of row 1, row 0
  WSCstring text = ss->getFixedText(0, 1, "text");
  printf(fixed cell(0,1) text=%s\n", text.getString());
}



getCellNo 関数の説明

Form
long getCellNo(WSCpoint* pt,long* col,long* row)
Function
Get line and row from a coordinates
Description
Parameters
(in)WSCpoint* pt Coordinates
(out)long* col variable for row
(out)long* row variable for line
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  // Get row and line of x:100、y:100
  WSCpoint pt;
  long     col, row;
  pt.x = 100;
  pt.y = 100;
  ss->getCellNo(&pt, &col, &row);
  printf(x=100, y=100 cell(%d,%d)\n", col, row);
}



setFocusCell 関数の説明

Form
long setFocusCell(long col,long row)
Function
Set forcus on cell
Description
Parameters
(in)long col row number
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
See getFocusCell()



getFocusCell 関数の説明

Form
long getFocusCell(long* col,long* row)
Function
Get cell's row
line that has forcus
Description
Parameters
(out)long* col variable for row
(out)long* row variable for line
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  // Set forcus on line 1, row 1
  ss->setFocusCell(1, 1);
 
  // Get row 
line that has forcus long col, row; ss->getFocusCell(&col, &row); printf(focus cell(%d,%d)\n", col, row); // Get row line that has forcus col = ss->getFocusCol(); row = ss->getFocusRow(); printf(focus cell(%d,%d)\n", col, row); }


getFocusCol 関数の説明

Form
long getFocusCol()
Function
Get row of forcused cell
Description
Parameters
None
Return value
row number of forcused cell
Notice
None
Samples
See getFocusCell()



getFocusRow 関数の説明

Form
long getFocusRow()
Function
Get a line of forcused cell
Description
Parameters
None
Return value
line number of forcused cell
Notice
None
Samples
See getFocusCell()



setRow 関数の説明

Form
long setRow(long row)
Function
Set current row
Description
Parameters
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
See setCellBkColor()



getRow 関数の説明

Form
long getRow()
Function
Get current line
Description
Parameters
None
Return value
Current line number
Notice
None
Samples



setStartRow 関数の説明

Form
long setStartRow(long row)
Function
Set start line
Description
Parameters
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
See setCellBkColor()



getStartRow 関数の説明

Form
long getStartRow()
Function
Get start line
Description
Parameters
None
Return value
Start line number
Notice
None
Samples



setEndRow 関数の説明

Form
long setEndRow(long row)
Function
Set end line
Description
Parameters
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
See setCellBkColor()



getEndRow 関数の説明

Form
long getEndRow()
Function
Get end line
Description
Parameters
None
Return value
End line number
Notice
None
Samples



setCol 関数の説明

Form
long setCol(long row)
Function
Set current row
Description
Parameters
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
See setCellBkColor()



getCol 関数の説明

Form
long getCol()
Function
Get current row
Description
Parameters
None
Return value
Current row number
Notice
None
Samples



setStartCol 関数の説明

Form
long setStartCol(long row)
Function
Set start row
Description
Parameters
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
See setCellBkColor()



getStartCol 関数の説明

Form
long getStartCol()
Function
Get start row
Description
Parameters
None
Return value
Start row number
Notice
None
Samples



setEndCol 関数の説明

Form
long setEndCol(long row)
Function
終了列を設定します。
Description
Parameters
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
See setCellBkColor()



getEndCol 関数の説明

Form
long getEndCol()
Function
Get end row
Description
Parameters
None
Return value
End row number
Notice
None
Samples



setSelectCell 関数の説明

Form
long setSelectCell(WSCbool fl)
Function
Set status of block selection
Description
Parameters
(in)WSCbool fl Selection Status
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
Remember to set unselected status when block selection status is not required
Samples
See setCellBkColor()



getSelectCell 関数の説明

Form
WSCbool getSelectCell()
Function
Get block selection status
Description
Parameters
None
Return value
True for selected, False for unselected
Notice
None
Samples



setEditEnabled 関数の説明

Form
long setEditEnabled(WSCbool fl)
Function
Set editable status
Description
Parameters
(in)WSCbool fl Editable:True, Uneditable:False
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getEditEnabled 関数の説明

Form
WSCbool getEditEnabled()
Function
Get editable status
Description
Parameters
None
Return value
True for editable, False for uneditable
Notice
None
Samples



getFocusCellRect 関数の説明

Form
long getFocusCellRect(WSCrect* rect)
Function
Get location and site of forcused cell
Description
Parameters
(out)WSCrect* rect Variable for location and size
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
   // Get location and site of forcused cell
   WSCrect r;
   long err = newshee_001->getFocusCellRect(&r);
   printf("x,y,w,h=%d,%d,%d,%d\n",r.x,r.y,r.width,r.height);



getVisibleCellRect 関数の説明

Form
long getVisibleCellRect(long col,long row,WSCrect* rect)
Function
Get location and size of variable cell currently displayed e
Description
Parameters
(in)long col row number
(in)long row line number
(out)WSCrect* rect Variable for location and size
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getCellRect 関数の説明

Form
long getCellRect(long col,long row,WSCrect* rect)
Function
Get location and size of cell
Description
Parameters
(in)long col row number
(in)long row line number
(out)WSCrect* rect Variable for location and size
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
This caliculates from top of cells and may not match with actual location.
Samples
   // Get location and size of cell (1,3)
   WSCrect r;
   long err = newshee_001->getCellRect(1,3,&r);
   printf("x,y,w,h=%d,%d,%d,%d\n",r.x,r.y,r.width,r.height);



setTopVisibleRow 関数の説明

Form
long setTopVisibleRow(long row)
Function
Set top row number of variable cell that currently displayed
Description
Parameters
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getTopVisibleRow 関数の説明

Form
long getTopVisibleRow()
Function
Get to row number of variable cell that currently displayed
Description
Parameters
None
Return value
row number of variable cell that currently displayed
Notice
None
Samples



setTopVisibleCol 関数の説明

Form
long setTopVisibleCol(long row)
Function
Set top row number of fixed cell that currently displayed
Description
Parameters
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getTopVisibleCol 関数の説明

Form
long getTopVisibleCol()
Function
Get to row number of variable cell that currently displayed
Description
Parameters
None
Return value
row number of variable cell that currently displayed
Notice
None
Samples



setCellDefFont 関数の説明

Form
long setCellDefFont(short fontno)
Function
Set default font number for variable cell
Description
Parameters
(in)short fontno font number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getCellDefFont 関数の説明

Form
long getCellDefFont()
Function
Get default font number of variable cell
Description
Parameters
None
Return value
default font number of variable cell
Notice
None
Samples



setCellFont 関数の説明

Form
long setCellFont(short fontno)
Form
long setCellFont(long col,long row,short fontno)
Function
Set cell font number
Description
Parameters
(in)short fontno font number
(in)long col row number
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
See getCellFont()



getCellFont 関数の説明

Form
long getCellFont()
Form
long getCellFont(long col,log row)
Function
Get cell font number
Description
Parameters
(in)long col row number
(in)long row line number
Return value
font number of variable cell
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Get font number of variable cell
  short font = ss->getCellFont();
  printf("cell default font:%d\n", font);
  
  //Set font 1 to row 1, line 1
  font = ss->setCellFont(1, 1, 1);

  //Set font 1 to row 1, from line 2 to row 2, line 3
  ss->setStartCol(1);
  ss->setStartRow(2);
  ss->setEndCol(2);
  ss->setEndRow(3);
  ss->setSelectCell(True);
  ss->setCellFont(1);
  ss->setSelectCell(False);
  
}



setFixedCellFont 関数の説明

Form
long setFixedCellFont(short fontno)
Function
Set default font number of fixed cell
Description
Parameters
(in)short fontno font number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getFixedCellFont 関数の説明

Form
long getFixedCellFont()
Function
Get default font number of fixed cell
Description
Parameters
None
Return value
default font number of fixed cell
Notice
None
Samples



setVertAutoNumber 関数の説明

Form
long setVertAutoNumber(WSCbool fl)
Function
Set line number status
Description
Parameters
(in)WSCbool fl Status
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getVertAutoNumber 関数の説明

Form
WSCbool getVertAutoNumber()
Function
Get line number status
Description
Parameters
None
Return value
True:Show, False:Do not show
Notice
None
Samples
   // Get line number status
   WSCbool fl = newshee_001->getVertAutoNumber();



setHorzAutoNumber 関数の説明

Form
long setHorzAutoNumber(WSCbool fl)
Function
row numberの表示状態を設定します。
Description
Parameters
(in)WSCbool fl True:Show, False:Do not show
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getHorzAutoNumber 関数の説明

Form
WSCbool getHorzAutoNumber()
Function
Description
Get row number status
Parameters
None
Return value
True:Show、False:Do not show
Notice
None
Samples



setCellAlignment 関数の説明

Form
long setCellAlignment(char align)
Form
long setCellAlignment(long col,long row,char align)
Function
Set location of variable cell
Description
Parameters
(in)char align alignment
(in)long col row number
(in)long row line number

Alignment should be:
Property Description
WS_LEFT Left anchor
WS_RIGHT Right anchor
WS_CENTER Center
WS_TOP Top anchor
WS_BOTTOM Bottom anchor
WS_LEFT_TOP Left top anchor
WS_LEFT_BOTTOM Left bottom anchor
WS_RIGHT_BOTTOM Right bottom anchor
WS_RIGHT_TOP Right top anchor
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getCellAlignment 関数の説明

Form
char getCellAlignment(long col,long row)
Function
Get alighment of specified col,row
Description
Parameters
(in)long col row number
(in)long row line number
Return value
alighment of specified col,row
Notice
None
Samples
   // Get alignment of cell(1,2)
   char align = newshee_001->getCellAlignment(1,2);



setFixedCellAlignment 関数の説明

Form
long setFixedCellAlignment(char align)
Form
long setFixedCellAlignment(long col,long row,char align)
Function
Set location of fixed cell
Description
Parameters
(in)char align Alignment
(in)long col row number
(in)long row line number

Alignment should be:
Property Description
WS_LEFT Left anchor
WS_RIGHT Right anchor
WS_CENTER Center
WS_TOP Top anchor
WS_BOTTOM Bottom anchor
WS_LEFT_TOP Left top anchor
WS_LEFT_BOTTOM Left bottom anchor
WS_RIGHT_BOTTOM Right bottom anchor
WS_RIGHT_TOP Right top anchor
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getFixedCellAlignment 関数の説明

Form
char getFixedCellAlignment(long col,long row)
Function
Get location of fixed cell
Description
Parameters
(in)long col row number
(in)long row line number
Return value
location of fixed cell
Notice
None
Samples



setCellLock 関数の説明

Form
long setCellLock(WSCbool fl)
Form
long setCellLock(long col,long row,WSCbool fl)
Function
Set editable/uneditable(locked) to variable cell
Description
Parameters
(in)WSCbool fl True:Uneditable (locked)、False:Editable
(in)long col row number
(in)long row line number
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getCellLock 関数の説明

Form
WSCbool getCellLock()
Function
Get uneditable property of variable cell
Description
Parameters
None
Return value
True:Uneditable, False:Editable
Notice
None
Samples



getClientWidth 関数の説明

Form
unsigned short getClientWidth()
Function
Get valid client width
Description
Parameters
None
Return value
client width
Notice
None
Samples



getClientHeight 関数の説明

Form
unsigned short getClientHeight()
Function
Get valid client height
Description
Parameters
None
Return value
client height
Notice
None
Samples



setNoRefresh 関数の説明

Form
void setNoRefresh(WSCbool fl)
Function
Set validation of drawing
Description
Parameters
(in)WSCbool fl Drawable/Undrawable
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Set undrawable
  ss->setNoRefresh(True);

  //Set background color, foreground color and text for row 1, from line 1 to row 2, line 3
  ss->setStartCol(1);
  ss->setStartRow(1);
  ss->setEndCol(2);
  ss->setEndRow(3);
  ss->setSelectCell(True);
  ss->setCellBkColor("#00ffff");
  ss->setCellTextColor("#ff0000");
  ss->setTect("text");
  ss->setSelectCell(False);
  //Set drawable
  ss->setNoRefresh(False);

  // Redraw
  ss->draw();
}



getNoRefresh 関数の説明

Form
WSCbool getNoRefresh()
Function
Get drawable status
Description
Parameters
None
Return value
True:Undrawable、False:Drawable
Notice
None
Samples



insertRow 関数の説明

Form
long insertRow()
Function
Insert line
Description
Parameters
None
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Insert a line into current line
  ss->insertRow();

  //Insert two lines in line 1
  ss->setStartCol(1);
  ss->setStartRow(1);
  ss->setEndCol(1);
  ss->setEndRow(2);
  ss->setSelectCell(True);
  ss->insertRow();
  ss->setSelectCell(False);

}



insertRow 関数の説明

Form
long insertRow(long row,long rows)
Function
Insert line
Description
Parameters
(in)long row line number
(in)long rows number of lines to insert
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }

  //Insert two lines in line 1
  ss->insertRow(1, 2);

}



insertCol 関数の説明

Form
long insertCol()
Function
Insert row
Description
Parameters
None
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Insert row into the currentl row
  ss->insertCol();

  //Insert two rows in row 1
  ss->setStartCol(1);
  ss->setStartRow(1);
  ss->setEndCol(2);
  ss->setEndRow(1);
  ss->setSelectCell(True);
  ss->insertCol();
  ss->setSelectCell(False);

}



insertCol 関数の説明

Form
long insertCol(long col,long cols)
Function
Insert row
Description
Parameters
(in)long col row number
(in)long cols number of rows to insert
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }

  //Insert two rows in line 1
  ss->insertCol(1, 2);

}



deleteRow 関数の説明

Form
long deleteRow()
Function
Delete line
Description
Parameters
None
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Delete current line
  ss->deleteRow();

  //Delete two lines from line 1
  ss->setStartCol(1);
  ss->setStartRow(1);
  ss->setEndCol(1);
  ss->setEndRow(2);
  ss->setSelectCell(True);
  ss->deleteRow();
  ss->setSelectCell(False);
}



deleteRow 関数の説明

Form
long deleteRow(long row,long rows)
Function
Delete line
Description
Parameters
(in)long row line number
(in)long rows number of lines to delete
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }

  //delete two lines from line 1
  ss->deleteRow(1, 2);
}



deleteCol 関数の説明

Form
long deleteCol()
Function
Delete row
Description
Parameters
None
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }
  //Delete current row
  ss->deleteCol();

  //1列目から2列削除します。
  ss->setStartCol(1);
  ss->setStartRow(1);
  ss->setEndCol(1);
  ss->setEndRow(2);
  ss->setSelectCell(True);
  ss->deleteCol();
  ss->setSelectCell(False);
}



deleteCol 関数の説明

Form
long deleteCol(long col,long cols)
Function
Delete row
Description
Parameters
(in)long col row number
(in)long cols number of rows to delete
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples
#include 
void sample_proc(WSCbase* object){
  WSCsheet* ss = (WSCsheet*)object->cast("WSCsheet");
  if (ss == NULL){
    return;
  }

  //Delte two rows from row 1
  ss->deleteCol(1, 2);
}



setDataSource 関数の説明

Form
long setDataSource(const char* name)
Form
long setDataSource(WSCstring& sname)
Function
Set datasource name
Description
Parameters
(in)const char* name datasource name
(in)WSCstring& sname datasource name
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
Samples



getDataSource 関数の説明

Form
WSCstring getDataSource()
Function
Get datasource name
Description
Parameters
None
Return value
Datasource name
Notice
Samples



setTableName 関数の説明

Form
long setTableName(const char* name)
Form
long setTableName(WSCstring& tname)
Function
Set table name of database
Description
Parameters
(in)const char* name Table name
(in)WSCstring& tname Table name
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
Samples



getTableName 関数の説明

Form
WSCstring getTableName()
Function
Get table name of database
Description
Parameters
なし
Return value
Table name of database
Notice
Samples



setDbItem 関数の説明

Form
long setDbItem(const char* name)
Form
long setDbItem(WSCstring& iname)
Function
Set item name
Description
Parameters
(in)const char* name item name
(in)WSCstring& iname item name
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getDbItem 関数の説明

Form
WSCstring getDbItem()
Function
Get item name
Description
Parameters
None
Return value
Item name
Notice
Samples



setDbSortItem1 関数の説明

Form
long setDbSortItem1(const char* name)
Form
long setDbSortItem1(WSCstring& iname)
Function
Set 1st item name for sort key
Description
Parameters
(in)const char* name item name
(in)WSCstring& iname item name
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
Samples



getDbSortItem1 関数の説明

Form
WSCstring getDbSortItem1()
Function
Get 1st item name for sort key
Description
Parameters
なし
Return value
1st item name for sort key
Notice
Samples



setDbSortItem2 関数の説明

Form
long setDbSortItem2(const char* name)
Form
long setDbSortItem2(WSCstring& iname)
Function
Set 2st item name for sort key
Description
Parameters
(in)const char* name item name
(in)WSCstring& iname item name
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
Samples



getDbSortItem2 関数の説明

Form
WSCstring getDbSortItem2()
Function
Get 2nd item name for sort key
Description
Parameters
None
Return value
2nd item name for sort key
Notice
Samples



setDbSortItem3 関数の説明

Form
long setDbSortItem3(const char* name)
Form
long setDbSortItem3(WSCstring& iname)
Function
Set 3rd item name for sort key
Description
Parameters
(in)const char* name item name
(in)WSCstring& iname item name
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
Samples



getDbSortItem3 関数の説明

Form
WSCstring getDbSortItem3()
Function
Get 3rd item name for sort key
Description
Parameters
None
Return value
3rd item name for sort key
Notice
Samples



setDbSort1 関数の説明

Form
long setDbSort1(unsigned char sort)
Function
Set 1st sort condition
Description
Parameters
(in)unsigned char sort Sort condition

Sort conditions are:
Property Description
WSCSHEET_DB_SORT_ASC Ascending
WSCSHEET_DB_SORT_DESC Descending
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
Samples



getDbSort1 関数の説明

Form
unsigned char getDbSort1()
Function
Get 1st sort condition
Description
Parameters
None
Return value
Returns sort property See setDbSort1() for more details
Notice
Samples



setDbSort2 関数の説明

Form
long setDbSort2(unsigned char sort)
Function
Set 2st sort condition
Description
Parameters
(in)unsigned char sort Sort condition

See setDbSort1() for more details
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
Samples



getDbSort2 関数の説明

Form
unsigned char getDbSort2()
Function
Get 2nd sort condition
Description
Parameters
None
Return value
Returns sort property See setDbSort1() for more details
Notice
Samples



setDbSort3 関数の説明

Form
long setDbSort3(unsigned char sort)
Function
Get 3rd sort condition
Description
Parameters
(in)unsigned char sort Sort condition

See setDbSort1() fore more details
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
Samples



getDbSort3 関数の説明

Form
unsigned char getDbSort3()
Function
Get 3rd sort condition
Description
Parameters
None
Return value
Returns sort property See setDbSort1() for more details
Notice
Samples



setDbFilter 関数の説明

Form
long setDbFilter(const char* filter)
Form
long setDbFilter(WSCstring& filter)
Function
Set extraction condition
Description
Parameters
(in)const char* filter extraction condition
(in)WSCstring& filter extraction condition
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
Samples



getDbFilter 関数の説明

Form
WSCstring getDbFilter()
Function
Get extraction condition
Description
Parameters
None
Return value
Extractin condition
Notice
Samples



setDbStmtString 関数の説明

Form
long setDbStmtString(const char* stmt)
Form
long setDbStmtString(WSCstring& stmt)
Function
Set extraction condition
Description
Parameters
(in)const char* stmt SQL Statement
(in)WSCstring& stmt SQL Statement
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
None
Samples



getDbStmtString 関数の説明

Form
WSCstring getDbStmtString()
Function
Get SQL statement
Description
Parameters
None
Return value
SQL statement
Notice
Samples



dbRefresh 関数の説明

Form
long dbRefresh()
Function
Connect to database and show data
Description
Parameters
None
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
If DB connection information is configured in properties, data is retrieved automatically at first time
Samples



dataClear 関数の説明

Form
long dataClear(long col, long row)
Function
Clear data and set number of rows/lines
Description
Parameters
(in)long col number of rows
(in)long row number of lines
Return value
Returns WS_NO_ERR if it succeeds; returns otherwise if it fails.
Notice
Data in fixed row, fixed line and properties of each cell are preserved Note that properties of removed lines are discarded.
Samples


Document Release 3.90

For use with WideStudio/MWT Release 3.90, Summer 2005


WideStudio/MWT Home | Up to

Copyright(C) WideStudio/MWT Development Team, 1999-2005 Last modified: June 25, 2005