wgui-cvs Mailing List for wGui (Page 2)
Status: Beta
Brought to you by:
greenwire
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(47) |
May
(7) |
Jun
(29) |
Jul
(41) |
Aug
(5) |
Sep
(4) |
Oct
|
Nov
(5) |
Dec
(15) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(14) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(16) |
Oct
(1) |
Nov
|
Dec
(5) |
2006 |
Jan
(5) |
Feb
(10) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
From: Rob W. <gre...@us...> - 2005-09-27 19:00:12
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21751 Modified Files: CHANGES Log Message: Added CFileDialog files, CFrame modal mode, cleaned up some code, and fixed some minor issues. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.158 retrieving revision 1.159 diff -C2 -d -r1.158 -r1.159 *** CHANGES 26 Sep 2005 18:37:48 -0000 1.158 --- CHANGES 27 Sep 2005 19:00:01 -0000 1.159 *************** *** 5,9 **** --- 5,11 ---- + Added CMessageBox class which derives from CFrame to make a simple message box + Added CFrame::CloseFrame() which closes the frame and causes it to delete itself + + Added CFrame modal mode, which when set to true causes all input to go to that window and be ignored by everything else + Added CMessage: EMessageType::APP_DESTROY_FRAME which allows the app to call delete on a frame rather than the frame calling delete on itself + + Changed CFrame: When dragging frames, they now turn partially transparent + Changed CMessage: Renamed a few message types (CTRL_LCLICK to CTRL_SINGLELCLICK, CTRL_MCLICK to CTRL_SINGLEMCLICK, and CTRL_RCLICK to CTRL_SINGLERCLICK) and re-ordered them in the enum |
From: Rob W. <gre...@us...> - 2005-09-27 19:00:10
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21751/src Modified Files: wg_frame.cpp wg_menu.cpp wg_message_server.cpp wg_view.cpp Added Files: wg_filedialog.cpp Log Message: Added CFileDialog files, CFrame modal mode, cleaned up some code, and fixed some minor issues. Index: wg_view.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_view.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** wg_view.cpp 22 Sep 2005 20:51:48 -0000 1.44 --- wg_view.cpp 27 Sep 2005 19:00:01 -0000 1.45 *************** *** 200,204 **** if (!m_pFloatingWindow || !m_pFloatingWindow->OnMouseButtonDown(pMouseMessage->Point, pMouseMessage->Button)) { ! OnMouseButtonDown(pMouseMessage->Point, pMouseMessage->Button); } } --- 200,212 ---- if (!m_pFloatingWindow || !m_pFloatingWindow->OnMouseButtonDown(pMouseMessage->Point, pMouseMessage->Button)) { ! if (pMouseMessage->Destination() == 0) ! { ! OnMouseButtonDown(pMouseMessage->Point, pMouseMessage->Button); ! } ! else if (dynamic_cast<const CWindow*>(pMouseMessage->Destination())) ! { ! const_cast<CWindow*>(static_cast<const CWindow*>(pMouseMessage->Destination()))-> ! OnMouseButtonDown(pMouseMessage->Point, pMouseMessage->Button); ! } } } *************** *** 212,216 **** if (!m_pFloatingWindow || !m_pFloatingWindow->OnMouseButtonUp(pMouseMessage->Point, pMouseMessage->Button)) { ! OnMouseButtonUp(pMouseMessage->Point, pMouseMessage->Button); } } --- 220,232 ---- if (!m_pFloatingWindow || !m_pFloatingWindow->OnMouseButtonUp(pMouseMessage->Point, pMouseMessage->Button)) { ! if (pMouseMessage->Destination() == 0) ! { ! OnMouseButtonUp(pMouseMessage->Point, pMouseMessage->Button); ! } ! else if (dynamic_cast<const CWindow*>(pMouseMessage->Destination())) ! { ! const_cast<CWindow*>(static_cast<const CWindow*>(pMouseMessage->Destination()))-> ! OnMouseButtonUp(pMouseMessage->Point, pMouseMessage->Button); ! } } } Index: wg_message_server.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_message_server.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** wg_message_server.cpp 7 Jan 2005 22:08:38 -0000 1.30 --- wg_message_server.cpp 27 Sep 2005 19:00:01 -0000 1.31 *************** *** 77,81 **** else { ! m_MessageClients[eMessageType].insert(std::make_pair(Priority, std::make_pair(pClient, false))); } } --- 77,81 ---- else { ! m_MessageClients[eMessageType].insert(std::make_pair(Priority, s_MessageClientActive(pClient, false))); } } *************** *** 88,92 **** while (iter != PriorityMap.end()) { ! if (iter->second.first == pClient) { PriorityMap.erase(iter); --- 88,92 ---- while (iter != PriorityMap.end()) { ! if (iter->second.pClient == pClient) { PriorityMap.erase(iter); *************** *** 108,112 **** while (iter2 != iter->second.end()) { ! if (iter2->second.first == pClient) { iter->second.erase(iter2); --- 108,112 ---- while (iter2 != iter->second.end()) { ! if (iter2->second.pClient == pClient) { iter->second.erase(iter2); *************** *** 129,135 **** t_MessageClientPriorityMap& PriorityMap = m_MessageClients[pMessage->MessageType()]; for (t_MessageClientPriorityMap::iterator iter = PriorityMap.begin(); iter != PriorityMap.end(); ++iter) { ! iter->second.second = true; } --- 129,137 ---- t_MessageClientPriorityMap& PriorityMap = m_MessageClients[pMessage->MessageType()]; + // we have to make sure that each client only gets the message once, + // even if the handling of one of these messages changes the message map for (t_MessageClientPriorityMap::iterator iter = PriorityMap.begin(); iter != PriorityMap.end(); ++iter) { ! iter->second.bWaitingForMessage = true; } *************** *** 140,147 **** for (; iter != PriorityMap.end(); ++iter) { ! if (iter->second.second) { ! iter->second.second = false; ! bFinished = iter->second.first->HandleMessage(pMessage); break; } --- 142,149 ---- for (; iter != PriorityMap.end(); ++iter) { ! if (iter->second.bWaitingForMessage) { ! iter->second.bWaitingForMessage = false; ! bFinished = iter->second.pClient->HandleMessage(pMessage); break; } Index: wg_frame.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_frame.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** wg_frame.cpp 26 Sep 2005 18:37:48 -0000 1.31 --- wg_frame.cpp 27 Sep 2005 19:00:01 -0000 1.32 *************** *** 36,42 **** m_iTitleBarHeight(16), m_bResizable(bResizable), m_pMenu(0), m_bDragMode(false) - // m_pSavedSurface(0) { if (pFontEngine) --- 36,42 ---- m_iTitleBarHeight(16), m_bResizable(bResizable), + m_bModal(false), m_pMenu(0), m_bDragMode(false) { if (pFontEngine) *************** *** 64,70 **** ! CFrame::~CFrame(void) // virtual { ! // SDL_FreeSurface(m_pSavedSurface); } --- 64,73 ---- ! CFrame::~CFrame(void) // virtual { ! if (m_bModal) ! { ! SetModal(false); ! } } *************** *** 76,79 **** --- 79,99 ---- + void CFrame::SetModal(bool bModal) + { + m_bModal = bModal; + + if (m_bModal) + { + CApplication::Instance()->SetMouseFocus(this); + CApplication::Instance()->SetKeyFocus(this); + } + else + { + CApplication::Instance()->SetMouseFocus(0); + CApplication::Instance()->SetKeyFocus(0); + } + } + + void CFrame::Draw(void) const // virtual { Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** wg_menu.cpp 26 Sep 2005 21:09:25 -0000 1.59 --- wg_menu.cpp 27 Sep 2005 19:00:01 -0000 1.60 *************** *** 76,80 **** { m_MenuItems.insert((iPosition == -1) ? m_MenuItems.end() : m_MenuItems.begin() + iPosition, ! std::make_pair(MenuItem, std::make_pair(CRenderedString(m_pFontEngine, MenuItem.sItemText, CRenderedString::VALIGN_TOP), CRect()))); m_bCachedRectsValid = false; // Draw(); --- 76,80 ---- { m_MenuItems.insert((iPosition == -1) ? m_MenuItems.end() : m_MenuItems.begin() + iPosition, ! s_MenuItemInfo(MenuItem, CRenderedString(m_pFontEngine, MenuItem.sItemText, CRenderedString::VALIGN_TOP), CRect())); m_bCachedRectsValid = false; // Draw(); *************** *** 141,147 **** for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->second.second.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !iter->first.bSpacer) { ! m_pHighlightedItem = &(iter->first); break; } --- 141,147 ---- for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->Rect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !iter->MenuItem.bSpacer) { ! m_pHighlightedItem = &(iter->MenuItem); break; } *************** *** 172,176 **** for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (pCtrlMessage->Source() == iter->first.pPopup) { CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, m_pParentWindow, --- 172,176 ---- for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (pCtrlMessage->Source() == iter->MenuItem.pPopup) { CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, m_pParentWindow, *************** *** 220,224 **** { m_MenuItems.insert((iPosition == -1) ? m_MenuItems.end() : m_MenuItems.begin() + iPosition, ! std::make_pair(MenuItem, std::make_pair(CRenderedString(m_pFontEngine, MenuItem.sItemText, CRenderedString::VALIGN_NORMAL), CRect()))); m_bCachedRectsValid = false; if (MenuItem.pPopup) --- 220,224 ---- { m_MenuItems.insert((iPosition == -1) ? m_MenuItems.end() : m_MenuItems.begin() + iPosition, ! s_MenuItemInfo(MenuItem, CRenderedString(m_pFontEngine, MenuItem.sItemText, CRenderedString::VALIGN_NORMAL), CRect())); m_bCachedRectsValid = false; if (MenuItem.pPopup) *************** *** 240,250 **** for (t_MenuItemVector::const_iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (m_pHighlightedItem == &(iter->first)) { ! Painter.DrawRect(iter->second.second, true, m_HighlightColor, m_HighlightColor); } ! CRect TextRect(iter->second.second); TextRect.Grow(-2); ! if (iter->first.bSpacer) { Painter.DrawVLine(TextRect.Top(), TextRect.Bottom(), TextRect.Left(), COLOR_LIGHTGRAY); --- 240,250 ---- for (t_MenuItemVector::const_iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (m_pHighlightedItem == &(iter->MenuItem)) { ! Painter.DrawRect(iter->Rect, true, m_HighlightColor, m_HighlightColor); } ! CRect TextRect(iter->Rect); TextRect.Grow(-2); ! if (iter->MenuItem.bSpacer) { Painter.DrawVLine(TextRect.Top(), TextRect.Bottom(), TextRect.Left(), COLOR_LIGHTGRAY); *************** *** 252,256 **** } else ! iter->second.first.Draw(m_pSDLSurface, TextRect, CPoint(TextRect.Left(), (TextRect.Top() + TextRect.Bottom()) * 3 / 4)); } } --- 252,256 ---- } else ! iter->RenderedString.Draw(m_pSDLSurface, TextRect, CPoint(TextRect.Left(), (TextRect.Top() + TextRect.Bottom()) * 3 / 4)); } } *************** *** 268,286 **** for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->second.second.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE && !iter->first.bSpacer) { HideActivePopup(); ! if (iter->first.pPopup) { ! CPopupMenu* pPopup = dynamic_cast<CPopupMenu*>(iter->first.pPopup); if (pPopup) { m_pActivePopup = pPopup; ! ShowActivePopup(iter->second.second, GetAncestor(ROOT)->GetClientRect()); } } else { ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, m_pParentWindow, this, iter->first.iItemId)); } break; --- 268,286 ---- for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->Rect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE && !iter->MenuItem.bSpacer) { HideActivePopup(); ! if (iter->MenuItem.pPopup) { ! CPopupMenu* pPopup = dynamic_cast<CPopupMenu*>(iter->MenuItem.pPopup); if (pPopup) { m_pActivePopup = pPopup; ! ShowActivePopup(iter->Rect, GetAncestor(ROOT)->GetClientRect()); } } else { ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, m_pParentWindow, this, iter->MenuItem.iItemId)); } break; *************** *** 314,320 **** for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->second.second.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !iter->first.bSpacer) { ! m_pHighlightedItem = &(iter->first); break; } --- 314,320 ---- for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->Rect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !iter->MenuItem.bSpacer) { ! m_pHighlightedItem = &(iter->MenuItem); break; } *************** *** 351,359 **** for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->first.bSpacer) { CRect TextRect(SubRect.Left() + iWidth, SubRect.Top() + 2, SubRect.Left() + iWidth + 1, SubRect.Bottom() - 2); TextRect.Grow(2); ! iter->second.second = TextRect; iWidth += 9; } --- 351,359 ---- for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->MenuItem.bSpacer) { CRect TextRect(SubRect.Left() + iWidth, SubRect.Top() + 2, SubRect.Left() + iWidth + 1, SubRect.Bottom() - 2); TextRect.Grow(2); ! iter->Rect = TextRect; iWidth += 9; } *************** *** 361,368 **** { CPoint Dims; ! iter->second.first.GetMetrics(&Dims, 0, 0); CRect TextRect(SubRect.Left() + iWidth, SubRect.Top() + 2, SubRect.Left() + iWidth + Dims.XPos(), SubRect.Bottom() - 2); TextRect.Grow(2); ! iter->second.second = TextRect; iWidth += Dims.XPos() + 8; } --- 361,368 ---- { CPoint Dims; ! iter->RenderedString.GetMetrics(&Dims, 0, 0); CRect TextRect(SubRect.Left() + iWidth, SubRect.Top() + 2, SubRect.Left() + iWidth + Dims.XPos(), SubRect.Bottom() - 2); TextRect.Grow(2); ! iter->Rect = TextRect; iWidth += Dims.XPos() + 8; } *************** *** 426,435 **** for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->first.bSpacer) iHeight += 6; else { CPoint Dims; ! iter->second.first.GetMetrics(&Dims, 0, 0); iHeight += Dims.YPos() + 5; } --- 426,435 ---- for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->MenuItem.bSpacer) iHeight += 6; else { CPoint Dims; ! iter->RenderedString.GetMetrics(&Dims, 0, 0); iHeight += Dims.YPos() + 5; } *************** *** 535,545 **** for (t_MenuItemVector::const_iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (m_pHighlightedItem == &(iter->first)) { ! Painter.DrawRect(iter->second.second, true, m_HighlightColor, m_HighlightColor); } ! CRect TextRect(iter->second.second); TextRect.Grow(-2); ! if (iter->first.bSpacer) { Painter.DrawHLine(TextRect.Left(), TextRect.Right(), TextRect.Top(), COLOR_LIGHTGRAY); --- 535,545 ---- for (t_MenuItemVector::const_iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (m_pHighlightedItem == &(iter->MenuItem)) { ! Painter.DrawRect(iter->Rect, true, m_HighlightColor, m_HighlightColor); } ! CRect TextRect(iter->Rect); TextRect.Grow(-2); ! if (iter->MenuItem.bSpacer) { Painter.DrawHLine(TextRect.Left(), TextRect.Right(), TextRect.Top(), COLOR_LIGHTGRAY); *************** *** 547,554 **** } else ! iter->second.first.Draw(m_pSDLSurface, TextRect, TextRect.TopLeft()); ! if (iter->first.pPopup) { ! CRect ArrowRect(iter->second.second); ArrowRect.SetLeft(ArrowRect.Right() - m_hRightArrowBitmap.Bitmap()->w); SDL_Rect SourceRect; --- 547,554 ---- } else ! iter->RenderedString.Draw(m_pSDLSurface, TextRect, TextRect.TopLeft()); ! if (iter->MenuItem.pPopup) { ! CRect ArrowRect(iter->Rect); ArrowRect.SetLeft(ArrowRect.Right() - m_hRightArrowBitmap.Bitmap()->w); SDL_Rect SourceRect; *************** *** 597,603 **** for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->second.second.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !iter->first.bSpacer) { ! if (!iter->first.pPopup) { CMessageClient* pDestination = m_pParentWindow; --- 597,603 ---- for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->Rect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !iter->MenuItem.bSpacer) { ! if (!iter->MenuItem.pPopup) { CMessageClient* pDestination = m_pParentWindow; *************** *** 606,610 **** pDestination = m_pParentMenu; } ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, pDestination, this, iter->first.iItemId)); HideAll(); } --- 606,610 ---- pDestination = m_pParentMenu; } ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, pDestination, this, iter->MenuItem.iItemId)); HideAll(); } *************** *** 612,617 **** { HideActivePopup(); ! m_pActivePopup = iter->first.pPopup; ! ShowActivePopup(iter->second.second, GetAncestor(ROOT)->GetClientRect()); } break; --- 612,617 ---- { HideActivePopup(); ! m_pActivePopup = iter->MenuItem.pPopup; ! ShowActivePopup(iter->Rect, GetAncestor(ROOT)->GetClientRect()); } break; *************** *** 658,664 **** for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (m_pHighlightedItem == &(iter->first)) { ! ItemRect = iter->second.second; break; } --- 658,664 ---- for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (m_pHighlightedItem == &(iter->MenuItem)) { ! ItemRect = iter->Rect; break; } *************** *** 693,701 **** for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->first.bSpacer) { CRect TextRect(SubRect.Left() + 3, SubRect.Top() + iHeight, SubRect.Right() - 3, SubRect.Top() + iHeight + 1); TextRect.Grow(2); ! iter->second.second = TextRect; iHeight += 6; } --- 693,701 ---- for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->MenuItem.bSpacer) { CRect TextRect(SubRect.Left() + 3, SubRect.Top() + iHeight, SubRect.Right() - 3, SubRect.Top() + iHeight + 1); TextRect.Grow(2); ! iter->Rect = TextRect; iHeight += 6; } *************** *** 703,710 **** { CPoint Dims; ! iter->second.first.GetMetrics(&Dims, 0, 0); CRect TextRect(SubRect.Left() + 3, SubRect.Top() + iHeight, SubRect.Right() - 3, SubRect.Top() + iHeight + Dims.YPos()); TextRect.Grow(2); ! iter->second.second = TextRect; iHeight += Dims.YPos() + 5; } --- 703,710 ---- { CPoint Dims; ! iter->RenderedString.GetMetrics(&Dims, 0, 0); CRect TextRect(SubRect.Left() + 3, SubRect.Top() + iHeight, SubRect.Right() - 3, SubRect.Top() + iHeight + Dims.YPos()); TextRect.Grow(2); ! iter->Rect = TextRect; iHeight += Dims.YPos() + 5; } --- NEW FILE: wg_filedialog.cpp --- // wg_filedialog.cpp // // CFileDialog class implementation // // // Copyright (c) 2002-2004 Rob Wiskow // ro...@bo... // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // #include "wgui_include_config.h" #include "wg_filedialog.h" namespace wGui { } |
From: Rob W. <gre...@us...> - 2005-09-27 19:00:10
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21751/tests Modified Files: TestView1.cpp Log Message: Added CFileDialog files, CFrame modal mode, cleaned up some code, and fixed some minor issues. Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** TestView1.cpp 26 Sep 2005 21:09:25 -0000 1.83 --- TestView1.cpp 27 Sep 2005 19:00:01 -0000 1.84 *************** *** 34,37 **** --- 34,38 ---- const long int SHOW_MESSAGE_BOX_1 = 16; const long int SHOW_MESSAGE_BOX_2 = 17; + const long int SHOW_MESSAGE_BOX_3 = 18; CTestWindow::CTestWindow(const wGui::CRect& WindowRect, wGui::CWindow* pParent) : *************** *** 79,82 **** --- 80,84 ---- pSubmenu->InsertMenuItem(wGui::SMenuItem("Show Message Box", SHOW_MESSAGE_BOX_1)); pSubmenu->InsertMenuItem(wGui::SMenuItem("Show A Different Message Box", SHOW_MESSAGE_BOX_2)); + pSubmenu->InsertMenuItem(wGui::SMenuItem("Show A Modal Message Box", SHOW_MESSAGE_BOX_3)); pSubmenu->InsertMenuItem(wGui::SMenuItem()); // instert a spacer pSubmenu->InsertMenuItem(wGui::SMenuItem("Exit", EXIT_APP)); *************** *** 337,340 **** --- 339,348 ---- new wGui::CMessageBox(this, 0, "Message Box 2", "Show another message box?", wGui::CMessageBox::BUTTON_YES | wGui::CMessageBox::BUTTON_NO); break; + case SHOW_MESSAGE_BOX_3: + { + wGui::CMessageBox* pMessageBox = new wGui::CMessageBox(this, 0, "Modal Message Box", "This message box is modal."); + pMessageBox->SetModal(true); + break; + } default: break; |
From: Rob W. <gre...@us...> - 2005-09-27 19:00:10
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21751/includes Modified Files: wg_application.h wg_frame.h wg_menu.h wg_message_server.h Added Files: wg_filedialog.h Log Message: Added CFileDialog files, CFrame modal mode, cleaned up some code, and fixed some minor issues. --- NEW FILE: wg_filedialog.h --- // wg_filedialog.h // // CFileDialog interface // // // Copyright (c) 2002-2004 Rob Wiskow // ro...@bo... // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // #ifndef _WG_FILEDIALOG_H_ #define _WG_FILEDIALOG_H_ #include "wg_frame.cpp" namespace wGui { //! A standard file selection dialog class CFrameDialog : public CFrame { public: protected: private: void operator=(CFileDialog) { } //!< The assignment operator is not allowed for CWindow derived objects }; } #endif // _WG_FILEDIALOG_H_ Index: wg_application.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_application.h,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** wg_application.h 22 Sep 2005 20:51:48 -0000 1.38 --- wg_application.h 27 Sep 2005 19:00:01 -0000 1.39 *************** *** 112,116 **** virtual CWindow* GetKeyFocus(void) const { return m_pKeyFocusWindow; } - //! This is for setting/getting the window that has the current mouse focus //! Any subsequent MOUSE messages will have this window as their destination --- 112,115 ---- *************** *** 122,127 **** virtual CWindow* GetMouseFocus(void) const { return m_pMouseFocusWindow; } - - //! Init() must be called before Exec() //! Takes care of initializing SDL and other important stuff --- 121,124 ---- Index: wg_frame.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_frame.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wg_frame.h 22 Sep 2005 20:51:48 -0000 1.20 --- wg_frame.h 27 Sep 2005 19:00:01 -0000 1.21 *************** *** 67,71 **** //! Indicates if the frame is resizable (set in the object constructor) //! \return true if the frame is resizable ! bool IsResizable(void) { return m_bResizable; } //! Attaches a standard menu to the frame, if the frame already has a menu, the old menu will be deleted --- 67,71 ---- //! Indicates if the frame is resizable (set in the object constructor) //! \return true if the frame is resizable ! bool IsResizable(void) const { return m_bResizable; } //! Attaches a standard menu to the frame, if the frame already has a menu, the old menu will be deleted *************** *** 75,83 **** //! Gets the menu for a frame //! \return A pointer to the frame's menu, 0 if the view doesn't have a menu ! CMenu* GetMenu(void) { return m_pMenu; } //! Closes the frame and causes it to delete itself void CloseFrame(void); // CWindow overrides --- 75,91 ---- //! Gets the menu for a frame //! \return A pointer to the frame's menu, 0 if the view doesn't have a menu ! CMenu* GetMenu(void) const { return m_pMenu; } //! Closes the frame and causes it to delete itself void CloseFrame(void); + //! Indicates if the frame is modal (doesn't allow input to any other windows) + //! \return true if the frame is modal + bool IsModal(void) const { return m_bModal; } + + //! Sets the frame's modal state + //! param bModal the modal state to set (CFrames are non-modal by default) + void SetModal(bool bModal); + // CWindow overrides *************** *** 120,125 **** CFontEngine* m_pFontEngine; //!< A pointer to the font engine to use to render the text std::auto_ptr<CRenderedString> m_pRenderedString; //!< An autopointer to the rendered version of the string ! bool m_bResizable; //!< Indicates if the view is resizable ! CMenu* m_pMenu; //!< A pointer to the view's menu private: --- 128,134 ---- CFontEngine* m_pFontEngine; //!< A pointer to the font engine to use to render the text std::auto_ptr<CRenderedString> m_pRenderedString; //!< An autopointer to the rendered version of the string ! bool m_bResizable; //!< Indicates if the frame is resizable ! bool m_bModal; //!< Indicates if the frame is modal ! CMenu* m_pMenu; //!< A pointer to the frame's menu private: *************** *** 127,133 **** bool m_bDragMode; //!< Indicates if the window is currently being dragged CPoint m_DragPointerStart; //!< The location of the cursor when the drag was started ! // SDL_Surface* m_pSavedSurface; //!< A pointer to a bitmap of what lies underneath the dragged frame ! // CRect m_SavedSurfaceRect; //!< A rect for the saved surface ! CRect m_FrameGhostRect; void operator=(CFrame) { } //!< The assignment operator is not allowed for CWindow derived objects }; --- 136,140 ---- bool m_bDragMode; //!< Indicates if the window is currently being dragged CPoint m_DragPointerStart; //!< The location of the cursor when the drag was started ! CRect m_FrameGhostRect; //!< The rect of the frame while being dragged in a semi-transparent state void operator=(CFrame) { } //!< The assignment operator is not allowed for CWindow derived objects }; Index: wg_message_server.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_message_server.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wg_message_server.h 3 Jun 2004 19:10:52 -0000 1.23 --- wg_message_server.h 27 Sep 2005 19:00:01 -0000 1.24 *************** *** 40,48 **** class CMessageClient; ! //! A pair that associates message client pointers with a priority ! typedef std::pair<CMessageClient*, bool> t_MessageClientActivePair; //! Multimap of message clients ordered by priority ! typedef std::multimap<unsigned char, t_MessageClientActivePair, std::greater<unsigned char> > t_MessageClientPriorityMap; //! Map of different message types --- 40,56 ---- class CMessageClient; ! //! A struct that associates message client pointers with a flag that indicates if the client has recieved a particular message ! struct s_MessageClientActive ! { ! s_MessageClientActive(CMessageClient* pC, bool bW) : ! pClient(pC), bWaitingForMessage(bW) ! { } ! ! CMessageClient* pClient; ! bool bWaitingForMessage; ! }; //! Multimap of message clients ordered by priority ! typedef std::multimap<unsigned char, s_MessageClientActive, std::greater<unsigned char> > t_MessageClientPriorityMap; //! Map of different message types Index: wg_menu.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_menu.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** wg_menu.h 7 Jan 2005 22:08:38 -0000 1.36 --- wg_menu.h 27 Sep 2005 19:00:01 -0000 1.37 *************** *** 131,135 **** CFontEngine* m_pFontEngine; //!< A pointer to the font engine to use to render the text ! typedef std::vector<std::pair<SMenuItem, std::pair<CRenderedString, CRect> > > t_MenuItemVector; //!< The type for menu items mutable t_MenuItemVector m_MenuItems; //!< The vector of menu items SMenuItem* m_pHighlightedItem; //!< The item that should be highlighted --- 131,146 ---- CFontEngine* m_pFontEngine; //!< A pointer to the font engine to use to render the text ! //! A struct containing the menu item with some cached data ! struct s_MenuItemInfo ! { ! s_MenuItemInfo(const SMenuItem& MI, const CRenderedString& RS, const CRect& R) ! : MenuItem(MI), RenderedString(RS), Rect(R) ! { } ! ! SMenuItem MenuItem; //!< The actual menu item ! CRenderedString RenderedString; //!< A cached rendered string for the text of the menu item ! CRect Rect; //!< The bounds rect for the menu item ! }; ! typedef std::vector<s_MenuItemInfo> t_MenuItemVector; //!< The type for menu items mutable t_MenuItemVector m_MenuItems; //!< The vector of menu items SMenuItem* m_pHighlightedItem; //!< The item that should be highlighted |
From: Rob W. <gre...@us...> - 2005-09-26 21:10:00
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26081/src Modified Files: wg_menu.cpp Log Message: Working on the CMenu bug Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** wg_menu.cpp 26 Sep 2005 18:37:48 -0000 1.58 --- wg_menu.cpp 26 Sep 2005 21:09:25 -0000 1.59 *************** *** 78,82 **** std::make_pair(MenuItem, std::make_pair(CRenderedString(m_pFontEngine, MenuItem.sItemText, CRenderedString::VALIGN_TOP), CRect()))); m_bCachedRectsValid = false; ! Draw(); } --- 78,82 ---- std::make_pair(MenuItem, std::make_pair(CRenderedString(m_pFontEngine, MenuItem.sItemText, CRenderedString::VALIGN_TOP), CRect()))); m_bCachedRectsValid = false; ! // Draw(); } |
From: Rob W. <gre...@us...> - 2005-09-26 21:10:00
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26081/tests Modified Files: TestView1.cpp Log Message: Working on the CMenu bug Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** TestView1.cpp 26 Sep 2005 18:37:48 -0000 1.82 --- TestView1.cpp 26 Sep 2005 21:09:25 -0000 1.83 *************** *** 76,90 **** 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)); ! GetMenu()->InsertMenuItem(wGui::SMenuItem("File", 0, pContextSubmenu)); ! pContextSubmenu = new wGui::CPopupMenu(wGui::CRect(0, 0, 70, 50), this); ! GetMenu()->InsertMenuItem(wGui::SMenuItem("Edit", 0, pContextSubmenu)); GetMenu()->InsertMenuItem(wGui::SMenuItem()); ! pContextSubmenu = new wGui::CPopupMenu(wGui::CRect(0, 0, 70, 50), this); ! GetMenu()->InsertMenuItem(wGui::SMenuItem("Help", 0, pContextSubmenu)); m_pButton = new wGui::CButton(wGui::CRect(20, 40, 100, 60), this, "Test Button"); --- 76,90 ---- AttachMenu(new wGui::CMenu(wGui::CRect(0, 0, 80, 22), this)); ! wGui::CPopupMenu* pSubmenu = new wGui::CPopupMenu(wGui::CRect(0, 0, 180, 50), this); ! pSubmenu->InsertMenuItem(wGui::SMenuItem("Show Message Box", SHOW_MESSAGE_BOX_1)); ! pSubmenu->InsertMenuItem(wGui::SMenuItem("Show A Different Message Box", SHOW_MESSAGE_BOX_2)); ! pSubmenu->InsertMenuItem(wGui::SMenuItem()); // instert a spacer ! pSubmenu->InsertMenuItem(wGui::SMenuItem("Exit", EXIT_APP)); ! GetMenu()->InsertMenuItem(wGui::SMenuItem("File", 0, pSubmenu)); ! pSubmenu = new wGui::CPopupMenu(wGui::CRect(0, 0, 70, 50), this); ! GetMenu()->InsertMenuItem(wGui::SMenuItem("Edit", 0, pSubmenu)); GetMenu()->InsertMenuItem(wGui::SMenuItem()); ! pSubmenu = new wGui::CPopupMenu(wGui::CRect(0, 0, 70, 50), this); ! GetMenu()->InsertMenuItem(wGui::SMenuItem("Help", 0, pSubmenu)); m_pButton = new wGui::CButton(wGui::CRect(20, 40, 100, 60), this, "Test Button"); *************** *** 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)); --- 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 ! wGui::CPopupMenu* 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,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")); --- 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")); |
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19172/src Modified Files: wg_button.cpp wg_checkbox.cpp wg_editbox.cpp wg_frame.cpp wg_listbox.cpp wg_menu.cpp wg_scrollbar.cpp wg_textbox.cpp Log Message: Fixed OnMouseButtonDown and OnMouseButtonUp Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** wg_editbox.cpp 22 Sep 2005 20:51:48 -0000 1.97 --- wg_editbox.cpp 26 Sep 2005 18:37:48 -0000 1.98 *************** *** 300,307 **** bool CEditBox::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = false; CPoint WindowPoint(ViewToWindow(Point)); ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && !m_bReadOnly && (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { --- 300,307 ---- bool CEditBox::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = CWindow::OnMouseButtonDown(Point, Button); CPoint WindowPoint(ViewToWindow(Point)); ! if (!bResult && m_bVisible && (Button == CMouseMessage::LEFT) && !m_bReadOnly && (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { Index: wg_checkbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_checkbox.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** wg_checkbox.cpp 22 Sep 2005 20:51:48 -0000 1.26 --- wg_checkbox.cpp 26 Sep 2005 18:37:48 -0000 1.27 *************** *** 87,93 **** bool CCheckBox::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { --- 87,93 ---- bool CCheckBox::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = CWindow::OnMouseButtonDown(Point, Button); ! if (!bResult && m_bVisible && (m_eCheckBoxState != DISABLED) && (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { *************** *** 102,108 **** bool CCheckBox::OnMouseButtonUp(CPoint Point, unsigned int Button) { ! bool bResult = false; ! if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && (m_MouseButton == Button) && (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { --- 102,108 ---- bool CCheckBox::OnMouseButtonUp(CPoint Point, unsigned int Button) { ! bool bResult = CWindow::OnMouseButtonUp(Point, Button); ! if (!bResult && m_bVisible && (m_eCheckBoxState != DISABLED) && (m_MouseButton == Button) && (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { Index: wg_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_button.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** wg_button.cpp 22 Sep 2005 20:51:48 -0000 1.42 --- wg_button.cpp 26 Sep 2005 18:37:48 -0000 1.43 *************** *** 125,132 **** bool CButton::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eButtonState == UP) && ! (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(DOWN); --- 125,131 ---- bool CButton::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = CWindow::OnMouseButtonDown(Point, Button); ! if (!bResult && m_bVisible && (m_eButtonState == UP) && (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(DOWN); *************** *** 141,147 **** bool CButton::OnMouseButtonUp(CPoint Point, unsigned int Button) { ! bool bResult = false; ! if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eButtonState == DOWN) && (m_MouseButton == Button) && (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { --- 140,146 ---- bool CButton::OnMouseButtonUp(CPoint Point, unsigned int Button) { ! bool bResult = CWindow::OnMouseButtonUp(Point, Button); ! if (!bResult && m_bVisible && (m_eButtonState == DOWN) && (m_MouseButton == Button) && (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** wg_scrollbar.cpp 22 Sep 2005 20:51:48 -0000 1.46 --- wg_scrollbar.cpp 26 Sep 2005 18:37:48 -0000 1.47 *************** *** 147,154 **** bool CScrollBar::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE) { if (Button == CMouseMessage::WHEELUP) --- 147,153 ---- bool CScrollBar::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = CWindow::OnMouseButtonDown(Point, Button); ! if (!bResult && m_bVisible && m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE) { if (Button == CMouseMessage::WHEELUP) Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** wg_menu.cpp 22 Sep 2005 20:51:48 -0000 1.57 --- wg_menu.cpp 26 Sep 2005 18:37:48 -0000 1.58 *************** *** 260,266 **** bool CMenu::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = false; ! if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { --- 260,266 ---- bool CMenu::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = CMenuBase::OnMouseButtonDown(Point, Button); ! if (!bResult && m_bVisible && (Button == CMouseMessage::LEFT) && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { *************** *** 589,597 **** bool CPopupMenu::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = false; CPoint WindowPoint(ViewToWindow(Point)); ! if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); --- 589,596 ---- bool CPopupMenu::OnMouseButtonDown(CPoint Point, unsigned int Button) { ! bool bResult = CMenuBase::OnMouseButtonDown(Point, Button); CPoint WindowPoint(ViewToWindow(Point)); ! if (!bResult && m_bVisible && (m_WindowRect.SizeRect().HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); Index: wg_listbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_listbox.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** wg_listbox.cpp 22 Sep 2005 20:51:48 -0000 1.48 --- wg_listbox.cpp 26 Sep 2005 18:37:48 -0000 1.49 *************** *** 198,204 **** bool CListBox::OnMouseButtonDown(CPoint Point, unsigned int Button) { - bool bResult = false; CPoint WindowPoint(ViewToWindow(Point)); ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && (m_WindowRect.SizeRect().HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { --- 198,204 ---- bool CListBox::OnMouseButtonDown(CPoint Point, unsigned int Button) { CPoint WindowPoint(ViewToWindow(Point)); ! bool bResult = CWindow::OnMouseButtonDown(Point, Button); ! if (!bResult && m_bVisible && (Button == CMouseMessage::LEFT) && (m_WindowRect.SizeRect().HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { *************** *** 223,231 **** bool CListBox::OnMouseButtonUp(CPoint Point, unsigned int Button) { ! bool bResult = false; CPoint WindowPoint(ViewToWindow(Point)); ! if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { if (m_iFocusedItem == stdex::safe_static_cast<int>((WindowPoint.YPos() - m_ClientRect.Top()) / m_iItemHeight + m_pVScrollbar->GetValue())) --- 223,230 ---- bool CListBox::OnMouseButtonUp(CPoint Point, unsigned int Button) { ! bool bResult = CWindow::OnMouseButtonUp(Point, Button); CPoint WindowPoint(ViewToWindow(Point)); ! if (!bResult && m_bVisible && (Button == CMouseMessage::LEFT) && (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { if (m_iFocusedItem == stdex::safe_static_cast<int>((WindowPoint.YPos() - m_ClientRect.Top()) / m_iItemHeight + m_pVScrollbar->GetValue())) Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** wg_textbox.cpp 22 Sep 2005 20:51:48 -0000 1.33 --- wg_textbox.cpp 26 Sep 2005 18:37:48 -0000 1.34 *************** *** 288,295 **** bool CTextBox::OnMouseButtonDown(CPoint Point, unsigned int Button) // virtual { ! bool bResult = false; CPoint WindowPoint(ViewToWindow(Point)); ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { if (Button == CMouseMessage::LEFT && !m_bReadOnly) --- 288,295 ---- bool CTextBox::OnMouseButtonDown(CPoint Point, unsigned int Button) // virtual { ! bool bResult = CWindow::OnMouseButtonDown(Point, Button); CPoint WindowPoint(ViewToWindow(Point)); ! if (!bResult && m_bVisible && (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { if (Button == CMouseMessage::LEFT && !m_bReadOnly) Index: wg_frame.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_frame.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** wg_frame.cpp 22 Sep 2005 20:51:48 -0000 1.30 --- wg_frame.cpp 26 Sep 2005 18:37:48 -0000 1.31 *************** *** 185,192 **** bool CFrame::OnMouseButtonDown(CPoint Point, unsigned int Button) // virtual { ! bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { if (m_TitleBarRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE) --- 185,191 ---- bool CFrame::OnMouseButtonDown(CPoint Point, unsigned int Button) // virtual { ! bool bResult = CWindow::OnMouseButtonDown(Point, Button); ! if (!bResult && m_bVisible && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { if (m_TitleBarRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE) |
From: Rob W. <gre...@us...> - 2005-09-26 18:37:59
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19172 Modified Files: CHANGES Log Message: Fixed OnMouseButtonDown and OnMouseButtonUp Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.157 retrieving revision 1.158 diff -C2 -d -r1.157 -r1.158 *** CHANGES 22 Sep 2005 20:51:48 -0000 1.157 --- CHANGES 26 Sep 2005 18:37:48 -0000 1.158 *************** *** 13,16 **** --- 13,18 ---- + Bugfix CPainter: Calls to DrawRect() previously ignored the draw mode if it was set to fill, (it was directly calling SDL_FillRect()) this has been fixed, but it may mean significantly slower drawing when in any other mode than PAINT_REPLACE which is special cased + + Bugfix: OnMouseButtonDown() and OnMouseButtonUp() wasn't returning the value it gets when it called it's base class for the function, which could + cause messages to go to the wrong window |
From: Rob W. <gre...@us...> - 2005-09-26 18:37:56
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19172/tests Modified Files: TestView1.cpp Log Message: Fixed OnMouseButtonDown and OnMouseButtonUp Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** TestView1.cpp 22 Sep 2005 20:51:48 -0000 1.81 --- TestView1.cpp 26 Sep 2005 18:37:48 -0000 1.82 *************** *** 209,215 **** bool CTestView::OnMouseButtonDown(wGui::CPoint Point, unsigned int Button) { ! bool bResult = false; ! if (! CView::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == wGui::CMouseMessage::RIGHT) && (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == wGui::CRect::RELPOS_INSIDE)) { --- 209,215 ---- bool CTestView::OnMouseButtonDown(wGui::CPoint Point, unsigned int Button) { ! bool bResult = CView::OnMouseButtonDown(Point, Button); ! if (!bResult && m_bVisible && (Button == wGui::CMouseMessage::RIGHT) && (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == wGui::CRect::RELPOS_INSIDE)) { |
From: Rob W. <gre...@us...> - 2005-09-22 20:52:00
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30653/src Modified Files: wg_application.cpp wg_button.cpp wg_checkbox.cpp wg_editbox.cpp wg_frame.cpp wg_groupbox.cpp wg_listbox.cpp wg_menu.cpp wg_painter.cpp wg_picture.cpp wg_progress.cpp wg_resources.cpp wg_scrollbar.cpp wg_textbox.cpp wg_tooltip.cpp wg_view.cpp wg_window.cpp Log Message: Added transparency effects to CFrame dragging Index: wg_view.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_view.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** wg_view.cpp 7 Jan 2005 22:08:38 -0000 1.43 --- wg_view.cpp 22 Sep 2005 20:51:48 -0000 1.44 *************** *** 103,107 **** ! void CView::SetWindowRect(const CRect& WindowRect ) { CWindow::SetWindowRect(WindowRect); --- 103,107 ---- ! void CView::SetWindowRect(const CRect& WindowRect) { CWindow::SetWindowRect(WindowRect); *************** *** 119,123 **** } ! m_pScreenSurface = SDL_SetVideoMode(m_WindowRect.Width(), m_WindowRect.Height(), DEFAULT_BPP, iFlags); if (m_pScreenSurface == NULL) throw( Wg_Ex_SDL(std::string("Could not set video mode : ") + SDL_GetError()) ); --- 119,123 ---- } ! m_pScreenSurface = SDL_SetVideoMode(m_WindowRect.Width(), m_WindowRect.Height(), CApplication::Instance()->GetBitsPerPixel(), iFlags); if (m_pScreenSurface == NULL) throw( Wg_Ex_SDL(std::string("Could not set video mode : ") + SDL_GetError()) ); *************** *** 125,134 **** ! void CView::SwitchMode( const CRect& WindowRect, bool bResizable, bool bFullScreen ) { m_bResizable = bResizable; m_bFullScreen = bFullScreen; ! SetWindowRect( WindowRect ); } --- 125,134 ---- ! void CView::SwitchMode(const CRect& WindowRect, bool bResizable, bool bFullScreen) { m_bResizable = bResizable; m_bFullScreen = bFullScreen; ! SetWindowRect(WindowRect); } *************** *** 147,151 **** { SDL_Surface* pFloatingSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), ! 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); PaintToSurface(*m_pScreenSurface, *pFloatingSurface, CPoint(0, 0)); SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); --- 147,151 ---- { SDL_Surface* pFloatingSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), ! CApplication::Instance()->GetBitsPerPixel(), 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); PaintToSurface(*m_pScreenSurface, *pFloatingSurface, CPoint(0, 0)); SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** wg_editbox.cpp 12 Dec 2004 09:08:18 -0000 1.96 --- wg_editbox.cpp 22 Sep 2005 20:51:48 -0000 1.97 *************** *** 175,179 **** if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface); CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-3); --- 175,179 ---- if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-3); Index: wg_checkbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_checkbox.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wg_checkbox.cpp 7 Jan 2005 22:08:38 -0000 1.25 --- wg_checkbox.cpp 22 Sep 2005 20:51:48 -0000 1.26 *************** *** 67,71 **** CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); ! CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); if (m_eCheckBoxState != DISABLED) --- 67,71 ---- CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); if (m_eCheckBoxState != DISABLED) Index: wg_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** wg_tooltip.cpp 12 Dec 2004 09:08:19 -0000 1.28 --- wg_tooltip.cpp 22 Sep 2005 20:51:48 -0000 1.29 *************** *** 86,90 **** if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), false); CRect SubRect(m_WindowRect.SizeRect()); --- 86,90 ---- if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); Painter.DrawRect(m_WindowRect.SizeRect(), false); CRect SubRect(m_WindowRect.SizeRect()); Index: wg_progress.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_progress.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wg_progress.cpp 12 Dec 2004 09:08:19 -0000 1.17 --- wg_progress.cpp 22 Sep 2005 20:51:48 -0000 1.18 *************** *** 54,58 **** CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); ! CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); Painter.DrawRect(SubRect, false, COLOR_LIGHTGRAY); --- 54,58 ---- CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); Painter.DrawRect(SubRect, false, COLOR_LIGHTGRAY); Index: wg_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_button.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** wg_button.cpp 7 Jan 2005 22:08:38 -0000 1.41 --- wg_button.cpp 22 Sep 2005 20:51:48 -0000 1.42 *************** *** 83,87 **** CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); ! CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); CRGBColor FontColor = DEFAULT_LINE_COLOR; --- 83,87 ---- CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); CRGBColor FontColor = DEFAULT_LINE_COLOR; *************** *** 242,246 **** CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); ! CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); switch (m_eButtonState) --- 242,246 ---- CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); switch (m_eButtonState) Index: wg_application.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_application.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** wg_application.cpp 3 Aug 2004 15:03:26 -0000 1.54 --- wg_application.cpp 22 Sep 2005 20:51:48 -0000 1.55 *************** *** 97,100 **** --- 97,101 ---- m_pMouseFocusWindow(0), m_pDefaultFontEngine(0), + m_iBitsPerPixel(DEFAULT_BPP), m_DefaultBackgroundColor(DEFAULT_BACKGROUND_COLOR), m_DefaultForegroundColor(DEFAULT_FOREGROUND_COLOR), Index: wg_groupbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_groupbox.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wg_groupbox.cpp 12 Dec 2004 09:08:19 -0000 1.20 --- wg_groupbox.cpp 22 Sep 2005 20:51:48 -0000 1.21 *************** *** 66,70 **** if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface); Painter.DrawRect(CRect(0, 5, m_WindowRect.Width() - 1, m_WindowRect.Height() - 5), false, DEFAULT_LINE_COLOR); --- 66,70 ---- if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); Painter.DrawRect(CRect(0, 5, m_WindowRect.Width() - 1, m_WindowRect.Height() - 5), false, DEFAULT_LINE_COLOR); Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** wg_scrollbar.cpp 7 Jan 2005 22:08:38 -0000 1.45 --- wg_scrollbar.cpp 22 Sep 2005 20:51:48 -0000 1.46 *************** *** 96,100 **** if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface); if (m_MinLimit != m_MaxLimit) { --- 96,100 ---- if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); if (m_MinLimit != m_MaxLimit) { Index: wg_picture.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_picture.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wg_picture.cpp 12 Dec 2004 09:08:19 -0000 1.14 --- wg_picture.cpp 22 Sep 2005 20:51:48 -0000 1.15 *************** *** 76,80 **** SDL_BlitSurface(m_hBitmap.Bitmap(), &SourceRect, m_pSDLSurface, &DestRect); ! CPainter Painter(m_pSDLSurface); if (m_bDrawBorder) { --- 76,80 ---- SDL_BlitSurface(m_hBitmap.Bitmap(), &SourceRect, m_pSDLSurface, &DestRect); ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); if (m_bDrawBorder) { Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** wg_menu.cpp 7 Jan 2005 22:08:38 -0000 1.56 --- wg_menu.cpp 22 Sep 2005 20:51:48 -0000 1.57 *************** *** 236,240 **** if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface); UpdateCachedRects(); for (t_MenuItemVector::const_iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) --- 236,240 ---- if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); UpdateCachedRects(); for (t_MenuItemVector::const_iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) *************** *** 528,532 **** if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_LIGHTGRAY); Painter.DrawHLine(0, m_WindowRect.Width(), m_WindowRect.Height(), COLOR_DARKGRAY); --- 528,532 ---- if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_LIGHTGRAY); Painter.DrawHLine(0, m_WindowRect.Width(), m_WindowRect.Height(), COLOR_DARKGRAY); Index: wg_painter.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_painter.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wg_painter.cpp 23 Nov 2004 23:05:16 -0000 1.22 --- wg_painter.cpp 22 Sep 2005 20:51:48 -0000 1.23 *************** *** 117,122 **** if (bFilled) { ! SDL_Rect FillRect = RealRect.SDLRect(); ! SDL_FillRect(m_pSurface, &FillRect, FillColor.SDLColor(m_pSurface->format)); } } --- 117,135 ---- if (bFilled) { ! if (m_PaintMode == PAINT_REPLACE) ! { ! SDL_Rect FillRect = RealRect.SDLRect(); ! SDL_FillRect(m_pSurface, &FillRect, FillColor.SDLColor(m_pSurface->format)); ! } ! else ! { ! for (int iY = RealRect.Top(); iY <= RealRect.Bottom(); ++iY) ! { ! for (int iX = RealRect.Left(); iX <= RealRect.Right(); ++iX) ! { ! DrawPoint(CPoint(iX, iY), FillColor); ! } ! } ! } } } Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** wg_window.cpp 12 Dec 2004 19:45:06 -0000 1.55 --- wg_window.cpp 22 Sep 2005 20:51:48 -0000 1.56 *************** *** 82,86 **** SDL_FreeSurface(m_pSDLSurface); m_pSDLSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), ! 32, 0x000000FF, 0x0000FF00, 0x00FF0000, /*0xFF000000*/ 0); if (!m_pSDLSurface) { --- 82,86 ---- SDL_FreeSurface(m_pSDLSurface); m_pSDLSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), ! CApplication::Instance()->GetBitsPerPixel(), 0x000000FF, 0x0000FF00, 0x00FF0000, /*0xFF000000*/ 0); if (!m_pSDLSurface) { *************** *** 259,263 **** if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), true, m_BackgroundColor, m_BackgroundColor); CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); --- 259,263 ---- if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); Painter.DrawRect(m_WindowRect.SizeRect(), true, m_BackgroundColor, m_BackgroundColor); CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); Index: wg_listbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_listbox.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** wg_listbox.cpp 12 Dec 2004 09:08:19 -0000 1.47 --- wg_listbox.cpp 22 Sep 2005 20:51:48 -0000 1.48 *************** *** 133,137 **** if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); int iStartIndex = m_pVScrollbar->GetValue(); --- 133,137 ---- if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); int iStartIndex = m_pVScrollbar->GetValue(); Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** wg_textbox.cpp 12 Dec 2004 09:08:19 -0000 1.32 --- wg_textbox.cpp 22 Sep 2005 20:51:48 -0000 1.33 *************** *** 159,163 **** if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); CPoint FontCenterPoint = m_WindowRect.Center(); --- 159,163 ---- if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); CPoint FontCenterPoint = m_WindowRect.Center(); Index: wg_resources.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_resources.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wg_resources.cpp 2 Apr 2004 17:26:16 -0000 1.16 --- wg_resources.cpp 22 Sep 2005 20:51:48 -0000 1.17 *************** *** 167,171 **** SDL_Surface* CwgBitmapResourceHandle::DrawBitmap(CRGBColor Data[], int iDataLength, int iWidth, int iHeight) const { ! SDL_Surface* pBitmap = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_SRCALPHA, iWidth, iHeight, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); CPainter Painter(pBitmap, CPainter::PAINT_REPLACE); for (int iRow = 0; iRow < iHeight; ++iRow) --- 167,172 ---- SDL_Surface* CwgBitmapResourceHandle::DrawBitmap(CRGBColor Data[], int iDataLength, int iWidth, int iHeight) const { ! SDL_Surface* pBitmap = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_SRCALPHA, iWidth, iHeight, ! CApplication::Instance()->GetBitsPerPixel(), 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); CPainter Painter(pBitmap, CPainter::PAINT_REPLACE); for (int iRow = 0; iRow < iHeight; ++iRow) Index: wg_frame.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_frame.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** wg_frame.cpp 7 Jan 2005 22:08:38 -0000 1.29 --- wg_frame.cpp 22 Sep 2005 20:51:48 -0000 1.30 *************** *** 37,42 **** m_bResizable(bResizable), m_pMenu(0), ! m_bDragMode(false), ! m_pSavedSurface(0) { if (pFontEngine) --- 37,42 ---- m_bResizable(bResizable), m_pMenu(0), ! m_bDragMode(false) ! // m_pSavedSurface(0) { if (pFontEngine) *************** *** 66,70 **** CFrame::~CFrame(void) // virtual { ! SDL_FreeSurface(m_pSavedSurface); } --- 66,70 ---- CFrame::~CFrame(void) // virtual { ! // SDL_FreeSurface(m_pSavedSurface); } *************** *** 82,86 **** if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface); CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); --- 82,86 ---- if (m_pSDLSurface) { ! CPainter Painter(m_pSDLSurface, CPainter::PAINT_REPLACE); CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); *************** *** 103,106 **** --- 103,143 ---- + void CFrame::PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const + { + if (m_bVisible) + { + SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); + if (!m_bDragMode) + { + SDL_Rect DestRect = CRect(m_WindowRect + Offset).SDLRect(); + SDL_BlitSurface(m_pSDLSurface, &SourceRect, &ScreenSurface, &DestRect); + CPoint NewOffset = m_ClientRect.TopLeft() + m_WindowRect.TopLeft() + Offset; + for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) + { + if (*iter) + { + (*iter)->PaintToSurface(ScreenSurface, FloatingSurface, NewOffset); + } + } + } + else + { + SDL_Rect DestGhostRect = CRect(m_FrameGhostRect + Offset).SDLRect(); + SDL_BlitSurface(m_pSDLSurface, &SourceRect, &FloatingSurface, &DestGhostRect); + for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) + { + if (*iter) + { + (*iter)->PaintToSurface(FloatingSurface, FloatingSurface, m_ClientRect.TopLeft() + m_FrameGhostRect.TopLeft() + Offset); + } + } + // this is a quick trick to convert the surface to being semi-transparent + CPainter Painter(&FloatingSurface, CPainter::PAINT_AND); + Painter.DrawRect(m_FrameGhostRect + Offset, true, CRGBColor(0xFF, 0xFF, 0xFF, 0x80), CRGBColor(0xFF, 0xFF, 0xFF, 0x80)); + } + } + } + + void CFrame::SetTitleBarHeight(int iTitleBarHeight) { *************** *** 157,160 **** --- 194,199 ---- m_bDragMode = true; m_DragPointerStart = Point; + m_FrameGhostRect = m_WindowRect; + CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); } SetNewParent(m_pParentWindow); // This moves the window to the top *************** *** 174,177 **** --- 213,217 ---- switch(pMessage->MessageType()) { + case CMessage::MOUSE_MOVE: // intentional fall through case CMessage::MOUSE_BUTTONUP: { *************** *** 179,246 **** if (pMouseMessage && m_bDragMode) { ! m_bDragMode = false; ! CPoint MoveDistance = pMouseMessage->Point - m_DragPointerStart; ! CRect Bounds = m_pParentWindow->GetClientRect(); ! if (m_WindowRect.Right() + MoveDistance.XPos() > Bounds.Right()) ! { ! MoveDistance.SetX(Bounds.Right() - m_WindowRect.Right()); ! } ! if (m_WindowRect.Left() + MoveDistance.XPos() < Bounds.Left()) { ! MoveDistance.SetX(Bounds.Left() - m_WindowRect.Left()); } ! if (m_WindowRect.Bottom() + MoveDistance.YPos() > Bounds.Bottom()) { ! MoveDistance.SetY(Bounds.Bottom() - m_WindowRect.Bottom()); } ! if (m_WindowRect.Top() + MoveDistance.YPos() < Bounds.Top()) { ! MoveDistance.SetY(Bounds.Top() - m_WindowRect.Top()); } ! MoveWindow(MoveDistance); ! if (m_pSavedSurface) { ! SDL_Rect SourceRect = m_SavedSurfaceRect.SDLRect(); ! SourceRect.x = 0; ! SourceRect.y = 0; ! SDL_Rect DestRect = m_SavedSurfaceRect.SDLRect(); ! SDL_BlitSurface(m_pSavedSurface, &SourceRect, m_pSDLSurface, &DestRect); ! SDL_FreeSurface(m_pSavedSurface); ! m_pSavedSurface = 0; } ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); ! bHandled = true; ! } ! break; ! } ! case CMessage::MOUSE_MOVE: ! { ! CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); ! if (pMouseMessage && m_bDragMode) ! { ! if (m_pSavedSurface) { ! SDL_Rect SourceRect = m_SavedSurfaceRect.SDLRect(); ! SourceRect.x = 0; ! SourceRect.y = 0; ! SDL_Rect DestRect = m_SavedSurfaceRect.SDLRect(); ! SDL_BlitSurface(m_pSavedSurface, &SourceRect, m_pSDLSurface, &DestRect); ! SDL_UpdateRect(m_pSDLSurface, m_SavedSurfaceRect.Left(), m_SavedSurfaceRect.Top(), m_SavedSurfaceRect.Width(), m_SavedSurfaceRect.Height()); } else { ! m_pSavedSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); } ! m_SavedSurfaceRect = m_WindowRect + pMouseMessage->Point - m_DragPointerStart; ! SDL_Rect DestRect = m_SavedSurfaceRect.SDLRect(); ! DestRect.x = 0; ! DestRect.y = 0; ! SDL_Rect SourceRect = m_SavedSurfaceRect.SDLRect(); ! SDL_BlitSurface(m_pSDLSurface, &SourceRect, m_pSavedSurface, &DestRect); ! ! CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_SavedSurfaceRect, false, COLOR_LIGHTGRAY); ! ! SDL_UpdateRect(m_pSDLSurface, m_SavedSurfaceRect.Left(), m_SavedSurfaceRect.Top(), m_SavedSurfaceRect.Width(), m_SavedSurfaceRect.Height()); } break; --- 219,251 ---- if (pMouseMessage && m_bDragMode) { ! CRect MovedRect = m_WindowRect + (pMouseMessage->Point - m_DragPointerStart); ! CRect Bounds = m_pParentWindow->GetClientRect().SizeRect(); ! if (MovedRect.Right() > Bounds.Right()) { ! MovedRect.Move(Bounds.Right() - MovedRect.Right(), 0); } ! if (MovedRect.Left() < Bounds.Left()) { ! MovedRect.Move(Bounds.Left() - MovedRect.Left(), 0); } ! if (MovedRect.Bottom() > Bounds.Bottom()) { ! MovedRect.Move(0, Bounds.Bottom() - MovedRect.Bottom()); } ! if (MovedRect.Top() < Bounds.Top()) { ! MovedRect.Move(0, Bounds.Top() - MovedRect.Top()); } ! if (pMessage->MessageType() == CMessage::MOUSE_BUTTONUP) { ! m_WindowRect = MovedRect; ! m_bDragMode = false; ! bHandled = true; } else { ! m_FrameGhostRect = MovedRect; } ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); } break; |
From: Rob W. <gre...@us...> - 2005-09-22 20:51:57
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30653/includes Modified Files: wg_application.h wg_frame.h wg_messagebox.h wg_painter.h wg_view.h Log Message: Added transparency effects to CFrame dragging Index: wg_painter.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_painter.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wg_painter.h 16 Jul 2004 16:41:35 -0000 1.18 --- wg_painter.h 22 Sep 2005 20:51:48 -0000 1.19 *************** *** 81,85 **** void DrawVLine(int yStart, int yEnd, int x, const CRGBColor& LineColor = DEFAULT_LINE_COLOR); ! //! Draw a rectangle //! \param Rect A CRect that describes the rectangle //! \param bFilled If true, rectangle will be filled with the FillColor, otherwise only the border is drawn --- 81,85 ---- void DrawVLine(int yStart, int yEnd, int x, const CRGBColor& LineColor = DEFAULT_LINE_COLOR); ! //! Draw a rectangle (this has been optimized to work much faster for filled rects in PAINT_REPLACE mode) //! \param Rect A CRect that describes the rectangle //! \param bFilled If true, rectangle will be filled with the FillColor, otherwise only the border is drawn Index: wg_view.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_view.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wg_view.h 25 Jun 2004 13:34:15 -0000 1.25 --- wg_view.h 22 Sep 2005 20:51:48 -0000 1.26 *************** *** 31,40 **** - namespace - { - const int DEFAULT_BPP = 16; - } - - namespace wGui { --- 31,34 ---- *************** *** 60,68 **** //! Indicates if the view is resizable (set in the constructor) //! \return true if the view is resizable ! bool IsResizable(void) { return m_bResizable; } //! Indicates id the view is fullscreen (set in the constructor) //! \return true if the view was created as fullscreen ! bool IsFullScreen(void) { return m_bFullScreen; } //! Attaches a standard menu to the view, if the view already has a menu, the old menu will be deleted --- 54,62 ---- //! Indicates if the view is resizable (set in the constructor) //! \return true if the view is resizable ! bool IsResizable(void) const { return m_bResizable; } //! Indicates id the view is fullscreen (set in the constructor) //! \return true if the view was created as fullscreen ! bool IsFullScreen(void) const { return m_bFullScreen; } //! Attaches a standard menu to the view, if the view already has a menu, the old menu will be deleted *************** *** 72,76 **** //! Gets the menu for the view //! \return A pointer to the view's menu, 0 if the view doesn't have a menu ! CMenu* GetMenu(void) { return m_pMenu; } //! Switch from current mode to other mode ( resizable / fullscreen ) --- 66,70 ---- //! Gets the menu for the view //! \return A pointer to the view's menu, 0 if the view doesn't have a menu ! CMenu* GetMenu(void) const { return m_pMenu; } //! Switch from current mode to other mode ( resizable / fullscreen ) Index: wg_application.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_application.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** wg_application.h 16 Jul 2004 16:41:35 -0000 1.37 --- wg_application.h 22 Sep 2005 20:51:48 -0000 1.38 *************** *** 41,44 **** --- 41,50 ---- + namespace + { + const int DEFAULT_BPP = 32; + } + + namespace wGui { *************** *** 144,147 **** --- 150,156 ---- virtual CFontEngine* GetDefaultFontEngine(void) const { return m_pDefaultFontEngine; } + //! \return The color depth of the view + virtual int GetBitsPerPixel(void) const { return m_iBitsPerPixel; } + //! Gets the default background color (set in the wgui.conf file) //! \return Default background color *************** *** 226,229 **** --- 235,239 ---- CFontEngine* m_pDefaultFontEngine; //!< A pointer to the default font engine + int m_iBitsPerPixel; //!< The color depth the app will be using CRGBColor m_DefaultBackgroundColor; //!< Default background color CRGBColor m_DefaultForegroundColor; //!< Default foreground color Index: wg_messagebox.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_messagebox.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wg_messagebox.h 7 Jan 2005 22:08:38 -0000 1.6 --- wg_messagebox.h 22 Sep 2005 20:51:48 -0000 1.7 *************** *** 42,49 **** //! \param sTitle The window title, which will appear in the title bar of the view //! \param sMessage The message to display in the message box ! //! \param iButtons A flag field to indicate which buttons to display in the message box ! CMessageBox(CView* pParent, CFontEngine* pFontEngine, const std::string& sTitle, const std::string& sMessage, int iButtons); ! //! The enum EButton { BUTTON_INVALID = 0, --- 42,49 ---- //! \param sTitle The window title, which will appear in the title bar of the view //! \param sMessage The message to display in the message box ! //! \param iButtons A flag field to indicate which buttons to display in the message box, defaults to a single OK button ! CMessageBox(CView* pParent, CFontEngine* pFontEngine, const std::string& sTitle, const std::string& sMessage, int iButtons = BUTTON_OK); ! //! The return values for a message box enum EButton { BUTTON_INVALID = 0, *************** *** 54,61 **** }; - //! Shows the message box as a modal dialog - //! \return The enum of the button that was clicked - // EButton DoModal(void); - // CMessageClient overrides --- 54,57 ---- Index: wg_frame.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_frame.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** wg_frame.h 5 Jan 2005 21:09:32 -0000 1.19 --- wg_frame.h 22 Sep 2005 20:51:48 -0000 1.20 *************** *** 85,88 **** --- 85,94 ---- virtual void Draw(void) const; + //! Blit the window to the given surface, using m_WindowRect as the offset into the surface + //! \param ScreenSurface A reference to the surface that the window will be copied to + //! \param FloatingSurface A reference to the floating surface which is overlayed at the very end (used for tooltips, menus and such) + //! \param Offset This is the current offset into the Surface that should be used as reference + virtual void PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const; + //! Giving a control a new WindowRect will move and resize the control //! \param WindowRect A CRect that defines the outer limits of the control *************** *** 121,126 **** bool m_bDragMode; //!< Indicates if the window is currently being dragged CPoint m_DragPointerStart; //!< The location of the cursor when the drag was started ! SDL_Surface* m_pSavedSurface; //!< A pointer to a bitmap of what lies underneath the dragged frame ! CRect m_SavedSurfaceRect; //!< A rect for the saved surface void operator=(CFrame) { } //!< The assignment operator is not allowed for CWindow derived objects }; --- 127,133 ---- bool m_bDragMode; //!< Indicates if the window is currently being dragged CPoint m_DragPointerStart; //!< The location of the cursor when the drag was started ! // SDL_Surface* m_pSavedSurface; //!< A pointer to a bitmap of what lies underneath the dragged frame ! // CRect m_SavedSurfaceRect; //!< A rect for the saved surface ! CRect m_FrameGhostRect; void operator=(CFrame) { } //!< The assignment operator is not allowed for CWindow derived objects }; |
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); |
From: Rob W. <gre...@us...> - 2005-09-22 20:51:56
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30653 Modified Files: CHANGES Log Message: Added transparency effects to CFrame dragging Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** CHANGES 7 Jan 2005 22:08:37 -0000 1.156 --- CHANGES 22 Sep 2005 20:51:48 -0000 1.157 *************** *** 1,3 **** --- 1,4 ---- 0.4.0 -> 0.4.1 + + Added CApplication: GetBitsPerPixel() which returns the color depth the app will use + Added CPoint: ToString() which returns the coordinates of the rectangle in a string + Added CRect: ToString() which returns the coordinates of the point in a string *************** *** 7,10 **** --- 8,16 ---- + Changed CMessage: Renamed a few message types (CTRL_LCLICK to CTRL_SINGLELCLICK, CTRL_MCLICK to CTRL_SINGLEMCLICK, and CTRL_RCLICK to CTRL_SINGLERCLICK) and re-ordered them in the enum + + Changed CView: IsResizable(), IsFullScreen() and GetMenu() were made const + + Changed All calls to create a new RGB surface now retrieve the color depth of the app and use that when creating their SDL_Surface + + Changed For speed, most wGui controls now use PAINT_REPLACE mode to draw themselves + + Bugfix CPainter: Calls to DrawRect() previously ignored the draw mode if it was set to fill, (it was directly calling SDL_FillRect()) + this has been fixed, but it may mean significantly slower drawing when in any other mode than PAINT_REPLACE which is special cased |
From: Rob W. <gre...@us...> - 2005-09-22 20:50:06
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30159/tests Modified Files: CalcApp-VS7.vcproj CalcApp-VS71.vcproj ConfigEditor-VS7.vcproj ConfigEditor-VS71.vcproj MessagingTest-VS7.vcproj MessagingTest-VS71.vcproj Notepad-VS7.vcproj Notepad-VS71.vcproj TestApp1-VS7.vcproj TestApp1-VS71.vcproj TestApp2-VS7.vcproj TestApp2-VS71.vcproj UnitTests-VS7.vcproj UnitTests-VS71.vcproj Log Message: Updated to freetype 2.1.10 Index: UnitTests-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/UnitTests-VS7.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UnitTests-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.3 --- UnitTests-VS7.vcproj 22 Sep 2005 20:49:55 -0000 1.4 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="1" Index: CalcApp-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/CalcApp-VS71.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CalcApp-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.2 --- CalcApp-VS71.vcproj 22 Sep 2005 20:49:55 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="1" Index: UnitTests-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/UnitTests-VS71.vcproj,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UnitTests-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.4 --- UnitTests-VS71.vcproj 22 Sep 2005 20:49:55 -0000 1.5 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="1" Index: CalcApp-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/CalcApp-VS7.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CalcApp-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 --- CalcApp-VS7.vcproj 22 Sep 2005 20:49:55 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="1" Index: Notepad-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/Notepad-VS71.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Notepad-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.3 --- Notepad-VS71.vcproj 22 Sep 2005 20:49:55 -0000 1.4 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="1" Index: TestApp1-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestApp1-VS71.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestApp1-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.2 --- TestApp1-VS71.vcproj 22 Sep 2005 20:49:55 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="1" Index: ConfigEditor-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/ConfigEditor-VS71.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConfigEditor-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.2 --- ConfigEditor-VS71.vcproj 22 Sep 2005 20:49:55 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="1" Index: TestApp1-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestApp1-VS7.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestApp1-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 --- TestApp1-VS7.vcproj 22 Sep 2005 20:49:55 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="1" Index: TestApp2-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestApp2-VS71.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestApp2-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.2 --- TestApp2-VS71.vcproj 22 Sep 2005 20:49:55 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="1" Index: TestApp2-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestApp2-VS7.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestApp2-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 --- TestApp2-VS7.vcproj 22 Sep 2005 20:49:55 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="1" Index: Notepad-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/Notepad-VS7.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Notepad-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 --- Notepad-VS7.vcproj 22 Sep 2005 20:49:55 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="1" Index: ConfigEditor-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/ConfigEditor-VS7.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConfigEditor-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 --- ConfigEditor-VS7.vcproj 22 Sep 2005 20:49:55 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="1" Index: MessagingTest-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/MessagingTest-VS71.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MessagingTest-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.2 --- MessagingTest-VS71.vcproj 22 Sep 2005 20:49:55 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="1" Index: MessagingTest-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/MessagingTest-VS7.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MessagingTest-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 --- MessagingTest-VS7.vcproj 22 Sep 2005 20:49:55 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype2110_D.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype2110.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="1" |
From: Rob W. <gre...@us...> - 2005-01-07 22:09:19
|
Update of /cvsroot/wgui/wgui/docs/tutorial/Calc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26926/docs/tutorial/Calc Modified Files: calc_tutorial.cpp calc_tutorial5.cpp calc_tutorial6.cpp Log Message: Work on the message box. Changed the single click message types to include the word SINGLE. Index: calc_tutorial.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/docs/tutorial/Calc/calc_tutorial.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** calc_tutorial.cpp 7 Apr 2004 15:14:47 -0000 1.1 --- calc_tutorial.cpp 7 Jan 2005 22:08:38 -0000 1.2 *************** *** 91,95 **** m_eCalcMode(MODE_NOP) { ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); m_pDisplay = new CEditBox(CRect(10, 10, 150, 30), this); m_pDisplay->SetWindowText("0"); --- 91,95 ---- m_eCalcMode(MODE_NOP) { ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); m_pDisplay = new CEditBox(CRect(10, 10, 150, 30), this); m_pDisplay->SetWindowText("0"); *************** *** 122,126 **** switch (pMessage->MessageType()) { ! case CMessage::CTRL_LCLICK: if (pMessage->Destination() == this) { --- 122,126 ---- switch (pMessage->MessageType()) { ! case CMessage::CTRL_SINGLELCLICK: if (pMessage->Destination() == this) { Index: calc_tutorial5.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/docs/tutorial/Calc/calc_tutorial5.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** calc_tutorial5.cpp 7 Apr 2004 15:14:47 -0000 1.1 --- calc_tutorial5.cpp 7 Jan 2005 22:08:38 -0000 1.2 *************** *** 78,82 **** CView(CRect(0, 0, 170, 210), "wGui Calculator Tutorial", false) { ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); m_pDisplay = new CEditBox(CRect(10, 10, 150, 30), this); m_pDisplay->SetWindowText("0"); --- 78,82 ---- CView(CRect(0, 0, 170, 210), "wGui Calculator Tutorial", false) { ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); m_pDisplay = new CEditBox(CRect(10, 10, 150, 30), this); m_pDisplay->SetWindowText("0"); *************** *** 109,113 **** switch (pMessage->MessageType()) { ! case CMessage::CTRL_LCLICK: if (pMessage->Destination() == this) { --- 109,113 ---- switch (pMessage->MessageType()) { ! case CMessage::CTRL_SINGLELCLICK: if (pMessage->Destination() == this) { Index: calc_tutorial6.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/docs/tutorial/Calc/calc_tutorial6.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** calc_tutorial6.cpp 7 Apr 2004 15:14:47 -0000 1.1 --- calc_tutorial6.cpp 7 Jan 2005 22:08:38 -0000 1.2 *************** *** 91,95 **** m_eCalcMode(MODE_NOP) { ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); m_pDisplay = new CEditBox(CRect(10, 10, 150, 30), this); m_pDisplay->SetWindowText("0"); --- 91,95 ---- m_eCalcMode(MODE_NOP) { ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); m_pDisplay = new CEditBox(CRect(10, 10, 150, 30), this); m_pDisplay->SetWindowText("0"); *************** *** 122,126 **** switch (pMessage->MessageType()) { ! case CMessage::CTRL_LCLICK: if (pMessage->Destination() == this) { --- 122,126 ---- switch (pMessage->MessageType()) { ! case CMessage::CTRL_SINGLELCLICK: if (pMessage->Destination() == this) { |
From: Rob W. <gre...@us...> - 2005-01-07 22:09:18
|
Update of /cvsroot/wgui/wgui/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26926/docs Modified Files: CalcTutorial.html Log Message: Work on the message box. Changed the single click message types to include the word SINGLE. Index: CalcTutorial.html =================================================================== RCS file: /cvsroot/wgui/wgui/docs/CalcTutorial.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CalcTutorial.html 7 Apr 2004 15:14:38 -0000 1.8 --- CalcTutorial.html 7 Jan 2005 22:08:37 -0000 1.9 *************** *** 219,223 **** <p>To indicate to the message server that we want to get Button Click messages, we have to add the following line to the view constructor.</p> <pre><code> ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); </code></pre> <p>Then we have to add a HandleMessage() method to the view.</p> --- 219,223 ---- <p>To indicate to the message server that we want to get Button Click messages, we have to add the following line to the view constructor.</p> <pre><code> ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); </code></pre> <p>Then we have to add a HandleMessage() method to the view.</p> *************** *** 247,251 **** switch (pMessage->MessageType()) { ! case CMessage::CTRL_LCLICK: if (pMessage->Destination() == this) { --- 247,251 ---- switch (pMessage->MessageType()) { ! case CMessage::CTRL_SINGLELCLICK: if (pMessage->Destination() == this) { *************** *** 328,332 **** m_eCalcMode(MODE_NOP) { ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); m_pDisplay = new CEditBox(CRect(10, 10, 150, 30), this); m_pDisplay->SetWindowText("0"); --- 328,332 ---- m_eCalcMode(MODE_NOP) { ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); m_pDisplay = new CEditBox(CRect(10, 10, 150, 30), this); m_pDisplay->SetWindowText("0"); *************** *** 384,388 **** switch (pMessage->MessageType()) { ! case CMessage::CTRL_LCLICK: if (pMessage->Destination() == this) { --- 384,388 ---- switch (pMessage->MessageType()) { ! case CMessage::CTRL_SINGLELCLICK: if (pMessage->Destination() == this) { |
From: Rob W. <gre...@us...> - 2005-01-07 22:09:18
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26926 Modified Files: CHANGES Log Message: Work on the message box. Changed the single click message types to include the word SINGLE. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.155 retrieving revision 1.156 diff -C2 -d -r1.155 -r1.156 *** CHANGES 5 Jan 2005 21:09:31 -0000 1.155 --- CHANGES 7 Jan 2005 22:08:37 -0000 1.156 *************** *** 4,7 **** --- 4,10 ---- + Added CMessageBox class which derives from CFrame to make a simple message box + Added CFrame::CloseFrame() which closes the frame and causes it to delete itself + + Added CMessage: EMessageType::APP_DESTROY_FRAME which allows the app to call delete on a frame rather than the frame calling delete on itself + + Changed CMessage: Renamed a few message types (CTRL_LCLICK to CTRL_SINGLELCLICK, CTRL_MCLICK to CTRL_SINGLEMCLICK, + and CTRL_RCLICK to CTRL_SINGLERCLICK) and re-ordered them in the enum |
From: Rob W. <gre...@us...> - 2005-01-07 22:09:18
|
Update of /cvsroot/wgui/wgui/includes/unit_tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26926/includes/unit_tests Modified Files: wg_button_unittests.h wg_checkbox_unittests.h wg_dropdown_unittests.h wg_editbox_unittests.h Log Message: Work on the message box. Changed the single click message types to include the word SINGLE. Index: wg_button_unittests.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/unit_tests/wg_button_unittests.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wg_button_unittests.h 25 Jun 2004 19:37:50 -0000 1.4 --- wg_button_unittests.h 7 Jan 2005 22:08:38 -0000 1.5 *************** *** 54,60 **** wGui::CMessageServer& Server = wGui::CMessageServer::Instance(); Server.IgnoreAllNewMessages(false); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_LCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_MCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_RCLICK); wGui::CButton* pButton1 = new wGui::CButton(wGui::CRect(1, 1, 5, 5), &Client1, ""); --- 54,60 ---- wGui::CMessageServer& Server = wGui::CMessageServer::Instance(); Server.IgnoreAllNewMessages(false); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLELCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLEMCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLERCLICK); wGui::CButton* pButton1 = new wGui::CButton(wGui::CRect(1, 1, 5, 5), &Client1, ""); *************** *** 79,83 **** } ensure_equals("CButton - OnMouseButtonUp (Button State)", pButton1->GetButtonState(), wGui::CButton::UP); ! ensure("CButton - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_LCLICK)); ensure("CButton - OnMouseButtonDown (middle button)", pButton1->OnMouseButtonDown( View.ClientToView(pButton1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); --- 79,83 ---- } ensure_equals("CButton - OnMouseButtonUp (Button State)", pButton1->GetButtonState(), wGui::CButton::UP); ! ensure("CButton - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_SINGLELCLICK)); ensure("CButton - OnMouseButtonDown (middle button)", pButton1->OnMouseButtonDown( View.ClientToView(pButton1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); *************** *** 88,92 **** Server.DeliverMessage(); } ! ensure("CButton - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_MCLICK)); } --- 88,92 ---- Server.DeliverMessage(); } ! ensure("CButton - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_SINGLEMCLICK)); } Index: wg_dropdown_unittests.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/unit_tests/wg_dropdown_unittests.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wg_dropdown_unittests.h 2 Apr 2004 17:26:15 -0000 1.3 --- wg_dropdown_unittests.h 7 Jan 2005 22:08:38 -0000 1.4 *************** *** 49,56 **** wGui::CMessageServer& Server = wGui::CMessageServer::Instance(); Server.IgnoreAllNewMessages(false); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_LCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_MCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_RCLICK); ! wGui::CDropDown* pDropDown1 = new wGui::CDropDown(wGui::CRect(1, 1, 40, 14), &Client1); ensure("CDropDown - GetWindowText", pDropDown1->GetWindowText() == ""); --- 49,56 ---- wGui::CMessageServer& Server = wGui::CMessageServer::Instance(); Server.IgnoreAllNewMessages(false); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLELCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLEMCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLERCLICK); ! wGui::CDropDown* pDropDown1 = new wGui::CDropDown(wGui::CRect(1, 1, 40, 14), &Client1); ensure("CDropDown - GetWindowText", pDropDown1->GetWindowText() == ""); Index: wg_editbox_unittests.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/unit_tests/wg_editbox_unittests.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wg_editbox_unittests.h 2 Apr 2004 17:26:15 -0000 1.2 --- wg_editbox_unittests.h 7 Jan 2005 22:08:38 -0000 1.3 *************** *** 49,55 **** wGui::CMessageServer& Server = wGui::CMessageServer::Instance(); Server.IgnoreAllNewMessages(false); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_LCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_MCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_RCLICK); wGui::CEditBox* pEditBox1 = new wGui::CEditBox(wGui::CRect(1, 1, 5, 5), &Client1); --- 49,55 ---- wGui::CMessageServer& Server = wGui::CMessageServer::Instance(); Server.IgnoreAllNewMessages(false); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLELCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLEMCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLERCLICK); wGui::CEditBox* pEditBox1 = new wGui::CEditBox(wGui::CRect(1, 1, 5, 5), &Client1); Index: wg_checkbox_unittests.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/unit_tests/wg_checkbox_unittests.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wg_checkbox_unittests.h 25 Jun 2004 19:37:50 -0000 1.3 --- wg_checkbox_unittests.h 7 Jan 2005 22:08:38 -0000 1.4 *************** *** 49,55 **** wGui::CMessageServer& Server = wGui::CMessageServer::Instance(); Server.IgnoreAllNewMessages(false); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_LCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_MCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_RCLICK); wGui::CCheckBox* pCheckBox1 = new wGui::CCheckBox(wGui::CRect(1, 1, 5, 5), &Client1); --- 49,55 ---- wGui::CMessageServer& Server = wGui::CMessageServer::Instance(); Server.IgnoreAllNewMessages(false); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLELCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLEMCLICK); ! Server.RegisterMessageClient(&Client1, wGui::CMessage::CTRL_SINGLERCLICK); wGui::CCheckBox* pCheckBox1 = new wGui::CCheckBox(wGui::CRect(1, 1, 5, 5), &Client1); *************** *** 71,75 **** } ensure_equals("CCheckBox - OnMouseButtonUp (CheckBox State)", pCheckBox1->GetCheckBoxState(), wGui::CCheckBox::CHECKED); ! ensure("CCheckBox - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_LCLICK)); ensure("CCheckBox - OnMouseButtonDown (middle CheckBox)", pCheckBox1->OnMouseButtonDown( View.ClientToView(pCheckBox1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); --- 71,75 ---- } ensure_equals("CCheckBox - OnMouseButtonUp (CheckBox State)", pCheckBox1->GetCheckBoxState(), wGui::CCheckBox::CHECKED); ! ensure("CCheckBox - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_SINGLELCLICK)); ensure("CCheckBox - OnMouseButtonDown (middle CheckBox)", pCheckBox1->OnMouseButtonDown( View.ClientToView(pCheckBox1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); *************** *** 80,84 **** Server.DeliverMessage(); } ! ensure("CCheckBox - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_MCLICK)); } --- 80,84 ---- Server.DeliverMessage(); } ! ensure("CCheckBox - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_SINGLEMCLICK)); } |
From: Rob W. <gre...@us...> - 2005-01-07 22:08:50
|
Update of /cvsroot/wgui/wgui/wgui_ex/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26926/wgui_ex/src Modified Files: wgex_bufferdisplay.cpp wgex_button.cpp wgex_display.cpp wgex_joystick.cpp wgex_keypiano.cpp wgex_popupmenu.cpp Log Message: Work on the message box. Changed the single click message types to include the word SINGLE. Index: wgex_joystick.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_joystick.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wgex_joystick.cpp 24 Nov 2003 17:36:05 -0000 1.4 --- wgex_joystick.cpp 7 Jan 2005 22:08:39 -0000 1.5 *************** *** 72,79 **** m_iPosX = m_DeltaOffset.XPos() + (int)( m_fValueX * m_DeltaSize.XPos() ); m_iPosY = m_DeltaOffset.YPos() + (int)( m_fValueY * m_DeltaSize.YPos() ); ! CMessageServer::Instance().QueueMessage( new TFloatMessage(CMessage::CTRL_VALUECHANGE, this, this, m_fValueX) ); // CMessageServer::Instance().QueueMessage( new TFloatMessage(CMessage::CTRL_VALUECHANGE, this, this, m_fValueY) ); ! StartDrawProc(); } --- 72,79 ---- m_iPosX = m_DeltaOffset.XPos() + (int)( m_fValueX * m_DeltaSize.XPos() ); m_iPosY = m_DeltaOffset.YPos() + (int)( m_fValueY * m_DeltaSize.YPos() ); ! CMessageServer::Instance().QueueMessage( new TFloatMessage(CMessage::CTRL_VALUECHANGE, this, this, m_fValueX) ); // CMessageServer::Instance().QueueMessage( new TFloatMessage(CMessage::CTRL_VALUECHANGE, this, this, m_fValueY) ); ! StartDrawProc(); } *************** *** 85,89 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { --- 85,89 ---- bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { *************** *** 91,100 **** CMessage::EMessageType MessageType = CMessage::UNKNOWN; ! switch( m_iMouseButton ) { case CMouseMessage::LEFT: // picker { ! MessageType = CMessage::CTRL_LCLICK; CApplication::Instance()->SetMouseVisibility( 0 ); CApplication::Instance()->SetMouseFocus( this ); --- 91,100 ---- CMessage::EMessageType MessageType = CMessage::UNKNOWN; ! switch( m_iMouseButton ) { case CMouseMessage::LEFT: // picker { ! MessageType = CMessage::CTRL_SINGLELCLICK; CApplication::Instance()->SetMouseVisibility( 0 ); CApplication::Instance()->SetMouseFocus( this ); *************** *** 103,110 **** break; } ! case CMouseMessage::MIDDLE: // random { ! MessageType = CMessage::CTRL_MCLICK; double newPosX = rand() / (double)( RAND_MAX + 1 ); double newPosY = rand() / (double)( RAND_MAX + 1 ); --- 103,110 ---- break; } ! case CMouseMessage::MIDDLE: // random { ! MessageType = CMessage::CTRL_SINGLEMCLICK; double newPosX = rand() / (double)( RAND_MAX + 1 ); double newPosY = rand() / (double)( RAND_MAX + 1 ); *************** *** 117,121 **** case CMouseMessage::RIGHT: // inverse { ! MessageType = CMessage::CTRL_RCLICK; CApplication::Instance()->SetMouseVisibility( 0 ); CApplication::Instance()->SetMouseFocus( this ); --- 117,121 ---- case CMouseMessage::RIGHT: // inverse { ! MessageType = CMessage::CTRL_SINGLERCLICK; CApplication::Instance()->SetMouseVisibility( 0 ); CApplication::Instance()->SetMouseFocus( this ); *************** *** 126,130 **** } ! } return bResult; --- 126,130 ---- } ! } return bResult; *************** *** 207,211 **** SetSliderPos( newPosX, newPosY ); ! bHandled = true; break; --- 207,211 ---- SetSliderPos( newPosX, newPosY ); ! bHandled = true; break; *************** *** 266,270 **** m_WindowRect.Top() + m_WindowRect.Height() / 2, COLOR_BLACK, 50 ); ! // mid y line Painter.DrawVLineAlpha( --- 266,270 ---- m_WindowRect.Top() + m_WindowRect.Height() / 2, COLOR_BLACK, 50 ); ! // mid y line Painter.DrawVLineAlpha( Index: wgex_display.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_display.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wgex_display.cpp 16 Jul 2004 16:41:36 -0000 1.14 --- wgex_display.cpp 7 Jan 2005 22:08:39 -0000 1.15 *************** *** 195,199 **** case CMouseMessage::LEFT: { ! MessageType = CMessage::CTRL_LCLICK; // reset release mode --- 195,199 ---- case CMouseMessage::LEFT: { ! MessageType = CMessage::CTRL_SINGLELCLICK; // reset release mode *************** *** 213,217 **** case CMouseMessage::MIDDLE: { ! MessageType = CMessage::CTRL_MCLICK; // reset release mode --- 213,217 ---- case CMouseMessage::MIDDLE: { ! MessageType = CMessage::CTRL_SINGLEMCLICK; // reset release mode *************** *** 235,239 **** case CMouseMessage::RIGHT: { ! MessageType = CMessage::CTRL_RCLICK; // set mouse stuff --- 235,239 ---- case CMouseMessage::RIGHT: { ! MessageType = CMessage::CTRL_SINGLERCLICK; // set mouse stuff Index: wgex_keypiano.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_keypiano.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wgex_keypiano.cpp 25 Nov 2003 17:25:55 -0000 1.3 --- wgex_keypiano.cpp 7 Jan 2005 22:08:39 -0000 1.4 *************** *** 44,48 **** { 38, 2, 5, 16 }, // G# { 41, 1, 8, 32 }, // A ! { 46, 2, 5, 16 }, // A# { 49, 1, 8, 32 } // B }; --- 44,48 ---- { 38, 2, 5, 16 }, // G# { 41, 1, 8, 32 }, // A ! { 46, 2, 5, 16 }, // A# { 49, 1, 8, 32 } // B }; *************** *** 79,83 **** if( m_iKeyPressed >= 0 ) DrawSingleKey( m_iKeyPressed ); ! if( ( m_iKeyLower >= 0 && m_iKeyLower <= 60 ) && ( m_iKeyUpper >= 0 && m_iKeyUpper <= 60 ) && --- 79,83 ---- if( m_iKeyPressed >= 0 ) DrawSingleKey( m_iKeyPressed ); ! if( ( m_iKeyLower >= 0 && m_iKeyLower <= 60 ) && ( m_iKeyUpper >= 0 && m_iKeyUpper <= 60 ) && *************** *** 94,98 **** int iOctaveNumber = iNoteNumber / 12; int iNoteOffset = iNoteNumber % 12; ! int w = KeysOffset[iNoteOffset].wOffset; int h = KeysOffset[iNoteOffset].hOffset; --- 94,98 ---- int iOctaveNumber = iNoteNumber / 12; int iNoteOffset = iNoteNumber % 12; ! int w = KeysOffset[iNoteOffset].wOffset; int h = KeysOffset[iNoteOffset].hOffset; *************** *** 136,140 **** int note = ( PointHit.XPos() - m_WindowRect.Left() ) % 57; int off_x, off_y = ( PointHit.YPos() - m_WindowRect.Top() ); ! // int off_x; int k = 0; --- 136,140 ---- int note = ( PointHit.XPos() - m_WindowRect.Left() ) % 57; int off_x, off_y = ( PointHit.YPos() - m_WindowRect.Top() ); ! // int off_x; int k = 0; *************** *** 154,158 **** k = 0; } ! if( k < 0 ) { octave--; --- 154,158 ---- k = 0; } ! if( k < 0 ) { octave--; *************** *** 163,167 **** } ! //________________________________________________________________ bool CKeyPiano::OnMouseButtonDown(CPoint Point, unsigned int Button) --- 163,167 ---- } ! //________________________________________________________________ bool CKeyPiano::OnMouseButtonDown(CPoint Point, unsigned int Button) *************** *** 169,173 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { --- 169,173 ---- bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { *************** *** 175,179 **** CMessage::EMessageType MessageType = CMessage::UNKNOWN; ! switch( m_iMouseButton ) { --- 175,179 ---- CMessage::EMessageType MessageType = CMessage::UNKNOWN; ! switch( m_iMouseButton ) { *************** *** 181,188 **** { m_iKeyPressed = PointToKey( Point ); ! CMessageServer::Instance().QueueMessage( ! new TIntMessage(CMessage::CTRL_LCLICK, m_pParentWindow, this, m_iKeyPressed) ); ! CApplication::Instance()->SetMouseFocus( this ); StartDrawProc(); --- 181,188 ---- { m_iKeyPressed = PointToKey( Point ); ! CMessageServer::Instance().QueueMessage( ! new TIntMessage(CMessage::CTRL_SINGLELCLICK, m_pParentWindow, this, m_iKeyPressed) ); ! CApplication::Instance()->SetMouseFocus( this ); StartDrawProc(); *************** *** 190,194 **** break; } ! case CMouseMessage::RIGHT: { --- 190,194 ---- break; } ! case CMouseMessage::RIGHT: { *************** *** 206,210 **** } ! } return bResult; --- 206,210 ---- } ! } return bResult; *************** *** 241,245 **** break; } ! default: break; --- 241,245 ---- break; } ! default: break; *************** *** 271,277 **** { m_iKeyPressed = PointToKey( pMouseMessage->Point ); ! CMessageServer::Instance().QueueMessage( ! new TIntMessage(CMessage::CTRL_LCLICK, m_pParentWindow, this, m_iKeyPressed) ); StartDrawProc(); --- 271,277 ---- { m_iKeyPressed = PointToKey( pMouseMessage->Point ); ! CMessageServer::Instance().QueueMessage( ! new TIntMessage(CMessage::CTRL_SINGLELCLICK, m_pParentWindow, this, m_iKeyPressed) ); StartDrawProc(); *************** *** 283,290 **** { m_iKeyUpper = PointToKey( pMouseMessage->Point ); ! CMessageServer::Instance().QueueMessage( new TIntMessage(CMessage::CTRL_VALUECHANGE, m_pParentWindow, this, m_iKeyUpper) ); ! StartDrawProc(); bHandled = true; --- 283,290 ---- { m_iKeyUpper = PointToKey( pMouseMessage->Point ); ! CMessageServer::Instance().QueueMessage( new TIntMessage(CMessage::CTRL_VALUECHANGE, m_pParentWindow, this, m_iKeyUpper) ); ! StartDrawProc(); bHandled = true; Index: wgex_bufferdisplay.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_bufferdisplay.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wgex_bufferdisplay.cpp 16 Jul 2004 16:41:36 -0000 1.9 --- wgex_bufferdisplay.cpp 7 Jan 2005 22:08:39 -0000 1.10 *************** *** 174,178 **** // CMessageClient overrides ! //! CControl handle MOUSE_BUTTONDOWN, MOUSE_BUTTONUP, and it's own CTRL_LCLICK messages //! \param pMessage A pointer to the message bool CBufferDisplay::HandleMessage( CMessage* pMessage ) --- 174,178 ---- // CMessageClient overrides ! //! CControl handle MOUSE_BUTTONDOWN, MOUSE_BUTTONUP, and it's own CTRL_SINGLELCLICK messages //! \param pMessage A pointer to the message bool CBufferDisplay::HandleMessage( CMessage* pMessage ) Index: wgex_popupmenu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_popupmenu.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wgex_popupmenu.cpp 21 Nov 2003 17:12:48 -0000 1.4 --- wgex_popupmenu.cpp 7 Jan 2005 22:08:39 -0000 1.5 *************** *** 208,212 **** pDestination = m_pParentMenu; } ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_LCLICK, pDestination, this, iter->first.iItemId)); HideAll(); } --- 208,212 ---- pDestination = m_pParentMenu; } ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, pDestination, this, iter->first.iItemId)); HideAll(); } *************** *** 353,357 **** Painter.DrawHLine(m_WindowRect.Left(), m_WindowRect.Right(), m_WindowRect.Top(), COLOR_WHITE); Painter.DrawVLine( m_WindowRect.Left(), m_WindowRect.Top(), m_WindowRect.Bottom(), COLOR_WHITE); ! // draws the darkgray stuff Painter.DrawHLine(m_WindowRect.Left(), m_WindowRect.Right(), m_WindowRect.Bottom(), COLOR_DARKGRAY); --- 353,357 ---- Painter.DrawHLine(m_WindowRect.Left(), m_WindowRect.Right(), m_WindowRect.Top(), COLOR_WHITE); Painter.DrawVLine( m_WindowRect.Left(), m_WindowRect.Top(), m_WindowRect.Bottom(), COLOR_WHITE); ! // draws the darkgray stuff Painter.DrawHLine(m_WindowRect.Left(), m_WindowRect.Right(), m_WindowRect.Bottom(), COLOR_DARKGRAY); *************** *** 364,368 **** if (m_pHighlightedItem == &(iter->first)) Painter.DrawFilledRectAlpha(iter->second.second, m_HighlightColor, m_iAlpha ); ! CRect TextRect(iter->second.second); TextRect.Grow(-2); --- 364,368 ---- if (m_pHighlightedItem == &(iter->first)) Painter.DrawFilledRectAlpha(iter->second.second, m_HighlightColor, m_iAlpha ); ! CRect TextRect(iter->second.second); TextRect.Grow(-2); Index: wgex_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_button.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wgex_button.cpp 21 Nov 2003 17:12:48 -0000 1.3 --- wgex_button.cpp 7 Jan 2005 22:08:39 -0000 1.4 *************** *** 79,83 **** Painter.DrawMcLineAlpha( Inset.BottomLeft(), Inset.BottomRight(), Lighter, Light, 50 ); Painter.DrawMcLineAlpha( Inset.TopRight(), Inset.BottomRight(), Lighter, Light, 50 ); ! Painter.DrawText( m_sWindowText, Inset, Inset.Center()+CPoint(1,1), COLOR_BLACK ); } --- 79,83 ---- Painter.DrawMcLineAlpha( Inset.BottomLeft(), Inset.BottomRight(), Lighter, Light, 50 ); Painter.DrawMcLineAlpha( Inset.TopRight(), Inset.BottomRight(), Lighter, Light, 50 ); ! Painter.DrawText( m_sWindowText, Inset, Inset.Center()+CPoint(1,1), COLOR_BLACK ); } *************** *** 108,112 **** StartDrawProc(); ! bResult = true; } --- 108,112 ---- StartDrawProc(); ! bResult = true; } *************** *** 127,141 **** { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_LCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_RCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_MCLICK; break; } CMessageServer::Instance().QueueMessage( new TIntMessage(MessageType, m_pParentWindow, this, 0) ); ! CApplication::Instance()->SetMouseFocus( 0 ); --- 127,141 ---- { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_SINGLELCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_SINGLERCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_SINGLEMCLICK; break; } CMessageServer::Instance().QueueMessage( new TIntMessage(MessageType, m_pParentWindow, this, 0) ); ! CApplication::Instance()->SetMouseFocus( 0 ); *************** *** 195,205 **** { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_LCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_RCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_MCLICK; break; } --- 195,205 ---- { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_SINGLELCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_SINGLERCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_SINGLEMCLICK; break; } *************** *** 294,298 **** CRect RectInset = m_WindowRect; RectInset.Grow( -1 ); ! // painter.PanelInset( middleInset, true ); Painter.DrawRectAlpha( RectInset, *ActiveColor, 200 ); --- 294,298 ---- CRect RectInset = m_WindowRect; RectInset.Grow( -1 ); ! // painter.PanelInset( middleInset, true ); Painter.DrawRectAlpha( RectInset, *ActiveColor, 200 ); |
From: Rob W. <gre...@us...> - 2005-01-07 22:08:50
|
Update of /cvsroot/wgui/wgui/wgui_ex/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26926/wgui_ex/tests Modified Files: WgEx_Main.cpp Log Message: Work on the message box. Changed the single click message types to include the word SINGLE. Index: WgEx_Main.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/tests/WgEx_Main.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** WgEx_Main.cpp 26 Feb 2004 17:00:36 -0000 1.23 --- WgEx_Main.cpp 7 Jan 2005 22:08:40 -0000 1.24 *************** *** 92,96 **** // m_hBitmap( CBitmapFileResourceHandle("testpic.bmp") ) { ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_TIMER); --- 92,96 ---- // m_hBitmap( CBitmapFileResourceHandle("testpic.bmp") ) { ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_TIMER); *************** *** 208,212 **** switch(pMessage->MessageType()) { ! case CMessage::CTRL_LCLICK: { TIntMessage* pCtrlMessage = dynamic_cast<TIntMessage*>(pMessage); --- 208,212 ---- switch(pMessage->MessageType()) { ! case CMessage::CTRL_SINGLELCLICK: { TIntMessage* pCtrlMessage = dynamic_cast<TIntMessage*>(pMessage); |
From: Rob W. <gre...@us...> - 2005-01-07 22:08:49
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26926/src Modified Files: wg_button.cpp wg_checkbox.cpp wg_dropdown.cpp wg_frame.cpp wg_menu.cpp wg_message_server.cpp wg_messagebox.cpp wg_scrollbar.cpp wg_toolbar.cpp wg_view.cpp Log Message: Work on the message box. Changed the single click message types to include the word SINGLE. Index: wg_view.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_view.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** wg_view.cpp 16 Jul 2004 16:41:36 -0000 1.42 --- wg_view.cpp 7 Jan 2005 22:08:38 -0000 1.43 *************** *** 30,33 **** --- 30,34 ---- #include "wg_message_server.h" #include "wg_application.h" + #include "wg_frame.h" #include "std_ex.h" *************** *** 54,57 **** --- 55,59 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::APP_PAINT); + CMessageServer::Instance().RegisterMessageClient(this, CMessage::APP_DESTROY_FRAME, CMessageServer::PRIORITY_FIRST); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_RESIZE); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONDOWN, CMessageServer::PRIORITY_FIRST); *************** *** 155,158 **** --- 157,173 ---- } break; + case CMessage::APP_DESTROY_FRAME: + if (pMessage->Destination() == this || pMessage->Destination() == 0) + { + CFrame* pFrame = dynamic_cast<CFrame*>(const_cast<CMessageClient*>(pMessage->Source())); + if (pFrame) + { + pFrame->SetNewParent(0); + CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); + delete pFrame; + } + bHandled = true; + } + break; case CMessage::CTRL_RESIZE: { Index: wg_messagebox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_messagebox.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wg_messagebox.cpp 5 Jan 2005 21:09:32 -0000 1.6 --- wg_messagebox.cpp 7 Jan 2005 22:08:38 -0000 1.7 *************** *** 66,70 **** switch(pMessage->MessageType()) { ! case CMessage::CTRL_LCLICK: { if (pMessage->Destination() == this) --- 66,70 ---- switch(pMessage->MessageType()) { ! case CMessage::CTRL_SINGLELCLICK: { if (pMessage->Destination() == this) Index: wg_dropdown.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_dropdown.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** wg_dropdown.cpp 16 Jul 2004 16:41:36 -0000 1.26 --- wg_dropdown.cpp 7 Jan 2005 22:08:38 -0000 1.27 *************** *** 54,58 **** this, CwgBitmapResourceHandle(WGRES_DOWN_ARROW_BITMAP)); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONDOWN); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_VALUECHANGE); Draw(); --- 54,58 ---- this, CwgBitmapResourceHandle(WGRES_DOWN_ARROW_BITMAP)); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONDOWN); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_VALUECHANGE); Draw(); *************** *** 125,129 **** break; } ! case CMessage::CTRL_LCLICK: { if (pMessage->Destination() == this) --- 125,129 ---- break; } ! case CMessage::CTRL_SINGLELCLICK: { if (pMessage->Destination() == this) Index: wg_checkbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_checkbox.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wg_checkbox.cpp 12 Dec 2004 09:08:18 -0000 1.24 --- wg_checkbox.cpp 7 Jan 2005 22:08:38 -0000 1.25 *************** *** 38,42 **** m_BackgroundColor = COLOR_WHITE; CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); Draw(); } --- 38,42 ---- m_BackgroundColor = COLOR_WHITE; CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); Draw(); } *************** *** 111,121 **** { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_LCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_RCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_MCLICK; break; } --- 111,121 ---- { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_SINGLELCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_SINGLERCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_SINGLEMCLICK; break; } *************** *** 147,151 **** break; } ! case CMessage::CTRL_LCLICK: if (pMessage->Destination() == this) { --- 147,151 ---- break; } ! case CMessage::CTRL_SINGLELCLICK: if (pMessage->Destination() == this) { Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** wg_scrollbar.cpp 12 Dec 2004 09:08:19 -0000 1.44 --- wg_scrollbar.cpp 7 Jan 2005 22:08:38 -0000 1.45 *************** *** 68,72 **** CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); Draw(); } --- 68,72 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); Draw(); } *************** *** 235,239 **** } break; ! case CMessage::CTRL_LCLICK: { if (pMessage->Destination() == this) --- 235,239 ---- } break; ! case CMessage::CTRL_SINGLELCLICK: { if (pMessage->Destination() == this) Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** wg_menu.cpp 12 Dec 2004 09:08:19 -0000 1.55 --- wg_menu.cpp 7 Jan 2005 22:08:38 -0000 1.56 *************** *** 59,63 **** CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_TIMER); --- 59,63 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_TIMER); *************** *** 165,169 **** break; } ! case CMessage::CTRL_LCLICK: { TIntMessage* pCtrlMessage = dynamic_cast<TIntMessage*>(pMessage); --- 165,169 ---- break; } ! case CMessage::CTRL_SINGLELCLICK: { TIntMessage* pCtrlMessage = dynamic_cast<TIntMessage*>(pMessage); *************** *** 174,178 **** if (pCtrlMessage->Source() == iter->first.pPopup) { ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_LCLICK, m_pParentWindow, this, pCtrlMessage->Value())); bHandled = true; --- 174,178 ---- if (pCtrlMessage->Source() == iter->first.pPopup) { ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, m_pParentWindow, this, pCtrlMessage->Value())); bHandled = true; *************** *** 282,286 **** else { ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_LCLICK, m_pParentWindow, this, iter->first.iItemId)); } break; --- 282,286 ---- else { ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, m_pParentWindow, this, iter->first.iItemId)); } break; *************** *** 607,611 **** pDestination = m_pParentMenu; } ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_LCLICK, pDestination, this, iter->first.iItemId)); HideAll(); } --- 607,611 ---- pDestination = m_pParentMenu; } ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, pDestination, this, iter->first.iItemId)); HideAll(); } Index: wg_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_button.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** wg_button.cpp 12 Dec 2004 09:08:18 -0000 1.40 --- wg_button.cpp 7 Jan 2005 22:08:38 -0000 1.41 *************** *** 151,161 **** { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_LCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_RCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_MCLICK; break; } --- 151,161 ---- { case CMouseMessage::LEFT: ! MessageType = CMessage::CTRL_SINGLELCLICK; break; case CMouseMessage::RIGHT: ! MessageType = CMessage::CTRL_SINGLERCLICK; break; case CMouseMessage::MIDDLE: ! MessageType = CMessage::CTRL_SINGLEMCLICK; break; } Index: wg_message_server.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_message_server.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** wg_message_server.cpp 12 Dec 2004 19:45:06 -0000 1.29 --- wg_message_server.cpp 7 Jan 2005 22:08:38 -0000 1.30 *************** *** 142,148 **** if (iter->second.second) { ! iter->second.second = false; ! bFinished = iter->second.first->HandleMessage(pMessage); ! break; } } --- 142,148 ---- if (iter->second.second) { ! iter->second.second = false; ! bFinished = iter->second.first->HandleMessage(pMessage); ! break; } } Index: wg_toolbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_toolbar.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wg_toolbar.cpp 16 Jul 2004 16:41:36 -0000 1.16 --- wg_toolbar.cpp 7 Jan 2005 22:08:38 -0000 1.17 *************** *** 36,40 **** { m_BackgroundColor = COLOR_LIGHTGRAY; ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); Draw(); } --- 36,40 ---- { m_BackgroundColor = COLOR_LIGHTGRAY; ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); Draw(); } *************** *** 144,148 **** switch(pMessage->MessageType()) { ! case CMessage::CTRL_LCLICK: { if (pMessage->Destination() == this) --- 144,148 ---- switch(pMessage->MessageType()) { ! case CMessage::CTRL_SINGLELCLICK: { if (pMessage->Destination() == this) *************** *** 156,160 **** } } ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_LCLICK, m_pParentWindow, this, iButtonID)); bHandled = true; } --- 156,160 ---- } } ! CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_SINGLELCLICK, m_pParentWindow, this, iButtonID)); bHandled = true; } Index: wg_frame.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_frame.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** wg_frame.cpp 5 Jan 2005 21:09:32 -0000 1.28 --- wg_frame.cpp 7 Jan 2005 22:08:38 -0000 1.29 *************** *** 60,64 **** CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); } --- 60,64 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); } *************** *** 72,79 **** 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; } --- 72,76 ---- void CFrame::CloseFrame(void) { ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_DESTROY_FRAME, 0, this)); } *************** *** 249,253 **** break; } ! case CMessage::CTRL_LCLICK: { if (pMessage->Destination() == this) --- 246,250 ---- break; } ! case CMessage::CTRL_SINGLELCLICK: { if (pMessage->Destination() == this) |
From: Rob W. <gre...@us...> - 2005-01-07 22:08:49
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26926/includes Modified Files: wg_checkbox.h wg_menu.h wg_message.h wg_messagebox.h wg_toolbar.h Log Message: Work on the message box. Changed the single click message types to include the word SINGLE. Index: wg_toolbar.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_toolbar.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wg_toolbar.h 3 Jun 2004 19:10:52 -0000 1.14 --- wg_toolbar.h 7 Jan 2005 22:08:38 -0000 1.15 *************** *** 52,56 **** //! Add a button to the toolbar //! The toolbar will become the button's parent ! //! The toolbar will catch all CTRL_LCLICK messages from the buttons and will post a CTRL_LCLICK message from the toolbar with the iButtonID value as the iNewValue //! \param pButton A pointer to the button to be inserted, inserts a spacer if this is NULL //! \param iButtonID An identifier that the toolbar will return when a button is clicked on, defaults to 0 --- 52,56 ---- //! Add a button to the toolbar //! The toolbar will become the button's parent ! //! The toolbar will catch all CTRL_SINGLELCLICK messages from the buttons and will post a CTRL_SINGLELCLICK message from the toolbar with the iButtonID value as the iNewValue //! \param pButton A pointer to the button to be inserted, inserts a spacer if this is NULL //! \param iButtonID An identifier that the toolbar will return when a button is clicked on, defaults to 0 *************** *** 60,64 **** //! Add a button to the end of toolbar //! The toolbar will become the button's parent ! //! The toolbar will catch all CTRL_LCLICK messages from the buttons and will post a CTRL_LCLICK message from the toolbar with the iButtonID value as the iNewValue //! \param pButton A pointer to the button to be inserted, inserts a spacer if this is NULL //! \param iButtonID An identifier that the toolbar will return when a button is clicked on, defaults to 0 --- 60,64 ---- //! Add a button to the end of toolbar //! The toolbar will become the button's parent ! //! The toolbar will catch all CTRL_SINGLELCLICK messages from the buttons and will post a CTRL_SINGLELCLICK message from the toolbar with the iButtonID value as the iNewValue //! \param pButton A pointer to the button to be inserted, inserts a spacer if this is NULL //! \param iButtonID An identifier that the toolbar will return when a button is clicked on, defaults to 0 *************** *** 93,97 **** // CMessageClient overrides ! //! CToolBars handle CTRL_LCLICK messages //! \param pMessage A pointer to the message virtual bool HandleMessage(CMessage* pMessage); --- 93,97 ---- // CMessageClient overrides ! //! CToolBars handle CTRL_SINGLELCLICK messages //! \param pMessage A pointer to the message virtual bool HandleMessage(CMessage* pMessage); Index: wg_message.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_message.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** wg_message.h 27 Dec 2004 04:59:36 -0000 1.31 --- wg_message.h 7 Jan 2005 22:08:38 -0000 1.32 *************** *** 49,52 **** --- 49,70 ---- { UNKNOWN = 0, //!< An unknown message, this is not a valid type + APP_DESTROY_FRAME, //!< CMessage used to delete frame objects, where Source() is the frame that is to be deleted, Destination() should be 0 + APP_EXIT, //!< CMessage used to tell controls or windows that the application is closing + APP_PAINT, //!< CMessage used to tell controls or windows to redraw themselves + CTRL_DOUBLELCLICK, //!< TIntMessage generated when a control is double clicked with the left mouse button + CTRL_DOUBLEMCLICK, //!< TIntMessage generated when a control is double clicked with the middle mouse button + CTRL_DOUBLERCLICK, //!< TIntMessage generated when a control is double clicked with the right mouse button + CTRL_GAININGKEYFOCUS, //!< CMessage used to tell a control that it's getting the keyboard focus + CTRL_GAININGMOUSEFOCUS, //!< CMessage used to tell a control that it's getting the mouse focus + CTRL_LOSINGKEYFOCUS, //!< CMessage used to tell a control that it's losing the keyboard focus + CTRL_LOSINGMOUSEFOCUS, //!< CMessage used to tell a control that it's losing the mouse focus + CTRL_MESSAGEBOXRETURN, //!< CValueMessage sent when a CMessageBox closes + CTRL_RESIZE, //!< TPointMessage used to tell the app that the view has been resized + CTRL_SINGLELCLICK, //!< TIntMessage generated when a control is clicked on with the left mouse button + CTRL_SINGLEMCLICK, //!< TIntMessage generated when a control is clicked on with the middle mouse button + CTRL_SINGLERCLICK, //!< TIntMessage generated when a control is clicked on with the right mouse button + CTRL_TIMER, //!< TIntMessage used to tell when a timer has expired, where Value() is the count of times fired + CTRL_VALUECHANGE, //!< CValueMessage generated when a control's text or value is changed via user input + CTRL_VALUECHANGING, //!< CValueMessage generated when a control's text or value is in the process of changing via user input KEYBOARD_KEYDOWN, //!< CKeyboardMessage generated when a keyboard key is pressed KEYBOARD_KEYUP, //!< CKeyboardMessage generated when a keyboard key is released *************** *** 54,74 **** MOUSE_BUTTONUP, //!< CMouseMessage generated when a mouse button is released MOUSE_MOVE, //!< CMouseMessage generated when a mouse is moved - CTRL_LCLICK, //!< TIntMessage generated when a control is clicked on with the left mouse button - CTRL_RCLICK, //!< TIntMessage generated when a control is clicked on with the right mouse button - CTRL_MCLICK, //!< TIntMessage generated when a control is clicked on with the middle mouse button - CTRL_DOUBLELCLICK, //!< TIntMessage generated when a control is double clicked with the left mouse button - CTRL_DOUBLERCLICK, //!< TIntMessage generated when a control is double clicked with the right mouse button - CTRL_DOUBLEMCLICK, //!< TIntMessage generated when a control is double clicked with the middle mouse button - CTRL_VALUECHANGE, //!< CValueMessage generated when a control's text or value is changed via user input - CTRL_VALUECHANGING, //!< CValueMessage generated when a control's text or value is in the process of changing via user input - CTRL_RESIZE, //!< TPointMessage used to tell the app that the view has been resized - CTRL_TIMER, //!< TIntMessage used to tell when a timer has expired, where Value() is the count of times fired - CTRL_GAININGKEYFOCUS, //!< CMessage used to tell a control that it's getting the keyboard focus - CTRL_LOSINGKEYFOCUS, //!< CMessage used to tell a control that it's losing the keyboard focus - CTRL_GAININGMOUSEFOCUS, //!< CMessage used to tell a control that it's getting the mouse focus - CTRL_LOSINGMOUSEFOCUS, //!< CMessage used to tell a control that it's losing the mouse focus - CTRL_MESSAGEBOXRETURN, //!< CValueMessage sent when a CMessageBox closes - APP_PAINT, //!< CMessage used to tell controls or windows to redraw themselves - APP_EXIT, //!< CMessage used to tell controls or windows that the application is closing SDL, //!< An unhandled SDL event USER //!< Any user defined messages of type CUserMessage --- 72,75 ---- Index: wg_checkbox.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_checkbox.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wg_checkbox.h 3 Jun 2004 19:10:52 -0000 1.15 --- wg_checkbox.h 7 Jan 2005 22:08:38 -0000 1.16 *************** *** 86,90 **** // CMessageClient overrides ! //! CCheckBoxes handle MOUSE_BUTTONDOWN, MOUSE_BUTTONUP, and it's own CTRL_LCLICK messages //! \param pMessage A pointer to the message virtual bool HandleMessage(CMessage* pMessage); --- 86,90 ---- // CMessageClient overrides ! //! CCheckBoxes handle MOUSE_BUTTONDOWN, MOUSE_BUTTONUP, and it's own CTRL_SINGLELCLICK messages //! \param pMessage A pointer to the message virtual bool HandleMessage(CMessage* pMessage); Index: wg_messagebox.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_messagebox.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wg_messagebox.h 27 Dec 2004 22:59:34 -0000 1.5 --- wg_messagebox.h 7 Jan 2005 22:08:38 -0000 1.6 *************** *** 37,41 **** { public: - //! \param WindowRect A CRect that defines the outer limits of the control //! \param pParent A pointer to the parent view //! \param pFontEngine A pointer to the font engine to use when drawing the control --- 37,40 ---- Index: wg_menu.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_menu.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** wg_menu.h 9 Jul 2004 16:46:40 -0000 1.35 --- wg_menu.h 7 Jan 2005 22:08:38 -0000 1.36 *************** *** 48,52 **** //! Constructs a new Menu Item //! \param sItemText The text to display for the menu item ! //! \param iItemId An identifier for the menu item, which gets returned in the CTRL_LCLICK message //! \param pPopup A pointer to a popup menu, if the menu item is actually a submenu, this should be 0 if the item isn't a submenu (defaults to 0) SMenuItem(std::string sItemText, long int iItemId = 0, CPopupMenu* pPopup = 0) : --- 48,52 ---- //! Constructs a new Menu Item //! \param sItemText The text to display for the menu item ! //! \param iItemId An identifier for the menu item, which gets returned in the CTRL_SINGLELCLICK message //! \param pPopup A pointer to a popup menu, if the menu item is actually a submenu, this should be 0 if the item isn't a submenu (defaults to 0) SMenuItem(std::string sItemText, long int iItemId = 0, CPopupMenu* pPopup = 0) : *************** *** 57,61 **** std::string sItemText; //!< The caption to display for the menu item ! long int iItemId; //!< An identifier for the menu item, which gets returned in the CTRL_LCLICK message CPopupMenu* pPopup; //!< A pointer to a popup menu, if the menu item is actually a submenu bool bSpacer; //!< Indicates if this is a spacer. If true, pPopup, iItemId and sItemText are ignored. --- 57,61 ---- std::string sItemText; //!< The caption to display for the menu item ! long int iItemId; //!< An identifier for the menu item, which gets returned in the CTRL_SINGLELCLICK message CPopupMenu* pPopup; //!< A pointer to a popup menu, if the menu item is actually a submenu bool bSpacer; //!< Indicates if this is a spacer. If true, pPopup, iItemId and sItemText are ignored. *************** *** 66,70 **** //! The CMenuBase is the base class for CMenus and CPopupMenus, and shouldn't be instantiated itself ! //! Menus will generate CTRL_LCLICK messages when a menu item is selected class CMenuBase : public CWindow --- 66,70 ---- //! The CMenuBase is the base class for CMenus and CPopupMenus, and shouldn't be instantiated itself ! //! Menus will generate CTRL_SINGLELCLICK messages when a menu item is selected class CMenuBase : public CWindow |
From: Rob W. <gre...@us...> - 2005-01-07 22:08:49
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26926/tests Modified Files: CalcApp.cpp ConfigEditor.cpp MessagingTest.cpp Notepad.cpp TestView1.cpp TestView2.cpp Log Message: Work on the message box. Changed the single click message types to include the word SINGLE. Index: ConfigEditor.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/ConfigEditor.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ConfigEditor.cpp 25 Jun 2004 19:37:51 -0000 1.5 --- ConfigEditor.cpp 7 Jan 2005 22:08:39 -0000 1.6 *************** *** 136,140 **** m_pStatusLabel = new CLabel(CRect(5, 325, 290, 345), this, "Status: Select a configuration level to edit."); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_VALUECHANGE); --- 136,140 ---- m_pStatusLabel = new CLabel(CRect(5, 325, 290, 345), this, "Status: Select a configuration level to edit."); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_VALUECHANGE); *************** *** 191,195 **** } } ! case CMessage::CTRL_LCLICK: { if (pMessage->Destination() == this) --- 191,195 ---- } } ! case CMessage::CTRL_SINGLELCLICK: { if (pMessage->Destination() == this) Index: MessagingTest.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/MessagingTest.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MessagingTest.cpp 25 Jun 2004 19:37:51 -0000 1.5 --- MessagingTest.cpp 7 Jan 2005 22:08:39 -0000 1.6 *************** *** 111,115 **** } ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); // queue the test message --- 111,115 ---- } ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); // queue the test message *************** *** 127,131 **** switch (pMessage->MessageType()) { ! case CMessage::CTRL_LCLICK: { if (pMessage->Destination() == this) --- 127,131 ---- switch (pMessage->MessageType()) { ! case CMessage::CTRL_SINGLELCLICK: { if (pMessage->Destination() == this) Index: Notepad.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/Notepad.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Notepad.cpp 21 Jul 2004 18:38:24 -0000 1.5 --- Notepad.cpp 7 Jan 2005 22:08:39 -0000 1.6 *************** *** 87,91 **** SetWindowText(std::string("Notepad - wGui version ") + wGui::CwgStringResourceHandle(wGui::WGRES_VERSION_STRING).String()); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_RESIZE); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); AttachMenu(new CMenu(CRect(0, 0, 80, 22), this)); --- 87,91 ---- SetWindowText(std::string("Notepad - wGui version ") + wGui::CwgStringResourceHandle(wGui::WGRES_VERSION_STRING).String()); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_RESIZE); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_SINGLELCLICK); AttachMenu(new CMenu(CRect(0, 0, 80, 22), this)); *************** *** 119,123 **** switch (pMessage->MessageType()) { ! case CMessage::CTRL_LCLICK: { TIntMessage* pCtrlMessage = dynamic_cast<TIntMessage*>(pMessage); --- 119,123 ---- switch (pMessage->MessageType()) { ! case CMessage::CTRL_SINGLELCLICK: { TIntMessage* pCtrlMessage = dynamic_cast<TIntMessage*>(pMessage); Index: TestView2.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView2.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TestView2.cpp 5 Jan 2005 21:09:33 -0000 1.13 --- TestView2.cpp 7 Jan 2005 22:08:39 -0000 1.14 *************** *** 35,39 **** m_pExitButton = new wGui::CButton(ClientToView(wGui::CRect(20, 80, 160, 100)), this, "Exit"); ! wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_LCLICK); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_MESSAGEBOXRETURN); } --- 35,39 ---- m_pExitButton = new wGui::CButton(ClientToView(wGui::CRect(20, 80, 160, 100)), this, "Exit"); ! wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_SINGLELCLICK); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_MESSAGEBOXRETURN); } *************** *** 48,52 **** switch (pMessage->MessageType()) { ! case wGui::CMessage::CTRL_LCLICK: { if (pMessage->Destination() == this) --- 48,52 ---- switch (pMessage->MessageType()) { ! case wGui::CMessage::CTRL_SINGLELCLICK: { if (pMessage->Destination() == this) Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** TestView1.cpp 27 Dec 2004 04:59:36 -0000 1.79 --- TestView1.cpp 7 Jan 2005 22:08:39 -0000 1.80 *************** *** 67,72 **** SetWindowText(std::string("Test App 1 - wGui version ") + wGui::CwgStringResourceHandle(wGui::WGRES_VERSION_STRING).String()); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_VALUECHANGE); ! wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_LCLICK); ! wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_RCLICK); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_RESIZE); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_TIMER); --- 67,72 ---- SetWindowText(std::string("Test App 1 - wGui version ") + wGui::CwgStringResourceHandle(wGui::WGRES_VERSION_STRING).String()); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_VALUECHANGE); ! wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_SINGLELCLICK); ! wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_SINGLERCLICK); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_RESIZE); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_TIMER); *************** *** 239,243 **** break; } ! case wGui::CMessage::CTRL_LCLICK: { wGui::TIntMessage* pCtrlMessage = dynamic_cast<wGui::TIntMessage*>(pMessage); --- 239,243 ---- break; } ! case wGui::CMessage::CTRL_SINGLELCLICK: { wGui::TIntMessage* pCtrlMessage = dynamic_cast<wGui::TIntMessage*>(pMessage); *************** *** 356,360 **** break; } ! case wGui::CMessage::CTRL_RCLICK: { if (pMessage && pMessage->Destination() == this) --- 356,360 ---- break; } ! case wGui::CMessage::CTRL_SINGLERCLICK: { if (pMessage && pMessage->Destination() == this) Index: CalcApp.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/CalcApp.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** CalcApp.cpp 2 Apr 2004 17:26:16 -0000 1.26 --- CalcApp.cpp 7 Jan 2005 22:08:39 -0000 1.27 *************** *** 86,90 **** { SetWindowText(std::string("wGui Calculator - wGui version ") + wGui::CwgStringResourceHandle(wGui::WGRES_VERSION_STRING).String()); ! wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_LCLICK); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::KEYBOARD_KEYDOWN); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::KEYBOARD_KEYUP); --- 86,90 ---- { SetWindowText(std::string("wGui Calculator - wGui version ") + wGui::CwgStringResourceHandle(wGui::WGRES_VERSION_STRING).String()); ! wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_SINGLELCLICK); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::KEYBOARD_KEYDOWN); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::KEYBOARD_KEYUP); *************** *** 118,122 **** switch (pMessage->MessageType()) { ! case wGui::CMessage::CTRL_LCLICK: if (pMessage->Destination() == this) { --- 118,122 ---- switch (pMessage->MessageType()) { ! case wGui::CMessage::CTRL_SINGLELCLICK: if (pMessage->Destination() == this) { |
From: Rob W. <gre...@us...> - 2005-01-07 22:08:48
|
Update of /cvsroot/wgui/wgui/wgui_ex/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26926/wgui_ex/includes Modified Files: wgex_bufferdisplay.h Log Message: Work on the message box. Changed the single click message types to include the word SINGLE. Index: wgex_bufferdisplay.h =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/includes/wgex_bufferdisplay.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wgex_bufferdisplay.h 26 Feb 2004 17:00:35 -0000 1.5 --- wgex_bufferdisplay.h 7 Jan 2005 22:08:39 -0000 1.6 *************** *** 67,71 **** // CMessageClient overrides ! //! CControl handle MOUSE_BUTTONDOWN, MOUSE_BUTTONUP, and it's own CTRL_LCLICK messages //! \param pMessage A pointer to the message virtual bool HandleMessage( CMessage* pMessage ); --- 67,71 ---- // CMessageClient overrides ! //! CControl handle MOUSE_BUTTONDOWN, MOUSE_BUTTONUP, and it's own CTRL_SINGLELCLICK messages //! \param pMessage A pointer to the message virtual bool HandleMessage( CMessage* pMessage ); |
From: Rob W. <gre...@us...> - 2005-01-05 21:09:44
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25490/tests Modified Files: TestView2.cpp Log Message: Work on the message box. Index: TestView2.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView2.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TestView2.cpp 27 Dec 2004 22:59:35 -0000 1.12 --- TestView2.cpp 5 Jan 2005 21:09:33 -0000 1.13 *************** *** 36,39 **** --- 36,40 ---- wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_LCLICK); + wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_MESSAGEBOXRETURN); } *************** *** 59,63 **** else if (pMessage->Source() == m_pShowMessageBoxButton) { ! new wGui::CMessageBox(this, 0, "Test MessageBox", "This is a message box.", wGui::CMessageBox::BUTTON_OK | wGui::CMessageBox::BUTTON_CANCEL); wGui::CMessageServer::Instance().QueueMessage(new wGui::CMessage(wGui::CMessage::APP_PAINT, 0, this)); bHandled = true; --- 60,64 ---- else if (pMessage->Source() == m_pShowMessageBoxButton) { ! new wGui::CMessageBox(this, 0, "Test MessageBox", "This is a message box. Do you want to see another?", wGui::CMessageBox::BUTTON_YES | wGui::CMessageBox::BUTTON_NO); wGui::CMessageServer::Instance().QueueMessage(new wGui::CMessage(wGui::CMessage::APP_PAINT, 0, this)); bHandled = true; *************** *** 69,72 **** --- 70,86 ---- } } + 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.", wGui::CMessageBox::BUTTON_OK); + } + bHandled = true; + } + break; } default: |