|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
|
void MyCug::OnSetup()
{
//******* Declare all variables int index , num_cols, num_rows;
CUGCell cell;
CString heading, number;;
//******* Enable the Menu EnableMenu(TRUE);
//****** Set the Rows and Columns SetNumberCols(10);
SetNumberRows(10) ;
//****** Get the Number of Rows and Columns num_rows = GetNumberRows();
num_cols = GetNumberCols();
//******* Add Row Heading to the grid for (index = 0; index < num_rows; index++)
{
heading.Format("%d", index + 1);
QuickSetText(-1, index, heading);
QuickSetAlignment(-1, index, UG_ALIGNVCENTER );
}
//****** Add the Side headings to the grid for (index = 0; index < num_cols; index++)
{
heading.Format("%d", index + 1);
QuickSetText(index, -1, heading);
QuickSetAlignment(index, -1, UG_ALIGNVCENTER );
}
//******* Populate the grid for (int x = 0; x < num_cols; x++)
{
for(int z = 0; z < num_rows; z++)
{
number.Format("%d", ((x + 1) * (z + 1)));
QuickSetText(x, z, number);
QuickSetAlignment(x, z, UG_ALIGNVCENTER );
}
}
//********** Join Cells Together EnableJoins(TRUE);
JoinCells(1, 1, 2, 4);
JoinCells(4, 1, 5, 6);
//******* Add the Dundas Bitmap int bitmap_index = AddBitmap("dundas.bmp");
QuickSetBitmap(1, 1, bitmap_index);
//******* Add another bitmap called toolbox int another_bitmap = AddBitmap("toolbox.bmp");
QuickSetBitmap(4, 1, another_bitmap);
}
|