?? ulott3d.~pas
字號:
with gl_HeadLineList do
begin
HeadLineList[CurHeadLineCount].Caption:='組3出現情況';
HeadLineList[CurHeadLineCount].Color:=TColor(RGB(191,215,183));
HeadLineList[CurHeadLineCount].ColBKColor:=gl_BackColorList.clColColorList[CurHeadLineCount mod 4];
HeadLineList[CurHeadLineCount].Width:=22;
HeadLineList[CurHeadLineCount].ItemCaptionList[0]:='10個號碼';
HeadLineList[CurHeadLineCount].CurItemCaptionCount:=1;
HeadLIneList[CurHeadLineCount].DisplayFlag:=true;
IdxZH3TenCode:=CurHeadLineCount;
CurHeadLineCount:=CurHeadLineCount+1;
end;
//組合3,45個組合(不考慮重復號碼)出現情況
with gl_HeadLineList do
begin
HeadLineList[CurHeadLineCount].Caption:='組3,45個組合(每個組合2注)出現情況';
HeadLineList[CurHeadLineCount].Color:=TColor(RGB(191,215,183));
HeadLineList[CurHeadLineCount].ColBKColor:=gl_BackColorList.clColColorList[CurHeadLineCount mod 4];
HeadLineList[CurHeadLineCount].Width:=22;
for i:=0 to cnZH3CodeTypeNoMax-1 do
HeadLineList[CurHeadLineCount].ItemCaptionList[i]:=IntToStr(gl_ZH3CodeTypeNoList.ZH3CodeTypeNoList[i].Code1)+IntToStr(gl_ZH3CodeTypeNoList.ZH3CodeTypeNoList[i].Code2);
HeadLineList[CurHeadLineCount].CurItemCaptionCount:=cnZH3CodeTypeNoMax;
HeadLIneList[CurHeadLineCount].DisplayFlag:=true;
IdxZH3CodeTypeNo:=CurHeadLineCount;
CurHeadLineCount:=CurHeadLineCount+1;
end;
//組合3,45個組合取前N個出現最多的,看看其出現概率
with gl_HeadLineList do
begin
HeadLineList[CurHeadLineCount].Caption:='組3,45個組合取前N個出現情況';
HeadLineList[CurHeadLineCount].Color:=TColor(RGB(191,215,183));
HeadLineList[CurHeadLineCount].ColBKColor:=gl_BackColorList.clColColorList[CurHeadLineCount mod 4];
HeadLineList[CurHeadLineCount].Width:=22;
HeadLineList[CurHeadLineCount].ItemCaptionList[0]:=FormGetCode.EditZH3Code45GetPreN.Text;
HeadLineList[CurHeadLineCount].CurItemCaptionCount:=1;
HeadLIneList[CurHeadLineCount].DisplayFlag:=true;
IdxZH3Code45SelectN:=CurHeadLineCount;
CurHeadLineCount:=CurHeadLineCount+1;
end;
//以下是循環控制內容
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
//設置每個標題相對位置
j:=0;
with gl_HeadLineList do
begin
for i:=0 to CurHeadLineCount-1 do
begin
HeadLineList[i].HeadLinePosition:=j;
j:=j+HeadLineList[i].CurItemCaptionCount;
end;
end;
/////////////////////////////////////////////////////////////
//顯示行列序號
for i:=1 to ZcPersistGrid.ColCount-1 do ZcPersistGrid.Cells[i,0].EditText:=IntToStr(i);
for i:=0 to ZcPersistGrid.RowCount-1 do ZcPersistGrid.Cells[0,gl_InfoFirstStartRow+i].EditText:=IntToStr(i+1);
////////////////////////////////////
//end ini file
finally
Ini.Free;
end;
end;
//顯示標題
procedure TForm3D.DisplayHeadLine;
var
i,j,x1,x2:integer;
vRect,R1:TRect;
begin
with gl_HeadLineList do
begin
for i:=0 to CurHeadLineCount-1 do
begin
//大標題
vRect.Left:=gl_HeadLineGridStartCol+HeadLineList[i].HeadLinePosition;
vRect.Top:=gl_HeadLIneGridStartRow;
vRect.Right:=gl_HeadLineGridStartCol+HeadLineList[i].HeadLinePosition+HeadLineList[i].CurItemCaptionCount;
vRect.Bottom:=gl_HeadLIneGridStartRow+1;
ZcPersistGrid.Merge(vRect);
SetCellValue(vRect.Left,vRect.Top,HeadLineList[i].Caption);
for x1:=vRect.Left to vRect.Right do
for x2:=gl_InfoFirstStartRow to ZcPersistGrid.RowCount-2 do
if length(ZcPersistGrid.Cells[x1,x2].Text)>0 then ZcPersistGrid.Cells[x1,x2].Text:='';
//小標題
for j:=0 to HeadLineList[i].CurItemCaptionCount-1 do
begin
SetCellValue(vRect.Left+j,vRect.Top+1,HeadLineList[i].ItemCaptionList[j]);
if HeadLineList[i].DisplayFlag=true then ZcPersistGrid.ColWidths[vRect.Left+j]:=HeadLineList[i].Width
else ZcPersistGrid.ColWidths[vRect.Left+j]:=0;
ZcPersistGrid.Colors.Cols[vRect.Left+j]:=HeadLineList[i].ColBkColor;
end;
//第一項開獎號碼期數列重新設置列寬
if i=0 then ZcPersistGrid.ColWidths[vRect.Left]:=50;
//第一、二行標題列高加長
ZcPersistGrid.RowHeights[vRect.Top]:=30;
ZcPersistGrid.RowHeights[vRect.Top+1]:=30;
// 設置列的對齊方式, 默認對齊方式是居中
//Grid.TextAligns.Cols[1] := gaCenterCenter;
/////////////////////////////////////////////////////////////
//第二部分標題
if i>0 then //跳過獎號
begin
//大標題
vRect.Left:=gl_InfoStartCol+HeadLineList[i].HeadLinePosition;
vRect.Top:=gl_InfoSecondStartRow-2;
vRect.Right:=gl_InfoStartCol+HeadLineList[i].HeadLinePosition+HeadLineList[i].CurItemCaptionCount;
vRect.Bottom:=gl_InfoSecondStartRow-1;
ZcPersistGrid.Merge(vRect);
SetCellValue(vRect.Left,vRect.Top,HeadLineList[i].Caption);
ZcPersistGrid.Cells[vRect.Left,vRect.Top].Color:=gl_BackColorList.clSecondHeadLineBKColor;
//小標題
for j:=0 to HeadLineList[i].CurItemCaptionCount-1 do
begin
SetCellValue(vRect.Left+j,vRect.Top+1,HeadLineList[i].ItemCaptionList[j]);
ZcPersistGrid.Cells[vRect.Left+j,vRect.Top+1].Color:=gl_BackColorList.clSecondHeadLineBKColor;
end;
end;
//第一、二行標題列高加長
ZcPersistGrid.RowHeights[vRect.Top]:=30;
ZcPersistGrid.RowHeights[vRect.Top+1]:=30;
end;
end;
///////////////////////////////////////////////////////////////////////////////////////////////
//顯示開獎信息
for i:=0 to gl_CodeList.CurCodeCount-1 do
begin
SetCellValue(gl_InfoStartCol+gl_HeadLineList.HeadLineList[gl_HeadLineList.IdxCode].HeadLinePosition,gl_InfoFirstStartRow+i,gl_CodeList.CodeList[i].CodeDateNumber);
SetCellValue(gl_InfoStartCol+gl_HeadLineList.HeadLineList[gl_HeadLineList.IdxCode].HeadLinePosition+1,gl_InfoFirstStartRow+i,IntToStr(gl_CodeList.CodeList[i].Code1));
SetCellValue(gl_InfoStartCol+gl_HeadLineList.HeadLineList[gl_HeadLineList.IdxCode].HeadLinePosition+2,gl_InfoFirstStartRow+i,IntToStr(gl_CodeList.CodeList[i].Code2));
SetCellValue(gl_InfoStartCol+gl_HeadLineList.HeadLineList[gl_HeadLineList.IdxCode].HeadLinePosition+3,gl_InfoFirstStartRow+i,IntToStr(gl_CodeList.CodeList[i].Code3));
end;
end;
//重新顯示標題
procedure TForm3D.DisplayHeadLineRepaint(pIdx:integer);
var
i,j,x1,x2:integer;
vRect,R1:TRect;
begin
with gl_HeadLineList do
begin
vRect.Left:=gl_HeadLineGridStartCol+HeadLineList[pIdx].HeadLinePosition;
vRect.Top:=gl_HeadLIneGridStartRow;
//小標題
for j:=0 to HeadLineList[pIdx].CurItemCaptionCount-1 do
SetCellValue(vRect.Left+j,vRect.Top+1,HeadLineList[pIdx].ItemCaptionList[j]);
vRect.Left:=gl_InfoStartCol+HeadLineList[pIdx].HeadLinePosition;
vRect.Top:=gl_InfoSecondStartRow-2;
//小標題
for j:=0 to HeadLineList[pIdx].CurItemCaptionCount-1 do
SetCellValue(vRect.Left+j,vRect.Top+1,HeadLineList[pIdx].ItemCaptionList[j]);
end;
end;
//設置單元格值
procedure TForm3D.SetCellValue(pCol:integer;pRow:integer;pValue:string);
begin
ZcPersistGrid.Cells[pCol,pRow].EditText:=pValue;
end;
//設置單元格背景色
procedure TForm3D.SetBackColor(pCol:integer;pRow:integer;pBkColor:TColor);
begin
ZcPersistGrid.Cells[pCol,pRow].Color:=pBkColor;
end;
////////////////////////////////////////////////////////////////////////////////////////////////////
//////
////// 分析函數和過程
//////
////////////////////////////////////////////////////////////////////////////////////////////////////
//判定奇偶個數(奇數個數)
function TForm3D.GetOddEvenCount(pCode1:integer;pCode2:integer;pCode3:integer):integer;
var
iCount:integer;
begin
iCount:=0;
if (pCode1 mod 2)=1 then iCount:=iCount+1;
if (pCode2 mod 2)=1 then iCount:=iCount+1;
if (pCode3 mod 2)=1 then iCount:=iCount+1;
GetOddEvenCount:=iCount;
end;
//判定大小個數(大的個數)
function TForm3D.GetBigSmallCount(pCode1:integer;pCode2:integer;pCode3:integer):integer;
var
iCount:integer;
begin
iCount:=0;
if pCode1>=5 then iCount:=iCount+1;
if pCode2>=5 then iCount:=iCount+1;
if pCode3>=5 then iCount:=iCount+1;
GetBigSmallCount:=iCount;
end;
//判定號碼個數
function TForm3D.GetCodeCount(pCode1:integer;pCode2:integer;pCode3:integer):integer;
var
iCount,i:integer;
vCode:array[0..9] of integer;
begin
for i:=0 to 9 do vCode[i]:=0;
vCode[pCode1]:=1;
vCode[pCode2]:=1;
vCode[pCode3]:=1;
iCount:=0;
for i:=0 to 9 do if vCode[i]=1 then iCount:=iCount+1;
GetCodeCount:=iCount;
end;
//取得形狀ID
function TForm3D.GetShapeIndex(pCode1:integer;pCode2:integer;pCode3:integer):integer;
var
vCodeShape:integer;
begin
if (pCode1<pCode2) and (pCode2<pCode3) then vCodeShape:=spLineHeadRight;
if (pCode1>pCode2) and (pCode2>pCode3) then vCodeShape:=spLineHeadLeft;
if (pCode1<pCode2) and (pCode2>pCode3) then vCodeShape:=spTipToTop;
if (pCode1>pCode2) and (pCode2<pCode3) then vCodeShape:=spTipToBottom;
if (pCode1=pCode2) and (pCode2<pCode3) then vCodeShape:=spFlatToRigthTop;
if (pCode1=pCode2) and (pCode2>pCode3) then vCodeShape:=spFlatToRigthBottom;
if (pCode1>pCode2) and (pCode2=pCode3) then vCodeShape:=spLeftTopToFlat;
if (pCode1<pCode2) and (pCode2=pCode3) then vCodeShape:=spLeftBottomToFlat;
if (pCode1=pCode2) and (pCode2=pCode3) then vCodeShape:=spFlat;
GetShapeIndex:=vCodeShape;
end;
//取得連號個數
function TForm3D.GetLinkCodeCount(pCode1:integer;pCode2:integer;pCode3:integer):integer;
var
iLink:integer;
begin
iLink:=0;
if abs(pCode1-pCode2)=1 then iLink:=iLink+1;
if abs(pCode2-pCode3)=1 then iLink:=iLink+1;
GetLinkCodeCOunt:=iLink;
end;
//取得開寶個數
function TForm3D.GetTreasureCount(pCode1:integer;pCode2:integer;pCode3:integer):integ
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -