Thread: [Wgui-cvs] wgui/tests TestFrame2.cpp,1.10,1.11 TestView1.cpp,1.80,1.81
Status: Beta
Brought to you by:
greenwire
|
From: Rob W. <gre...@us...> - 2005-09-22 20:51:57
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30653/tests Modified Files: TestFrame2.cpp TestView1.cpp Log Message: Added transparency effects to CFrame dragging Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** TestView1.cpp 7 Jan 2005 22:08:39 -0000 1.80 --- TestView1.cpp 22 Sep 2005 20:51:48 -0000 1.81 *************** *** 49,53 **** if (m_pSDLSurface) { ! wGui::CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), false, wGui::COLOR_WHITE); Painter.DrawRect(m_ClientRect, false, wGui::COLOR_RED); --- 49,53 ---- if (m_pSDLSurface) { ! wGui::CPainter Painter(m_pSDLSurface, wGui::CPainter::PAINT_REPLACE); Painter.DrawRect(m_WindowRect.SizeRect(), false, wGui::COLOR_WHITE); Painter.DrawRect(m_ClientRect, false, wGui::COLOR_RED); *************** *** 71,81 **** wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_RESIZE); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_TIMER); m_pTimer = new wGui::CTimer(this); 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)); --- 71,82 ---- wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_RESIZE); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_TIMER); + wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_MESSAGEBOXRETURN); m_pTimer = new wGui::CTimer(this); AttachMenu(new wGui::CMenu(wGui::CRect(0, 0, 80, 22), this)); ! wGui::CPopupMenu* pContextSubmenu = new wGui::CPopupMenu(wGui::CRect(0, 0, 180, 50), this); ! pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Show Message Box", SHOW_MESSAGE_BOX_1)); ! pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Show A Different Message Box", SHOW_MESSAGE_BOX_2)); pContextSubmenu->InsertMenuItem(wGui::SMenuItem()); // instert a spacer pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Exit", EXIT_APP)); *************** *** 166,171 **** // So it's being commented out for the purposes of getting 0.4.0 released // There's probably something wrong with the CMenu class, but I haven't figured it out yet ! /* ! pContextSubmenu = new wGui::CPopupMenu(wGui::CRect(0, 0, 80, 50), m_pContextMenu); pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Clear", CLEAR_EDIT_BOX_1)); pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Fill", FILL_EDIT_BOX_1)); --- 167,171 ---- // So it's being commented out for the purposes of getting 0.4.0 released // There's probably something wrong with the CMenu class, but I haven't figured it out yet ! /* pContextSubmenu = new wGui::CPopupMenu(wGui::CRect(0, 0, 80, 50), m_pContextMenu); pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Clear", CLEAR_EDIT_BOX_1)); pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Fill", FILL_EDIT_BOX_1)); *************** *** 183,188 **** wGui::CPopupMenu* pContextSubmenu4 = new wGui::CPopupMenu(wGui::CRect(0, 0, 140, 50), pContextSubmenu3); pContextSubmenu3->InsertMenuItem(wGui::SMenuItem("Empty submenu 3", 0, pContextSubmenu4)); ! */ ! m_pDropDown = new wGui::CDropDown(wGui::CRect(10, 55, 205, 73), m_pGroupBox); m_pDropDown->AddItem(wGui::SListItem("Item1")); --- 183,187 ---- wGui::CPopupMenu* pContextSubmenu4 = new wGui::CPopupMenu(wGui::CRect(0, 0, 140, 50), pContextSubmenu3); pContextSubmenu3->InsertMenuItem(wGui::SMenuItem("Empty submenu 3", 0, pContextSubmenu4)); ! */ m_pDropDown = new wGui::CDropDown(wGui::CRect(10, 55, 205, 73), m_pGroupBox); m_pDropDown->AddItem(wGui::SListItem("Item1")); *************** *** 332,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; --- 331,340 ---- m_pBtnPictureButton->SetPicture(wGui::CwgBitmapResourceHandle(m_eCurrentPicture)); break; case SHOW_MESSAGE_BOX_1: ! new wGui::CMessageBox(this, 0, "Message Box 1", "This is a test of the message box."); ! break; case SHOW_MESSAGE_BOX_2: ! new wGui::CMessageBox(this, 0, "Message Box 2", "Show another message box?", wGui::CMessageBox::BUTTON_YES | wGui::CMessageBox::BUTTON_NO); ! break; default: break; *************** *** 404,407 **** --- 398,402 ---- break; case wGui::WGRES_LEFT_ARROW_BITMAP: + // this is an intentional fall-through case default: m_eCurrentPicture = wGui::WGRES_UP_ARROW_BITMAP; *************** *** 414,417 **** --- 409,424 ---- break; } + case wGui::CMessage::CTRL_MESSAGEBOXRETURN: + { + if (dynamic_cast<wGui::CValueMessage<wGui::CMessageBox::EButton>* >(pMessage)) + { + if (dynamic_cast<wGui::CValueMessage<wGui::CMessageBox::EButton>* >(pMessage)->Value() == wGui::CMessageBox::BUTTON_YES) + { + new wGui::CMessageBox(this, 0, "Another Message Box", "Here's your other message box."); + } + bHandled = true; + } + break; + } default: bHandled = CView::HandleMessage(pMessage); Index: TestFrame2.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestFrame2.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** TestFrame2.cpp 27 Dec 2004 04:59:36 -0000 1.10 --- TestFrame2.cpp 22 Sep 2005 20:51:48 -0000 1.11 *************** *** 53,57 **** if (m_pSDLSurface) { ! wGui::CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect, false, wGui::COLOR_WHITE); Painter.DrawRect(m_ClientRect, false, wGui::COLOR_RED); --- 53,57 ---- if (m_pSDLSurface) { ! wGui::CPainter Painter(m_pSDLSurface, wGui::CPainter::PAINT_REPLACE); Painter.DrawRect(m_WindowRect, false, wGui::COLOR_WHITE); Painter.DrawRect(m_ClientRect, false, wGui::COLOR_RED); |