diff options
author | Ian C <ianc@noddybox.co.uk> | 2005-04-02 01:53:30 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2005-04-02 01:53:30 +0000 |
commit | 98164e7547f7ea21204e69885158cd0494e08c5d (patch) | |
tree | 24d0957da8fb5fd68481e10d442cfbb534ff4494 /src/test/w32dtst.cpp | |
parent | effc648f262bd3bd7b57d4e76db2f768510be55c (diff) |
Added simple support for dialog menus
Diffstat (limited to 'src/test/w32dtst.cpp')
-rw-r--r-- | src/test/w32dtst.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/w32dtst.cpp b/src/test/w32dtst.cpp index 0e09ea2..75b5b44 100644 --- a/src/test/w32dtst.cpp +++ b/src/test/w32dtst.cpp @@ -59,6 +59,9 @@ public: (this,static_cast<W32DLib::W32DLibCallback>(&Test::OnComboDbl)); m_combo.OnTextChanged (this,static_cast<W32DLib::W32DLibCallback>(&Test::OnComboTxt)); + + SetMenuProc + (this,static_cast<W32DLib::W32DLibCallback>(&Test::OnMenu)); } virtual ~Test() @@ -201,6 +204,25 @@ private: std::cout << ":GetText=" << m_text.GetText() << std::endl; return TRUE; } + + BOOL OnMenu(UINT msg, WPARAM wp, LPARAM lp) + { + int cmd=LOWORD(wp); + + std::cout << "Menu command " << cmd << std::endl; + + switch(cmd) + { + case IDMENUQUIT: + Dialog::Close(IDCANCEL); + break; + + default: + break; + } + + return TRUE; + } }; int WINAPI WinMain (HINSTANCE hInstance, @@ -217,6 +239,10 @@ int WINAPI WinMain (HINSTANCE hInstance, { std::cout << "res=IDOK" << std::endl; } + else if (i==IDCANCEL) + { + std::cout << "res=IDCANCEL" << std::endl; + } else { std::cout << "res=" << i << std::endl; |