root/lang/objective-cplusplus/i3/trunk/src/gui-windows/OutputWindowPlatform.cc @ 37319

Revision 37319, 2.5 kB (checked in by saturday06, 3 years ago)

new project

  • Property svn:executable set to *
Line 
1#include <mil/PrecompiledHeaders.h>
2#include "OutputWindow.h"
3#include "OutputWindowPlatform.h"
4#include "Mediator.h"
5
6/**
7 *
8 */
9
10using namespace mil;
11
12namespace i3 {
13
14template <>
15OutputWindowPlatform<OutputWindow>::OutputWindowPlatform() {
16}
17
18template <>
19OutputWindowPlatform<OutputWindow>::~OutputWindowPlatform() {
20}
21
22template <>
23void OutputWindowPlatform<OutputWindow>::createUI() {
24    if (local_window) {
25        return;
26    }
27    // -------------------------------------------------------------
28    // ウィンドウ作成
29    //
30
31    const int DEFAULT_WINDOW_WIDTH = 200;
32    const int DEFAULT_WINDOW_HEIGHT = 200;
33
34    TCHAR ClassName[] = _T("i3/WNDCLASS::lpszClassName/OutputWindow"); //  <- rule required
35    //int nCmdShow = SW_SHOW;
36
37    WNDCLASS wc    = {};
38    wc.style         = CS_HREDRAW | CS_VREDRAW;
39    wc.lpfnWndProc   = DefWindowProc;
40    wc.cbClsExtra    = 0;
41    wc.cbWndExtra    = 0;
42    wc.hInstance     = i3::hInstance;
43    wc.hIcon         = LoadIcon(i3::hInstance, _T("IDI_ICON1"));
44    wc.hCursor       = LoadCursor(NULL, IDC_ARROW);
45    wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
46    wc.lpszMenuName  = NULL;
47    wc.lpszClassName = ClassName;
48
49    if (!RegisterClass(&wc)) {
50        //halt << "lpszClassName: [" << wc.lpszClassName << "]";
51        //return;
52    }
53
54    DWORD dwDefaultStyle = WS_POPUP;
55    DWORD dwDefaultExStyle = 0;
56//    DWORD dwDefaultExStyle = WS_EX_DLGMODALFRAME;
57#ifdef _WIN32_WCE
58    dwDefaultStyle |= WS_BORDER;
59#else
60    dwDefaultStyle |= WS_THICKFRAME;
61//    dwDefaultStyle |= WS_DLGFRAME;
62//    dwDefaultStyle |= WS_BORDER;
63#endif
64    dwDefaultStyle &= ~WS_CAPTION;
65
66    HWND hWnd = CreateWindowEx(
67                    dwDefaultExStyle,
68                    ClassName,
69                    _T("i3/OutputWindow"), //  <- need rule
70                    dwDefaultStyle,
71                    30, //CW_USEDEFAULT,
72                    90, //CW_USEDEFAULT,
73                    DEFAULT_WINDOW_WIDTH,
74                    DEFAULT_WINDOW_HEIGHT,
75                    NULL,
76                    NULL,
77                    i3::hInstance,
78                    NULL
79                );
80
81    if (!IsWindow(hWnd)) {
82        // what ..?
83        halt << hWnd;
84        return;
85    }
86
87    setWindow(hWnd);
88}
89
90template <>
91void OutputWindowPlatform<OutputWindow>::run() {
92    createUI();
93    UpdateWindow(local_window);
94    ShowWindow(local_window, SW_HIDE);
95    loop();
96}
97
98}
Note: See TracBrowser for help on using the browser.