Changeset 17978

Show
Ignore:
Timestamp:
08/21/08 22:32:02 (5 years ago)
Author:
saturday06
Message:

guimoduleのてすと

Location:
lang/cplusplus/i3/src/mol
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/cplusplus/i3/src/mol/include/mol/gui-windows/DummyMessageHandler-inl.h

    r16050 r17978  
    1 void OnActivate(HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized) 
    2 { 
    3     SetMsgHandled(false); 
    4  
     1void OnActivate(HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized) { 
     2    SetMsgHandled(false); 
    53} 
    64 
    75void OnActivateApp(HWND hwnd, BOOL fActivate, DWORD dwThreadId) { 
    86    SetMsgHandled(false); 
    9  
    107} 
    118 
    129void OnCancelMode(HWND hwnd) { 
    1310    SetMsgHandled(false); 
    14  
    1511} 
    1612 
    1713void OnChildActivate(HWND hwnd) { 
    1814    SetMsgHandled(false); 
    19  
    2015} 
    2116 
    2217void OnClose(HWND hwnd) { 
    2318    SetMsgHandled(false); 
    24  
    2519} 
    2620 
    2721void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) { 
    2822    SetMsgHandled(false); 
    29  
    3023} 
    3124 
    3225void OnCommNotify(HWND hwnd, int cid, UINT flags) { 
    3326    SetMsgHandled(false); 
    34  
    3527} 
    3628 
    3729void OnCompacting(HWND hwnd, UINT compactRatio) { 
    3830    SetMsgHandled(false); 
    39  
    4031} 
    4132 
     
    4738void OnContextMenu(HWND hwnd, HWND hwndContext, UINT xPos, UINT yPos) { 
    4839    SetMsgHandled(false); 
    49  
    5040} 
    5141 
     
    10191void OnDeleteItem(HWND hwnd, const DELETEITEMSTRUCT * lpDeleteItem) { 
    10292    SetMsgHandled(false); 
    103  
    10493} 
    10594 
    10695void OnDestroy(HWND hwnd) { 
    10796    SetMsgHandled(false); 
    108  
    10997} 
    11098 
     
    117105void OnDevModeChange(HWND hwnd, LPCTSTR lpszDeviceName) { 
    118106    SetMsgHandled(false); 
    119  
    120107} 
    121108 
    122109void OnDisplayChange(HWND hwnd, UINT bitsPerPixel, UINT cxScreen, UINT cyScreen) { 
    123110    SetMsgHandled(false); 
    124  
    125111} 
    126112 
    127113void OnDrawItem(HWND hwnd, const DRAWITEMSTRUCT * lpDrawItem) { 
    128114    SetMsgHandled(false); 
    129  
    130115} 
    131116 
    132117void OnEnable(HWND hwnd, BOOL fEnable) { 
    133118    SetMsgHandled(false); 
    134  
    135119} 
    136120 
    137121void OnEndSession(HWND hwnd, BOOL fEnding) { 
    138122    SetMsgHandled(false); 
    139  
    140123} 
    141124 
    142125void OnEnterIdle(HWND hwnd, UINT source, HWND hwndSource) { 
    143126    SetMsgHandled(false); 
    144  
    145127} 
    146128 
     
    153135void OnFontChange(HWND hwnd) { 
    154136    SetMsgHandled(false); 
    155  
    156137} 
    157138 
     
    170151void OnGetMinMaxInfo(HWND hwnd, LPMINMAXINFO lpMinMaxInfo) { 
    171152    SetMsgHandled(false); 
    172  
    173153} 
    174154 
     
    187167void OnHScroll(HWND hwnd, HWND hwndCtl, UINT code, int pos) { 
    188168    SetMsgHandled(false); 
    189  
    190169} 
    191170 
     
    204183void OnInitMenu(HWND hwnd, HMENU hMenu) { 
    205184    SetMsgHandled(false); 
    206  
    207185} 
    208186 
    209187void OnInitMenuPopup(HWND hwnd, HMENU hMenu, UINT item, BOOL fSystemMenu) { 
    210188    SetMsgHandled(false); 
    211  
    212189} 
    213190 
    214191void OnKillFocus(HWND hwnd, HWND hwndNewFocus) { 
    215192    SetMsgHandled(false); 
    216  
    217193} 
    218194 
    219195void OnMeasureItem(HWND hwnd, MEASUREITEMSTRUCT * lpMeasureItem) { 
    220196    SetMsgHandled(false); 
    221  
    222197} 
    223198 
     
    230205void OnMenuSelect(HWND hwnd, HMENU hmenu, int item, HMENU hmenuPopup, UINT flags) { 
    231206    SetMsgHandled(false); 
    232  
    233207} 
    234208 
    235209void OnMove(HWND hwnd, int x, int y) { 
    236210    SetMsgHandled(false); 
    237  
    238211} 
    239212 
     
    246219void OnPaint(HWND hwnd) { 
    247220    SetMsgHandled(false); 
    248  
    249221} 
    250222 
    251223void OnPaletteChanged(HWND hwnd, HWND hwndPaletteChange) { 
    252224    SetMsgHandled(false); 
    253  
    254225} 
    255226 
    256227void OnPaletteIsChanging(HWND hwnd, HWND hwndPaletteChange) { 
    257228    SetMsgHandled(false); 
    258  
    259229} 
    260230 
    261231void OnPower(HWND hwnd, int code) { 
    262232    SetMsgHandled(false); 
    263  
    264233} 
    265234 
     
    290259void OnQueueSync(HWND hwnd) { 
    291260    SetMsgHandled(false); 
    292  
    293261} 
    294262 
    295263void OnQuit(HWND hwnd, int exitCode) { 
    296264    SetMsgHandled(false); 
    297  
    298265} 
    299266 
    300267void OnSetFocus(HWND hwnd, HWND hwndOldFocus) { 
    301268    SetMsgHandled(false); 
    302  
    303269} 
    304270 
    305271void OnSetFont(HWND hwndCtl, HFONT hfont, BOOL fRedraw) { 
    306272    SetMsgHandled(false); 
    307  
    308273} 
    309274 
    310275void OnSetRedraw(HWND hwnd, BOOL fRedraw) { 
    311276    SetMsgHandled(false); 
    312  
    313277} 
    314278 
    315279void OnSetText(HWND hwnd, LPCTSTR lpszText) { 
    316280    SetMsgHandled(false); 
    317  
    318281} 
    319282 
    320283void OnShowWindow(HWND hwnd, BOOL fShow, UINT status) { 
    321284    SetMsgHandled(false); 
    322  
    323285} 
    324286 
    325287void OnSize(HWND hwnd, UINT state, int cx, int cy) { 
    326288    SetMsgHandled(false); 
    327  
    328289} 
    329290 
    330291void OnSpoolerStatus(HWND hwnd, UINT status, int cJobInQueue) { 
    331292    SetMsgHandled(false); 
    332  
    333293} 
    334294 
    335295void OnSysColorChange(HWND hwnd) { 
    336296    SetMsgHandled(false); 
    337  
    338297} 
    339298 
    340299void OnSysCommand(HWND hwnd, UINT cmd, int x, int y) { 
    341300    SetMsgHandled(false); 
    342  
    343301} 
    344302 
    345303void OnSystemError(HWND hwnd, int errCode) { 
    346304    SetMsgHandled(false); 
    347  
    348305} 
    349306 
    350307void OnTimeChange(HWND hwnd) { 
    351308    SetMsgHandled(false); 
    352  
    353309} 
    354310 
    355311void OnTimer(HWND hwnd, UINT id) { 
    356312    SetMsgHandled(false); 
    357  
    358313} 
    359314 
    360315void OnVScroll(HWND hwnd, HWND hwndCtl, UINT code, int pos) { 
    361316    SetMsgHandled(false); 
    362  
    363317} 
    364318 
    365319void OnWindowPosChanged(HWND hwnd, const LPWINDOWPOS lpwpos) { 
    366320    SetMsgHandled(false); 
    367  
    368321} 
    369322 
     
    376329void OnWinIniChange(HWND hwnd, LPCTSTR lpszSectionName) { 
    377330    SetMsgHandled(false); 
    378  
    379331} 
    380332 
    381333void OnChar(HWND hwnd, TCHAR ch, int cRepeat) { 
    382334    SetMsgHandled(false); 
    383  
    384335} 
    385336 
     
    391342void OnDeadChar(HWND hwnd, TCHAR ch, int cRepeat) { 
    392343    SetMsgHandled(false); 
    393  
    394344} 
    395345 
    396346void OnDropFiles(HWND hwnd, HDROP hdrop) { 
    397347    SetMsgHandled(false); 
    398  
    399348} 
    400349 
    401350void OnHotKey(HWND hwnd, int idHotKey, UINT fuModifiers, UINT vk) { 
    402351    SetMsgHandled(false); 
    403  
    404352} 
    405353 
    406354void OnKeyDown(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags) { 
    407355    SetMsgHandled(false); 
    408  
    409356} 
    410357 
    411358void OnKeyUp(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags) { 
    412359    SetMsgHandled(false); 
    413  
    414360} 
    415361 
    416362void OnLButtonDblClk(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags) { 
    417363    SetMsgHandled(false); 
    418  
    419364} 
    420365 
    421366void OnLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags) { 
    422367    SetMsgHandled(false); 
    423  
    424368} 
    425369 
    426370void OnLButtonUp(HWND hwnd, int x, int y, UINT keyFlags) { 
    427371    SetMsgHandled(false); 
    428  
    429372} 
    430373 
    431374void OnMButtonDblclk(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags) { 
    432375    SetMsgHandled(false); 
    433  
    434376} 
    435377 
    436378void OnMButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags) { 
    437379    SetMsgHandled(false); 
    438  
    439380} 
    440381 
    441382void OnMButtonUp(HWND hwnd, int x, int y, UINT flags) { 
    442383    SetMsgHandled(false); 
    443  
    444384} 
    445385 
     
    452392void OnMouseMove(HWND hwnd, int x, int y, UINT keyFlags) { 
    453393    SetMsgHandled(false); 
    454  
    455394} 
    456395 
    457396void OnMouseWheel(HWND hwnd, int xPos, int yPos, int zDelta, UINT fwKeys) { 
    458397    SetMsgHandled(false); 
    459  
    460398} 
    461399 
    462400void OnParentNotify(HWND hwnd, UINT msg, HWND hwndChild, int idChild) { 
    463401    SetMsgHandled(false); 
    464  
    465402} 
    466403 
    467404void OnRButtonDblClk(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags) { 
    468405    SetMsgHandled(false); 
    469  
    470406} 
    471407 
    472408void OnRButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags) { 
    473409    SetMsgHandled(false); 
    474  
    475410} 
    476411 
    477412void OnRButtonUp(HWND hwnd, int x, int y, UINT flags) { 
    478413    SetMsgHandled(false); 
    479  
    480414} 
    481415 
     
    488422void OnSysChar(HWND hwnd, TCHAR ch, int cRepeat) { 
    489423    SetMsgHandled(false); 
    490  
    491424} 
    492425 
    493426void OnSysDeadChar(HWND hwnd, TCHAR ch, int cRepeat) { 
    494427    SetMsgHandled(false); 
    495  
    496428} 
    497429 
    498430void OnSysKeyDown(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags) { 
    499431    SetMsgHandled(false); 
    500  
    501432} 
    502433 
    503434void OnSysKeyUp(HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags) { 
    504435    SetMsgHandled(false); 
    505  
    506436} 
    507437 
     
    514444void OnAskCBFormatName(HWND hwnd, int cchMax, LPTSTR rgchName) { 
    515445    SetMsgHandled(false); 
    516  
    517446} 
    518447 
    519448void OnChangeCBChain(HWND hwnd, HWND hwndRemove, HWND hwndNext) { 
    520449    SetMsgHandled(false); 
    521  
    522450} 
    523451 
    524452void OnClear(HWND hwnd) { 
    525453    SetMsgHandled(false); 
    526  
    527454} 
    528455 
    529456void OnCopy(HWND hwnd) { 
    530457    SetMsgHandled(false); 
    531  
    532458} 
    533459 
    534460void OnCut(HWND hwnd) { 
    535461    SetMsgHandled(false); 
    536  
    537462} 
    538463 
    539464void OnDestroyClipboard(HWND hwnd) { 
    540465    SetMsgHandled(false); 
    541  
    542466} 
    543467 
    544468void OnDrawClipboard(HWND hwnd) { 
    545469    SetMsgHandled(false); 
    546  
    547470} 
    548471 
    549472void OnHScrollClipboard(HWND hwnd, HWND hwndCBViewer, UINT code, int pos) { 
    550473    SetMsgHandled(false); 
    551  
    552474} 
    553475 
    554476void OnMDIActivate(HWND hwnd, BOOL fActive, HWND hwndActivate, HWND hwndDeactivate) { 
    555477    SetMsgHandled(false); 
    556  
    557478} 
    558479 
     
    571492void OnMDIDestroy(HWND hwnd, HWND hwndDestroy) { 
    572493    SetMsgHandled(false); 
    573  
    574494} 
    575495 
     
    582502void OnMDIIconArrange(HWND hwnd) { 
    583503    SetMsgHandled(false); 
    584  
    585504} 
    586505 
    587506void OnMDIMaximize(HWND hwnd, HWND hwndMaximize) { 
    588507    SetMsgHandled(false); 
    589  
    590508} 
    591509 
     
    598516void OnMDIRestore(HWND hwnd, HWND hwndRestore) { 
    599517    SetMsgHandled(false); 
    600  
    601518} 
    602519 
     
    615532void OnPaintClipboard(HWND hwnd, HWND hwndCBViewer, const LPPAINTSTRUCT lpPaintStruct) { 
    616533    SetMsgHandled(false); 
    617  
    618534} 
    619535 
    620536void OnPaste(HWND hwnd) { 
    621537    SetMsgHandled(false); 
    622  
    623538} 
    624539 
    625540void OnRenderAllFormats(HWND hwnd) { 
    626541    SetMsgHandled(false); 
    627  
    628542} 
    629543 
     
    636550void OnSizeClipboard(HWND hwnd, HWND hwndCBViewer, const LPRECT lprc) { 
    637551    SetMsgHandled(false); 
    638  
    639552} 
    640553 
    641554void OnUndo(HWND hwnd) { 
    642555    SetMsgHandled(false); 
    643  
    644556} 
    645557 
    646558void OnVScrollClipboard(HWND hwnd, HWND hwndCBViewer, UINT code, int pos) { 
    647559    SetMsgHandled(false); 
    648  
    649560} 
    650561 
     
    669580void OnNCDestroy(HWND hwnd) { 
    670581    SetMsgHandled(false); 
    671  
    672582} 
    673583 
     
    680590void OnNCLButtonDblClk(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest) { 
    681591    SetMsgHandled(false); 
    682  
    683592} 
    684593 
    685594void OnNCLButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest) { 
    686595    SetMsgHandled(false); 
    687  
    688596} 
    689597 
    690598void OnNCLButtonUp(HWND hwnd, int x, int y, UINT codeHitTest) { 
    691599    SetMsgHandled(false); 
    692  
    693600} 
    694601 
    695602void OnNCMButtonDblClk(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest) { 
    696603    SetMsgHandled(false); 
    697  
    698604} 
    699605 
    700606void OnNCMButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest) { 
    701607    SetMsgHandled(false); 
    702  
    703608} 
    704609 
    705610void OnNCMButtonUp(HWND hwnd, int x, int y, UINT codeHitTest) { 
    706611    SetMsgHandled(false); 
    707  
    708612} 
    709613 
    710614void OnNCMouseMove(HWND hwnd, int x, int y, UINT codeHitTest) { 
    711615    SetMsgHandled(false); 
    712  
    713616} 
    714617 
    715618void OnNCPaint(HWND hwnd, HRGN hrgn) { 
    716619    SetMsgHandled(false); 
    717  
    718620} 
    719621 
    720622void OnNCRButtonDblClk(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest) { 
    721623    SetMsgHandled(false); 
    722  
    723624} 
    724625 
    725626void OnNCRButtonDown(HWND hwnd, BOOL fDoubleClick, int x, int y, UINT codeHitTest) { 
    726627    SetMsgHandled(false); 
    727  
    728628} 
    729629 
    730630void OnNCRButtonUp(HWND hwnd, int x, int y, UINT codeHitTest) { 
    731631    SetMsgHandled(false); 
    732  
    733 } 
    734  
     632} 
     633 
  • lang/cplusplus/i3/src/mol/src/Test.cpp

    r17973 r17978  
    1919#ifdef def_test_Module 
    2020#include <mol/Module.h> 
     21#ifdef MOL_GUI_WINDOWS 
     22#include <mol/gui-windows/GuiModule.h> 
     23#else 
     24#include <mol/gui-qt/GuiModule.h> 
     25#endif 
    2126 
    2227namespace ns_test_Module { 
     
    6166    } 
    6267}; 
    63 } 
    64 BOOST_AUTO_TEST_CASE(test_Module) 
    65 { 
    66     using namespace ns_test_Module; 
     68struct FooGuiModule : GuiModule<FooGuiModule> { 
     69    FooGuiModule() { 
     70        HINSTANCE hInstance = GetModuleHandle(NULL); 
     71        const TCHAR ClassName[] = _T("iz8eiafjiolkedf"); 
     72        int nCmdShow = SW_SHOW; 
     73 
     74        WNDCLASSEX wc; 
     75        wc.cbSize        = sizeof(WNDCLASSEX); 
     76        wc.style         = CS_HREDRAW | CS_VREDRAW | WS_OVERLAPPED; 
     77        wc.lpfnWndProc   = DefWindowProc; 
     78        wc.cbClsExtra    = 0; 
     79        wc.cbWndExtra    = 0; 
     80        wc.hInstance     = hInstance; 
     81        wc.hIcon         = NULL; 
     82        wc.hCursor       = LoadCursor(NULL, IDC_ARROW); 
     83        wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); 
     84        wc.lpszMenuName  = NULL; 
     85        wc.lpszClassName = ClassName; 
     86        wc.hIconSm       = NULL; 
     87 
     88        if (!RegisterClassEx(&wc)) { 
     89            assert(0); 
     90        } 
     91        hWnd = CreateWindowEx( 
     920, ClassName, _T("InputWindow"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 
     93CW_USEDEFAULT,200,50,NULL,NULL,hInstance,NULL 
     94); 
     95        assert(IsWindow(hWnd)); 
     96 
     97        ShowWindow(hWnd, nCmdShow); 
     98        UpdateWindow(hWnd); 
     99        wndproc.set(hWnd); 
     100    } 
     101    ~FooGuiModule() { 
     102        DestroyWindow(hWnd); 
     103    } 
     104    void execute_front() { 
     105        MSG msg = {}; 
     106        while (1) { 
     107            if (PeekMessage (&msg,NULL,0,0,PM_NOREMOVE)) { 
     108                if (!GetMessage (&msg,NULL,0,0)) { 
     109                    return; 
     110                } 
     111                TranslateMessage(&msg); 
     112                DispatchMessage(&msg); 
     113            } else { 
     114                return; 
     115            } 
     116        } 
     117    } 
     118    void execute(FooEvent& e) { 
     119        global = e.value; 
     120        repostEvent(); 
     121    } 
     122    void execute(BarEvent& e) { 
     123        global = e.value; 
     124    } 
     125    void execute(IncEvent& i) { 
     126        global++; 
     127        repostEvent(); 
     128    } 
     129    void execute(Plus5& e) { 
     130        global += 5; 
     131    } 
     132    void execute(Minus3& e) { 
     133        global -= 3; 
     134    } 
     135}; 
     136template <typename FooModule> 
     137void test() { 
    67138    { 
    68139        FooModule m; 
     
    120191} 
    121192 
     193} 
     194BOOST_AUTO_TEST_CASE(test_Module) 
     195{ 
     196    using namespace ns_test_Module; 
     197    test<FooModule>(); 
     198    test<FooGuiModule>(); 
     199} 
     200 
    122201#endif 
    123202