wgui-cvs Mailing List for wGui (Page 4)
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...> - 2004-09-01 18:57:40
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14753/includes Modified Files: wg_editbox.h Log Message: Fixed a small bug in the drag selection for edit boxes. Index: wg_editbox.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_editbox.h,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** wg_editbox.h 3 Jun 2004 19:10:52 -0000 1.55 --- wg_editbox.h 1 Sep 2004 18:57:31 -0000 1.56 *************** *** 87,90 **** --- 87,95 ---- virtual int GetSelectionLength(void) const { return m_SelLength; } + //! Gets a character index from a point + //! \param Point The point (in window coordinates) + //! \return The index (in characters) of the point in the string + virtual std::string::size_type GetIndexFromPoint(const CPoint& Point) const; + // CWindow overrides |
|
From: Rob W. <gre...@us...> - 2004-09-01 18:57:39
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14753 Modified Files: CHANGES Log Message: Fixed a small bug in the drag selection for edit boxes. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** CHANGES 19 Jul 2004 21:49:55 -0000 1.151 --- CHANGES 1 Sep 2004 18:57:30 -0000 1.152 *************** *** 1,4 **** --- 1,5 ---- 0.3.3 -> 0.4.0 + Added CDropDown: SetListboxHeight() which allows the height of the drop list to be changed + + Added CEditBox: GetIndexFromPoint() which returns the character index in a edit box for a point specified in window coordinates + Added CRect: SizeRect() which returns a CRect the same size as the Rect, but with a top left coordinate of (0, 0) + Added CWindow: HitTest() which performs a simple hit test to see if a point lies within the window or any of it's children |
|
From: Rob W. <gre...@us...> - 2004-08-03 20:11:10
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1611/tests Modified Files: TestView1.cpp Log Message: kinda fixes a crash bug in the menus for the testapp. Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** TestView1.cpp 3 Aug 2004 15:03:26 -0000 1.75 --- TestView1.cpp 3 Aug 2004 20:11:01 -0000 1.76 *************** *** 157,161 **** m_pContextMenu->InsertMenuItem(wGui::SMenuItem("Menu Item 1")); m_pContextMenu->InsertMenuItem(wGui::SMenuItem("Menu Item 2")); - m_pContextMenu->InsertMenuItem(wGui::SMenuItem("Menu Item 3")); pContextSubmenu = new wGui::CPopupMenu(wGui::CRect(0, 0, 80, 50), m_pContextMenu); pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Clear", CLEAR_EDIT_BOX_1)); --- 157,160 ---- *************** *** 169,177 **** m_pContextMenu->InsertMenuItem(wGui::SMenuItem("Empty submenu", 0, pContextSubmenu)); wGui::CPopupMenu* pContextSubmenu2 = new wGui::CPopupMenu(wGui::CRect(0, 0, 140, 50), pContextSubmenu); ! pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Empty submenu", 0, pContextSubmenu2)); wGui::CPopupMenu* pContextSubmenu3 = new wGui::CPopupMenu(wGui::CRect(0, 0, 140, 50), pContextSubmenu2); ! pContextSubmenu2->InsertMenuItem(wGui::SMenuItem("Empty submenu", 0, pContextSubmenu3)); wGui::CPopupMenu* pContextSubmenu4 = new wGui::CPopupMenu(wGui::CRect(0, 0, 140, 50), pContextSubmenu3); ! pContextSubmenu3->InsertMenuItem(wGui::SMenuItem("Empty submenu", 0, pContextSubmenu4)); m_pDropDown = new wGui::CDropDown(wGui::CRect(10, 55, 205, 73), m_pGroupBox); --- 168,176 ---- m_pContextMenu->InsertMenuItem(wGui::SMenuItem("Empty submenu", 0, pContextSubmenu)); wGui::CPopupMenu* pContextSubmenu2 = new wGui::CPopupMenu(wGui::CRect(0, 0, 140, 50), pContextSubmenu); ! pContextSubmenu->InsertMenuItem(wGui::SMenuItem("Empty submenu 1", 0, pContextSubmenu2)); wGui::CPopupMenu* pContextSubmenu3 = new wGui::CPopupMenu(wGui::CRect(0, 0, 140, 50), pContextSubmenu2); ! pContextSubmenu2->InsertMenuItem(wGui::SMenuItem("Empty submenu 2", 0, pContextSubmenu3)); 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); |
|
From: Rob W. <gre...@us...> - 2004-08-03 20:11:09
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1611/src Modified Files: wg_textbox.cpp Log Message: kinda fixes a crash bug in the menus for the testapp. Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** wg_textbox.cpp 3 Aug 2004 15:30:16 -0000 1.29 --- wg_textbox.cpp 3 Aug 2004 20:11:01 -0000 1.30 *************** *** 279,284 **** m_ClientRect = m_WindowRect.SizeRect(); m_ClientRect.Grow(-3); - // m_pVerticalScrollBar->SetWindowRect(CRect(m_ClientRect.Right() - 12, -m_ClientRect.Top(), m_ClientRect.Right(), m_ClientRect.Bottom() - 12)); - // m_pHorizontalScrollBar->SetWindowRect(CRect(-m_ClientRect.Left(), m_ClientRect.Bottom() - 12, m_ClientRect.Right() - 12, m_ClientRect.Bottom())); UpdateScrollBars(); } --- 279,282 ---- |
|
From: Rob W. <gre...@us...> - 2004-08-03 15:30:27
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9104/src Modified Files: wg_textbox.cpp Log Message: Fixed scrollbar layout in textboxes. Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** wg_textbox.cpp 23 Jul 2004 14:46:00 -0000 1.28 --- wg_textbox.cpp 3 Aug 2004 15:30:16 -0000 1.29 *************** *** 67,73 **** m_ClientRect.Grow(-3); m_pVerticalScrollBar = new CScrollBar( ! CRect(m_WindowRect.Width() - 12, 0, m_WindowRect.Width(), m_WindowRect.Height() - 12) - m_ClientRect.TopLeft(), this, CScrollBar::VERTICAL), m_pHorizontalScrollBar = new CScrollBar( ! CRect(0, m_WindowRect.Height() - 12, m_WindowRect.Width() - 12, m_WindowRect.Height()) - m_ClientRect.TopLeft(), this, CScrollBar::HORIZONTAL), m_ScrollBarVisibilityMap[CScrollBar::VERTICAL] = SCROLLBAR_VIS_AUTO; m_ScrollBarVisibilityMap[CScrollBar::HORIZONTAL] = SCROLLBAR_VIS_AUTO; --- 67,73 ---- m_ClientRect.Grow(-3); m_pVerticalScrollBar = new CScrollBar( ! CRect(m_WindowRect.Width() - 12, 1, m_WindowRect.Width(), m_WindowRect.Height() - 12) - m_ClientRect.TopLeft(), this, CScrollBar::VERTICAL), m_pHorizontalScrollBar = new CScrollBar( ! CRect(1, m_WindowRect.Height() - 12, m_WindowRect.Width() - 12, m_WindowRect.Height()) - m_ClientRect.TopLeft(), this, CScrollBar::HORIZONTAL), m_ScrollBarVisibilityMap[CScrollBar::VERTICAL] = SCROLLBAR_VIS_AUTO; m_ScrollBarVisibilityMap[CScrollBar::HORIZONTAL] = SCROLLBAR_VIS_AUTO; *************** *** 278,284 **** CWindow::SetWindowRect(WindowRect); m_ClientRect = m_WindowRect.SizeRect(); ! m_ClientRect.Grow(-1); ! m_pVerticalScrollBar->SetWindowRect(CRect(m_ClientRect.Right() - 12, m_ClientRect.Top(), m_ClientRect.Right(), m_ClientRect.Bottom() - 12)); ! m_pHorizontalScrollBar->SetWindowRect(CRect(m_ClientRect.Left(), m_ClientRect.Bottom() - 12, m_ClientRect.Right() - 12, m_ClientRect.Bottom())); UpdateScrollBars(); } --- 278,284 ---- CWindow::SetWindowRect(WindowRect); m_ClientRect = m_WindowRect.SizeRect(); ! m_ClientRect.Grow(-3); ! // m_pVerticalScrollBar->SetWindowRect(CRect(m_ClientRect.Right() - 12, -m_ClientRect.Top(), m_ClientRect.Right(), m_ClientRect.Bottom() - 12)); ! // m_pHorizontalScrollBar->SetWindowRect(CRect(-m_ClientRect.Left(), m_ClientRect.Bottom() - 12, m_ClientRect.Right() - 12, m_ClientRect.Bottom())); UpdateScrollBars(); } *************** *** 899,903 **** m_pVerticalScrollBar->SetValue(iLastLine); } ! m_pVerticalScrollBar->SetWindowRect(CRect(m_ClientRect.Width() + 2, 0, m_ClientRect.Width() + 14, m_ClientRect.Height())); m_pHorizontalScrollBar->SetMaxLimit(iMaxHorzLimit); if (m_pHorizontalScrollBar->GetValue() > iMaxHorzLimit) --- 899,903 ---- m_pVerticalScrollBar->SetValue(iLastLine); } ! m_pVerticalScrollBar->SetWindowRect(CRect(m_ClientRect.Width() + 2, 1 - m_ClientRect.Top(), m_ClientRect.Width() + 14, m_ClientRect.Height())); m_pHorizontalScrollBar->SetMaxLimit(iMaxHorzLimit); if (m_pHorizontalScrollBar->GetValue() > iMaxHorzLimit) *************** *** 905,909 **** m_pHorizontalScrollBar->SetValue(iMaxHorzLimit); } ! m_pHorizontalScrollBar->SetWindowRect(CRect(0, m_ClientRect.Height() + 2, m_ClientRect.Width(), m_ClientRect.Height() + 14)); } --- 905,909 ---- m_pHorizontalScrollBar->SetValue(iMaxHorzLimit); } ! m_pHorizontalScrollBar->SetWindowRect(CRect(1 - m_ClientRect.Left(), m_ClientRect.Height() + 2, m_ClientRect.Width(), m_ClientRect.Height() + 14)); } |
|
From: Rob W. <gre...@us...> - 2004-08-03 15:03:36
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3530/src Modified Files: wg_application.cpp wg_scrollbar.cpp wg_window.cpp Log Message: Fixed resizing bug in TestApp1 Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** wg_window.cpp 19 Jul 2004 21:49:58 -0000 1.52 --- wg_window.cpp 3 Aug 2004 15:03:26 -0000 1.53 *************** *** 83,86 **** --- 83,90 ---- m_pSDLSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), 32, 0x000000FF, 0x0000FF00, 0x00FF0000, /*0xFF000000*/ 0); + if (!m_pSDLSurface) + { + CApplication::Instance()->GetApplicationLog().AddLogEntry(std::string("SDL Unable To Create Surface: ") + SDL_GetError(), APP_LOG_ERROR); + } m_ClientRect = CRect(stdex::safe_static_cast<int>(m_ClientRect.Left() * dHorizontalScale), stdex::safe_static_cast<int>(m_ClientRect.Top() * dVerticalScale), stdex::safe_static_cast<int>(m_ClientRect.Right() * dHorizontalScale), stdex::safe_static_cast<int>(m_ClientRect.Bottom() * dVerticalScale)); Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** wg_scrollbar.cpp 21 Jul 2004 18:38:23 -0000 1.42 --- wg_scrollbar.cpp 3 Aug 2004 15:03:26 -0000 1.43 *************** *** 111,115 **** CWindow::SetWindowRect(WindowRect); // Resposition the thumb rect and the button controls - SetValue(m_Value); switch (m_ScrollBarType) { --- 111,114 ---- *************** *** 132,135 **** --- 131,135 ---- break; } + SetValue(m_Value); } Index: wg_application.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_application.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** wg_application.cpp 16 Jul 2004 16:41:36 -0000 1.53 --- wg_application.cpp 3 Aug 2004 15:03:26 -0000 1.54 *************** *** 301,304 **** --- 301,305 ---- { m_AppLog.AddLogEntry("Exception (wGui) : " + e.std_what(), APP_LOG_CRITICAL); + m_AppLog.AddLogEntry(std::string("SDL Last Error = ") + SDL_GetError(), APP_LOG_ERROR); if (!m_bHandleExceptionsInternally) { *************** *** 311,314 **** --- 312,316 ---- { m_AppLog.AddLogEntry("Exception (std) : " + std::string(e.what()), APP_LOG_CRITICAL); + m_AppLog.AddLogEntry(std::string("SDL Last Error = ") + SDL_GetError(), APP_LOG_ERROR); if (!m_bHandleExceptionsInternally) { *************** *** 321,324 **** --- 323,327 ---- { m_AppLog.AddLogEntry("Exception (non std)", APP_LOG_CRITICAL); + m_AppLog.AddLogEntry(std::string("SDL Last Error = ") + SDL_GetError(), APP_LOG_ERROR); if (!m_bHandleExceptionsInternally) { |
|
From: Rob W. <gre...@us...> - 2004-08-03 15:03:36
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3530/tests Modified Files: TestView1.cpp Log Message: Fixed resizing bug in TestApp1 Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** TestView1.cpp 16 Jul 2004 16:41:36 -0000 1.74 --- TestView1.cpp 3 Aug 2004 15:03:26 -0000 1.75 *************** *** 357,361 **** bHandled = CView::HandleMessage(pMessage); m_pVScrollBar->SetWindowRect(wGui::CRect(m_ClientRect.Width() - 12, 0, m_ClientRect.Width(), m_ClientRect.Height() - 13)); ! m_pHScrollBar->SetWindowRect(wGui::CRect(m_ClientRect.Width() - 12, 0, m_ClientRect.Width(), m_ClientRect.Height() - 13)); } break; --- 357,361 ---- bHandled = CView::HandleMessage(pMessage); m_pVScrollBar->SetWindowRect(wGui::CRect(m_ClientRect.Width() - 12, 0, m_ClientRect.Width(), m_ClientRect.Height() - 13)); ! m_pHScrollBar->SetWindowRect(wGui::CRect(0, m_ClientRect.Height() - 12, m_ClientRect.Width() - 13, m_ClientRect.Height())); } break; |
|
From: Rob W. <gre...@us...> - 2004-07-23 14:46:11
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23265/src Modified Files: wg_listbox.cpp wg_renderedstring.cpp wg_textbox.cpp Log Message: Code cleanup. Index: wg_listbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_listbox.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** wg_listbox.cpp 16 Jul 2004 16:41:36 -0000 1.45 --- wg_listbox.cpp 23 Jul 2004 14:46:00 -0000 1.46 *************** *** 114,118 **** { if (iItemIndex >= 0 && iItemIndex < stdex::safe_static_cast<int>(m_SelectedItems.size())) ! m_SelectedItems[iItemIndex] = bSelected; } --- 114,118 ---- { if (iItemIndex >= 0 && iItemIndex < stdex::safe_static_cast<int>(m_SelectedItems.size())) ! m_SelectedItems.at(iItemIndex) = bSelected; } *************** *** 122,126 **** for (unsigned int i = 0; i < m_Items.size(); ++i) { ! m_SelectedItems[i] = bSelected; } } --- 122,126 ---- for (unsigned int i = 0; i < m_Items.size(); ++i) { ! m_SelectedItems.at(i) = bSelected; } } *************** *** 142,146 **** ItemRect.ClipTo(m_ClientRect); ItemRect.SetBottom(ItemRect.Bottom() - 1); ! if (m_SelectedItems[i]) { Painter.DrawRect(ItemRect, true, CApplication::Instance()->GetDefaultSelectionColor(), CApplication::Instance()->GetDefaultSelectionColor()); --- 142,146 ---- ItemRect.ClipTo(m_ClientRect); ItemRect.SetBottom(ItemRect.Bottom() - 1); ! if (m_SelectedItems.at(i)) { Painter.DrawRect(ItemRect, true, CApplication::Instance()->GetDefaultSelectionColor(), CApplication::Instance()->GetDefaultSelectionColor()); *************** *** 153,157 **** } ItemRect.Grow(-1); ! m_RenderedStrings[i].Draw(m_pSDLSurface, ItemRect, ItemRect.TopLeft() + CPoint(0, 1), m_Items[i].ItemColor); } } --- 153,157 ---- } ItemRect.Grow(-1); ! m_RenderedStrings.at(i).Draw(m_pSDLSurface, ItemRect, ItemRect.TopLeft() + CPoint(0, 1), m_Items[i].ItemColor); } } Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** wg_textbox.cpp 21 Jul 2004 18:38:23 -0000 1.27 --- wg_textbox.cpp 23 Jul 2004 14:46:00 -0000 1.28 *************** *** 195,199 **** // move the cursor into view by scrolling if necessary ! int CursorPos = vCharRects[SelStartPoint.YPos()][SelStartPoint.XPos()].Left() + vOffsets[SelStartPoint.YPos()].XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10; if (m_bScrollToCursor) { --- 195,200 ---- // move the cursor into view by scrolling if necessary ! int CursorPos = vCharRects.at(SelStartPoint.YPos()).at(SelStartPoint.XPos()).Left() + ! vOffsets.at(SelStartPoint.YPos()).XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10; if (m_bScrollToCursor) { *************** *** 201,210 **** { m_pHorizontalScrollBar->SetValue(m_pHorizontalScrollBar->GetValue() - (m_ClientRect.Left() - CursorPos) / 10 - 1); ! CursorPos = vCharRects[SelStartPoint.YPos()][SelStartPoint.XPos()].Left() + vOffsets[SelStartPoint.YPos()].XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10; } if (CursorPos > m_ClientRect.Right()) { m_pHorizontalScrollBar->SetValue(m_pHorizontalScrollBar->GetValue() + (CursorPos - m_ClientRect.Right()) / 10 + 1); ! CursorPos = vCharRects[SelStartPoint.YPos()][SelStartPoint.XPos()].Left() + vOffsets[SelStartPoint.YPos()].XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10; } if (SelStartPoint.YPos() < m_pVerticalScrollBar->GetValue()) --- 202,213 ---- { m_pHorizontalScrollBar->SetValue(m_pHorizontalScrollBar->GetValue() - (m_ClientRect.Left() - CursorPos) / 10 - 1); ! CursorPos = vCharRects.at(SelStartPoint.YPos()).at(SelStartPoint.XPos()).Left() + ! vOffsets.at(SelStartPoint.YPos()).XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10; } if (CursorPos > m_ClientRect.Right()) { m_pHorizontalScrollBar->SetValue(m_pHorizontalScrollBar->GetValue() + (CursorPos - m_ClientRect.Right()) / 10 + 1); ! CursorPos = vCharRects.at(SelStartPoint.YPos()).at(SelStartPoint.XPos()).Left() + ! vOffsets.at(SelStartPoint.YPos()).XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10; } if (SelStartPoint.YPos() < m_pVerticalScrollBar->GetValue()) *************** *** 225,236 **** { CPoint TopLeft = m_ClientRect.TopLeft() + CPoint(0, m_iRowHeight * (CurLine - m_pVerticalScrollBar->GetValue())); ! CRect SelRect(TopLeft, TopLeft + CPoint(vBoundingDimensions[CurLine].XPos(), m_iRowHeight - 2)); if (CurLine == SelStartPoint.YPos()) { ! SelRect.SetLeft(vCharRects[CurLine][SelStartPoint.XPos()].Left() + vOffsets[CurLine].XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10); } if (CurLine == SelEndPoint.YPos()) { ! SelRect.SetRight(vCharRects[CurLine][SelEndPoint.XPos() - 1].Right() + vOffsets[CurLine].XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10); } SelRect.ClipTo(m_ClientRect); --- 228,241 ---- { CPoint TopLeft = m_ClientRect.TopLeft() + CPoint(0, m_iRowHeight * (CurLine - m_pVerticalScrollBar->GetValue())); ! CRect SelRect(TopLeft, TopLeft + CPoint(vBoundingDimensions.at(CurLine).XPos(), m_iRowHeight - 2)); if (CurLine == SelStartPoint.YPos()) { ! SelRect.SetLeft(vCharRects.at(CurLine).at(SelStartPoint.XPos()).Left() + ! vOffsets.at(CurLine).XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10); } if (CurLine == SelEndPoint.YPos()) { ! SelRect.SetRight(vCharRects.at(CurLine).at(SelEndPoint.XPos() - 1).Right() + ! vOffsets.at(CurLine).XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10); } SelRect.ClipTo(m_ClientRect); *************** *** 330,341 **** } // figure out which character was clicked on ! int xDelta = abs(WindowPoint.XPos() - (vCharRects[iCurLine][0].Left() + vOffsets[iCurLine].XPos() + m_ClientRect.Left())); m_SelStart = 0; ! for (unsigned int i = 0; i < vCharRects[iCurLine].size(); ++i) { ! if (abs(WindowPoint.XPos() - (vCharRects[iCurLine][i].Right() + vOffsets[iCurLine].XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)) < xDelta) { ! xDelta = abs(WindowPoint.XPos() - (vCharRects[iCurLine][i].Right() + vOffsets[iCurLine].XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)); m_SelStart = i + 1; --- 335,346 ---- } // figure out which character was clicked on ! int xDelta = abs(WindowPoint.XPos() - (vCharRects.at(iCurLine).at(0).Left() + vOffsets.at(iCurLine).XPos() + m_ClientRect.Left())); m_SelStart = 0; ! for (unsigned int i = 0; i < vCharRects.at(iCurLine).size(); ++i) { ! if (abs(WindowPoint.XPos() - (vCharRects.at(iCurLine).at(i).Right() + vOffsets.at(iCurLine).XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)) < xDelta) { ! xDelta = abs(WindowPoint.XPos() - (vCharRects.at(iCurLine).at(i).Right() + vOffsets.at(iCurLine).XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)); m_SelStart = i + 1; *************** *** 344,348 **** for (unsigned int iChar = 0; iChar < iCurLine; ++iChar) { ! m_SelStart += vCharRects[iChar].size(); } } --- 349,353 ---- for (unsigned int iChar = 0; iChar < iCurLine; ++iChar) { ! m_SelStart += vCharRects.at(iChar).size(); } } *************** *** 447,458 **** // figure out which character was clicked on ! int xDelta = abs(WindowPoint.XPos() - (vCharRects[iCurLine][0].Left() + vOffsets[iCurLine].XPos() + m_ClientRect.Left())); std::string::size_type CursorPos = 0; ! for (unsigned int i = 0; i < vCharRects[iCurLine].size(); ++i) { ! if (abs(WindowPoint.XPos() - (vCharRects[iCurLine][i].Right() + vOffsets[iCurLine].XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)) < xDelta) { ! xDelta = abs(WindowPoint.XPos() - (vCharRects[iCurLine][i].Right() + vOffsets[iCurLine].XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)); CursorPos = i + 1; --- 452,463 ---- // figure out which character was clicked on ! int xDelta = abs(WindowPoint.XPos() - (vCharRects.at(iCurLine).at(0).Left() + vOffsets.at(iCurLine).XPos() + m_ClientRect.Left())); std::string::size_type CursorPos = 0; ! for (unsigned int i = 0; i < vCharRects.at(iCurLine).size(); ++i) { ! if (abs(WindowPoint.XPos() - (vCharRects.at(iCurLine).at(i).Right() + vOffsets.at(iCurLine).XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)) < xDelta) { ! xDelta = abs(WindowPoint.XPos() - (vCharRects.at(iCurLine).at(i).Right() + vOffsets.at(iCurLine).XPos() + m_ClientRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)); CursorPos = i + 1; *************** *** 461,465 **** for (unsigned int iChar = 0; iChar < iCurLine; ++iChar) { ! CursorPos += vCharRects[iChar].size(); } --- 466,470 ---- for (unsigned int iChar = 0; iChar < iCurLine; ++iChar) { ! CursorPos += vCharRects.at(iChar).size(); } Index: wg_renderedstring.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_renderedstring.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wg_renderedstring.cpp 28 Apr 2004 15:41:46 -0000 1.15 --- wg_renderedstring.cpp 23 Jul 2004 14:46:00 -0000 1.16 *************** *** 73,77 **** { CRGBColor PixelColor(FontColor.red, FontColor.green, FontColor.blue, *PixelOffset); ! CPoint PixelPoint(CPoint(x + pGlyph->left, y) + OriginPoint + OriginOffset + CharacterRects[i].TopLeft()); if (BoundingRect.HitTest(PixelPoint) == CRect::RELPOS_INSIDE) { --- 73,77 ---- { CRGBColor PixelColor(FontColor.red, FontColor.green, FontColor.blue, *PixelOffset); ! CPoint PixelPoint(CPoint(x + pGlyph->left, y) + OriginPoint + OriginOffset + CharacterRects.at(i).TopLeft()); if (BoundingRect.HitTest(PixelPoint) == CRect::RELPOS_INSIDE) { *************** *** 124,128 **** } - //FT_Glyph_Metrics* pMetrics = m_pFontEngine->GetMetrics(m_sString[i]); if ((pMetrics->horiBearingY - pMetrics->height) < iMinY) { --- 124,127 ---- |
|
From: Rob W. <gre...@us...> - 2004-07-22 21:17:36
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1199/src Modified Files: wg_editbox.cpp Log Message: Fixed a bug with the edit box scrolling code, and cleaned it up. Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** wg_editbox.cpp 19 Jul 2004 21:49:56 -0000 1.92 --- wg_editbox.cpp 22 Jul 2004 21:17:25 -0000 1.93 *************** *** 159,166 **** if (CApplication::Instance()->GetKeyFocus() == dynamic_cast<const CWindow*>(this) && !m_bReadOnly) { ! CPoint Offset; std::vector<CRect> CharRects; ! m_pRenderedString->GetMetrics(0, &Offset, &CharRects); std::string::size_type SelStartNorm = 0; --- 159,166 ---- if (CApplication::Instance()->GetKeyFocus() == dynamic_cast<const CWindow*>(this) && !m_bReadOnly) { ! CPoint BoundedDims; CPoint Offset; std::vector<CRect> CharRects; ! m_pRenderedString->GetMetrics(&BoundedDims, &Offset, &CharRects); std::string::size_type SelStartNorm = 0; *************** *** 179,215 **** if (! m_bMouseDown) { ! int RightBorder = CharRects[SelStartNorm + SelLenNorm - 1].Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset; ! int LeftBorder = CharRects[SelStartNorm].Left() + Offset.XPos() + m_ScrollOffset; ! ! if (m_SelLength < 0) { ! if (LeftBorder <= 0) { ! m_ScrollOffset = -(CharRects[SelStartNorm].Left() + Offset.XPos()); } ! else if (RightBorder > SubRect.Right()) { ! m_ScrollOffset = SubRect.Right() - (CharRects[SelStartNorm + SelLenNorm].Right() + Offset.XPos() + SubRect.Left()); } ! } ! else ! { ! if (RightBorder >= SubRect.Right()) { ! m_ScrollOffset = SubRect.Right() - (CharRects[SelStartNorm + SelLenNorm].Right() + Offset.XPos() + SubRect.Left()); } ! else if (LeftBorder < 0) { ! m_ScrollOffset = -(CharRects[SelStartNorm].Left() + Offset.XPos()); } - } ! if (m_ScrollOffset != 0 && ! (CharRects[m_sWindowText.length()].Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset < SubRect.Right())) ! { ! m_ScrollOffset = SubRect.Right() - (CharRects[m_sWindowText.length()].Right() + Offset.XPos() + SubRect.Left()); ! if (m_ScrollOffset > 0) { ! m_ScrollOffset = 0; } } --- 179,213 ---- if (! m_bMouseDown) { ! if (CharRects.empty() || BoundedDims.XPos() < SubRect.Width()) { ! m_ScrollOffset = 0; ! } ! else ! { ! int iCursorPos = 0; ! if (m_SelStart + m_SelLength >= CharRects.size()) { ! iCursorPos = CharRects.back().Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset; } ! else { ! iCursorPos = CharRects.at(m_SelStart + m_SelLength).Left() + Offset.XPos() + SubRect.Left() + m_ScrollOffset; } ! if (iCursorPos < SubRect.Left()) { ! m_ScrollOffset = -(iCursorPos - m_ScrollOffset - SubRect.Left() - Offset.XPos()); } ! else if (iCursorPos > SubRect.Right()) { ! m_ScrollOffset = -(iCursorPos - m_ScrollOffset - SubRect.Left() - Offset.XPos() - SubRect.Width() + 1); } ! if (m_ScrollOffset < 0 && (CharRects.back().Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset < SubRect.Right())) { ! m_ScrollOffset = SubRect.Right() - CharRects.back().Right() - 1; ! if (m_ScrollOffset > 0) ! { ! m_ScrollOffset = 0; ! } } } *************** *** 222,227 **** SelRect.SetBottom(SubRect.Bottom()); SelRect.SetTop(SubRect.Top()); ! SelRect.SetLeft(CharRects[SelStartNorm].Left() + Offset.XPos() + SubRect.Left() + m_ScrollOffset); ! SelRect.SetRight(CharRects[SelLenNorm + SelStartNorm - 1].Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset); SelRect.ClipTo(SubRect); Painter.DrawRect(SelRect, true, CApplication::Instance()->GetDefaultSelectionColor(), CApplication::Instance()->GetDefaultSelectionColor()); --- 220,225 ---- SelRect.SetBottom(SubRect.Bottom()); SelRect.SetTop(SubRect.Top()); ! SelRect.SetLeft(CharRects.at(SelStartNorm).Left() + Offset.XPos() + SubRect.Left() + m_ScrollOffset); ! SelRect.SetRight(CharRects.at(SelLenNorm + SelStartNorm - 1).Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset); SelRect.ClipTo(SubRect); Painter.DrawRect(SelRect, true, CApplication::Instance()->GetDefaultSelectionColor(), CApplication::Instance()->GetDefaultSelectionColor()); *************** *** 230,235 **** { //RenderStringWithCursor ! int CursorPos; ! CursorPos = CharRects[m_SelStart + m_SelLength].Left() + Offset.XPos() + SubRect.Left() + m_ScrollOffset; if (CursorPos >= SubRect.Left() && CursorPos <= SubRect.Right()) { --- 228,240 ---- { //RenderStringWithCursor ! int CursorPos = Offset.XPos() + SubRect.Left() + m_ScrollOffset; ! if (m_SelStart + m_SelLength >= CharRects.size() && !CharRects.empty()) ! { ! CursorPos += CharRects.back().Right(); ! } ! else if (m_SelStart + m_SelLength >= 0 && m_SelStart + m_SelLength < CharRects.size()) ! { ! CursorPos += CharRects.at(m_SelStart + m_SelLength).Left(); ! } if (CursorPos >= SubRect.Left() && CursorPos <= SubRect.Right()) { *************** *** 290,301 **** SubRect.Grow(-3); - int xDelta = abs(WindowPoint.XPos() - (CharRects[0].Left() + Offset.XPos() + SubRect.Left())); m_SelStart = 0; ! for (unsigned int i = 0; i < m_pRenderedString->GetLength(); ++i) { ! if (abs(WindowPoint.XPos() - (CharRects[i].Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)) < xDelta) { ! xDelta = abs(WindowPoint.XPos() - (CharRects[i].Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)); ! m_SelStart = i + 1; } } --- 295,309 ---- SubRect.Grow(-3); m_SelStart = 0; ! if (!CharRects.empty()) { ! int xDelta = abs(WindowPoint.XPos() - (CharRects.front().Left() + Offset.XPos() + SubRect.Left())); ! for (unsigned int i = 0; i < m_pRenderedString->GetLength(); ++i) { ! if (abs(WindowPoint.XPos() - (CharRects.at(i).Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)) < xDelta) ! { ! xDelta = abs(WindowPoint.XPos() - (CharRects.at(i).Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)); ! m_SelStart = i + 1; ! } } } *************** *** 366,377 **** m_pRenderedString->GetMetrics(0, &Offset, &CharRects); - int xDelta = abs(WindowPoint.XPos() - (CharRects[0].Left() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)); std::string::size_type CursorPos = 0; ! for (unsigned int i = 0; i < m_pRenderedString->GetLength(); ++i) { ! if (abs(WindowPoint.XPos() - (CharRects[i].Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)) < xDelta) { ! xDelta = abs(WindowPoint.XPos() - (CharRects[i].Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)); ! CursorPos = i + 1; } } --- 374,388 ---- m_pRenderedString->GetMetrics(0, &Offset, &CharRects); std::string::size_type CursorPos = 0; ! if (!CharRects.empty()) { ! int xDelta = abs(WindowPoint.XPos() - (CharRects.front().Left() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)); ! for (unsigned int i = 0; i < m_pRenderedString->GetLength(); ++i) { ! if (abs(WindowPoint.XPos() - (CharRects.at(i).Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)) < xDelta) ! { ! xDelta = abs(WindowPoint.XPos() - (CharRects.at(i).Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)); ! CursorPos = i + 1; ! } } } |
|
From: Rob W. <gre...@us...> - 2004-07-21 18:38:34
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26307/src Modified Files: wg_scrollbar.cpp wg_textbox.cpp Log Message: Fixed the placement of the scrollbars in textboxes, a minor layout issue in scrollbars, and the position of the textbox in the notepad test app. Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** wg_scrollbar.cpp 16 Jul 2004 16:41:36 -0000 1.41 --- wg_scrollbar.cpp 21 Jul 2004 18:38:23 -0000 1.42 *************** *** 125,129 **** m_ClientRect = CRect(m_WindowRect.Height(), 0, m_WindowRect.Width() - m_WindowRect.Height() - 1, m_WindowRect.Height() - 1); m_pBtnUpLeft->SetWindowRect(CRect(-m_ClientRect.Height(), 0, -1, m_ClientRect.Height() - 1)); ! m_pBtnDownRight->SetWindowRect(CRect(m_ClientRect.Width() + 1, 0, m_ClientRect.Width() + m_ClientRect.Height() - 1, m_ClientRect.Height())); break; } --- 125,129 ---- m_ClientRect = CRect(m_WindowRect.Height(), 0, m_WindowRect.Width() - m_WindowRect.Height() - 1, m_WindowRect.Height() - 1); m_pBtnUpLeft->SetWindowRect(CRect(-m_ClientRect.Height(), 0, -1, m_ClientRect.Height() - 1)); ! m_pBtnDownRight->SetWindowRect(CRect(m_ClientRect.Width() + 1, 0, m_ClientRect.Width() + m_ClientRect.Height(), m_ClientRect.Height() - 1)); break; } Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** wg_textbox.cpp 19 Jul 2004 21:49:58 -0000 1.26 --- wg_textbox.cpp 21 Jul 2004 18:38:23 -0000 1.27 *************** *** 880,896 **** iLastLine = 0; } ! m_ClientRect.SetRight(m_WindowRect.Width() - 17); ! m_pVerticalScrollBar->SetMaxLimit(iLastLine); ! if (m_pVerticalScrollBar->GetValue() > iLastLine) { ! m_pVerticalScrollBar->SetValue(iLastLine); } - int iBottom = m_WindowRect.Bottom() - 1; if (bHorzVisible) { ! iBottom -= 12; } ! m_pVerticalScrollBar->SetWindowRect(CRect(m_WindowRect.Right() - 13, m_WindowRect.Top() + 1, m_WindowRect.Right() - 1, iBottom)); ! m_ClientRect.SetBottom(m_WindowRect.Height() - 17); m_pHorizontalScrollBar->SetMaxLimit(iMaxHorzLimit); if (m_pHorizontalScrollBar->GetValue() > iMaxHorzLimit) --- 880,898 ---- iLastLine = 0; } ! if (bVertVisible) { ! m_ClientRect.SetRight(m_WindowRect.Width() - 17); } if (bHorzVisible) { ! m_ClientRect.SetBottom(m_WindowRect.Height() - 17); } ! ! m_pVerticalScrollBar->SetMaxLimit(iLastLine); ! if (m_pVerticalScrollBar->GetValue() > iLastLine) ! { ! m_pVerticalScrollBar->SetValue(iLastLine); ! } ! m_pVerticalScrollBar->SetWindowRect(CRect(m_ClientRect.Width() + 2, 0, m_ClientRect.Width() + 14, m_ClientRect.Height())); m_pHorizontalScrollBar->SetMaxLimit(iMaxHorzLimit); if (m_pHorizontalScrollBar->GetValue() > iMaxHorzLimit) *************** *** 898,907 **** m_pHorizontalScrollBar->SetValue(iMaxHorzLimit); } ! int iRight = m_WindowRect.Right() - 1; ! if (bVertVisible) ! { ! iRight -= 12; ! } ! m_pHorizontalScrollBar->SetWindowRect(CRect(m_WindowRect.Left() + 1, m_WindowRect.Bottom() - 13, iRight, m_WindowRect.Bottom() - 1)); } --- 900,904 ---- m_pHorizontalScrollBar->SetValue(iMaxHorzLimit); } ! m_pHorizontalScrollBar->SetWindowRect(CRect(0, m_ClientRect.Height() + 2, m_ClientRect.Width(), m_ClientRect.Height() + 14)); } |
|
From: Rob W. <gre...@us...> - 2004-07-21 18:38:34
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26307/tests Modified Files: Notepad.cpp Log Message: Fixed the placement of the scrollbars in textboxes, a minor layout issue in scrollbars, and the position of the textbox in the notepad test app. Index: Notepad.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/Notepad.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Notepad.cpp 25 Jun 2004 13:34:16 -0000 1.4 --- Notepad.cpp 21 Jul 2004 18:38:24 -0000 1.5 *************** *** 105,109 **** GetMenu()->InsertMenuItem(SMenuItem("Format", 0, pContextSubmenu)); ! m_pTextBox = new CTextBox(m_ClientRect, this); m_pTextBox->SetScrollBarVisibility(CScrollBar::VERTICAL, CTextBox::SCROLLBAR_VIS_ALWAYS); m_pTextBox->SetWindowText("This is a sample notepad application.\nLoad and Save doesn't work here yet, since the UI for that requires some sort of dialog type thing, which we don't really have yet (see the CFrame class)."); --- 105,109 ---- GetMenu()->InsertMenuItem(SMenuItem("Format", 0, pContextSubmenu)); ! m_pTextBox = new CTextBox(m_ClientRect.SizeRect(), this); m_pTextBox->SetScrollBarVisibility(CScrollBar::VERTICAL, CTextBox::SCROLLBAR_VIS_ALWAYS); m_pTextBox->SetWindowText("This is a sample notepad application.\nLoad and Save doesn't work here yet, since the UI for that requires some sort of dialog type thing, which we don't really have yet (see the CFrame class)."); |
|
From: Rob W. <gre...@us...> - 2004-07-19 21:50:10
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29916/src Modified Files: wg_editbox.cpp wg_textbox.cpp wg_tooltip.cpp wg_window.cpp Log Message: Tooltips and cursor changes now check the floating window and any children. Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** wg_window.cpp 16 Jul 2004 16:41:36 -0000 1.51 --- wg_window.cpp 19 Jul 2004 21:49:58 -0000 1.52 *************** *** 240,243 **** --- 240,254 ---- + bool CWindow::HitTest(const CPoint& Point) const + { + bool bHit = m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE; + for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); !bHit && iter != m_ChildWindows.end(); ++iter) + { + bHit = (*iter)->HitTest(Point); + } + return bHit; + } + + void CWindow::Draw(void) const { Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** wg_editbox.cpp 16 Jul 2004 16:41:36 -0000 1.91 --- wg_editbox.cpp 19 Jul 2004 21:49:56 -0000 1.92 *************** *** 347,358 **** // back to a normal cursor. CView* pView = GetView(); ! int eFloatingWindowHit = CRect::RELPOS_INVALID; ! if (pView && pView->GetFloatingWindow()) ! { ! eFloatingWindowHit = pView->GetFloatingWindow()->GetWindowRect().SizeRect().HitTest( ! pView->GetFloatingWindow()->ViewToWindow(pMouseMessage->Point)); ! } ! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && ! eFloatingWindowHit != CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; --- 347,352 ---- // back to a normal cursor. CView* pView = GetView(); ! bool bHitFloating = pView && pView->GetFloatingWindow() && pView->GetFloatingWindow()->HitTest(pMouseMessage->Point); ! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !bHitFloating && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; *************** *** 360,365 **** CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE || ! eFloatingWindowHit == CRect::RELPOS_INSIDE) && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; --- 354,358 ---- CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE || bHitFloating) && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wg_textbox.cpp 16 Jul 2004 16:41:36 -0000 1.25 --- wg_textbox.cpp 19 Jul 2004 21:49:58 -0000 1.26 *************** *** 403,414 **** // back to a normal cursor. CView* pView = GetView(); ! int eFloatingWindowHit = CRect::RELPOS_INVALID; ! if (pView && pView->GetFloatingWindow()) ! { ! eFloatingWindowHit = pView->GetFloatingWindow()->GetWindowRect().SizeRect().HitTest( ! pView->GetFloatingWindow()->ViewToWindow(pMouseMessage->Point)); ! } ! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && ! eFloatingWindowHit != CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; --- 403,408 ---- // back to a normal cursor. CView* pView = GetView(); ! bool bHitFloating = pView && pView->GetFloatingWindow() && pView->GetFloatingWindow()->HitTest(pMouseMessage->Point); ! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !bHitFloating && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; *************** *** 416,421 **** CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE || ! eFloatingWindowHit == CRect::RELPOS_INSIDE) && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; --- 410,414 ---- CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE || bHitFloating) && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; Index: wg_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wg_tooltip.cpp 19 Jul 2004 21:15:57 -0000 1.25 --- wg_tooltip.cpp 19 Jul 2004 21:49:58 -0000 1.26 *************** *** 147,159 **** } CView* pView = GetView(); ! int eFloatingWindowHit = CRect::RELPOS_INVALID; ! if (pView && pView->GetFloatingWindow()) ! { ! eFloatingWindowHit = pView->GetFloatingWindow()->GetWindowRect().SizeRect().HitTest( ! pView->GetFloatingWindow()->ViewToWindow(pMouseMessage->Point)); ! } if (m_pParentWindow->GetWindowRect().SizeRect().HitTest( ! m_pParentWindow->ViewToWindow(m_LastMousePosition)) == CRect::RELPOS_INSIDE ! && eFloatingWindowHit != CRect::RELPOS_INSIDE) { m_pTimer->StartTimer(1000); --- 147,154 ---- } CView* pView = GetView(); ! bool bHitFloating = pView && pView->GetFloatingWindow() && pView->GetFloatingWindow()->HitTest(pMouseMessage->Point) && ! pView->GetFloatingWindow() != m_pParentWindow; if (m_pParentWindow->GetWindowRect().SizeRect().HitTest( ! m_pParentWindow->ViewToWindow(m_LastMousePosition)) == CRect::RELPOS_INSIDE && !bHitFloating) { m_pTimer->StartTimer(1000); |
|
From: Rob W. <gre...@us...> - 2004-07-19 21:50:06
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29916/includes Modified Files: wg_window.h Log Message: Tooltips and cursor changes now check the floating window and any children. Index: wg_window.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_window.h,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** wg_window.h 16 Jul 2004 16:41:35 -0000 1.43 --- wg_window.h 19 Jul 2004 21:49:56 -0000 1.44 *************** *** 155,158 **** --- 155,163 ---- virtual std::string GetWindowText(void) { return m_sWindowText; } + //! Check to see if a point lies within the window or any of it's children + //! \param Point the point to check against in View coordinates + //! \return true if the point lies within the window rect, or any of it's children's window rects + virtual bool HitTest(const CPoint& Point) const; + //! Render the window itself virtual void Draw(void) const; |
|
From: Rob W. <gre...@us...> - 2004-07-19 21:50:05
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29916 Modified Files: CHANGES Log Message: Tooltips and cursor changes now check the floating window and any children. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** CHANGES 16 Jul 2004 16:41:35 -0000 1.150 --- CHANGES 19 Jul 2004 21:49:55 -0000 1.151 *************** *** 2,5 **** --- 2,6 ---- + Added CDropDown: SetListboxHeight() which allows the height of the drop list to be changed + Added CRect: SizeRect() which returns a CRect the same size as the Rect, but with a top left coordinate of (0, 0) + + Added CWindow: HitTest() which performs a simple hit test to see if a point lies within the window or any of it's children + Added CWindow: PaintToSurface() which blits the window's sirface to the surface it is passed. + Added CWindow: ViewToClient() which does the opposite of ClientToView() *************** *** 19,22 **** --- 20,24 ---- + Bugfix CEditBox: The mouse cursor is no longer changed to an IBeam when over an edit box if it's also over a floating window + Bugfix CTextBox: The mouse cursor is no longer changed to an IBeam when over an text box if it's also over a floating window + + Bugfix CToolTip: Tooltips will not appear if the mouse is being held over a floating window |
|
From: Rob W. <gre...@us...> - 2004-07-19 21:16:07
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23874/src Modified Files: wg_tooltip.cpp Log Message: Tooltips will no longer appear if the window the mouse is in the floating window Index: wg_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wg_tooltip.cpp 16 Jul 2004 16:41:36 -0000 1.24 --- wg_tooltip.cpp 19 Jul 2004 21:15:57 -0000 1.25 *************** *** 23,26 **** --- 23,27 ---- #include "wgui_include_config.h" + #include "wg_view.h" #include "wg_tooltip.h" *************** *** 145,150 **** HideTip(); } if (m_pParentWindow->GetWindowRect().SizeRect().HitTest( ! m_pParentWindow->ViewToWindow(m_LastMousePosition)) == CRect::RELPOS_INSIDE) { m_pTimer->StartTimer(1000); --- 146,159 ---- HideTip(); } + CView* pView = GetView(); + int eFloatingWindowHit = CRect::RELPOS_INVALID; + if (pView && pView->GetFloatingWindow()) + { + eFloatingWindowHit = pView->GetFloatingWindow()->GetWindowRect().SizeRect().HitTest( + pView->GetFloatingWindow()->ViewToWindow(pMouseMessage->Point)); + } if (m_pParentWindow->GetWindowRect().SizeRect().HitTest( ! m_pParentWindow->ViewToWindow(m_LastMousePosition)) == CRect::RELPOS_INSIDE ! && eFloatingWindowHit != CRect::RELPOS_INSIDE) { m_pTimer->StartTimer(1000); |
|
From: Rob W. <gre...@us...> - 2004-07-16 18:53:00
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10911/src Modified Files: wg_menu.cpp Log Message: Draw architecture changes. Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** wg_menu.cpp 16 Jul 2004 16:41:36 -0000 1.52 --- wg_menu.cpp 16 Jul 2004 18:52:51 -0000 1.53 *************** *** 131,135 **** { CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); ! if (m_bVisible && pMouseMessage && m_WindowRect.HitTest(ViewToWindow(pMouseMessage->Point)) == CRect::RELPOS_INSIDE) { UpdateCachedRects(); --- 131,136 ---- { CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); ! if (m_bVisible && pMouseMessage && ! m_WindowRect.SizeRect().HitTest(ViewToWindow(pMouseMessage->Point)) == CRect::RELPOS_INSIDE) { UpdateCachedRects(); *************** *** 148,152 **** { m_pPopupTimer->StopTimer(); ! if (m_pHighlightedItem->pPopup) { m_pPopupTimer->StartTimer(1000); --- 149,153 ---- { m_pPopupTimer->StopTimer(); ! if (m_pHighlightedItem && m_pHighlightedItem->pPopup) { m_pPopupTimer->StartTimer(1000); *************** *** 300,304 **** { CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); ! if (m_bVisible && pMouseMessage && m_WindowRect.HitTest(ViewToWindow(pMouseMessage->Point)) == CRect::RELPOS_INSIDE) { UpdateCachedRects(); --- 301,306 ---- { CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); ! if (m_bVisible && pMouseMessage && ! m_WindowRect.SizeRect().HitTest(ViewToWindow(pMouseMessage->Point)) == CRect::RELPOS_INSIDE) { UpdateCachedRects(); *************** *** 476,479 **** --- 478,482 ---- CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); m_pHighlightedItem = 0; + Draw(); } |
|
From: Rob W. <gre...@us...> - 2004-07-16 16:41:51
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18181/tests Modified Files: TestView1.cpp Log Message: Draw architecture changes. Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** TestView1.cpp 15 Jul 2004 18:26:15 -0000 1.73 --- TestView1.cpp 16 Jul 2004 16:41:36 -0000 1.74 *************** *** 355,367 **** if (pResizeMessage && pResizeMessage->Source() == wGui::CApplication::Instance()) { ! CView::HandleMessage(pMessage); ! wGui::CRect NewRect = m_ClientRect; ! NewRect.SetLeft(NewRect.Right() - 12); ! NewRect.SetBottom(NewRect.Bottom() - 12); ! m_pVScrollBar->SetWindowRect(NewRect); ! NewRect = m_ClientRect; ! NewRect.SetTop(NewRect.Bottom() - 12); ! NewRect.SetRight(NewRect.Right() - 12); ! m_pHScrollBar->SetWindowRect(NewRect); } break; --- 355,361 ---- if (pResizeMessage && pResizeMessage->Source() == wGui::CApplication::Instance()) { ! bHandled = CView::HandleMessage(pMessage); ! m_pVScrollBar->SetWindowRect(wGui::CRect(m_ClientRect.Width() - 12, 0, m_ClientRect.Width(), m_ClientRect.Height() - 13)); ! m_pHScrollBar->SetWindowRect(wGui::CRect(m_ClientRect.Width() - 12, 0, m_ClientRect.Width(), m_ClientRect.Height() - 13)); } break; |
|
From: Rob W. <gre...@us...> - 2004-07-16 16:41:51
|
Update of /cvsroot/wgui/wgui/wgui_ex/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18181/wgui_ex/includes Modified Files: wgex_tooltip.h Log Message: Draw architecture changes. Index: wgex_tooltip.h =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/includes/wgex_tooltip.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wgex_tooltip.h 6 Nov 2003 17:45:24 -0000 1.1 --- wgex_tooltip.h 16 Jul 2004 16:41:36 -0000 1.2 *************** *** 48,56 **** //! \param sText The label text //! \param FontColor The color of the tooltip text ! //! \param BGColor The color of the tooltip's background //! \param pFontEngine A pointer to the font engine to use when drawing the tooltip //! If this is left out (or set to 0) it will use the default font engine specified by the CApplication (which must be set before instantiating this object) CShadeToolTip(CWindow* pToolWindow, std::string sText, ! CRGBColor& FontColor = COLOR_WHITE, CRGBColor& BGColor = COLOR_RED, CFontEngine* pFontEngine = 0); //! Standard destructor --- 48,56 ---- //! \param sText The label text //! \param FontColor The color of the tooltip text ! //! \param BackgroundColor The color of the tooltip's background //! \param pFontEngine A pointer to the font engine to use when drawing the tooltip //! If this is left out (or set to 0) it will use the default font engine specified by the CApplication (which must be set before instantiating this object) CShadeToolTip(CWindow* pToolWindow, std::string sText, ! CRGBColor& FontColor = COLOR_WHITE, CRGBColor& BackgroundColor = COLOR_RED, CFontEngine* pFontEngine = 0); //! Standard destructor |
|
From: Rob W. <gre...@us...> - 2004-07-16 16:41:50
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18181/src Modified Files: wg_application.cpp wg_button.cpp wg_checkbox.cpp wg_color.cpp wg_dropdown.cpp wg_editbox.cpp wg_groupbox.cpp wg_label.cpp wg_listbox.cpp wg_menu.cpp wg_progress.cpp wg_scrollbar.cpp wg_textbox.cpp wg_toolbar.cpp wg_tooltip.cpp wg_view.cpp wg_window.cpp Log Message: Draw architecture changes. Index: wg_view.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_view.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** wg_view.cpp 7 Jul 2004 21:03:55 -0000 1.41 --- wg_view.cpp 16 Jul 2004 16:41:36 -0000 1.42 *************** *** 167,173 **** } ! m_ClientRect = CRect(m_ClientRect.Left(), m_ClientRect.Top(), ! m_WindowRect.Width(), m_WindowRect.Height()); ! m_ClientRect.ClipTo(m_WindowRect); m_pScreenSurface = SDL_SetVideoMode(m_WindowRect.Width(), m_WindowRect.Height(), DEFAULT_BPP, iFlags); --- 167,172 ---- } ! m_ClientRect = CRect(m_ClientRect.Left(), m_ClientRect.Top(), m_WindowRect.Width(), m_WindowRect.Height()); ! m_ClientRect.ClipTo(m_WindowRect.SizeRect()); m_pScreenSurface = SDL_SetVideoMode(m_WindowRect.Width(), m_WindowRect.Height(), DEFAULT_BPP, iFlags); Index: wg_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_button.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** wg_button.cpp 6 Jul 2004 03:29:02 -0000 1.37 --- wg_button.cpp 16 Jul 2004 16:41:36 -0000 1.38 *************** *** 52,56 **** m_pFontEngine, sText, CRenderedString::VALIGN_CENTER, CRenderedString::HALIGN_CENTER)); m_pRenderedString = pRenderedString; ! m_BGColor = CApplication::Instance()->GetDefaultFGColor(); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); Draw(); --- 52,56 ---- m_pFontEngine, sText, CRenderedString::VALIGN_CENTER, CRenderedString::HALIGN_CENTER)); m_pRenderedString = pRenderedString; ! m_BackgroundColor = CApplication::Instance()->GetDefaultForegroundColor(); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); Draw(); Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** wg_editbox.cpp 15 Jul 2004 18:26:14 -0000 1.90 --- wg_editbox.cpp 16 Jul 2004 16:41:36 -0000 1.91 *************** *** 49,53 **** m_bDrawCursor(true) { ! m_BGColor = COLOR_WHITE; m_ClientRect.Grow(-4); if (pFontEngine) --- 49,53 ---- m_bDrawCursor(true) { ! m_BackgroundColor = COLOR_WHITE; m_ClientRect.Grow(-4); if (pFontEngine) *************** *** 84,88 **** void CEditBox::SetReadOnly(bool bReadOnly) { ! m_BGColor = bReadOnly ? COLOR_LIGHTGRAY : COLOR_WHITE; m_bReadOnly = bReadOnly; Draw(); --- 84,88 ---- void CEditBox::SetReadOnly(bool bReadOnly) { ! m_BackgroundColor = bReadOnly ? COLOR_LIGHTGRAY : COLOR_WHITE; m_bReadOnly = bReadOnly; Draw(); Index: wg_checkbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_checkbox.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wg_checkbox.cpp 30 Jun 2004 22:31:01 -0000 1.22 --- wg_checkbox.cpp 16 Jul 2004 16:41:36 -0000 1.23 *************** *** 36,40 **** m_MouseButton(0) { ! m_BGColor = COLOR_WHITE; CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); --- 36,40 ---- m_MouseButton(0) { ! m_BackgroundColor = COLOR_WHITE; CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); Index: wg_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wg_tooltip.cpp 8 Jul 2004 21:42:51 -0000 1.23 --- wg_tooltip.cpp 16 Jul 2004 16:41:36 -0000 1.24 *************** *** 28,32 **** { ! CToolTip::CToolTip(CWindow* pToolWindow, std::string sText, CRGBColor& FontColor, CRGBColor& BGColor, CFontEngine* pFontEngine) : CWindow(CRect(), pToolWindow), m_FontColor(FontColor) --- 28,32 ---- { ! CToolTip::CToolTip(CWindow* pToolWindow, std::string sText, CRGBColor& FontColor, CRGBColor& BackgroundColor, CFontEngine* pFontEngine) : CWindow(CRect(), pToolWindow), m_FontColor(FontColor) *************** *** 52,56 **** m_BoundingRect = CRect(CPoint(0, 0), Dims + CPoint(4, 4)); ! m_BGColor = BGColor; CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_TIMER); --- 52,56 ---- m_BoundingRect = CRect(CPoint(0, 0), Dims + CPoint(4, 4)); ! m_BackgroundColor = BackgroundColor; CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_TIMER); Index: wg_progress.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_progress.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wg_progress.cpp 30 Jun 2004 22:31:01 -0000 1.15 --- wg_progress.cpp 16 Jul 2004 16:41:36 -0000 1.16 *************** *** 35,39 **** m_BarColor(BarColor) { ! m_BGColor = DEFAULT_FG_COLOR; Draw(); } --- 35,39 ---- m_BarColor(BarColor) { ! m_BackgroundColor = DEFAULT_FOREGROUND_COLOR; Draw(); } Index: wg_color.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_color.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wg_color.cpp 2 Apr 2004 17:26:16 -0000 1.17 --- wg_color.cpp 16 Jul 2004 16:41:36 -0000 1.18 *************** *** 60,65 **** blue = 0xFF; bInitted = true; ! } ! if (s == "LIGHTGRAY") { --- 60,65 ---- blue = 0xFF; bInitted = true; ! } ! if (s == "LIGHTGRAY") { *************** *** 174,179 **** ! CRGBColor DEFAULT_BG_COLOR = CRGBColor(0x60, 0x60, 0x60); ! CRGBColor DEFAULT_FG_COLOR = CRGBColor(0xA0, 0xA0, 0xA0); CRGBColor DEFAULT_LINE_COLOR = CRGBColor(0x00, 0x00, 0x00); CRGBColor DEFAULT_DISABLED_LINE_COLOR = CRGBColor(0x40, 0x40, 0x40); --- 174,179 ---- ! CRGBColor DEFAULT_BACKGROUND_COLOR = CRGBColor(0x60, 0x60, 0x60); ! CRGBColor DEFAULT_FOREGROUND_COLOR = CRGBColor(0xA0, 0xA0, 0xA0); CRGBColor DEFAULT_LINE_COLOR = CRGBColor(0x00, 0x00, 0x00); CRGBColor DEFAULT_DISABLED_LINE_COLOR = CRGBColor(0x40, 0x40, 0x40); Index: wg_application.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_application.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** wg_application.cpp 28 Apr 2004 15:41:46 -0000 1.52 --- wg_application.cpp 16 Jul 2004 16:41:36 -0000 1.53 *************** *** 97,103 **** m_pMouseFocusWindow(0), m_pDefaultFontEngine(0), ! m_DefaultColorBG(DEFAULT_BG_COLOR), ! m_DefaultColorFG(DEFAULT_FG_COLOR), ! m_DefaultColorSelect(DEFAULT_BG_COLOR), m_bHandleExceptionsInternally(bHandleExceptionsInternally), m_bResourcePoolEnabled(true), --- 97,103 ---- m_pMouseFocusWindow(0), m_pDefaultFontEngine(0), ! m_DefaultBackgroundColor(DEFAULT_BACKGROUND_COLOR), ! m_DefaultForegroundColor(DEFAULT_FOREGROUND_COLOR), ! m_DefaultSelectionColor(DEFAULT_BACKGROUND_COLOR), m_bHandleExceptionsInternally(bHandleExceptionsInternally), m_bResourcePoolEnabled(true), *************** *** 236,250 **** if (m_GlobalConfig.EntryExists("BACKGROUNDCOLOR")) { ! m_DefaultColorBG = CRGBColor(m_GlobalConfig.GetStringEntry("BACKGROUNDCOLOR").second); } if (m_GlobalConfig.EntryExists("FOREGROUNDCOLOR")) { ! m_DefaultColorFG = CRGBColor(m_GlobalConfig.GetStringEntry("FOREGROUNDCOLOR").second); } if (m_GlobalConfig.EntryExists("SELECTIONCOLOR")) { ! m_DefaultColorSelect = CRGBColor(m_GlobalConfig.GetStringEntry("SELECTIONCOLOR").second); } --- 236,250 ---- if (m_GlobalConfig.EntryExists("BACKGROUNDCOLOR")) { ! m_DefaultBackgroundColor = CRGBColor(m_GlobalConfig.GetStringEntry("BACKGROUNDCOLOR").second); } if (m_GlobalConfig.EntryExists("FOREGROUNDCOLOR")) { ! m_DefaultForegroundColor = CRGBColor(m_GlobalConfig.GetStringEntry("FOREGROUNDCOLOR").second); } if (m_GlobalConfig.EntryExists("SELECTIONCOLOR")) { ! m_DefaultSelectionColor = CRGBColor(m_GlobalConfig.GetStringEntry("SELECTIONCOLOR").second); } Index: wg_groupbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_groupbox.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wg_groupbox.cpp 1 Jul 2004 17:00:35 -0000 1.17 --- wg_groupbox.cpp 16 Jul 2004 16:41:36 -0000 1.18 *************** *** 49,53 **** m_pFontEngine, sText, CRenderedString::VALIGN_TOP, CRenderedString::HALIGN_LEFT)); m_pRenderedString = pRenderedString; ! m_BGColor = CApplication::Instance()->GetDefaultBGColor(); Draw(); } --- 49,53 ---- m_pFontEngine, sText, CRenderedString::VALIGN_TOP, CRenderedString::HALIGN_LEFT)); m_pRenderedString = pRenderedString; ! m_BackgroundColor = CApplication::Instance()->GetDefaultBackgroundColor(); Draw(); } *************** *** 70,74 **** m_pRenderedString->GetMetrics(&Dims, &Offset, 0); Painter.DrawRect(CRect(CPoint(6, 0), CPoint(14, 0) + Dims), ! true, m_BGColor, m_BGColor); m_pRenderedString->Draw(m_pSDLSurface, m_WindowRect.SizeRect(), CPoint(10, 0), m_FontColor); } --- 70,74 ---- m_pRenderedString->GetMetrics(&Dims, &Offset, 0); Painter.DrawRect(CRect(CPoint(6, 0), CPoint(14, 0) + Dims), ! true, m_BackgroundColor, m_BackgroundColor); m_pRenderedString->Draw(m_pSDLSurface, m_WindowRect.SizeRect(), CPoint(10, 0), m_FontColor); } Index: wg_dropdown.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_dropdown.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wg_dropdown.cpp 15 Jul 2004 18:26:14 -0000 1.25 --- wg_dropdown.cpp 16 Jul 2004 16:41:36 -0000 1.26 *************** *** 42,46 **** m_pEditBox->SetReadOnly(true); // Override the normal read-only BG color ! m_pEditBox->SetBGColor(COLOR_WHITE); } --- 42,46 ---- m_pEditBox->SetReadOnly(true); // Override the normal read-only BG color ! m_pEditBox->SetBackgroundColor(COLOR_WHITE); } Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** wg_scrollbar.cpp 7 Jul 2004 21:03:55 -0000 1.40 --- wg_scrollbar.cpp 16 Jul 2004 16:41:36 -0000 1.41 *************** *** 41,45 **** m_bDragging(false) { ! m_BGColor = CApplication::Instance()->GetDefaultFGColor(); switch (m_ScrollBarType) { --- 41,45 ---- m_bDragging(false) { ! m_BackgroundColor = CApplication::Instance()->GetDefaultForegroundColor(); switch (m_ScrollBarType) { *************** *** 100,104 **** CRect SubRect(m_ThumbRect); SubRect.Grow(-1); ! Painter.DrawRect(SubRect, true, COLOR_LIGHTGRAY, m_BGColor); Painter.DrawHLine(SubRect.Left(), SubRect.Right(), SubRect.Bottom(), COLOR_DARKGRAY); Painter.DrawVLine(SubRect.Top(), SubRect.Bottom(), SubRect.Right(), COLOR_DARKGRAY); --- 100,104 ---- CRect SubRect(m_ThumbRect); SubRect.Grow(-1); ! Painter.DrawRect(SubRect, true, COLOR_LIGHTGRAY, m_BackgroundColor); Painter.DrawHLine(SubRect.Left(), SubRect.Right(), SubRect.Bottom(), COLOR_DARKGRAY); Painter.DrawVLine(SubRect.Top(), SubRect.Bottom(), SubRect.Right(), COLOR_DARKGRAY); Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** wg_menu.cpp 15 Jul 2004 18:26:15 -0000 1.51 --- wg_menu.cpp 16 Jul 2004 16:41:36 -0000 1.52 *************** *** 44,48 **** m_pActivePopup(0), m_hRightArrowBitmap(WGRES_RIGHT_ARROW_BITMAP), ! m_HighlightColor(DEFAULT_BG_COLOR), m_pPopupTimer(0) { --- 44,48 ---- m_pActivePopup(0), m_hRightArrowBitmap(WGRES_RIGHT_ARROW_BITMAP), ! m_HighlightColor(DEFAULT_BACKGROUND_COLOR), m_pPopupTimer(0) { *************** *** 77,80 **** --- 77,81 ---- std::make_pair(MenuItem, std::make_pair(CRenderedString(m_pFontEngine, MenuItem.sItemText, CRenderedString::VALIGN_TOP), CRect()))); m_bCachedRectsValid = false; + Draw(); } *************** *** 140,152 **** if (iter->second.second.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !iter->first.bSpacer) { ! if (m_pHighlightedItem != &(iter->first)) ! { ! m_pPopupTimer->StopTimer(); ! m_pHighlightedItem = &(iter->first); ! if (iter->first.pPopup) ! { ! m_pPopupTimer->StartTimer(1000); ! } ! } break; } --- 141,145 ---- if (iter->second.second.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !iter->first.bSpacer) { ! m_pHighlightedItem = &(iter->first); break; } *************** *** 154,157 **** --- 147,155 ---- if (pOldHighlight != m_pHighlightedItem) { + m_pPopupTimer->StopTimer(); + if (m_pHighlightedItem->pPopup) + { + m_pPopupTimer->StartTimer(1000); + } Draw(); } *************** *** 226,229 **** --- 224,228 ---- MenuItem.pPopup->SetParentMenu(this); } + Draw(); } *************** *** 300,303 **** --- 299,327 ---- case CMessage::MOUSE_MOVE: { + CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); + if (m_bVisible && pMouseMessage && m_WindowRect.HitTest(ViewToWindow(pMouseMessage->Point)) == CRect::RELPOS_INSIDE) + { + UpdateCachedRects(); + SMenuItem* pOldHighlight = m_pHighlightedItem; + m_pHighlightedItem = 0; + CPoint WindowPoint(ViewToWindow(pMouseMessage->Point)); + 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; + } + } + if (pOldHighlight != m_pHighlightedItem) + { + Draw(); + } + } + else if (m_pHighlightedItem != 0) + { + m_pHighlightedItem = 0; + Draw(); + } break; } Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** wg_window.cpp 15 Jul 2004 18:26:15 -0000 1.50 --- wg_window.cpp 16 Jul 2004 16:41:36 -0000 1.51 *************** *** 41,45 **** m_sWindowText(""), m_WindowRect(WindowRect), ! m_BGColor(DEFAULT_BG_COLOR), m_ClientRect(WindowRect.SizeRect()), m_pParentWindow(0), --- 41,45 ---- m_sWindowText(""), m_WindowRect(WindowRect), ! m_BackgroundColor(DEFAULT_BACKGROUND_COLOR), m_ClientRect(WindowRect.SizeRect()), m_pParentWindow(0), *************** *** 53,57 **** SetWindowRect(WindowRect); ! m_BGColor = CApplication::Instance()->GetDefaultBGColor(); SetNewParent(pParent); } --- 53,57 ---- SetWindowRect(WindowRect); ! m_BackgroundColor = CApplication::Instance()->GetDefaultBackgroundColor(); SetNewParent(pParent); } *************** *** 243,247 **** { CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), true, m_BGColor, m_BGColor); CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); } --- 243,247 ---- { CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), true, m_BackgroundColor, m_BackgroundColor); CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); } Index: wg_label.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_label.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** wg_label.cpp 25 Jun 2004 19:37:51 -0000 1.19 --- wg_label.cpp 16 Jul 2004 16:41:36 -0000 1.20 *************** *** 46,50 **** m_pFontEngine, sText, CRenderedString::VALIGN_BOTTOM, CRenderedString::HALIGN_LEFT)); m_pRenderedString = pRenderedString; ! m_BGColor = CApplication::Instance()->GetDefaultBGColor(); Draw(); } --- 46,50 ---- m_pFontEngine, sText, CRenderedString::VALIGN_BOTTOM, CRenderedString::HALIGN_LEFT)); m_pRenderedString = pRenderedString; ! m_BackgroundColor = CApplication::Instance()->GetDefaultBackgroundColor(); Draw(); } Index: wg_toolbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_toolbar.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wg_toolbar.cpp 30 Jun 2004 22:31:02 -0000 1.15 --- wg_toolbar.cpp 16 Jul 2004 16:41:36 -0000 1.16 *************** *** 35,39 **** CWindow(WindowRect, pParent) { ! m_BGColor = COLOR_LIGHTGRAY; CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); Draw(); --- 35,39 ---- CWindow(WindowRect, pParent) { ! m_BackgroundColor = COLOR_LIGHTGRAY; CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); Draw(); Index: wg_listbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_listbox.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** wg_listbox.cpp 15 Jul 2004 18:26:15 -0000 1.44 --- wg_listbox.cpp 16 Jul 2004 16:41:36 -0000 1.45 *************** *** 56,60 **** m_pVScrollbar->SetMaxLimit(0); m_ClientRect = CRect(2, 2, m_WindowRect.Width() - 16, m_WindowRect.Height() - 4); ! m_BGColor = COLOR_WHITE; CMessageServer::Instance().RegisterMessageClient(this, CMessage::KEYBOARD_KEYDOWN); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_VALUECHANGE); --- 56,60 ---- m_pVScrollbar->SetMaxLimit(0); m_ClientRect = CRect(2, 2, m_WindowRect.Width() - 16, m_WindowRect.Height() - 4); ! m_BackgroundColor = COLOR_WHITE; CMessageServer::Instance().RegisterMessageClient(this, CMessage::KEYBOARD_KEYDOWN); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_VALUECHANGE); Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wg_textbox.cpp 15 Jul 2004 18:26:15 -0000 1.24 --- wg_textbox.cpp 16 Jul 2004 16:41:36 -0000 1.25 *************** *** 52,56 **** m_bScrollToCursor(false) { ! m_BGColor = COLOR_WHITE; m_ClientRect = CRect(3, 3, m_WindowRect.Width() - 17, m_WindowRect.Height() - 17); if (pFontEngine) --- 52,56 ---- m_bScrollToCursor(false) { ! m_BackgroundColor = COLOR_WHITE; m_ClientRect = CRect(3, 3, m_WindowRect.Width() - 17, m_WindowRect.Height() - 17); if (pFontEngine) *************** *** 100,104 **** void CTextBox::SetReadOnly(bool bReadOnly) // virtual { ! m_BGColor = bReadOnly ? COLOR_LIGHTGRAY : COLOR_WHITE; m_bReadOnly = bReadOnly; Draw(); --- 100,104 ---- void CTextBox::SetReadOnly(bool bReadOnly) // virtual { ! m_BackgroundColor = bReadOnly ? COLOR_LIGHTGRAY : COLOR_WHITE; m_bReadOnly = bReadOnly; Draw(); |
|
From: Rob W. <gre...@us...> - 2004-07-16 16:41:50
|
Update of /cvsroot/wgui/wgui/wgui_ex/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18181/wgui_ex/src Modified Files: wgex_bufferdisplay.cpp wgex_display.cpp wgex_tooltip.cpp Log Message: Draw architecture changes. Index: wgex_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_tooltip.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wgex_tooltip.cpp 12 Nov 2003 18:35:21 -0000 1.2 --- wgex_tooltip.cpp 16 Jul 2004 16:41:36 -0000 1.3 *************** *** 29,33 **** { ! CShadeToolTip::CShadeToolTip( CWindow* pToolWindow, std::string sText, CRGBColor& FontColor, CRGBColor& BGColor, CFontEngine* pFontEngine ) : CWindow( CRect(), pToolWindow ), m_FontColor( FontColor ), --- 29,33 ---- { ! CShadeToolTip::CShadeToolTip( CWindow* pToolWindow, std::string sText, CRGBColor& FontColor, CRGBColor& BackgroundColor, CFontEngine* pFontEngine ) : CWindow( CRect(), pToolWindow ), m_FontColor( FontColor ), *************** *** 43,47 **** m_pTimer = new CTimer(this); ! m_BGColor = BGColor; CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_TIMER); --- 43,47 ---- m_pTimer = new CTimer(this); ! m_BackgroundColor = BackgroundColor; CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_TIMER); *************** *** 60,64 **** CRenderedString RenderedString( m_pFontEngine, m_sWindowText, CRenderedString::VALIGN_TOP, CRenderedString::HALIGN_CENTER ); ! CPoint Dims; RenderedString.GetMetrics(&Dims, 0, 0); --- 60,64 ---- CRenderedString RenderedString( m_pFontEngine, m_sWindowText, CRenderedString::VALIGN_TOP, CRenderedString::HALIGN_CENTER ); ! CPoint Dims; RenderedString.GetMetrics(&Dims, 0, 0); *************** *** 104,112 **** // blit the outbound rect ! painter.DrawFilledRectAlpha(m_WindowRect, m_BGColor, m_iAlpha ); // blit the outbound rect ! painter.DrawRect(m_WindowRect, m_BGColor ); ! CRect SubRect(m_WindowRect); SubRect.Grow(-2); --- 104,112 ---- // blit the outbound rect ! painter.DrawFilledRectAlpha(m_WindowRect, m_BackgroundColor, m_iAlpha ); // blit the outbound rect ! painter.DrawRect(m_WindowRect, m_BackgroundColor ); ! CRect SubRect(m_WindowRect); SubRect.Grow(-2); Index: wgex_bufferdisplay.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_bufferdisplay.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wgex_bufferdisplay.cpp 26 Feb 2004 17:00:36 -0000 1.8 --- wgex_bufferdisplay.cpp 16 Jul 2004 16:41:36 -0000 1.9 *************** *** 281,285 **** DrawWaveDisabled( Painter ); Inset.Grow(+2); ! Painter.DrawFilledRect( Inset, m_BGColor ); Painter.DrawPanelOutset( Inset, true ); return; --- 281,285 ---- DrawWaveDisabled( Painter ); Inset.Grow(+2); ! Painter.DrawFilledRect( Inset, m_BackgroundColor ); Painter.DrawPanelOutset( Inset, true ); return; Index: wgex_display.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/wgui_ex/src/wgex_display.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wgex_display.cpp 26 Nov 2003 16:54:52 -0000 1.13 --- wgex_display.cpp 16 Jul 2004 16:41:36 -0000 1.14 *************** *** 41,47 **** m_bHaveValueText( bHaveText ) { ! m_BGColor = COLOR_PANEL_HI; m_bMousable = true; ! m_bReleased = false; m_fRelease = 1.0f; --- 41,47 ---- m_bHaveValueText( bHaveText ) { ! m_BackgroundColor = COLOR_PANEL_HI; m_bMousable = true; ! m_bReleased = false; m_fRelease = 1.0f; *************** *** 78,82 **** // fill with background -- ! Painter.DrawFilledRect( m_WindowRect, m_BGColor ); // draw a panel inset + inside -- --- 78,82 ---- // fill with background -- ! Painter.DrawFilledRect( m_WindowRect, m_BackgroundColor ); // draw a panel inset + inside -- *************** *** 186,190 **** if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && m_bMousable ! && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { --- 186,190 ---- if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && m_bMousable ! && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { *************** *** 210,214 **** break; } ! case CMouseMessage::MIDDLE: { --- 210,214 ---- break; } ! case CMouseMessage::MIDDLE: { *************** *** 225,229 **** CMessageServer::Instance().QueueMessage( new TFloatMessage(CMessage::CTRL_VALUECHANGE, m_pParentWindow, this, m_fValue) ); ! // set display and draw ! SetDisplayFloat( m_fValue ); --- 225,229 ---- CMessageServer::Instance().QueueMessage( new TFloatMessage(CMessage::CTRL_VALUECHANGE, m_pParentWindow, this, m_fValue) ); ! // set display and draw ! SetDisplayFloat( m_fValue ); *************** *** 276,280 **** break; } ! case CMouseMessage::MIDDLE: { --- 276,280 ---- break; } ! case CMouseMessage::MIDDLE: { *************** *** 292,296 **** else m_bReleased = false; ! bResult = true; break; --- 292,296 ---- else m_bReleased = false; ! bResult = true; break; *************** *** 338,342 **** case TOP2BOTTOM: m_fRelease = dx / 1000.0f - dy / 100.0f ; ! m_fValue -= dx / 5000.0f - dy / 200.0f ; break; case BOTTOM2TOP: --- 338,342 ---- case TOP2BOTTOM: m_fRelease = dx / 1000.0f - dy / 100.0f ; ! m_fValue -= dx / 5000.0f - dy / 200.0f ; break; case BOTTOM2TOP: *************** *** 365,369 **** break; } ! case CMouseMessage::MIDDLE: { bHandled = true; --- 365,369 ---- break; } ! case CMouseMessage::MIDDLE: { bHandled = true; *************** *** 530,534 **** // fill with background -- ! Painter.DrawFilledRect( m_WindowRect, m_BGColor ); // draw title text -- --- 530,534 ---- // fill with background -- ! Painter.DrawFilledRect( m_WindowRect, m_BackgroundColor ); // draw title text -- *************** *** 614,618 **** if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && m_bMousable ! && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { --- 614,618 ---- if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && m_bMousable ! && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && CApplication::Instance()->GetMouseFocus() == 0 ) { |
|
From: Rob W. <gre...@us...> - 2004-07-16 16:41:50
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18181/includes Modified Files: wg_application.h wg_color.h wg_painter.h wg_tooltip.h wg_window.h Log Message: Draw architecture changes. Index: wg_tooltip.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_tooltip.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** wg_tooltip.h 6 Jul 2004 16:32:25 -0000 1.19 --- wg_tooltip.h 16 Jul 2004 16:41:35 -0000 1.20 *************** *** 48,56 **** //! \param sText The label text //! \param FontColor The color of the tooltip text ! //! \param BGColor The color of the tooltip's background //! \param pFontEngine A pointer to the font engine to use when drawing the tooltip //! If this is left out (or set to 0) it will use the default font engine specified by the CApplication (which must be set before instantiating this object) CToolTip(CWindow* pToolWindow, std::string sText, ! CRGBColor& FontColor = DEFAULT_LINE_COLOR, CRGBColor& BGColor = COLOR_WHITE, CFontEngine* pFontEngine = 0); //! Standard destructor --- 48,56 ---- //! \param sText The label text //! \param FontColor The color of the tooltip text ! //! \param BackgroundColor The color of the tooltip's background //! \param pFontEngine A pointer to the font engine to use when drawing the tooltip //! If this is left out (or set to 0) it will use the default font engine specified by the CApplication (which must be set before instantiating this object) CToolTip(CWindow* pToolWindow, std::string sText, ! CRGBColor& FontColor = DEFAULT_LINE_COLOR, CRGBColor& BackgroundColor = COLOR_WHITE, CFontEngine* pFontEngine = 0); //! Standard destructor Index: wg_painter.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_painter.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wg_painter.h 2 Apr 2004 17:26:14 -0000 1.17 --- wg_painter.h 16 Jul 2004 16:41:35 -0000 1.18 *************** *** 87,91 **** //! \param FillColor The color to fill the rectangle with void DrawRect(const CRect& Rect, bool bFilled, const CRGBColor& BorderColor = DEFAULT_LINE_COLOR, ! const CRGBColor& FillColor = DEFAULT_FG_COLOR); //! Draw a line between two points --- 87,91 ---- //! \param FillColor The color to fill the rectangle with void DrawRect(const CRect& Rect, bool bFilled, const CRGBColor& BorderColor = DEFAULT_LINE_COLOR, ! const CRGBColor& FillColor = DEFAULT_FOREGROUND_COLOR); //! Draw a line between two points Index: wg_window.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_window.h,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** wg_window.h 6 Jul 2004 16:32:25 -0000 1.42 --- wg_window.h 16 Jul 2004 16:41:35 -0000 1.43 *************** *** 86,94 **** //! Set the window's background color //! \param Color A CRGBColor that represents the background color ! virtual void SetBGColor(const CRGBColor& Color) { m_BGColor = Color; } //! Retrieve a window's background color //! \return A CRGBColor object that represents the background color ! virtual CRGBColor GetBGColor(void) { return m_BGColor; } //! Describes the ancestor that is desired --- 86,94 ---- //! Set the window's background color //! \param Color A CRGBColor that represents the background color ! virtual void SetBackgroundColor(const CRGBColor& Color) { m_BackgroundColor = Color; } //! Retrieve a window's background color //! \return A CRGBColor object that represents the background color ! virtual CRGBColor GetBackgroundColor(void) { return m_BackgroundColor; } //! Describes the ancestor that is desired *************** *** 209,213 **** //! Background color of the window ! CRGBColor m_BGColor; //! The client area of the window, represented in the window's coordinates where (0,0) is the top left corner of the window --- 209,213 ---- //! Background color of the window ! CRGBColor m_BackgroundColor; //! The client area of the window, represented in the window's coordinates where (0,0) is the top left corner of the window Index: wg_color.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_color.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wg_color.h 2 Apr 2004 17:26:13 -0000 1.20 --- wg_color.h 16 Jul 2004 16:41:35 -0000 1.21 *************** *** 106,111 **** // Predefined colors ! extern CRGBColor DEFAULT_BG_COLOR; ! extern CRGBColor DEFAULT_FG_COLOR; extern CRGBColor DEFAULT_LINE_COLOR; extern CRGBColor DEFAULT_DISABLED_LINE_COLOR; --- 106,111 ---- // Predefined colors ! extern CRGBColor DEFAULT_BACKGROUND_COLOR; ! extern CRGBColor DEFAULT_FOREGROUND_COLOR; extern CRGBColor DEFAULT_LINE_COLOR; extern CRGBColor DEFAULT_DISABLED_LINE_COLOR; Index: wg_application.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_application.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** wg_application.h 8 Jun 2004 03:40:49 -0000 1.36 --- wg_application.h 16 Jul 2004 16:41:35 -0000 1.37 *************** *** 146,158 **** //! Gets the default background color (set in the wgui.conf file) //! \return Default background color ! virtual CRGBColor GetDefaultBGColor(void) const { return m_DefaultColorBG; } //! Gets the default foreground color (set in the wgui.conf file) //! \return Default foreground color ! virtual CRGBColor GetDefaultFGColor(void) const { return m_DefaultColorFG; } //! Gets the default selection color (set in the wgui.conf file) //! \return Default selection color ! virtual CRGBColor GetDefaultSelectionColor(void) const { return m_DefaultColorSelect; } //! The resource pool is used to keep wGui provided resources around even when there are no other handles begin kept by the user --- 146,158 ---- //! Gets the default background color (set in the wgui.conf file) //! \return Default background color ! virtual CRGBColor GetDefaultBackgroundColor(void) const { return m_DefaultBackgroundColor; } //! Gets the default foreground color (set in the wgui.conf file) //! \return Default foreground color ! virtual CRGBColor GetDefaultForegroundColor(void) const { return m_DefaultForegroundColor; } //! Gets the default selection color (set in the wgui.conf file) //! \return Default selection color ! virtual CRGBColor GetDefaultSelectionColor(void) const { return m_DefaultSelectionColor; } //! The resource pool is used to keep wGui provided resources around even when there are no other handles begin kept by the user *************** *** 226,232 **** CFontEngine* m_pDefaultFontEngine; //!< A pointer to the default font engine ! CRGBColor m_DefaultColorBG; //!< Default background color ! CRGBColor m_DefaultColorFG; //!< Default foreground color ! CRGBColor m_DefaultColorSelect; //!< Default selection color bool m_bHandleExceptionsInternally; //!< If true, wGui will handle most exceptions itself --- 226,232 ---- CFontEngine* m_pDefaultFontEngine; //!< A pointer to the default font engine ! CRGBColor m_DefaultBackgroundColor; //!< Default background color ! CRGBColor m_DefaultForegroundColor; //!< Default foreground color ! CRGBColor m_DefaultSelectionColor; //!< Default selection color bool m_bHandleExceptionsInternally; //!< If true, wGui will handle most exceptions itself |
|
From: Rob W. <gre...@us...> - 2004-07-16 16:41:44
|
Update of /cvsroot/wgui/wgui/includes/unit_tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18181/includes/unit_tests Modified Files: wg_window_unittests.h Log Message: Draw architecture changes. Index: wg_window_unittests.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/unit_tests/wg_window_unittests.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wg_window_unittests.h 25 Jun 2004 19:37:50 -0000 1.9 --- wg_window_unittests.h 16 Jul 2004 16:41:35 -0000 1.10 *************** *** 53,57 **** ensure("CWindow constructor", pWindow1->GetWindowRect() == wGui::CRect()); ensure("CWindow constructor", pWindow1->GetAncestor(wGui::CWindow::PARENT) == 0); ! ensure("CWindow constructor", pWindow1->GetBGColor() == wGui::DEFAULT_BG_COLOR); ensure("CWindow constructor", pWindow1->IsVisible()); --- 53,57 ---- ensure("CWindow constructor", pWindow1->GetWindowRect() == wGui::CRect()); ensure("CWindow constructor", pWindow1->GetAncestor(wGui::CWindow::PARENT) == 0); ! ensure("CWindow constructor", pWindow1->GetBackgroundColor() == wGui::DEFAULT_BACKGROUND_COLOR); ensure("CWindow constructor", pWindow1->IsVisible()); *************** *** 76,81 **** ensure("CWindow MoveWindow - WindowRect", pWindow1->GetWindowRect() == wGui::CRect(2, 5, 4, 7)); ensure("CWindow MoveWindow - ClientRect", pWindow1->GetClientRect() == wGui::CRect(2, 5, 2, 5)); ! pWindow1->SetBGColor(wGui::COLOR_YELLOW); ! ensure("CWindow SetBGColor", pWindow1->GetBGColor() == wGui::COLOR_YELLOW); wGui::CWindow* pWindow2 = new wGui::CWindow(wGui::CRect(), pWindow1); --- 76,81 ---- ensure("CWindow MoveWindow - WindowRect", pWindow1->GetWindowRect() == wGui::CRect(2, 5, 4, 7)); ensure("CWindow MoveWindow - ClientRect", pWindow1->GetClientRect() == wGui::CRect(2, 5, 2, 5)); ! pWindow1->SetBackgroundColor(wGui::COLOR_YELLOW); ! ensure("CWindow SetBackgroundColor", pWindow1->GetBackgroundColor() == wGui::COLOR_YELLOW); wGui::CWindow* pWindow2 = new wGui::CWindow(wGui::CRect(), pWindow1); |
|
From: Rob W. <gre...@us...> - 2004-07-16 16:41:44
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18181 Modified Files: CHANGES Log Message: Draw architecture changes. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.149 retrieving revision 1.150 diff -C2 -d -r1.149 -r1.150 *** CHANGES 15 Jul 2004 18:26:14 -0000 1.149 --- CHANGES 16 Jul 2004 16:41:35 -0000 1.150 *************** *** 5,13 **** --- 5,19 ---- + Added CWindow: ViewToClient() which does the opposite of ClientToView() + Added CWindow: ViewToWindow() which converts view coordinates to window coordinates + + Changed CApplication: GetDefaultBGColor() has been renamed to GetDefaultBackgroundColor() + + Changed CApplication: GetDefaultFGColor() has been renamed to GetDefaultForegroundColor() + Changed CDropDown: The listbox that is owned by the CDropDown class is now actually parented by it as well, instead of being parented by the root window (the view) + + Changed CRGBColor: DEFAULT_BG_COLOR has been renamed to DEFAULT_BACKGROUND_COLOR + + Changed CRGBColor: DEFAULT_FG_COLOR has been renamed to DEFAULT_FOREGROUND_COLOR + Changed CWindow: CWindows now have their own SDL surfaces for drawing, which is then blitted to the final surface on a screen update + Changed CWindow: GetClientRect() now returns the client rect in the window's coordinates, not in the screen coordinates, and does not clip to the window's rect + Changed CWindow: SetWindowRect() now scales the client rect along with the window rect + Changed CWindow: renamed ClientToScreen() to ClientToView() + + Changed CWindow: SetBGColor() has been renamed to SetBackgroundColor() + + Changed CWindow: GetBGColor() has been renamed to GetBackgroundColor() + Removed CWindow: DrawPostChild(), DrawChildren(), DrawBG(), DrawChildren, and StartDrawProc() have been removed + Bugfix CEditBox: The mouse cursor is no longer changed to an IBeam when over an edit box if it's also over a floating window |
|
From: Rob W. <gre...@us...> - 2004-07-15 18:26:42
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25778/src Modified Files: wg_dropdown.cpp wg_editbox.cpp wg_listbox.cpp wg_menu.cpp wg_textbox.cpp wg_window.cpp Log Message: Draw architecture changes. Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** wg_menu.cpp 8 Jul 2004 21:42:51 -0000 1.50 --- wg_menu.cpp 15 Jul 2004 18:26:15 -0000 1.51 *************** *** 432,436 **** m_bVisible = true; CView* pView = GetView(); ! if (!dynamic_cast<CPopupMenu*>(m_pParentWindow) && pView) { pView->SetFloatingWindow(this); --- 432,436 ---- m_bVisible = true; CView* pView = GetView(); ! if (pView && !dynamic_cast<CPopupMenu*>(m_pParentWindow)) { pView->SetFloatingWindow(this); Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** wg_editbox.cpp 30 Jun 2004 22:31:01 -0000 1.89 --- wg_editbox.cpp 15 Jul 2004 18:26:14 -0000 1.90 *************** *** 29,32 **** --- 29,33 ---- #include "wg_timer.h" #include "wg_error.h" + #include "wg_view.h" #include "wutil_debug.h" #include "std_ex.h" *************** *** 345,349 **** //Else if it's outside the control and the I Beam cursor is set, set it // back to a normal cursor. ! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; --- 346,358 ---- //Else if it's outside the control and the I Beam cursor is set, set it // back to a normal cursor. ! CView* pView = GetView(); ! int eFloatingWindowHit = CRect::RELPOS_INVALID; ! if (pView && pView->GetFloatingWindow()) ! { ! eFloatingWindowHit = pView->GetFloatingWindow()->GetWindowRect().SizeRect().HitTest( ! pView->GetFloatingWindow()->ViewToWindow(pMouseMessage->Point)); ! } ! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && ! eFloatingWindowHit != CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; *************** *** 351,355 **** CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if (m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; --- 360,365 ---- CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE || ! eFloatingWindowHit == CRect::RELPOS_INSIDE) && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; Index: wg_dropdown.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_dropdown.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wg_dropdown.cpp 7 Jul 2004 21:03:55 -0000 1.24 --- wg_dropdown.cpp 15 Jul 2004 18:26:14 -0000 1.25 *************** *** 45,49 **** } - // We create the listbox with the root window (probably a CView object) as it's parent, so that it gets the OnMouseButtonDown/Up properly m_pListBox = new CListBox(CRect(0, m_WindowRect.Height(), m_WindowRect.Width(), m_WindowRect.Height() + iItemHeight * 5 + 1), this, true, iItemHeight, pFontEngine); --- 45,48 ---- *************** *** 63,68 **** CDropDown::~CDropDown(void) { ! // The listbox is parented by the root window, so we need to delete it by hand ! // delete m_pListBox; } --- 62,73 ---- CDropDown::~CDropDown(void) { ! ! } ! ! ! void CDropDown::SetListboxHeight(int iItemCount) ! { ! m_pListBox->SetWindowRect( ! CRect(0, m_WindowRect.Height(), m_WindowRect.Width(), m_WindowRect.Height() + m_pListBox->GetItemHeight() * iItemCount + 1)); } *************** *** 181,186 **** pView->SetFloatingWindow(m_pListBox); } - // This makes sure the ListBox is at the top of the order so it gets first shot at the OnMouseButtonDown/Up - // m_pListBox->SetNewParent(m_pListBox->GetAncestor(PARENT)); m_pListBox->SetVisible(true); } --- 186,189 ---- Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** wg_window.cpp 6 Jul 2004 16:32:25 -0000 1.49 --- wg_window.cpp 15 Jul 2004 18:26:15 -0000 1.50 *************** *** 162,166 **** } } ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, GetAncestor(PARENT), this)); } } --- 162,166 ---- } } ! 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.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** wg_listbox.cpp 7 Jul 2004 21:03:55 -0000 1.43 --- wg_listbox.cpp 15 Jul 2004 18:26:15 -0000 1.44 *************** *** 162,167 **** { CWindow::SetWindowRect(WindowRect); ! m_ClientRect = CRect(1, 1, m_WindowRect.Width() - 12, m_WindowRect.Height() - 1); ! m_pVScrollbar->SetWindowRect(CRect(m_ClientRect.Right() + 1, 0, m_ClientRect.Right() + 12, m_WindowRect.Height())); } --- 162,170 ---- { CWindow::SetWindowRect(WindowRect); ! m_ClientRect = CRect(2, 2, m_WindowRect.Width() - 16, m_WindowRect.Height() - 4); ! CRect ScrollbarRect(m_WindowRect.SizeRect()); ! ScrollbarRect.Grow(-1); ! m_pVScrollbar->SetWindowRect( ! CRect(ScrollbarRect.Right() - 12, ScrollbarRect.Top(), ScrollbarRect.Right(), ScrollbarRect.Bottom()) - CPoint(2, 2) /* client adjustment */); } *************** *** 219,226 **** bool bResult = false; if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { ! if (m_iFocusedItem == stdex::safe_static_cast<int>((Point.YPos() - m_ClientRect.Top()) / m_iItemHeight + m_pVScrollbar->GetValue())) { if (m_bSingleSelection) --- 222,230 ---- 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())) { if (m_bSingleSelection) Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wg_textbox.cpp 6 Jul 2004 05:30:38 -0000 1.23 --- wg_textbox.cpp 15 Jul 2004 18:26:15 -0000 1.24 *************** *** 27,30 **** --- 27,31 ---- #include "wg_message_server.h" #include "wg_application.h" + #include "wg_view.h" #include "wg_error.h" #include "wutil_debug.h" *************** *** 401,405 **** //Else if it's outside the control and the I Beam cursor is set, set it // back to a normal cursor. ! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; --- 402,414 ---- //Else if it's outside the control and the I Beam cursor is set, set it // back to a normal cursor. ! CView* pView = GetView(); ! int eFloatingWindowHit = CRect::RELPOS_INVALID; ! if (pView && pView->GetFloatingWindow()) ! { ! eFloatingWindowHit = pView->GetFloatingWindow()->GetWindowRect().SizeRect().HitTest( ! pView->GetFloatingWindow()->ViewToWindow(pMouseMessage->Point)); ! } ! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && ! eFloatingWindowHit != CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; *************** *** 407,411 **** CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if (m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; --- 416,421 ---- CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE || ! eFloatingWindowHit == CRect::RELPOS_INSIDE) && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; |
|
From: Rob W. <gre...@us...> - 2004-07-15 18:26:41
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25778/includes Modified Files: wg_dropdown.h wg_rect.h Log Message: Draw architecture changes. Index: wg_rect.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_rect.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** wg_rect.h 25 Jun 2004 13:34:15 -0000 1.31 --- wg_rect.h 15 Jul 2004 18:26:14 -0000 1.32 *************** *** 193,196 **** --- 193,197 ---- enum ERelativePosition { + RELPOS_INVALID = 0, //!< This usually indicates some form of error RELPOS_ABOVE = 1, //!< The point is above the top of the CRect RELPOS_BELOW = 2, //!< The point is below the bottom of the CRect Index: wg_dropdown.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_dropdown.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wg_dropdown.h 1 Jul 2004 17:00:34 -0000 1.15 --- wg_dropdown.h 15 Jul 2004 18:26:14 -0000 1.16 *************** *** 89,92 **** --- 89,96 ---- void SetAllSelections(bool bSelected) { m_pListBox->SetAllSelections(bSelected); } + //! Sets the height of the drop list + //! \param iItemCount The height of the listbox in number of items shown (this is set to 5 by default) + void SetListboxHeight(int iItemCount); + // CWindow overrides |