[Wgui-cvs] wgui/tests TestFrame2.cpp,1.9,1.10 TestView1.cpp,1.78,1.79 TestView2.cpp,1.10,1.11 TestVi
Status: Beta
Brought to you by:
greenwire
|
From: Rob W. <gre...@us...> - 2004-12-27 04:59:46
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24643/tests Modified Files: TestFrame2.cpp TestView1.cpp TestView2.cpp TestView2.h Log Message: Started work on the CMessageBox class. Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** TestView1.cpp 12 Dec 2004 19:45:06 -0000 1.78 --- TestView1.cpp 27 Dec 2004 04:59:36 -0000 1.79 *************** *** 32,35 **** --- 32,37 ---- const long int EXIT_APP = 14; const long int NEXT_BUTTON_PICTURE = 15; + const long int SHOW_MESSAGE_BOX_1 = 16; + const long int SHOW_MESSAGE_BOX_2 = 17; CTestWindow::CTestWindow(const wGui::CRect& WindowRect, wGui::CWindow* pParent) : *************** *** 74,79 **** AttachMenu(new wGui::CMenu(wGui::CRect(0, 0, 80, 22), this)); wGui::CPopupMenu* pContextSubmenu = new wGui::CPopupMenu(wGui::CRect(0, 0, 140, 50), this); ! pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Do Something")); ! pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Do Something Else")); pContextSubmenu->InsertMenuItem(wGui::SMenuItem()); // instert a spacer pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Exit", EXIT_APP)); --- 76,81 ---- AttachMenu(new wGui::CMenu(wGui::CRect(0, 0, 80, 22), this)); wGui::CPopupMenu* pContextSubmenu = new wGui::CPopupMenu(wGui::CRect(0, 0, 140, 50), this); ! pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Do Something"/*, SHOW_MESSAGE_BOX_1*/)); ! pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Do Something Else"/*, SHOW_MESSAGE_BOX_2*/)); pContextSubmenu->InsertMenuItem(wGui::SMenuItem()); // instert a spacer pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Exit", EXIT_APP)); *************** *** 329,332 **** --- 331,346 ---- } m_pBtnPictureButton->SetPicture(wGui::CwgBitmapResourceHandle(m_eCurrentPicture)); + break; + /* + case SHOW_MESSAGE_BOX_1: + wGui::CMessageBox(this, 0, "Message Box 1", "This is a test of the message box.", wGui::CMessageBox::BUTTON_OK).DoModal(); + break; + case SHOW_MESSAGE_BOX_2: + if (wGui::CMessageBox(this, 0, "Message Box 2", "Show another message box?", wGui::CMessageBox::BUTTON_YES | wGui::CMessageBox::BUTTON_NO).DoModal() == wGui::CMessageBox::BUTTON_YES) + { + wGui::CMessageBox(this, 0, "Message Box 2", "Here's your extra message box.", wGui::CMessageBox::BUTTON_OK).DoModal(); + } + break; + */ default: break; Index: TestFrame2.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestFrame2.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TestFrame2.cpp 12 Dec 2004 09:08:19 -0000 1.9 --- TestFrame2.cpp 27 Dec 2004 04:59:36 -0000 1.10 *************** *** 36,40 **** wGui::CFrame(wGui::CRect(0, 0, 140, 80) + Location, pParent, pFontEngine, "Simple Frame", false) { ! m_pButton = new wGui::CButton(wGui::CRect(20, 20, 150, 40), this, "Test Button"); } --- 36,40 ---- wGui::CFrame(wGui::CRect(0, 0, 140, 80) + Location, pParent, pFontEngine, "Simple Frame", false) { ! m_pButton = new wGui::CButton(wGui::CRect(20, 20, 100, 40), this, "Test Button"); } Index: TestView2.h =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView2.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestView2.h 2 Apr 2004 17:26:16 -0000 1.4 --- TestView2.h 27 Dec 2004 04:59:36 -0000 1.5 *************** *** 40,43 **** --- 40,44 ---- protected: wGui::CButton* m_pCreateFrameButton; + wGui::CButton* m_pShowMessageBoxButton; wGui::CButton* m_pExitButton; }; Index: TestView2.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView2.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TestView2.cpp 23 Nov 2004 23:05:28 -0000 1.10 --- TestView2.cpp 27 Dec 2004 04:59:36 -0000 1.11 *************** *** 31,36 **** SetWindowText(std::string("Test App 2 - wGui version ") + wGui::CwgStringResourceHandle(wGui::WGRES_VERSION_STRING).String()); ! m_pCreateFrameButton = new wGui::CButton(ClientToView(wGui::CRect(20, 20, 140, 40)), this, "Create Frame"); ! m_pExitButton = new wGui::CButton(ClientToView(wGui::CRect(20, 50, 140, 70)), this, "Exit"); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_LCLICK); --- 31,37 ---- SetWindowText(std::string("Test App 2 - wGui version ") + wGui::CwgStringResourceHandle(wGui::WGRES_VERSION_STRING).String()); ! m_pCreateFrameButton = new wGui::CButton(ClientToView(wGui::CRect(20, 20, 160, 40)), this, "Create Frame"); ! m_pShowMessageBoxButton = new wGui::CButton(ClientToView(wGui::CRect(20, 50, 160, 70)), this, "Show Message Box"); ! m_pExitButton = new wGui::CButton(ClientToView(wGui::CRect(20, 80, 160, 100)), this, "Exit"); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_LCLICK); *************** *** 56,59 **** --- 57,67 ---- bHandled = true; } + else if (pMessage->Source() == m_pShowMessageBoxButton) + { + new wGui::CMessageBox(this, 0, "Test MessageBox", "This is a message box.", wGui::CMessageBox::BUTTON_OK); + new wGui::CMessageBox(this, 0, "Test MessageBox", "This is another message box.", wGui::CMessageBox::BUTTON_OK | wGui::CMessageBox::BUTTON_YES | wGui::CMessageBox::BUTTON_NO); + wGui::CMessageServer::Instance().QueueMessage(new wGui::CMessage(wGui::CMessage::APP_PAINT, 0, this)); + bHandled = true; + } else if (pMessage->Source() == m_pExitButton) { |