原本若想要透過Good.Trace輸出格式化的訊息,需要利用間接的方法,經由string.format格式化訊息,再傳給Good.Trace輸出,現在可以直接使用格式化輸出。
Good.Trace(string.format('id = %d', idObj))
Good.Trace('id = %d', idObj)
int FirstLine = GetFirstVisibleLine();
int FirstLineIndex = LineIndex(FirstLine);
POINT ptBottom = {0, rcClient.bottom - GetSystemMetrics(SM_CYHSCROLL) - 1};
int LastLineIndex = CharFromPos(ptBottom);
int LastLine = LineFromChar(LastLineIndex);
for (int i = FirstLine; i <= LastLine; i++) {
int Index = LineIndex(i);
POINT pos = PosFromChar(Index);
if (-1 == pos.x) {
break;
}
DrawText(LineNumber, Pos);
}
void OnTimer(UINT_PTR nIDEvent)
{
int Start, End;
GetSel(Start, End);
if (Start != nStartChar || End != nEndChar) {
DrawLineNumbers();
nStartChar = Start;
nEndChar = End;
}
}
Node::Add(Image)
{
if (NotImageAdded()) {
if (IsImageFit(Image)) {
AddImage(Image);
Left = new Node(BoundLeft + ImageWidth, BoundTop, BoundRight, BoundTop + ImageHeight);
Right = new Node(BoundLeft, BoundTop + ImageHeight, BoundRight, BoundBottom);
return true;
}
return false;
}
if (Left->Add(Image)) {
return true;
}
if (Right->Add(Image)) {
return true;
}
return false;
}
Node::Add(Image)
{
if (NotImageAdded()) {
if (IsImageFit(Image)) {
AddImage(Image);
if (BoundWidth - ImageWidth > BoundHeight - ImageHeight) {
Left = new Node(BoundLeft + ImageWidth, BoundTop, BoundRight, BoundBottom);
Right = new Node(BoundLeft, BoundTop + ImageHeight, BoundLeft + ImageWidth, BoundBottom);
} else {
Left = new Node(BoundLeft + ImageWidth, BoundTop, BoundRight, BoundTop + ImageHeight);
Right = new Node(BoundLeft, BoundTop + ImageHeight, BoundRight, BoundBottom);
}
return true;
}
return false;
}
if (Left->Add(Image)) {
return true;
}
if (Right->Add(Image)) {
return true;
}
return false;
}