[Wgui-cvs] wgui/src wg_frame.cpp,1.27,1.28 wg_messagebox.cpp,1.5,1.6
Status: Beta
Brought to you by:
greenwire
|
From: Rob W. <gre...@us...> - 2005-01-05 21:09:43
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25490/src Modified Files: wg_frame.cpp wg_messagebox.cpp Log Message: Work on the message box. Index: wg_messagebox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_messagebox.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wg_messagebox.cpp 27 Dec 2004 22:59:35 -0000 1.5 --- wg_messagebox.cpp 5 Jan 2005 21:09:32 -0000 1.6 *************** *** 30,38 **** CMessageBox::CMessageBox(CView* pParent, CFontEngine* pFontEngine, const std::string& sTitle, const std::string& sMessage, int iButtons) : ! CFrame(CRect(0, 0, 300, 90), pParent, pFontEngine, sTitle), m_iButtons(iButtons) { m_pMessageLabel = new CLabel(CRect(10, 10, 290, 26), this, sMessage); - // m_bVisible = false; CPoint BottomRight(290, 60); if (iButtons & CMessageBox::BUTTON_CANCEL) --- 30,37 ---- CMessageBox::CMessageBox(CView* pParent, CFontEngine* pFontEngine, const std::string& sTitle, const std::string& sMessage, int iButtons) : ! CFrame(CRect(20, 20, 320, 110), pParent, pFontEngine, sTitle), m_iButtons(iButtons) { m_pMessageLabel = new CLabel(CRect(10, 10, 290, 26), this, sMessage); CPoint BottomRight(290, 60); if (iButtons & CMessageBox::BUTTON_CANCEL) *************** *** 58,67 **** } - /* - CMessageBox::EButton CMessageBox::DoModal(void) - { - SetVisible(true); - } - */ bool CMessageBox::HandleMessage(CMessage* pMessage) --- 57,60 ---- *************** *** 82,89 **** { CMessageServer::Instance().QueueMessage(new CValueMessage<CMessageBox::EButton>(CMessage::CTRL_MESSAGEBOXRETURN, m_pParentWindow, 0, iter->first)); ! SetNewParent(0); ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); ! delete this; bHandled = true; } } --- 75,81 ---- { CMessageServer::Instance().QueueMessage(new CValueMessage<CMessageBox::EButton>(CMessage::CTRL_MESSAGEBOXRETURN, m_pParentWindow, 0, iter->first)); ! CloseFrame(); bHandled = true; + break; } } Index: wg_frame.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_frame.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** wg_frame.cpp 27 Dec 2004 04:59:36 -0000 1.27 --- wg_frame.cpp 5 Jan 2005 21:09:32 -0000 1.28 *************** *** 70,73 **** --- 70,82 ---- + void CFrame::CloseFrame(void) + { + // suicide the frame by detaching it from it's parent, queing up an APP_PAINT message, then deleting itself + SetNewParent(0); + CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); + delete this; + } + + void CFrame::Draw(void) const // virtual { *************** *** 246,253 **** if (pMessage->Source() == m_pFrameCloseButton) { ! // suicide the frame by detaching it from it's parent, queing up an APP_PAINT message, then deleting itself ! SetNewParent(0); ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); ! delete this; bHandled = true; } --- 255,259 ---- if (pMessage->Source() == m_pFrameCloseButton) { ! CloseFrame(); bHandled = true; } |