本文整理汇总了C++中sequence::init方法的典型用法代码示例。如果您正苦于以下问题:C++ sequence::init方法的具体用法?C++ sequence::init怎么用?C++ sequence::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sequence
的用法示例。
在下文中一共展示了sequence::init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WndProc
//
// Main window procedure - just used to host the CodeView and UniView windows
//
LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
int width = LOWORD(lParam);
int height = HIWORD(lParam);
int height2;
RECT rect;
switch(msg)
{
case WM_CREATE:
g_seq.init(INITIAL_TEXT, lstrlen(INITIAL_TEXT));
hwndUniView = CreateUniView(hwnd, &g_seq);
hwndSpanView = CreateSpanView(hwnd, &g_seq);
return 0;
case WM_CLOSE:
DestroyWindow(hwnd);
return 0;
case WM_SIZE:
GetWindowRect(hwndUniView, &rect);
height2 = rect.bottom-rect.top;
MoveWindow(hwndUniView, 0, 0, width, height2, TRUE);
MoveWindow(hwndSpanView, 0, height2+2, width, height-height2-2, TRUE);
InvalidateRect(hwndSpanView, 0,0);
return 0;
case WM_USER:
InvalidateRect(hwndSpanView, 0, 0);
return 0;
case WM_SETFOCUS:
SetFocus(hwndUniView);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDM_FILE_FONT:
if(GetFont(hwnd, &g_LogFont))
{
DeleteObject(g_hFont);
g_hFont = CreateFontIndirect(&g_LogFont);
UpdateFont();
InvalidateRect(hwndUniView, 0, 0);
SetFocus(hwndMain);
SetFocus(hwndUniView);
}
return 0;
case IDM_FILE_ABOUT:
MessageBox(hwnd,
_T("Piece Chain Demo\r\n\r\nCopyright(c) 2006 by Catch22 Productions.\r\nWritten by J Brown.\r\n\r\nHompage at www.catch22.net"),
_T("Piece Chain Demo"),
MB_ICONINFORMATION);
return 0;
// Quit :)
case IDM_FILE_EXIT:
PostMessage(hwnd, WM_CLOSE, 0, 0);
return 0;
}
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}