wgui-cvs Mailing List for wGui (Page 5)
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-07-15 18:26:41
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25778 Modified Files: CHANGES Log Message: Draw architecture changes. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.148 retrieving revision 1.149 diff -C2 -d -r1.148 -r1.149 *** CHANGES 7 Jul 2004 21:03:54 -0000 1.148 --- CHANGES 15 Jul 2004 18:26:14 -0000 1.149 *************** *** 1,3 **** --- 1,4 ---- 0.3.3 -> 0.4.0 + + 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: PaintToSurface() which blits the window's sirface to the surface it is passed. *************** *** 9,13 **** + Changed CWindow: SetWindowRect() now scales the client rect along with the window rect + Changed CWindow: renamed ClientToScreen() to ClientToView() ! + Removed CWindow: DrawPostChild(), DrawChildren(), DrawBG(), DrawChildren, and StartDrawProc() has been removed --- 10,16 ---- + Changed CWindow: SetWindowRect() now scales the client rect along with the window rect + Changed CWindow: renamed ClientToScreen() to ClientToView() ! + 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 ! + 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 |
|
From: Rob W. <gre...@us...> - 2004-07-15 18:26:27
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25778/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.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** TestView1.cpp 7 Jul 2004 21:03:55 -0000 1.72 --- TestView1.cpp 15 Jul 2004 18:26:15 -0000 1.73 *************** *** 180,183 **** --- 180,184 ---- m_pDropDown->AddItem(wGui::SListItem("Item3", 0, wGui::COLOR_RED)); m_pDropDown->AddItem(wGui::SListItem("Item4")); + m_pDropDown->SetListboxHeight(8); m_pListBox = new wGui::CListBox(wGui::CRect(20, 290, 200, 360), this); m_pListBox->AddItem(wGui::SListItem("Item1")); |
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24720/tests Modified Files: CalcApp-VS71.vcproj ConfigEditor-VS71.vcproj MessagingTest-VS71.vcproj Notepad-VS71.vcproj TestApp1-VS71.vcproj TestApp2-VS71.vcproj UnitTests-VS71.vcproj Log Message: Update to new SDL and Freetype libraries. Index: CalcApp-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/CalcApp-VS71.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CalcApp-VS71.vcproj 19 Nov 2003 16:19:12 -0000 1.1 --- CalcApp-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.2 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="1" Index: UnitTests-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/UnitTests-VS71.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UnitTests-VS71.vcproj 9 Mar 2004 00:58:33 -0000 1.3 --- UnitTests-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.4 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="1" Index: TestApp2-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestApp2-VS71.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestApp2-VS71.vcproj 19 Nov 2003 16:19:12 -0000 1.1 --- TestApp2-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.2 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="1" Index: Notepad-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/Notepad-VS71.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Notepad-VS71.vcproj 22 Apr 2004 07:15:11 -0000 1.2 --- Notepad-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="1" Index: MessagingTest-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/MessagingTest-VS71.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MessagingTest-VS71.vcproj 19 Nov 2003 16:19:12 -0000 1.1 --- MessagingTest-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.2 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="1" Index: TestApp1-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestApp1-VS71.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestApp1-VS71.vcproj 19 Nov 2003 16:19:12 -0000 1.1 --- TestApp1-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.2 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="1" Index: ConfigEditor-VS71.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/ConfigEditor-VS71.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ConfigEditor-VS71.vcproj 19 Dec 2003 07:39:14 -0000 1.1 --- ConfigEditor-VS71.vcproj 11 Jul 2004 20:32:35 -0000 1.2 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="2" *************** *** 93,97 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="1" --- 93,97 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="1" |
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29195/tests Modified Files: CalcApp-VS7.vcproj ConfigEditor-VS7.vcproj MessagingTest-VS7.vcproj Notepad-VS7.vcproj TestApp1-VS7.vcproj TestApp2-VS7.vcproj UnitTests-VS7.vcproj Log Message: Changed the FreeType library to version 2.1.9 Index: UnitTests-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/UnitTests-VS7.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UnitTests-VS7.vcproj 20 Nov 2003 16:36:36 -0000 1.2 --- UnitTests-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.3 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/UnitTests.exe" LinkIncremental="1" Index: TestApp1-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestApp1-VS7.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestApp1-VS7.vcproj 19 Nov 2003 16:19:12 -0000 1.1 --- TestApp1-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/TestApp1.exe" LinkIncremental="1" Index: ConfigEditor-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/ConfigEditor-VS7.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ConfigEditor-VS7.vcproj 19 Dec 2003 07:39:14 -0000 1.1 --- ConfigEditor-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/ConfigEditor.exe" LinkIncremental="1" Index: CalcApp-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/CalcApp-VS7.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CalcApp-VS7.vcproj 19 Nov 2003 16:19:12 -0000 1.1 --- CalcApp-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/Calc.exe" LinkIncremental="1" Index: TestApp2-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestApp2-VS7.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TestApp2-VS7.vcproj 19 Nov 2003 16:19:12 -0000 1.1 --- TestApp2-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/TestApp2.exe" LinkIncremental="1" Index: Notepad-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/Notepad-VS7.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Notepad-VS7.vcproj 8 Apr 2004 22:02:19 -0000 1.1 --- Notepad-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/Notepad.exe" LinkIncremental="1" Index: MessagingTest-VS7.vcproj =================================================================== RCS file: /cvsroot/wgui/wgui/tests/MessagingTest-VS7.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MessagingTest-VS7.vcproj 19 Nov 2003 16:19:12 -0000 1.1 --- MessagingTest-VS7.vcproj 9 Jul 2004 19:46:48 -0000 1.2 *************** *** 36,40 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype214_D.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="2" --- 36,40 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrtd.lib msvcprtd.lib wGuid.lib freetype219_D.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="2" *************** *** 87,91 **** <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype214.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="1" --- 87,91 ---- <Tool Name="VCLinkerTool" ! AdditionalDependencies="SDL.lib sdlmain.lib msvcrt.lib MSVCPRT.LIB wGui.lib freetype219.lib" OutputFile="$(OutDir)/MessagingTest.exe" LinkIncremental="1" |
|
From: Rob W. <gre...@us...> - 2004-07-09 19:46:57
|
Update of /cvsroot/wgui/wgui/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29195/docs Modified Files: Coordinates.html Log Message: Changed the FreeType library to version 2.1.9 Index: Coordinates.html =================================================================== RCS file: /cvsroot/wgui/wgui/docs/Coordinates.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Coordinates.html 9 Jul 2004 16:46:40 -0000 1.1 --- Coordinates.html 9 Jul 2004 19:46:48 -0000 1.2 *************** *** 14,22 **** <p>The other major coordinate system is "Client Coordinates". These are relative to the top left corner of the window's client rect. The client rect itself is always in window coordinates. "Client Coordinates" are used when defining the position of any child windows of the ! window. The purpose of this is most easily seen when considering a CView window. Since all child windows (which is what any controls in the view are), are defined in terms of the view's client coordinate system, we can move them all just by redefining the CView's client rect. This is done when a menu is attached to the view to make room for it.</p> ! <p>wGui also defines a special "View Coordinates" system. This is simply the "Window Coordinates" for the view, but it also represents the ! coordinate system that directly relates to the pixels you see on the screen. In the end, everything is essentially translated to "View Coordinates".</p> <p>The CWindow class defines several methods to help translating between View and Client Coordinates, or View and Window Coordinates. A method for translating directly between Window and Client coordinates was not added, as it only requires the addition or subtraction of --- 14,25 ---- <p>The other major coordinate system is "Client Coordinates". These are relative to the top left corner of the window's client rect. The client rect itself is always in window coordinates. "Client Coordinates" are used when defining the position of any child windows of the ! window. All child window's Window Rects are defined using these coordinates. ! The purpose of this is most easily seen when considering a CView window. Since all child windows (which is what any controls in the view are), are defined in terms of the view's client coordinate system, we can move them all just by redefining the CView's client rect. This is done when a menu is attached to the view to make room for it.</p> ! <p>wGui also defines a special "View Coordinates" system. Because of the limitations of SDL, wGui cannot draw outside of it's view, ! so there isn't anything in screen coordinates. "View Coordinates" is as close as we can get. This is simply the "Window Coordinates" for the view, ! but it also represents the coordinate system that directly relates to the pixels you see on the screen. In the end, everything is essentially ! translated to "View Coordinates".</p> <p>The CWindow class defines several methods to help translating between View and Client Coordinates, or View and Window Coordinates. A method for translating directly between Window and Client coordinates was not added, as it only requires the addition or subtraction of |
|
From: Rob W. <gre...@us...> - 2004-07-09 16:46:52
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7946/includes Modified Files: wg_menu.h Log Message: Draw architecture changes. Index: wg_menu.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_menu.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** wg_menu.h 8 Jul 2004 21:42:50 -0000 1.34 --- wg_menu.h 9 Jul 2004 16:46:40 -0000 1.35 *************** *** 270,274 **** //! Check to see where it will fit, then show the popup menu //! \param ParentRect A CRect that defines the dimensions of the item that is spawning the popup ! //! \param BoundingRect A CRect that defines the boundaries the popup has to fit in virtual void ShowActivePopup(const CRect& ParentRect, const CRect& BoundingRect); --- 270,274 ---- //! Check to see where it will fit, then show the popup menu //! \param ParentRect A CRect that defines the dimensions of the item that is spawning the popup ! //! \param BoundingRect A CRect that defines the boundaries the popup has to fit in, this is in view coordinates virtual void ShowActivePopup(const CRect& ParentRect, const CRect& BoundingRect); |
|
From: Rob W. <gre...@us...> - 2004-07-09 16:46:49
|
Update of /cvsroot/wgui/wgui/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7946/docs Modified Files: index.html Added Files: Coordinates.html Log Message: Draw architecture changes. --- NEW FILE: Coordinates.html --- <html> <head> <title>wGui - Coordinate Systems</title> </head> <body> <h1>wGui - Coordinate Systems</h1> <p>wGui uses a coordinate system that can be a little confusing without some explanation.</p> <p>All the coordinate systems within wGui assume X increases as you move from left to right, and Y increases as you move from top to bottom on the screen. Negative coordinates are allowed.</p> <p>Every window in wGui has two coordinate systems associated with it. The first is called the "Window Coordinates", and is relative to the top left corner of the window (the top left corner of the window is always (0, 0)). This comes in handy when drawing the window, since the control doesn't need to calculate where it is on the screen before it can draw to the correct place. It only draws in reference to itself, and lets the rest of the system worry about where it will be placed. "Window Coordinates" are used for logic surrounding a window.</p> <p>The other major coordinate system is "Client Coordinates". These are relative to the top left corner of the window's client rect. The client rect itself is always in window coordinates. "Client Coordinates" are used when defining the position of any child windows of the window. The purpose of this is most easily seen when considering a CView window. Since all child windows (which is what any controls in the view are), are defined in terms of the view's client coordinate system, we can move them all just by redefining the CView's client rect. This is done when a menu is attached to the view to make room for it.</p> <p>wGui also defines a special "View Coordinates" system. This is simply the "Window Coordinates" for the view, but it also represents the coordinate system that directly relates to the pixels you see on the screen. In the end, everything is essentially translated to "View Coordinates".</p> <p>The CWindow class defines several methods to help translating between View and Client Coordinates, or View and Window Coordinates. A method for translating directly between Window and Client coordinates was not added, as it only requires the addition or subtraction of the Client Rect's TopLeft() point.</p> </body> </html> Index: index.html =================================================================== RCS file: /cvsroot/wgui/wgui/docs/index.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.html 7 Apr 2004 15:14:38 -0000 1.5 --- index.html 9 Jul 2004 16:46:40 -0000 1.6 *************** *** 7,10 **** --- 7,11 ---- <h2><a href="Overview.html">wGui Overview</a></h2> <h2><a href="Application.html">Application Framework</a></h2> + <h2><a href="Coordinates.html">Coordinate Systems</a></h2> <h2><a href="ConfigStore.html">Global Configuration</a></h2> <h2><a href="Controls.html">Controls</a></h2> |
|
From: Rob W. <gre...@us...> - 2004-07-08 21:42:59
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10783/src Modified Files: wg_menu.cpp wg_tooltip.cpp Log Message: Draw architecture changes. Index: wg_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wg_tooltip.cpp 6 Jul 2004 16:32:25 -0000 1.22 --- wg_tooltip.cpp 8 Jul 2004 21:42:51 -0000 1.23 *************** *** 98,102 **** ! void CToolTip::PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const { if (m_bVisible) --- 98,102 ---- ! void CToolTip::PaintToSurface(SDL_Surface& /*ScreenSurface*/, SDL_Surface& FloatingSurface, const CPoint& Offset) const { if (m_bVisible) *************** *** 108,112 **** for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) { ! (*iter)->PaintToSurface(ScreenSurface, FloatingSurface, NewOffset); } } --- 108,112 ---- for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) { ! (*iter)->PaintToSurface(FloatingSurface, FloatingSurface, NewOffset); } } Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** wg_menu.cpp 29 Jun 2004 22:14:20 -0000 1.49 --- wg_menu.cpp 8 Jul 2004 21:42:51 -0000 1.50 *************** *** 130,141 **** { CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); ! if (m_bVisible && pMouseMessage && m_WindowRect.HitTest(pMouseMessage->Point) == CRect::RELPOS_INSIDE) { UpdateCachedRects(); SMenuItem* pOldHighlight = m_pHighlightedItem; m_pHighlightedItem = 0; for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->second.second.HitTest(pMouseMessage->Point) == CRect::RELPOS_INSIDE && !iter->first.bSpacer) { if (m_pHighlightedItem != &(iter->first)) --- 130,142 ---- { 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) { if (m_pHighlightedItem != &(iter->first)) *************** *** 258,267 **** if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->second.second.HitTest(Point) == CRect::RELPOS_INSIDE && !iter->first.bSpacer) { HideActivePopup(); --- 259,268 ---- if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->second.second.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE && !iter->first.bSpacer) { HideActivePopup(); *************** *** 428,432 **** } ! SetWindowRect(CRect(Position, Position + CPoint(m_WindowRect.Width() - 1, iHeight + 2))); m_bVisible = true; CView* pView = GetView(); --- 429,433 ---- } ! SetWindowRect(GetAncestor(PARENT)->ViewToClient(CRect(Position, Position + CPoint(m_WindowRect.Width() - 1, iHeight + 2)))); m_bVisible = true; CView* pView = GetView(); *************** *** 478,482 **** bool CPopupMenu::IsInsideChild(const CPoint& Point) const { ! if (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE) { return true; --- 479,483 ---- bool CPopupMenu::IsInsideChild(const CPoint& Point) const { ! if (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE) { return true; *************** *** 495,501 **** CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect, false, COLOR_LIGHTGRAY); ! Painter.DrawHLine(m_WindowRect.Left(), m_WindowRect.Right(), m_WindowRect.Bottom(), COLOR_DARKGRAY); ! Painter.DrawVLine(m_WindowRect.Top(), m_WindowRect.Bottom(), m_WindowRect.Right(), COLOR_DARKGRAY); UpdateCachedRects(); for (t_MenuItemVector::const_iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) --- 496,502 ---- CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_LIGHTGRAY); ! Painter.DrawHLine(0, m_WindowRect.Width(), m_WindowRect.Height(), COLOR_DARKGRAY); ! Painter.DrawVLine(0, m_WindowRect.Height(), m_WindowRect.Width(), COLOR_DARKGRAY); UpdateCachedRects(); for (t_MenuItemVector::const_iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) *************** *** 536,550 **** bool CPopupMenu::OnMouseButtonDown(CPoint Point, unsigned int Button) { bool bResult = false; if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->second.second.HitTest(Point) == CRect::RELPOS_INSIDE && !iter->first.bSpacer) { if (!iter->first.pPopup) --- 537,568 ---- + void CPopupMenu::PaintToSurface(SDL_Surface& /*ScreenSurface*/, SDL_Surface& FloatingSurface, const CPoint& Offset) const + { + if (m_bVisible) + { + SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); + SDL_Rect DestRect = CRect(m_WindowRect + Offset).SDLRect(); + SDL_BlitSurface(m_pSDLSurface, &SourceRect, &FloatingSurface, &DestRect); + CPoint NewOffset = m_ClientRect.TopLeft() + m_WindowRect.TopLeft() + Offset; + for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) + { + (*iter)->PaintToSurface(FloatingSurface, FloatingSurface, NewOffset); + } + } + } + + bool CPopupMenu::OnMouseButtonDown(CPoint Point, unsigned int Button) { bool bResult = false; + CPoint WindowPoint(ViewToWindow(Point)); if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); for (t_MenuItemVector::iterator iter = m_MenuItems.begin(); iter != m_MenuItems.end(); ++iter) { ! if (iter->second.second.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !iter->first.bSpacer) { if (!iter->first.pPopup) *************** *** 585,589 **** { CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); ! if (m_bVisible && pMouseMessage && (m_WindowRect.HitTest(pMouseMessage->Point) != CRect::RELPOS_INSIDE)) { // If the user clicked outside the window, we just want to hide the window, --- 603,608 ---- { CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); ! if (m_bVisible && pMouseMessage && ! m_WindowRect.SizeRect().HitTest(ViewToWindow(pMouseMessage->Point)) != CRect::RELPOS_INSIDE) { // If the user clicked outside the window, we just want to hide the window, *************** *** 591,595 **** // But we only want the root popup to do this, and only if none of it's children were hit if (!dynamic_cast<CPopupMenu*>(m_pParentWindow) && !IsInsideChild(pMouseMessage->Point) && ! !(m_pParentMenu && m_pParentMenu->GetWindowRect().HitTest(pMouseMessage->Point) == CRect::RELPOS_INSIDE)) { HideAll(); --- 610,615 ---- // But we only want the root popup to do this, and only if none of it's children were hit if (!dynamic_cast<CPopupMenu*>(m_pParentWindow) && !IsInsideChild(pMouseMessage->Point) && ! !(m_pParentMenu && m_pParentMenu->GetWindowRect().SizeRect().HitTest( ! m_pParentMenu->ViewToWindow(pMouseMessage->Point)) == CRect::RELPOS_INSIDE)) { HideAll(); *************** *** 675,683 **** if (BoundingRect.HitTest(ParentRect.TopRight() + CPoint(5, 0) + CPoint(MenuRect.Width(), 0)) & CRect::RELPOS_RIGHT) { ! m_pActivePopup->Show(ParentRect.TopLeft() - CPoint(MenuRect.Width() + 5, 0)); } else { ! m_pActivePopup->Show(ParentRect.TopRight() + CPoint(5, 0)); } } --- 695,703 ---- if (BoundingRect.HitTest(ParentRect.TopRight() + CPoint(5, 0) + CPoint(MenuRect.Width(), 0)) & CRect::RELPOS_RIGHT) { ! m_pActivePopup->Show(ClientToView(ParentRect.TopLeft() - CPoint(MenuRect.Width() + 5, 0)) - m_ClientRect.TopLeft()); } else { ! m_pActivePopup->Show(ClientToView(ParentRect.TopRight() + CPoint(5, 0)) - m_ClientRect.TopLeft()); } } |
|
From: Rob W. <gre...@us...> - 2004-07-08 21:42:59
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10783/includes Modified Files: wg_menu.h Log Message: Draw architecture changes. Index: wg_menu.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_menu.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** wg_menu.h 3 Jun 2004 19:10:52 -0000 1.33 --- wg_menu.h 8 Jul 2004 21:42:50 -0000 1.34 *************** *** 216,220 **** //! Show the popup at the given point ! //! \param Position The point to use for the top left corner of the popup void Show(CPoint Position); --- 216,220 ---- //! Show the popup at the given point ! //! \param Position The point to use for the top left corner of the popup, in view coordinates void Show(CPoint Position); *************** *** 244,247 **** --- 244,253 ---- virtual void Draw(void) const; + //! Blit the window to the given surface, using m_WindowRect as the offset into the surface + //! \param ScreenSurface A reference to the surface that the window will be copied to + //! \param FloatingSurface A reference to the floating surface which is overlayed at the very end (used for tooltips, menus and such) + //! \param Offset This is the current offset into the Surface that should be used as reference + virtual void PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const; + //! This is called whenever the popup is clicked on by the mouse //! Only the topmost window that bounds the point will be called by the system |
|
From: Rob W. <gre...@us...> - 2004-07-07 21:04:04
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30602/src Modified Files: wg_dropdown.cpp wg_listbox.cpp wg_scrollbar.cpp wg_view.cpp Log Message: Draw architecture changes. Index: wg_view.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_view.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** wg_view.cpp 6 Jul 2004 16:32:25 -0000 1.40 --- wg_view.cpp 7 Jul 2004 21:03:55 -0000 1.41 *************** *** 81,84 **** --- 81,85 ---- if (m_pMenu) { + m_pMenu->SetNewParent(this); int iMenuHeight = m_pMenu->GetWindowRect().Height(); m_pMenu->SetWindowRect(CRect(0, -iMenuHeight, m_WindowRect.Width() - 1, -1)); Index: wg_dropdown.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_dropdown.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wg_dropdown.cpp 1 Jul 2004 17:00:34 -0000 1.23 --- wg_dropdown.cpp 7 Jul 2004 21:03:55 -0000 1.24 *************** *** 46,52 **** // 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( ! ClientToView(CRect(0, m_WindowRect.Height(), m_WindowRect.Width(), m_WindowRect.Height() + iItemHeight * 5 + 1)), ! GetAncestor(ROOT), true, iItemHeight, pFontEngine); m_pListBox->SetVisible(false); m_pListBox->SetDropDown(this); --- 46,51 ---- // 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); m_pListBox->SetVisible(false); m_pListBox->SetDropDown(this); *************** *** 65,69 **** { // The listbox is parented by the root window, so we need to delete it by hand ! delete m_pListBox; } --- 64,68 ---- { // The listbox is parented by the root window, so we need to delete it by hand ! // delete m_pListBox; } *************** *** 72,77 **** { CWindow::SetWindowRect(WindowRect); ! m_pListBox->SetWindowRect(ClientToView( ! CRect(0, m_WindowRect.Height(), m_WindowRect.Width(), m_WindowRect.Height() + m_pListBox->GetItemHeight() * 5 + 1))); m_pDropButton->SetWindowRect(CRect(m_WindowRect.Width() - m_WindowRect.Height() + 1, 0, m_WindowRect.Width(), m_WindowRect.Height())); m_pEditBox->SetWindowRect(CRect(0, 0, m_WindowRect.Width() - m_WindowRect.Height(), m_WindowRect.Height())); --- 71,75 ---- { CWindow::SetWindowRect(WindowRect); ! m_pListBox->SetWindowRect(CRect(0, m_WindowRect.Height(), m_WindowRect.Width(), m_WindowRect.Height() + m_pListBox->GetItemHeight() * 5 + 1)); m_pDropButton->SetWindowRect(CRect(m_WindowRect.Width() - m_WindowRect.Height() + 1, 0, m_WindowRect.Width(), m_WindowRect.Height())); m_pEditBox->SetWindowRect(CRect(0, 0, m_WindowRect.Width() - m_WindowRect.Height(), m_WindowRect.Height())); *************** *** 184,188 **** } // 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); } --- 182,186 ---- } // 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); } Index: wg_listbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_listbox.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** wg_listbox.cpp 6 Jul 2004 05:30:38 -0000 1.42 --- wg_listbox.cpp 7 Jul 2004 21:03:55 -0000 1.43 *************** *** 167,170 **** --- 167,193 ---- + void CListBox::PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const + { + if (m_pDropDown) + { + if (m_bVisible) + { + SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); + SDL_Rect DestRect = CRect(m_WindowRect + Offset).SDLRect(); + SDL_BlitSurface(m_pSDLSurface, &SourceRect, &FloatingSurface, &DestRect); + CPoint NewOffset = m_ClientRect.TopLeft() + m_WindowRect.TopLeft() + Offset; + for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) + { + (*iter)->PaintToSurface(FloatingSurface, FloatingSurface, NewOffset); + } + } + } + else + { + CWindow::PaintToSurface(ScreenSurface, FloatingSurface, Offset); + } + } + + bool CListBox::OnMouseButtonDown(CPoint Point, unsigned int Button) { Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** wg_scrollbar.cpp 6 Jul 2004 03:29:02 -0000 1.39 --- wg_scrollbar.cpp 7 Jul 2004 21:03:55 -0000 1.40 *************** *** 45,61 **** { case VERTICAL: ! m_ClientRect = CRect(0, m_WindowRect.Width() + 1, m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(0, -m_ClientRect.Width() - 1, m_ClientRect.Width() - 1, -1), this, CwgBitmapResourceHandle(WGRES_UP_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(0, m_ClientRect.Height() + 1, m_ClientRect.Width(), m_ClientRect.Height() + m_ClientRect.Width()), this, CwgBitmapResourceHandle(WGRES_DOWN_ARROW_BITMAP)); break; case HORIZONTAL: ! m_ClientRect = CRect(m_WindowRect.Height() + 1, 0, m_WindowRect.Width() - m_WindowRect.Height() - 1, m_WindowRect.Height() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(-m_ClientRect.Height() - 1, 0, -1, m_ClientRect.Height() - 1), this, CwgBitmapResourceHandle(WGRES_LEFT_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(m_ClientRect.Width() + 1, 0, m_ClientRect.Width() + m_ClientRect.Height(), m_ClientRect.Height()), this, CwgBitmapResourceHandle(WGRES_RIGHT_ARROW_BITMAP)); break; --- 45,61 ---- { case VERTICAL: ! m_ClientRect = CRect(0, m_WindowRect.Width(), m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(0, -m_ClientRect.Width(), m_ClientRect.Width() - 1, -1), this, CwgBitmapResourceHandle(WGRES_UP_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(0, m_ClientRect.Height() + 1, m_ClientRect.Width() - 1, m_ClientRect.Height() + m_ClientRect.Width()), this, CwgBitmapResourceHandle(WGRES_DOWN_ARROW_BITMAP)); break; case HORIZONTAL: ! m_ClientRect = CRect(m_WindowRect.Height(), 0, m_WindowRect.Width() - m_WindowRect.Height() - 1, m_WindowRect.Height() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(-m_ClientRect.Height(), 0, -1, m_ClientRect.Height() - 1), this, CwgBitmapResourceHandle(WGRES_LEFT_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(m_ClientRect.Width() + 1, 0, m_ClientRect.Width() + m_ClientRect.Height(), m_ClientRect.Height() - 1), this, CwgBitmapResourceHandle(WGRES_RIGHT_ARROW_BITMAP)); break; *************** *** 116,129 **** case VERTICAL: { ! m_ClientRect = CRect(0, m_WindowRect.Width() + 1, m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft->SetWindowRect(CRect(0, -m_ClientRect.Width() - 1, m_ClientRect.Width() - 1, -1)); ! m_pBtnDownRight->SetWindowRect(CRect(0, m_ClientRect.Height() + 1, m_ClientRect.Width(), m_ClientRect.Height() + m_ClientRect.Width())); break; } case HORIZONTAL: { ! m_ClientRect = CRect(m_WindowRect.Height() + 1, 0, m_WindowRect.Width() - m_WindowRect.Height() - 1, m_WindowRect.Height() - 1); ! m_pBtnUpLeft->SetWindowRect(CRect(-m_ClientRect.Height() - 1, 0, -1, m_ClientRect.Height() - 1)); ! m_pBtnDownRight->SetWindowRect(CRect(m_ClientRect.Width() + 1, 0, m_ClientRect.Width() + m_ClientRect.Height(), m_ClientRect.Height())); break; } --- 116,129 ---- case VERTICAL: { ! m_ClientRect = CRect(0, m_WindowRect.Width(), m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft->SetWindowRect(CRect(0, -m_ClientRect.Width(), m_ClientRect.Width() - 1, -1)); ! m_pBtnDownRight->SetWindowRect(CRect(0, m_ClientRect.Height() + 1, m_ClientRect.Width() - 1, m_ClientRect.Height() + m_ClientRect.Width())); break; } case HORIZONTAL: { ! 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; } |
|
From: Rob W. <gre...@us...> - 2004-07-07 21:04:04
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30602/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.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** TestView1.cpp 1 Jul 2004 17:00:36 -0000 1.71 --- TestView1.cpp 7 Jul 2004 21:03:55 -0000 1.72 *************** *** 114,120 **** m_pCheckBox = new wGui::CCheckBox(wGui::CRect(224, 124, 236, 136), this); new wGui::CLabel(wGui::CRect(245, 120, 380, 140), this, "Read-Only EditBox2"); ! m_pVScrollBar = new wGui::CScrollBar(wGui::CRect(m_ClientRect.Width() - 12, 0, m_ClientRect.Width(), m_ClientRect.Height() - 12), this, wGui::CScrollBar::VERTICAL); ! m_pHScrollBar = new wGui::CScrollBar(wGui::CRect(0, m_ClientRect.Height() - 12, m_ClientRect.Width() - 12, m_ClientRect.Height()), this, wGui::CScrollBar::HORIZONTAL); m_pTestWindow = new CTestWindow(wGui::CRect(240, 10, 340, 110), this); --- 114,120 ---- m_pCheckBox = new wGui::CCheckBox(wGui::CRect(224, 124, 236, 136), this); new wGui::CLabel(wGui::CRect(245, 120, 380, 140), this, "Read-Only EditBox2"); ! m_pVScrollBar = new wGui::CScrollBar(wGui::CRect(m_ClientRect.Width() - 12, 0, m_ClientRect.Width(), m_ClientRect.Height() - 13), this, wGui::CScrollBar::VERTICAL); ! m_pHScrollBar = new wGui::CScrollBar(wGui::CRect(0, m_ClientRect.Height() - 12, m_ClientRect.Width() - 13, m_ClientRect.Height()), this, wGui::CScrollBar::HORIZONTAL); m_pTestWindow = new CTestWindow(wGui::CRect(240, 10, 340, 110), this); |
|
From: Rob W. <gre...@us...> - 2004-07-07 21:04:04
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30602/includes Modified Files: wg_listbox.h Log Message: Draw architecture changes. Index: wg_listbox.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_listbox.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wg_listbox.h 3 Jun 2004 19:10:52 -0000 1.25 --- wg_listbox.h 7 Jul 2004 21:03:55 -0000 1.26 *************** *** 127,130 **** --- 127,136 ---- virtual void SetWindowRect(const CRect& WindowRect); + //! Blit the window to the given surface, using m_WindowRect as the offset into the surface + //! \param ScreenSurface A reference to the surface that the window will be copied to + //! \param FloatingSurface A reference to the floating surface which is overlayed at the very end (used for tooltips, menus and such) + //! \param Offset This is the current offset into the Surface that should be used as reference + virtual void PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const; + //! This is called whenever the listbox is clicked on by the mouse //! Only the topmost window that bounds the point will be called by the system |
|
From: Rob W. <gre...@us...> - 2004-07-07 21:04:03
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30602 Modified Files: CHANGES Log Message: Draw architecture changes. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** CHANGES 6 Jul 2004 05:30:36 -0000 1.147 --- CHANGES 7 Jul 2004 21:03:54 -0000 1.148 *************** *** 4,7 **** --- 4,8 ---- + Added CWindow: ViewToClient() which does the opposite of ClientToView() + Added CWindow: ViewToWindow() which converts view coordinates to window coordinates + + 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 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 |
|
From: Rob W. <gre...@us...> - 2004-07-06 16:32:35
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10078/src Modified Files: 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.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** wg_view.cpp 30 Jun 2004 22:31:02 -0000 1.39 --- wg_view.cpp 6 Jul 2004 16:32:25 -0000 1.40 *************** *** 44,48 **** m_bFullScreen(bFullScreen), m_pMenu(0), ! m_pFloatingWindow(0) { if (m_pInstance) --- 44,49 ---- m_bFullScreen(bFullScreen), m_pMenu(0), ! m_pFloatingWindow(0), ! m_pScreenSurface(0) { if (m_pInstance) *************** *** 57,62 **** CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP, CMessageServer::PRIORITY_FIRST); ! SetWindowRect( WindowRect ); ! SetWindowText( sTitle ); CApplication::Instance()->GetApplicationLog().AddLogEntry("Created new CView : " + sTitle, APP_LOG_INFO); Draw(); --- 58,63 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP, CMessageServer::PRIORITY_FIRST); ! SetWindowRect(WindowRect); ! SetWindowText(sTitle); CApplication::Instance()->GetApplicationLog().AddLogEntry("Created new CView : " + sTitle, APP_LOG_INFO); Draw(); *************** *** 142,146 **** if (pMessage->Destination() == this || pMessage->Destination() == 0) { ! PaintToSurface(*m_pScreenSurface, CPoint(0, 0)); SDL_UpdateRect(m_pScreenSurface, 0, 0, 0, 0); bHandled = true; --- 143,153 ---- if (pMessage->Destination() == this || pMessage->Destination() == 0) { ! SDL_Surface* pFloatingSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), ! 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); ! PaintToSurface(*m_pScreenSurface, *pFloatingSurface, CPoint(0, 0)); ! SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); ! SDL_Rect DestRect = CRect(m_WindowRect.SizeRect()).SDLRect(); ! SDL_BlitSurface(pFloatingSurface, &SourceRect, m_pScreenSurface, &DestRect); ! SDL_FreeSurface(pFloatingSurface); SDL_UpdateRect(m_pScreenSurface, 0, 0, 0, 0); bHandled = true; Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** wg_window.cpp 6 Jul 2004 05:30:38 -0000 1.48 --- wg_window.cpp 6 Jul 2004 16:32:25 -0000 1.49 *************** *** 248,252 **** ! void CWindow::PaintToSurface(SDL_Surface& Surface, const CPoint& Offset) const { if (m_bVisible) --- 248,252 ---- ! void CWindow::PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const { if (m_bVisible) *************** *** 254,262 **** SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); SDL_Rect DestRect = CRect(m_WindowRect + Offset).SDLRect(); ! SDL_BlitSurface(m_pSDLSurface, &SourceRect, &Surface, &DestRect); CPoint NewOffset = m_ClientRect.TopLeft() + m_WindowRect.TopLeft() + Offset; for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) { ! (*iter)->PaintToSurface(Surface, NewOffset); } } --- 254,262 ---- SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); SDL_Rect DestRect = CRect(m_WindowRect + Offset).SDLRect(); ! SDL_BlitSurface(m_pSDLSurface, &SourceRect, &ScreenSurface, &DestRect); CPoint NewOffset = m_ClientRect.TopLeft() + m_WindowRect.TopLeft() + Offset; for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) { ! (*iter)->PaintToSurface(ScreenSurface, FloatingSurface, NewOffset); } } Index: wg_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wg_tooltip.cpp 6 Jul 2004 05:30:38 -0000 1.21 --- wg_tooltip.cpp 6 Jul 2004 16:32:25 -0000 1.22 *************** *** 98,101 **** --- 98,117 ---- + void CToolTip::PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const + { + if (m_bVisible) + { + SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); + SDL_Rect DestRect = CRect(m_WindowRect + Offset).SDLRect(); + SDL_BlitSurface(m_pSDLSurface, &SourceRect, &FloatingSurface, &DestRect); + CPoint NewOffset = m_ClientRect.TopLeft() + m_WindowRect.TopLeft() + Offset; + for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) + { + (*iter)->PaintToSurface(ScreenSurface, FloatingSurface, NewOffset); + } + } + } + + bool CToolTip::HandleMessage(CMessage* pMessage) { |
|
From: Rob W. <gre...@us...> - 2004-07-06 16:32:33
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10078/includes Modified Files: 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.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wg_tooltip.h 6 Jul 2004 05:30:37 -0000 1.18 --- wg_tooltip.h 6 Jul 2004 16:32:25 -0000 1.19 *************** *** 73,76 **** --- 73,82 ---- virtual void MoveWindow(const CPoint& MoveDistance); + //! Blit the window to the given surface, using m_WindowRect as the offset into the surface + //! \param ScreenSurface A reference to the surface that the window will be copied to + //! \param FloatingSurface A reference to the floating surface which is overlayed at the very end (used for tooltips, menus and such) + //! \param Offset This is the current offset into the Surface that should be used as reference + virtual void PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const; + // CMessageClient overrides Index: wg_window.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_window.h,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** wg_window.h 6 Jul 2004 05:30:37 -0000 1.41 --- wg_window.h 6 Jul 2004 16:32:25 -0000 1.42 *************** *** 159,165 **** //! Blit the window to the given surface, using m_WindowRect as the offset into the surface ! //! \param Surface A reference to the surface that the window will be copied to //! \param Offset This is the current offset into the Surface that should be used as reference ! virtual void PaintToSurface(SDL_Surface& Surface, const CPoint& Offset) const; //! Transfer the ownership of the window, so it has a new parent --- 159,166 ---- //! Blit the window to the given surface, using m_WindowRect as the offset into the surface ! //! \param ScreenSurface A reference to the surface that the window will be copied to ! //! \param FloatingSurface A reference to the floating surface which is overlayed at the very end (used for tooltips, menus and such) //! \param Offset This is the current offset into the Surface that should be used as reference ! virtual void PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const; //! Transfer the ownership of the window, so it has a new parent |
|
From: Rob W. <gre...@us...> - 2004-07-06 05:30:50
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19966/src Modified Files: wg_listbox.cpp wg_textbox.cpp wg_tooltip.cpp wg_window.cpp Log Message: New drawing architecture work. Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** wg_window.cpp 6 Jul 2004 03:29:02 -0000 1.47 --- wg_window.cpp 6 Jul 2004 05:30:38 -0000 1.48 *************** *** 96,107 **** - CRect CWindow::GetClientRect(void) const - { - CRect ClientRect(m_ClientRect); - ClientRect.ClipTo(m_WindowRect); - return ClientRect; - } - - CWindow* CWindow::GetAncestor(EAncestor eAncestor) const { --- 96,99 ---- *************** *** 165,169 **** { (*iter)->SetVisible(bVisible); ! if ((*iter) == CApplication::Instance()->GetKeyFocus()) { CApplication::Instance()->SetKeyFocus(0); --- 157,161 ---- { (*iter)->SetVisible(bVisible); ! if (!bVisible && (*iter) == CApplication::Instance()->GetKeyFocus()) { CApplication::Instance()->SetKeyFocus(0); Index: wg_listbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_listbox.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** wg_listbox.cpp 30 Jun 2004 22:31:01 -0000 1.41 --- wg_listbox.cpp 6 Jul 2004 05:30:38 -0000 1.42 *************** *** 242,247 **** m_iFocusedItem++; int diff = m_iFocusedItem - m_pVScrollbar->GetValue(); ! CRect ClientRect(GetClientRect()); ! if (m_iItemHeight * (m_pVScrollbar->GetValue() + diff + 1) > (unsigned int) ClientRect.Height()) { m_pVScrollbar->SetValue(m_pVScrollbar->GetValue() + 1); --- 242,246 ---- m_iFocusedItem++; int diff = m_iFocusedItem - m_pVScrollbar->GetValue(); ! if (m_iItemHeight * (m_pVScrollbar->GetValue() + diff + 1) > stdex::safe_static_cast<unsigned int>(m_ClientRect.Height())) { m_pVScrollbar->SetValue(m_pVScrollbar->GetValue() + 1); *************** *** 269,275 **** case SDLK_PAGEDOWN: { - CRect ClientRect(GetClientRect()); int nSize = Size() - 1; ! int nItemsPerPage = ClientRect.Height() / m_iItemHeight; if (m_iFocusedItem + nItemsPerPage < nSize) { --- 268,273 ---- case SDLK_PAGEDOWN: { int nSize = Size() - 1; ! int nItemsPerPage = m_ClientRect.Height() / m_iItemHeight; if (m_iFocusedItem + nItemsPerPage < nSize) { *************** *** 287,292 **** case SDLK_PAGEUP: { ! CRect ClientRect(GetClientRect()); ! int nItemsPerPage = ClientRect.Height() / m_iItemHeight; if (m_iFocusedItem - nItemsPerPage > 0) { --- 285,289 ---- case SDLK_PAGEUP: { ! int nItemsPerPage = m_ClientRect.Height() / m_iItemHeight; if (m_iFocusedItem - nItemsPerPage > 0) { Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wg_textbox.cpp 30 Jun 2004 22:31:01 -0000 1.22 --- wg_textbox.cpp 6 Jul 2004 05:30:38 -0000 1.23 *************** *** 64,72 **** m_pDblClickTimer = new CTimer(); m_pCursorTimer = new CTimer(this); ! m_ClientRect.Grow(-1); m_pVerticalScrollBar = new CScrollBar( ! CRect(m_ClientRect.Right() - 12, m_ClientRect.Top(), m_ClientRect.Right(), m_ClientRect.Bottom() - 12) , this, CScrollBar::VERTICAL), m_pHorizontalScrollBar = new CScrollBar( ! CRect(m_ClientRect.Left(), m_ClientRect.Bottom() - 12, m_ClientRect.Right() - 12, m_ClientRect.Bottom()) , this, CScrollBar::HORIZONTAL), m_ScrollBarVisibilityMap[CScrollBar::VERTICAL] = SCROLLBAR_VIS_AUTO; m_ScrollBarVisibilityMap[CScrollBar::HORIZONTAL] = SCROLLBAR_VIS_AUTO; --- 64,72 ---- m_pDblClickTimer = new CTimer(); m_pCursorTimer = new CTimer(this); ! 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; *************** *** 159,163 **** Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); CPoint FontCenterPoint = m_WindowRect.Center(); - CRect TextRect(m_ClientRect); CRGBColor FontColor = m_bReadOnly ? DEFAULT_DISABLED_LINE_COLOR : DEFAULT_LINE_COLOR; --- 159,162 ---- *************** *** 195,210 **** // move the cursor into view by scrolling if necessary ! int CursorPos = vCharRects[SelStartPoint.YPos()][SelStartPoint.XPos()].Left() + vOffsets[SelStartPoint.YPos()].XPos() + TextRect.Left() - m_pHorizontalScrollBar->GetValue() * 10; if (m_bScrollToCursor) { ! if (CursorPos < TextRect.Left()) { ! m_pHorizontalScrollBar->SetValue(m_pHorizontalScrollBar->GetValue() - (TextRect.Left() - CursorPos) / 10 - 1); ! CursorPos = vCharRects[SelStartPoint.YPos()][SelStartPoint.XPos()].Left() + vOffsets[SelStartPoint.YPos()].XPos() + TextRect.Left() - m_pHorizontalScrollBar->GetValue() * 10; } ! if (CursorPos > TextRect.Right()) { ! m_pHorizontalScrollBar->SetValue(m_pHorizontalScrollBar->GetValue() + (CursorPos - TextRect.Right()) / 10 + 1); ! CursorPos = vCharRects[SelStartPoint.YPos()][SelStartPoint.XPos()].Left() + vOffsets[SelStartPoint.YPos()].XPos() + TextRect.Left() - m_pHorizontalScrollBar->GetValue() * 10; } if (SelStartPoint.YPos() < m_pVerticalScrollBar->GetValue()) --- 194,209 ---- // 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) { ! if (CursorPos < m_ClientRect.Left()) { ! 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()) *************** *** 224,238 **** for (int CurLine = SelStartPoint.YPos(); CurLine <= SelEndPoint.YPos(); ++CurLine) { ! CPoint TopLeft = TextRect.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() + TextRect.Left() - m_pHorizontalScrollBar->GetValue() * 10); } if (CurLine == SelEndPoint.YPos()) { ! SelRect.SetRight(vCharRects[CurLine][SelEndPoint.XPos() - 1].Right() + vOffsets[CurLine].XPos() + TextRect.Left() - m_pHorizontalScrollBar->GetValue() * 10); } ! SelRect.ClipTo(TextRect); Painter.DrawRect(SelRect, true, CApplication::Instance()->GetDefaultSelectionColor(), CApplication::Instance()->GetDefaultSelectionColor()); } --- 223,237 ---- for (int CurLine = SelStartPoint.YPos(); CurLine <= SelEndPoint.YPos(); ++CurLine) { ! 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); Painter.DrawRect(SelRect, true, CApplication::Instance()->GetDefaultSelectionColor(), CApplication::Instance()->GetDefaultSelectionColor()); } *************** *** 242,249 **** if (m_SelLength == 0 && SelStartPoint.YPos() >= m_pVerticalScrollBar->GetValue() && m_bDrawCursor) { ! if (CursorPos >= TextRect.Left() && CursorPos <= TextRect.Right()) { ! Painter.DrawVLine(TextRect.Top() + m_iRowHeight * (SelStartPoint.YPos() - m_pVerticalScrollBar->GetValue()) - 1, ! TextRect.Top() + m_iRowHeight * (SelStartPoint.YPos() - m_pVerticalScrollBar->GetValue() + 1) - 1, CursorPos, COLOR_BLACK); } } --- 241,248 ---- if (m_SelLength == 0 && SelStartPoint.YPos() >= m_pVerticalScrollBar->GetValue() && m_bDrawCursor) { ! if (CursorPos >= m_ClientRect.Left() && CursorPos <= m_ClientRect.Right()) { ! Painter.DrawVLine(m_ClientRect.Top() + m_iRowHeight * (SelStartPoint.YPos() - m_pVerticalScrollBar->GetValue()) - 1, ! m_ClientRect.Top() + m_iRowHeight * (SelStartPoint.YPos() - m_pVerticalScrollBar->GetValue() + 1) - 1, CursorPos, COLOR_BLACK); } } *************** *** 251,258 **** // finally, draw the text ! CPoint LineOrigin = TextRect.TopLeft() - CPoint(m_pHorizontalScrollBar->GetValue() * 10, 0); for(std::vector<CRenderedString*>::const_iterator iter = m_vpRenderedString.begin() + m_pVerticalScrollBar->GetValue(); ! iter != m_vpRenderedString.end() && LineOrigin.YPos() < TextRect.Bottom(); ++iter) { ! (*iter)->Draw(m_pSDLSurface, TextRect, LineOrigin, FontColor); LineOrigin.SetY(LineOrigin.YPos() + m_iRowHeight); } --- 250,257 ---- // finally, draw the text ! CPoint LineOrigin = m_ClientRect.TopLeft() - CPoint(m_pHorizontalScrollBar->GetValue() * 10, 0); for(std::vector<CRenderedString*>::const_iterator iter = m_vpRenderedString.begin() + m_pVerticalScrollBar->GetValue(); ! iter != m_vpRenderedString.end() && LineOrigin.YPos() < m_ClientRect.Bottom(); ++iter) { ! (*iter)->Draw(m_pSDLSurface, m_ClientRect, LineOrigin, FontColor); LineOrigin.SetY(LineOrigin.YPos() + m_iRowHeight); } *************** *** 285,289 **** CPoint WindowPoint(ViewToWindow(Point)); ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (GetClientRect().HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { if (Button == CMouseMessage::LEFT && !m_bReadOnly) --- 284,288 ---- CPoint WindowPoint(ViewToWindow(Point)); ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { if (Button == CMouseMessage::LEFT && !m_bReadOnly) Index: wg_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wg_tooltip.cpp 29 Jun 2004 22:14:20 -0000 1.20 --- wg_tooltip.cpp 6 Jul 2004 05:30:38 -0000 1.21 *************** *** 66,70 **** void CToolTip::ShowTip(const CPoint& DrawPoint) { ! SetWindowRect(m_BoundingRect + DrawPoint); SetVisible(true); Draw(); --- 66,70 ---- void CToolTip::ShowTip(const CPoint& DrawPoint) { ! SetWindowRect(m_pParentWindow->ViewToClient(m_BoundingRect + DrawPoint)); SetVisible(true); Draw(); *************** *** 112,116 **** { // Timer has expired, so it's time to show the tooltip ! ShowTip(ViewToClient(m_LastMousePosition) + CPoint(-6, 18)); bHandled = true; } --- 112,116 ---- { // Timer has expired, so it's time to show the tooltip ! ShowTip(m_LastMousePosition + CPoint(-6, 18)); bHandled = true; } *************** *** 130,134 **** } if (m_pParentWindow->GetWindowRect().SizeRect().HitTest( ! m_pParentWindow->ViewToClient(m_LastMousePosition)) == CRect::RELPOS_INSIDE) { m_pTimer->StartTimer(1000); --- 130,134 ---- } if (m_pParentWindow->GetWindowRect().SizeRect().HitTest( ! m_pParentWindow->ViewToWindow(m_LastMousePosition)) == CRect::RELPOS_INSIDE) { m_pTimer->StartTimer(1000); |
|
From: Rob W. <gre...@us...> - 2004-07-06 05:30:46
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19966/includes Modified Files: wg_tooltip.h wg_window.h Log Message: New drawing architecture work. Index: wg_tooltip.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_tooltip.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wg_tooltip.h 2 Apr 2004 17:26:14 -0000 1.17 --- wg_tooltip.h 6 Jul 2004 05:30:37 -0000 1.18 *************** *** 58,62 **** //! Displays the tooltip ! //! \param DrawPoint Where to poisition the top left corner of the tooltip void ShowTip(const CPoint& DrawPoint); --- 58,62 ---- //! Displays the tooltip ! //! \param DrawPoint Where to poisition the top left corner of the tooltip, in view coordinates void ShowTip(const CPoint& DrawPoint); Index: wg_window.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_window.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** wg_window.h 30 Jun 2004 22:31:01 -0000 1.40 --- wg_window.h 6 Jul 2004 05:30:37 -0000 1.41 *************** *** 69,72 **** --- 69,73 ---- //! Gets the window's rectangle + //! This is represented in the window's parent's client coordinates //! \return A copy of the CRect that the window represents virtual CRect GetWindowRect(void) const { return m_WindowRect; } *************** *** 81,85 **** //! Internally it's represented via the window's coordinates //! \return The client area CRect ! virtual CRect GetClientRect(void) const; //! Set the window's background color --- 82,86 ---- //! Internally it's represented via the window's coordinates //! \return The client area CRect ! virtual CRect GetClientRect(void) const { return m_ClientRect; } //! Set the window's background color |
|
From: Rob W. <gre...@us...> - 2004-07-06 05:30:46
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19966 Modified Files: CHANGES Log Message: New drawing architecture work. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** CHANGES 1 Jul 2004 17:00:32 -0000 1.146 --- CHANGES 6 Jul 2004 05:30:36 -0000 1.147 *************** *** 5,9 **** + Added CWindow: ViewToWindow() which converts view coordinates to window coordinates + 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 + Changed CWindow: SetWindowRect() now scales the client rect along with the window rect + Changed CWindow: renamed ClientToScreen() to ClientToView() --- 5,9 ---- + Added CWindow: ViewToWindow() which converts view coordinates to window coordinates + 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() |
|
From: Rob W. <gre...@us...> - 2004-07-06 03:29:11
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3267/src Modified Files: wg_button.cpp wg_scrollbar.cpp wg_window.cpp Log Message: New drawing architecture work. Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** wg_window.cpp 1 Jul 2004 17:00:35 -0000 1.46 --- wg_window.cpp 6 Jul 2004 03:29:02 -0000 1.47 *************** *** 40,43 **** --- 40,44 ---- CWindow::CWindow(const CRect& WindowRect, CWindow* pParent) : m_sWindowText(""), + m_WindowRect(WindowRect), m_BGColor(DEFAULT_BG_COLOR), m_ClientRect(WindowRect.SizeRect()), *************** *** 289,293 **** bool bResult = false; ! if (m_bVisible && (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) --- 290,294 ---- bool bResult = false; ! if (m_bVisible && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) *************** *** 309,313 **** bool bResult = false; ! if (m_bVisible && (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) --- 310,314 ---- bool bResult = false; ! if (m_bVisible && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** wg_scrollbar.cpp 1 Jul 2004 17:00:35 -0000 1.38 --- wg_scrollbar.cpp 6 Jul 2004 03:29:02 -0000 1.39 *************** *** 46,50 **** case VERTICAL: m_ClientRect = CRect(0, m_WindowRect.Width() + 1, m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(0, -m_ClientRect.Width(), m_ClientRect.Width() - 1, -1), this, CwgBitmapResourceHandle(WGRES_UP_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( --- 46,50 ---- case VERTICAL: m_ClientRect = CRect(0, m_WindowRect.Width() + 1, m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(0, -m_ClientRect.Width() - 1, m_ClientRect.Width() - 1, -1), this, CwgBitmapResourceHandle(WGRES_UP_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( *************** *** 54,58 **** case HORIZONTAL: m_ClientRect = CRect(m_WindowRect.Height() + 1, 0, m_WindowRect.Width() - m_WindowRect.Height() - 1, m_WindowRect.Height() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(-m_ClientRect.Height(), 0, -1, m_ClientRect.Height() - 1), this, CwgBitmapResourceHandle(WGRES_LEFT_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( --- 54,58 ---- case HORIZONTAL: m_ClientRect = CRect(m_WindowRect.Height() + 1, 0, m_WindowRect.Width() - m_WindowRect.Height() - 1, m_WindowRect.Height() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(-m_ClientRect.Height() - 1, 0, -1, m_ClientRect.Height() - 1), this, CwgBitmapResourceHandle(WGRES_LEFT_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( *************** *** 117,121 **** { m_ClientRect = CRect(0, m_WindowRect.Width() + 1, m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft->SetWindowRect(CRect(0, -m_ClientRect.Width(), m_ClientRect.Width() - 1, -1)); m_pBtnDownRight->SetWindowRect(CRect(0, m_ClientRect.Height() + 1, m_ClientRect.Width(), m_ClientRect.Height() + m_ClientRect.Width())); break; --- 117,121 ---- { m_ClientRect = CRect(0, m_WindowRect.Width() + 1, m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft->SetWindowRect(CRect(0, -m_ClientRect.Width() - 1, m_ClientRect.Width() - 1, -1)); m_pBtnDownRight->SetWindowRect(CRect(0, m_ClientRect.Height() + 1, m_ClientRect.Width(), m_ClientRect.Height() + m_ClientRect.Width())); break; *************** *** 124,128 **** { m_ClientRect = CRect(m_WindowRect.Height() + 1, 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())); break; --- 124,128 ---- { m_ClientRect = CRect(m_WindowRect.Height() + 1, 0, m_WindowRect.Width() - m_WindowRect.Height() - 1, m_WindowRect.Height() - 1); ! m_pBtnUpLeft->SetWindowRect(CRect(-m_ClientRect.Height() - 1, 0, -1, m_ClientRect.Height() - 1)); m_pBtnDownRight->SetWindowRect(CRect(m_ClientRect.Width() + 1, 0, m_ClientRect.Width() + m_ClientRect.Height(), m_ClientRect.Height())); break; *************** *** 147,151 **** if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! m_ClientRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE) { if (Button == CMouseMessage::WHEELUP) --- 147,151 ---- if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE) { if (Button == CMouseMessage::WHEELUP) *************** *** 161,165 **** else if (Button == CMouseMessage::LEFT) { ! switch (m_ThumbRect.HitTest(ViewToClient(Point))) { case CRect::RELPOS_INSIDE: --- 161,165 ---- else if (Button == CMouseMessage::LEFT) { ! switch (m_ThumbRect.HitTest(ViewToWindow(Point))) { case CRect::RELPOS_INSIDE: *************** *** 212,221 **** { case VERTICAL: ! m_Value = ConstrainValue((pMouseMessage->Point.YPos() - m_ClientRect.Top()) * ! (m_MaxLimit - m_MinLimit) / m_ClientRect.Height() + m_MinLimit); break; case HORIZONTAL: ! m_Value = ConstrainValue((pMouseMessage->Point.XPos() - m_ClientRect.Left()) * ! (m_MaxLimit - m_MinLimit) / m_ClientRect.Width() + m_MinLimit); break; default: --- 212,221 ---- { case VERTICAL: ! m_Value = ConstrainValue((ViewToWindow(pMouseMessage->Point).YPos() - m_ClientRect.Top() - m_ThumbRect.Height() / 2) * ! (m_MaxLimit - m_MinLimit) / (m_ClientRect.Height() - m_ThumbRect.Height()) + m_MinLimit); break; case HORIZONTAL: ! m_Value = ConstrainValue((ViewToWindow(pMouseMessage->Point).XPos() - m_ClientRect.Left() - m_ThumbRect.Width() / 2) * ! (m_MaxLimit - m_MinLimit) / (m_ClientRect.Width() - m_ThumbRect.Width()) + m_MinLimit); break; default: *************** *** 272,277 **** iThumbHeight = 10; } ! m_ThumbRect.SetTop(m_ClientRect.Top() + (m_ClientRect.Height() - iThumbHeight) * (m_Value - m_MinLimit) / (m_MaxLimit - m_MinLimit) - 1); ! m_ThumbRect.SetBottom(m_ThumbRect.Top() + iThumbHeight); break; } --- 272,277 ---- iThumbHeight = 10; } ! m_ThumbRect.SetTop(m_ClientRect.Top() + (m_ClientRect.Height() - iThumbHeight) * (m_Value - m_MinLimit) / (m_MaxLimit - m_MinLimit)); ! m_ThumbRect.SetBottom(m_ThumbRect.Top() + iThumbHeight + 1); break; } *************** *** 283,288 **** iThumbWidth = 10; } ! m_ThumbRect.SetLeft(m_ClientRect.Left() + (m_ClientRect.Width() - iThumbWidth) * (m_Value - m_MinLimit) / (m_MaxLimit - m_MinLimit) - 1); ! m_ThumbRect.SetRight(m_ThumbRect.Left() + iThumbWidth); break; } --- 283,288 ---- iThumbWidth = 10; } ! m_ThumbRect.SetLeft(m_ClientRect.Left() + (m_ClientRect.Width() - iThumbWidth) * (m_Value - m_MinLimit) / (m_MaxLimit - m_MinLimit)); ! m_ThumbRect.SetRight(m_ThumbRect.Left() + iThumbWidth + 1); break; } Index: wg_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_button.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** wg_button.cpp 30 Jun 2004 22:31:01 -0000 1.36 --- wg_button.cpp 6 Jul 2004 03:29:02 -0000 1.37 *************** *** 195,198 **** --- 195,199 ---- std::auto_ptr<CBitmapResourceHandle> phBitmap(new CBitmapFileResourceHandle(sPictureFile)); m_phBitmap = phBitmap; + Draw(); } *************** *** 203,206 **** --- 204,208 ---- std::auto_ptr<CBitmapResourceHandle> phBitmap(new CBitmapResourceHandle(hBitmap)); m_phBitmap = phBitmap; + Draw(); } *************** *** 230,237 **** CWindow::Draw(); ! CRect SubRect(m_WindowRect); SubRect.Grow(-1); CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect, false, COLOR_BLACK); switch (m_eButtonState) { --- 232,239 ---- CWindow::Draw(); ! CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); switch (m_eButtonState) { |
|
From: Rob W. <gre...@us...> - 2004-07-01 17:01:19
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2601/includes Modified Files: wg_dropdown.h Log Message: Draw architecture changes. Index: wg_dropdown.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_dropdown.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wg_dropdown.h 3 Jun 2004 19:10:52 -0000 1.14 --- wg_dropdown.h 1 Jul 2004 17:00:34 -0000 1.15 *************** *** 55,67 **** virtual ~CDropDown(void); - // CWindow overrides - //! Set the WindowText of the control - //! \param sWindowText The text to assign to the window - virtual void SetWindowText(std::string sWindowText); - - //CWindow overrides - //! Get the WindowText of the control - virtual std::string GetWindowText(); - //! Adds a new item to the list //! \param ListItem A SListItem structure with the data for the item --- 55,58 ---- *************** *** 99,102 **** --- 90,110 ---- + // CWindow overrides + //! Giving a control a new WindowRect will move and resize the control + //! \param WindowRect A CRect that defines the outer limits of the control + virtual void SetWindowRect(const CRect& WindowRect); + + //! Set the WindowText of the control + //! \param sWindowText The text to assign to the window + virtual void SetWindowText(std::string sWindowText); + + //! Get the WindowText of the control + virtual std::string GetWindowText(); + + //! Move the window and any child windows + //! \param MoveDistance The relative distance to move the window + virtual void MoveWindow(const CPoint& MoveDistance); + + // CMessageClient overrides //! CDropDown will handle MOUSE_BUTTONDOWN messages |
|
From: Rob W. <gre...@us...> - 2004-07-01 17:01:19
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2601 Modified Files: CHANGES Log Message: Draw architecture changes. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** CHANGES 30 Jun 2004 22:30:52 -0000 1.145 --- CHANGES 1 Jul 2004 17:00:32 -0000 1.146 *************** *** 6,9 **** --- 6,10 ---- + 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 + + Changed CWindow: SetWindowRect() now scales the client rect along with the window rect + Changed CWindow: renamed ClientToScreen() to ClientToView() + Removed CWindow: DrawPostChild(), DrawChildren(), DrawBG(), DrawChildren, and StartDrawProc() has been removed |
|
From: Rob W. <gre...@us...> - 2004-07-01 17:00:59
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2601/src Modified Files: wg_dropdown.cpp wg_groupbox.cpp wg_scrollbar.cpp wg_window.cpp Log Message: Draw architecture changes. Index: wg_dropdown.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_dropdown.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wg_dropdown.cpp 30 Jun 2004 22:31:01 -0000 1.22 --- wg_dropdown.cpp 1 Jul 2004 17:00:34 -0000 1.23 *************** *** 47,51 **** // 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( ! ClientToView(CRect(m_WindowRect.BottomLeft(), CPoint(m_WindowRect.Right(), m_WindowRect.Bottom() + iItemHeight * 5 + 1))), GetAncestor(ROOT), true, iItemHeight, pFontEngine); m_pListBox->SetVisible(false); --- 47,51 ---- // 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( ! ClientToView(CRect(0, m_WindowRect.Height(), m_WindowRect.Width(), m_WindowRect.Height() + iItemHeight * 5 + 1)), GetAncestor(ROOT), true, iItemHeight, pFontEngine); m_pListBox->SetVisible(false); *************** *** 69,72 **** --- 69,82 ---- + void CDropDown::SetWindowRect(const CRect& WindowRect) + { + CWindow::SetWindowRect(WindowRect); + m_pListBox->SetWindowRect(ClientToView( + CRect(0, m_WindowRect.Height(), m_WindowRect.Width(), m_WindowRect.Height() + m_pListBox->GetItemHeight() * 5 + 1))); + m_pDropButton->SetWindowRect(CRect(m_WindowRect.Width() - m_WindowRect.Height() + 1, 0, m_WindowRect.Width(), m_WindowRect.Height())); + m_pEditBox->SetWindowRect(CRect(0, 0, m_WindowRect.Width() - m_WindowRect.Height(), m_WindowRect.Height())); + } + + void CDropDown::SetWindowText(std::string sWindowText) { *************** *** 74,77 **** --- 84,88 ---- } + std::string CDropDown::GetWindowText() { *************** *** 79,82 **** --- 90,101 ---- } + + void CDropDown::MoveWindow(const CPoint& MoveDistance) + { + CWindow::MoveWindow(MoveDistance); + m_pListBox->MoveWindow(MoveDistance); + } + + bool CDropDown::HandleMessage(CMessage* pMessage) { Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** wg_window.cpp 30 Jun 2004 22:31:02 -0000 1.45 --- wg_window.cpp 1 Jul 2004 17:00:35 -0000 1.46 *************** *** 75,83 **** void CWindow::SetWindowRect(const CRect& WindowRect) { m_WindowRect = WindowRect; if (m_pSDLSurface) SDL_FreeSurface(m_pSDLSurface); ! m_pSDLSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), 32, 0x000000FF, 0x0000FF00, 0x00FF0000, /*0xFF000000*/ 0); ! Draw(); // we need to redraw here because we've got a new empty buffer } --- 75,88 ---- void CWindow::SetWindowRect(const CRect& WindowRect) { + double dHorizontalScale = m_WindowRect.Width() != 0 ? static_cast<double>(WindowRect.Width()) / m_WindowRect.Width() : 0; + double dVerticalScale = m_WindowRect.Height() != 0 ? static_cast<double>(WindowRect.Height()) / m_WindowRect.Height() : 0; m_WindowRect = WindowRect; if (m_pSDLSurface) SDL_FreeSurface(m_pSDLSurface); ! m_pSDLSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), ! 32, 0x000000FF, 0x0000FF00, 0x00FF0000, /*0xFF000000*/ 0); ! 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)); ! Draw(); // we need to redraw here because we've got a new buffer } *************** *** 86,93 **** { m_WindowRect = m_WindowRect + MoveDistance; - for (std::list<CWindow*>::iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) - { - (*iter)->MoveWindow(MoveDistance); - } CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); } --- 91,94 ---- Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** wg_scrollbar.cpp 30 Jun 2004 22:31:01 -0000 1.37 --- wg_scrollbar.cpp 1 Jul 2004 17:00:35 -0000 1.38 *************** *** 147,151 **** if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE) { if (Button == CMouseMessage::WHEELUP) --- 147,151 ---- if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! m_ClientRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE) { if (Button == CMouseMessage::WHEELUP) *************** *** 161,165 **** else if (Button == CMouseMessage::LEFT) { ! switch (m_ThumbRect.HitTest(Point)) { case CRect::RELPOS_INSIDE: --- 161,165 ---- else if (Button == CMouseMessage::LEFT) { ! switch (m_ThumbRect.HitTest(ViewToClient(Point))) { case CRect::RELPOS_INSIDE: Index: wg_groupbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_groupbox.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wg_groupbox.cpp 30 Jun 2004 22:31:01 -0000 1.16 --- wg_groupbox.cpp 1 Jul 2004 17:00:35 -0000 1.17 *************** *** 65,69 **** CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(CRect(0, 5, m_WindowRect.Width(), m_WindowRect.Height()), false, DEFAULT_LINE_COLOR); CPoint Dims, Offset; --- 65,69 ---- CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(CRect(0, 5, m_WindowRect.Width() - 1, m_WindowRect.Height() - 5), false, DEFAULT_LINE_COLOR); CPoint Dims, Offset; |
|
From: Rob W. <gre...@us...> - 2004-07-01 17:00:48
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2601/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.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** TestView1.cpp 30 Jun 2004 22:31:02 -0000 1.70 --- TestView1.cpp 1 Jul 2004 17:00:36 -0000 1.71 *************** *** 48,55 **** Painter.DrawRect(m_WindowRect.SizeRect(), false, wGui::COLOR_WHITE); Painter.DrawRect(m_ClientRect, false, wGui::COLOR_RED); ! Painter.DrawLine(wGui::CPoint(10, 70), wGui::CPoint(60, 70)); ! Painter.DrawLine(wGui::CPoint(20, 30), wGui::CPoint(60, 50), wGui::COLOR_GREEN); ! Painter.DrawLine(wGui::CPoint(60, 30), wGui::CPoint(70, 100), wGui::COLOR_RED); ! Painter.DrawLine(wGui::CPoint(20, 30), wGui::CPoint(20, 100), wGui::COLOR_BLUE); } --- 48,55 ---- Painter.DrawRect(m_WindowRect.SizeRect(), false, wGui::COLOR_WHITE); Painter.DrawRect(m_ClientRect, false, wGui::COLOR_RED); ! Painter.DrawLine(wGui::CPoint(10, 50), wGui::CPoint(60, 50)); ! Painter.DrawLine(wGui::CPoint(20, 10), wGui::CPoint(60, 30), wGui::COLOR_GREEN); ! Painter.DrawLine(wGui::CPoint(60, 10), wGui::CPoint(70, 80), wGui::COLOR_RED); ! Painter.DrawLine(wGui::CPoint(20, 10), wGui::CPoint(20, 80), wGui::COLOR_BLUE); } *************** *** 107,111 **** m_pTextBox->SetWindowText("This is a multiline text box.\nThis should be the second line.\nThe third goes here.\nAnd this is a really long line that should extend beyond the right border.\nNow we follow with a bunch of newlines.\n\n\n\n\n\nThe End."); m_pGroupBox = new wGui::CGroupBox(wGui::CRect(225, 160, 470, 260), this, "GroupBox"); ! m_pBigassEditBox = new wGui::CEditBox(wGui::CRect(5, 5, 220, 60), m_pGroupBox, wGui::CApplication::Instance()->GetFontEngine("Vera.ttf", 25)); m_pBigassEditBox->SetWindowText("Big box to test stuff"); new wGui::CToolTip(m_pBigassEditBox, "This is a Big Ass Editbox"); --- 107,111 ---- m_pTextBox->SetWindowText("This is a multiline text box.\nThis should be the second line.\nThe third goes here.\nAnd this is a really long line that should extend beyond the right border.\nNow we follow with a bunch of newlines.\n\n\n\n\n\nThe End."); m_pGroupBox = new wGui::CGroupBox(wGui::CRect(225, 160, 470, 260), this, "GroupBox"); ! m_pBigassEditBox = new wGui::CEditBox(wGui::CRect(5, 5, 220, 45), m_pGroupBox, wGui::CApplication::Instance()->GetFontEngine("Vera.ttf", 25)); m_pBigassEditBox->SetWindowText("Big box to test stuff"); new wGui::CToolTip(m_pBigassEditBox, "This is a Big Ass Editbox"); *************** *** 175,179 **** pContextSubmenu3->InsertMenuItem(wGui::SMenuItem("Empty submenu", 0, pContextSubmenu4)); ! m_pDropDown = new wGui::CDropDown(wGui::CRect(10, 70, 205, 88), m_pGroupBox); m_pDropDown->AddItem(wGui::SListItem("Item1")); m_pDropDown->AddItem(wGui::SListItem("Item2", 0, wGui::COLOR_BLUE)); --- 175,179 ---- pContextSubmenu3->InsertMenuItem(wGui::SMenuItem("Empty submenu", 0, pContextSubmenu4)); ! m_pDropDown = new wGui::CDropDown(wGui::CRect(10, 55, 205, 73), m_pGroupBox); m_pDropDown->AddItem(wGui::SListItem("Item1")); m_pDropDown->AddItem(wGui::SListItem("Item2", 0, wGui::COLOR_BLUE)); |
|
From: Rob W. <gre...@us...> - 2004-06-30 22:31:17
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8424/src Modified Files: wg_button.cpp wg_checkbox.cpp wg_dropdown.cpp wg_editbox.cpp wg_frame.cpp wg_groupbox.cpp wg_listbox.cpp wg_progress.cpp wg_scrollbar.cpp wg_textbox.cpp wg_toolbar.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.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** wg_view.cpp 29 Jun 2004 22:14:20 -0000 1.38 --- wg_view.cpp 30 Jun 2004 22:31:02 -0000 1.39 *************** *** 83,91 **** m_pMenu->SetWindowRect(CRect(0, -iMenuHeight, m_WindowRect.Width() - 1, -1)); m_ClientRect.SetTop(iMenuHeight + 1); ! m_ClientRect.ClipTo(m_WindowRect); } else { ! m_ClientRect = m_WindowRect; } } --- 83,91 ---- m_pMenu->SetWindowRect(CRect(0, -iMenuHeight, m_WindowRect.Width() - 1, -1)); m_ClientRect.SetTop(iMenuHeight + 1); ! m_ClientRect.ClipTo(m_WindowRect.SizeRect()); } else { ! m_ClientRect = m_WindowRect.SizeRect(); } } *************** *** 178,182 **** if (!m_pFloatingWindow || !m_pFloatingWindow->OnMouseButtonDown(pMouseMessage->Point, pMouseMessage->Button)) { - // wUtil::Trace(std::string("Mouse Click at: ") + stdex::itoa(pMouseMessage->Point.XPos()) + ", " + stdex::itoa(pMouseMessage->Point.YPos())); OnMouseButtonDown(pMouseMessage->Point, pMouseMessage->Button); } --- 178,181 ---- Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** wg_editbox.cpp 29 Jun 2004 22:14:20 -0000 1.88 --- wg_editbox.cpp 30 Jun 2004 22:31:01 -0000 1.89 *************** *** 258,263 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && !m_bReadOnly && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { bool fSkipCursorPositioning = false; --- 258,264 ---- bool bResult = false; ! CPoint WindowPoint(ViewToWindow(Point)); ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! !m_bReadOnly && (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { bool fSkipCursorPositioning = false; *************** *** 285,298 **** std::vector<CRect> CharRects; m_pRenderedString->GetMetrics(0, &Offset, &CharRects); ! CRect SubRect(m_WindowRect); SubRect.Grow(-3); ! int xDelta = abs(Point.XPos() - (CharRects[0].Left() + Offset.XPos() + SubRect.Left())); m_SelStart = 0; for (unsigned int i = 0; i < m_pRenderedString->GetLength(); ++i) { ! if (abs(Point.XPos() - (CharRects[i].Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)) < xDelta) { ! xDelta = abs(Point.XPos() - (CharRects[i].Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)); m_SelStart = i + 1; } --- 286,299 ---- std::vector<CRect> CharRects; m_pRenderedString->GetMetrics(0, &Offset, &CharRects); ! CRect SubRect(m_WindowRect.SizeRect()); 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; } *************** *** 338,341 **** --- 339,343 ---- if (pMouseMessage && m_bVisible && !m_bReadOnly) { + CPoint WindowPoint(ViewToWindow(pMouseMessage->Point)); //If the cursor is within the control then check to see if we've already // set the cursor to the I Beam, if we have, don't do anything. If we *************** *** 343,348 **** //Else if it's outside the control and the I Beam cursor is set, set it // back to a normal cursor. ! if (m_WindowRect.SizeRect().HitTest(ViewToClient(pMouseMessage->Point)) == CRect::RELPOS_INSIDE ! && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; --- 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; *************** *** 350,355 **** CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if (m_WindowRect.SizeRect().HitTest(ViewToClient(pMouseMessage->Point)) != CRect::RELPOS_INSIDE ! && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; --- 351,355 ---- CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if (m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; *************** *** 363,373 **** m_pRenderedString->GetMetrics(0, &Offset, &CharRects); ! int xDelta = abs(pMouseMessage->Point.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(pMouseMessage->Point.XPos() - (CharRects[i].Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)) < xDelta) { ! xDelta = abs(pMouseMessage->Point.XPos() - (CharRects[i].Right() + Offset.XPos() + SubRect.Left() + m_ScrollOffset)); CursorPos = i + 1; } --- 363,373 ---- 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; } Index: wg_checkbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_checkbox.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wg_checkbox.cpp 29 Jun 2004 18:03:40 -0000 1.21 --- wg_checkbox.cpp 30 Jun 2004 22:31:01 -0000 1.22 *************** *** 87,91 **** if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { m_MouseButton = Button; --- 87,91 ---- if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && ! (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { m_MouseButton = Button; *************** *** 102,106 **** if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && (m_MouseButton == Button) && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { CMessage::EMessageType MessageType = CMessage::UNKNOWN; --- 102,106 ---- if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && (m_MouseButton == Button) && ! (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { CMessage::EMessageType MessageType = CMessage::UNKNOWN; *************** *** 136,141 **** { CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); ! if (pMouseMessage && (m_WindowRect.HitTest(pMouseMessage->Point) != CRect::RELPOS_INSIDE) ! && (m_MouseButton == pMouseMessage->Button) && (m_eCheckBoxState != DISABLED)) { m_MouseButton = 0; --- 136,141 ---- { CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); ! if (pMouseMessage && (m_ClientRect.HitTest(ViewToWindow(pMouseMessage->Point)) != CRect::RELPOS_INSIDE) ! && (m_MouseButton == pMouseMessage->Button)) { m_MouseButton = 0; Index: wg_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_button.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** wg_button.cpp 29 Jun 2004 18:03:40 -0000 1.35 --- wg_button.cpp 30 Jun 2004 22:31:01 -0000 1.36 *************** *** 121,128 **** bool bResult = false; - // wUtil::Trace(std::string("[Button - ") + m_sWindowText + "] Mouse Click at: " + stdex::itoa(ViewToClient(Point).XPos()) + ", " + stdex::itoa(ViewToClient(Point).YPos())); - if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eButtonState == UP) && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(DOWN); --- 121,126 ---- bool bResult = false; if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eButtonState == UP) && ! (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(DOWN); *************** *** 140,144 **** if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eButtonState == DOWN) && ! (m_MouseButton == Button) && (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(UP); --- 138,142 ---- if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eButtonState == DOWN) && ! (m_MouseButton == Button) && (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(UP); Index: wg_progress.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_progress.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wg_progress.cpp 25 Jun 2004 19:37:51 -0000 1.14 --- wg_progress.cpp 30 Jun 2004 22:31:01 -0000 1.15 *************** *** 50,57 **** CWindow::Draw(); ! CRect SubRect(m_WindowRect); SubRect.Grow(-1); CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect, false, COLOR_BLACK); Painter.DrawRect(SubRect, false, COLOR_LIGHTGRAY); Painter.DrawHLine(SubRect.Left(), SubRect.Right(), SubRect.Top(), COLOR_DARKGRAY); --- 50,57 ---- CWindow::Draw(); ! CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); Painter.DrawRect(SubRect, false, COLOR_LIGHTGRAY); Painter.DrawHLine(SubRect.Left(), SubRect.Right(), SubRect.Top(), COLOR_DARKGRAY); Index: wg_groupbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_groupbox.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wg_groupbox.cpp 25 Jun 2004 19:37:51 -0000 1.15 --- wg_groupbox.cpp 30 Jun 2004 22:31:01 -0000 1.16 *************** *** 87,91 **** { CWindow::SetWindowRect(WindowRect); ! m_ClientRect = m_WindowRect; m_ClientRect.Grow(-2); m_ClientRect.SetTop(15); --- 87,91 ---- { CWindow::SetWindowRect(WindowRect); ! m_ClientRect = m_WindowRect.SizeRect(); m_ClientRect.Grow(-2); m_ClientRect.SetTop(15); Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** wg_scrollbar.cpp 29 Jun 2004 22:14:20 -0000 1.36 --- wg_scrollbar.cpp 30 Jun 2004 22:31:01 -0000 1.37 *************** *** 45,63 **** { case VERTICAL: ! m_ClientRect = CRect(0, m_WindowRect.Width() + 1, ! m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(0, -m_WindowRect.Width(), m_WindowRect.Width() - 1, -1), this, CwgBitmapResourceHandle(WGRES_UP_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(0, m_WindowRect.Height() + 1, m_WindowRect.Width(), m_WindowRect.Height() + m_WindowRect.Width()), this, CwgBitmapResourceHandle(WGRES_DOWN_ARROW_BITMAP)); break; case HORIZONTAL: ! m_ClientRect = CRect(m_WindowRect.Height() + 1, 0, ! m_WindowRect.Width() - m_WindowRect.Height() - 1, m_WindowRect.Height() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(-m_WindowRect.Height(), 0, -1, m_WindowRect.Height() - 1), this, CwgBitmapResourceHandle(WGRES_LEFT_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(m_WindowRect.Width() + 1, 0, m_WindowRect.Width() + m_WindowRect.Height(), m_WindowRect.Height()), this, CwgBitmapResourceHandle(WGRES_RIGHT_ARROW_BITMAP)); break; --- 45,61 ---- { case VERTICAL: ! m_ClientRect = CRect(0, m_WindowRect.Width() + 1, m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(0, -m_ClientRect.Width(), m_ClientRect.Width() - 1, -1), this, CwgBitmapResourceHandle(WGRES_UP_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(0, m_ClientRect.Height() + 1, m_ClientRect.Width(), m_ClientRect.Height() + m_ClientRect.Width()), this, CwgBitmapResourceHandle(WGRES_DOWN_ARROW_BITMAP)); break; case HORIZONTAL: ! m_ClientRect = CRect(m_WindowRect.Height() + 1, 0, m_WindowRect.Width() - m_WindowRect.Height() - 1, m_WindowRect.Height() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(-m_ClientRect.Height(), 0, -1, m_ClientRect.Height() - 1), this, CwgBitmapResourceHandle(WGRES_LEFT_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(m_ClientRect.Width() + 1, 0, m_ClientRect.Width() + m_ClientRect.Height(), m_ClientRect.Height()), this, CwgBitmapResourceHandle(WGRES_RIGHT_ARROW_BITMAP)); break; *************** *** 118,135 **** case VERTICAL: { ! m_pBtnUpLeft->SetWindowRect(CRect(0, -WindowRect.Width(), WindowRect.Width() - 1, -1)); ! m_pBtnDownRight->SetWindowRect( ! CRect(0, WindowRect.Height() + 1, WindowRect.Width(), WindowRect.Height() + WindowRect.Width())); ! m_ClientRect.SetTop(m_pBtnUpLeft->GetWindowRect().Height() + 1); ! m_ClientRect.SetBottom(m_WindowRect.Height() - m_pBtnUpLeft->GetWindowRect().Height() - 1); break; } case HORIZONTAL: { ! m_pBtnUpLeft->SetWindowRect(CRect(-WindowRect.Height(), 0, -1, WindowRect.Height() - 1)); ! m_pBtnDownRight->SetWindowRect( ! CRect(WindowRect.Width() + 1, 0, WindowRect.Width() + WindowRect.Height(), WindowRect.Height())); ! m_ClientRect.SetLeft(m_pBtnUpLeft->GetWindowRect().Width() + 1); ! m_ClientRect.SetRight(m_WindowRect.Width() - m_pBtnUpLeft->GetWindowRect().Width() - 1); break; } --- 116,129 ---- case VERTICAL: { ! m_ClientRect = CRect(0, m_WindowRect.Width() + 1, m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft->SetWindowRect(CRect(0, -m_ClientRect.Width(), m_ClientRect.Width() - 1, -1)); ! m_pBtnDownRight->SetWindowRect(CRect(0, m_ClientRect.Height() + 1, m_ClientRect.Width(), m_ClientRect.Height() + m_ClientRect.Width())); break; } case HORIZONTAL: { ! m_ClientRect = CRect(m_WindowRect.Height() + 1, 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())); break; } Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** wg_window.cpp 29 Jun 2004 18:03:41 -0000 1.44 --- wg_window.cpp 30 Jun 2004 22:31:02 -0000 1.45 *************** *** 78,82 **** if (m_pSDLSurface) SDL_FreeSurface(m_pSDLSurface); ! m_pSDLSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); Draw(); // we need to redraw here because we've got a new empty buffer } --- 78,82 ---- if (m_pSDLSurface) SDL_FreeSurface(m_pSDLSurface); ! m_pSDLSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), 32, 0x000000FF, 0x0000FF00, 0x00FF0000, /*0xFF000000*/ 0); Draw(); // we need to redraw here because we've got a new empty buffer } *************** *** 157,170 **** void CWindow::SetVisible(bool bVisible) { ! m_bVisible = bVisible; ! for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) { ! (*iter)->SetVisible(bVisible); ! if ((*iter) == CApplication::Instance()->GetKeyFocus()) { ! CApplication::Instance()->SetKeyFocus(0); } } - CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, GetAncestor(PARENT), this)); } --- 157,173 ---- void CWindow::SetVisible(bool bVisible) { ! if (m_bVisible != bVisible) { ! m_bVisible = bVisible; ! for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) { ! (*iter)->SetVisible(bVisible); ! if ((*iter) == CApplication::Instance()->GetKeyFocus()) ! { ! CApplication::Instance()->SetKeyFocus(0); ! } } + CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, GetAncestor(PARENT), this)); } } *************** *** 214,217 **** --- 217,242 ---- + CRect CWindow::ViewToWindow(const CRect& Rect) const + { + CRect WindowRect(Rect - m_WindowRect.TopLeft()); + if (m_pParentWindow) + { + WindowRect = m_pParentWindow->ViewToClient(WindowRect); + } + return WindowRect; + } + + + CPoint CWindow::ViewToWindow(const CPoint& Point) const + { + CPoint WindowPoint(Point - m_WindowRect.TopLeft()); + if (m_pParentWindow) + { + WindowPoint = m_pParentWindow->ViewToClient(WindowPoint); + } + return WindowPoint; + } + + void CWindow::SetWindowText(const std::string& sText) { Index: wg_dropdown.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_dropdown.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wg_dropdown.cpp 25 Jun 2004 19:37:51 -0000 1.21 --- wg_dropdown.cpp 30 Jun 2004 22:31:01 -0000 1.22 *************** *** 37,42 **** m_bAllowEdit(bAllowEdit) { ! m_pEditBox = new CEditBox(CRect(WindowRect.TopLeft(), CPoint(WindowRect.Right() - WindowRect.Height(), WindowRect.Bottom())), ! this, pFontEngine); if (!m_bAllowEdit) { --- 37,41 ---- m_bAllowEdit(bAllowEdit) { ! m_pEditBox = new CEditBox(CRect(0, 0, m_WindowRect.Width() - m_WindowRect.Height(), m_WindowRect.Height()), this, pFontEngine); if (!m_bAllowEdit) { *************** *** 47,51 **** // 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(WindowRect.BottomLeft(), CPoint(WindowRect.Right(), WindowRect.Bottom() + iItemHeight * 5 + 1)), GetAncestor(ROOT), true, iItemHeight, pFontEngine); m_pListBox->SetVisible(false); --- 46,51 ---- // 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( ! ClientToView(CRect(m_WindowRect.BottomLeft(), CPoint(m_WindowRect.Right(), m_WindowRect.Bottom() + iItemHeight * 5 + 1))), GetAncestor(ROOT), true, iItemHeight, pFontEngine); m_pListBox->SetVisible(false); *************** *** 53,57 **** m_pDropButton = new CPictureButton( ! CRect(CPoint(WindowRect.Right() - WindowRect.Height() + 1, WindowRect.Top()), WindowRect.BottomRight()), this, CwgBitmapResourceHandle(WGRES_DOWN_ARROW_BITMAP)); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONDOWN); --- 53,57 ---- m_pDropButton = new CPictureButton( ! CRect(m_WindowRect.Width() - m_WindowRect.Height() + 1, 0, m_WindowRect.Width(), m_WindowRect.Height()), this, CwgBitmapResourceHandle(WGRES_DOWN_ARROW_BITMAP)); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONDOWN); *************** *** 94,99 **** if (pMouseMessage->Button == CMouseMessage::LEFT) { ! if (m_pListBox->IsVisible() && m_pDropButton->GetWindowRect().HitTest(pMouseMessage->Point) != CRect::RELPOS_INSIDE ! && m_pListBox->GetWindowRect().HitTest(pMouseMessage->Point) != CRect::RELPOS_INSIDE) { HideListBox(); --- 94,100 ---- if (pMouseMessage->Button == CMouseMessage::LEFT) { ! if (m_pListBox->IsVisible() && ! m_pDropButton->GetWindowRect().SizeRect().HitTest(m_pDropButton->ViewToWindow(pMouseMessage->Point)) != CRect::RELPOS_INSIDE && ! m_pListBox->GetWindowRect().SizeRect().HitTest(m_pListBox->ViewToWindow(pMouseMessage->Point)) != CRect::RELPOS_INSIDE) { HideListBox(); Index: wg_toolbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_toolbar.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wg_toolbar.cpp 29 Jun 2004 22:14:20 -0000 1.14 --- wg_toolbar.cpp 30 Jun 2004 22:31:02 -0000 1.15 *************** *** 117,128 **** // Hide any buttons that extend beyond the end of the toolbar ! if (xPosition > m_WindowRect.Width()) ! { ! pButton->SetVisible(false); ! } ! else ! { ! pButton->SetVisible(true); ! } } else --- 117,121 ---- // Hide any buttons that extend beyond the end of the toolbar ! pButton->SetVisible(xPosition <= m_WindowRect.Width()); } else *************** *** 138,141 **** --- 131,135 ---- { CWindow::SetWindowRect(WindowRect); + m_ClientRect = m_WindowRect.SizeRect(); RepositionButtons(); } Index: wg_listbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_listbox.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** wg_listbox.cpp 29 Jun 2004 18:03:40 -0000 1.40 --- wg_listbox.cpp 30 Jun 2004 22:31:01 -0000 1.41 *************** *** 49,56 **** m_pFontEngine = CApplication::Instance()->GetDefaultFontEngine(); } ! CRect ScrollbarRect(m_WindowRect); ScrollbarRect.Grow(-1); m_pVScrollbar = new CScrollBar( ! CRect(ScrollbarRect.Right() - 12, ScrollbarRect.Top(), ScrollbarRect.Right(), ScrollbarRect.Bottom()) , this, CScrollBar::VERTICAL), m_pVScrollbar->SetMaxLimit(0); m_ClientRect = CRect(2, 2, m_WindowRect.Width() - 16, m_WindowRect.Height() - 4); --- 49,57 ---- m_pFontEngine = CApplication::Instance()->GetDefaultFontEngine(); } ! CRect ScrollbarRect(m_WindowRect.SizeRect()); ScrollbarRect.Grow(-1); m_pVScrollbar = new CScrollBar( ! CRect(ScrollbarRect.Right() - 12, ScrollbarRect.Top(), ScrollbarRect.Right(), ScrollbarRect.Bottom()) - CPoint(2, 2) /* client adjustment */, ! this, CScrollBar::VERTICAL), m_pVScrollbar->SetMaxLimit(0); m_ClientRect = CRect(2, 2, m_WindowRect.Width() - 16, m_WindowRect.Height() - 4); *************** *** 65,70 **** CListBox::~CListBox(void) { ! // This shouldn't be necessary, since it's a child it should be automatically deleted ! // delete m_pVScrollbar; } --- 66,70 ---- CListBox::~CListBox(void) { ! } *************** *** 133,145 **** CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); - CRect ClientRect(GetClientRect()); int iStartIndex = m_pVScrollbar->GetValue(); for (unsigned int i = iStartIndex; i < m_Items.size(); ++i) { ! CRect ItemRect(ClientRect.Left(), ClientRect.Top() + (i - iStartIndex) * m_iItemHeight, ! ClientRect.Right(), ClientRect.Top() + (i - iStartIndex + 1) * m_iItemHeight - 1); ! if (ItemRect.Overlaps(GetClientRect())) { ! ItemRect.ClipTo(GetClientRect()); ItemRect.SetBottom(ItemRect.Bottom() - 1); if (m_SelectedItems[i]) --- 133,144 ---- CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); int iStartIndex = m_pVScrollbar->GetValue(); for (unsigned int i = iStartIndex; i < m_Items.size(); ++i) { ! CRect ItemRect(m_ClientRect.Left(), m_ClientRect.Top() + (i - iStartIndex) * m_iItemHeight, ! m_ClientRect.Right(), m_ClientRect.Top() + (i - iStartIndex + 1) * m_iItemHeight - 1); ! if (ItemRect.Overlaps(m_ClientRect)) { ! ItemRect.ClipTo(m_ClientRect); ItemRect.SetBottom(ItemRect.Bottom() - 1); if (m_SelectedItems[i]) *************** *** 163,170 **** { CWindow::SetWindowRect(WindowRect); ! CRect ScrollbarRect(m_WindowRect); ! ScrollbarRect.Grow(-1); ! m_pVScrollbar->SetWindowRect(CRect(ScrollbarRect.Right() - 12, ScrollbarRect.Top(), ScrollbarRect.Right(), ScrollbarRect.Bottom())); ! m_ClientRect = CRect(2, 2, m_WindowRect.Width() - 16, m_WindowRect.Height() - 4); } --- 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())); } *************** *** 173,179 **** { bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { if (CApplication::Instance()->GetKeyFocus() != this) --- 170,176 ---- { bool bResult = false; ! CPoint WindowPoint(ViewToWindow(Point)); if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_WindowRect.SizeRect().HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { if (CApplication::Instance()->GetKeyFocus() != this) *************** *** 182,190 **** } ! CRect ClientRect(GetClientRect()); ! if (!m_Items.empty() && ClientRect.HitTest(Point) == CRect::RELPOS_INSIDE) { // Prep the new selection ! m_iFocusedItem = (Point.YPos() - ClientRect.Top()) / m_iItemHeight + m_pVScrollbar->GetValue(); Draw(); } --- 179,186 ---- } ! if (!m_Items.empty() && m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE) { // Prep the new selection ! m_iFocusedItem = (WindowPoint.YPos() + m_ClientRect.Top()) / m_iItemHeight + m_pVScrollbar->GetValue(); Draw(); } *************** *** 199,208 **** { bool bResult = false; - CRect ClientRect(GetClientRect()); ! if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (ClientRect.HitTest(Point) == CRect::RELPOS_INSIDE) && ! (Button == CMouseMessage::LEFT)) { ! if (m_iFocusedItem == stdex::safe_static_cast<int>((Point.YPos() - ClientRect.Top()) / m_iItemHeight + m_pVScrollbar->GetValue())) { if (m_bSingleSelection) --- 195,203 ---- { 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) *************** *** 210,214 **** SetAllSelections(false); } ! SetSelection(m_iFocusedItem, ! IsSelected(m_iFocusedItem)); CWindow* pDestination = m_pParentWindow; if (m_pDropDown) --- 205,209 ---- SetAllSelections(false); } ! SetSelection(m_iFocusedItem, !IsSelected(m_iFocusedItem)); CWindow* pDestination = m_pParentWindow; if (m_pDropDown) Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wg_textbox.cpp 25 Jun 2004 19:37:51 -0000 1.21 --- wg_textbox.cpp 30 Jun 2004 22:31:01 -0000 1.22 *************** *** 64,73 **** m_pDblClickTimer = new CTimer(); m_pCursorTimer = new CTimer(this); ! CRect ScrollbarRect(m_WindowRect); ! ScrollbarRect.Grow(-1); m_pVerticalScrollBar = new CScrollBar( ! CRect(ScrollbarRect.Right() - 12, ScrollbarRect.Top(), ScrollbarRect.Right(), ScrollbarRect.Bottom() - 12) , this, CScrollBar::VERTICAL), m_pHorizontalScrollBar = new CScrollBar( ! CRect(ScrollbarRect.Left(), ScrollbarRect.Bottom() - 12, ScrollbarRect.Right() - 12, ScrollbarRect.Bottom()) , this, CScrollBar::HORIZONTAL), m_ScrollBarVisibilityMap[CScrollBar::VERTICAL] = SCROLLBAR_VIS_AUTO; m_ScrollBarVisibilityMap[CScrollBar::HORIZONTAL] = SCROLLBAR_VIS_AUTO; --- 64,72 ---- m_pDblClickTimer = new CTimer(); m_pCursorTimer = new CTimer(this); ! m_ClientRect.Grow(-1); m_pVerticalScrollBar = new CScrollBar( ! CRect(m_ClientRect.Right() - 12, m_ClientRect.Top(), m_ClientRect.Right(), m_ClientRect.Bottom() - 12) , this, CScrollBar::VERTICAL), m_pHorizontalScrollBar = new CScrollBar( ! CRect(m_ClientRect.Left(), m_ClientRect.Bottom() - 12, m_ClientRect.Right() - 12, m_ClientRect.Bottom()) , this, CScrollBar::HORIZONTAL), m_ScrollBarVisibilityMap[CScrollBar::VERTICAL] = SCROLLBAR_VIS_AUTO; m_ScrollBarVisibilityMap[CScrollBar::HORIZONTAL] = SCROLLBAR_VIS_AUTO; *************** *** 273,280 **** { CWindow::SetWindowRect(WindowRect); ! CRect ScrollbarRect(m_WindowRect); ! ScrollbarRect.Grow(-1); ! m_pVerticalScrollBar->SetWindowRect(CRect(ScrollbarRect.Right() - 12, ScrollbarRect.Top(), ScrollbarRect.Right(), ScrollbarRect.Bottom() - 12)); ! m_pHorizontalScrollBar->SetWindowRect(CRect(ScrollbarRect.Left(), ScrollbarRect.Bottom() - 12, ScrollbarRect.Right() - 12, ScrollbarRect.Bottom())); UpdateScrollBars(); } --- 272,279 ---- { 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(); } *************** *** 285,289 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (GetClientRect().HitTest(Point) == CRect::RELPOS_INSIDE)) { if (Button == CMouseMessage::LEFT && !m_bReadOnly) --- 284,289 ---- bool bResult = false; ! CPoint WindowPoint(ViewToWindow(Point)); ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (GetClientRect().HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { if (Button == CMouseMessage::LEFT && !m_bReadOnly) *************** *** 324,329 **** // figure out which line was clicked on ! CRect TextRect(GetClientRect()); ! unsigned int iCurLine = (Point.YPos() - TextRect.Top()) / m_iRowHeight + m_pVerticalScrollBar->GetValue(); if (iCurLine >= m_iLineCount) { --- 324,328 ---- // figure out which line was clicked on ! unsigned int iCurLine = (WindowPoint.YPos() - m_ClientRect.Top()) / m_iRowHeight + m_pVerticalScrollBar->GetValue(); if (iCurLine >= m_iLineCount) { *************** *** 331,341 **** } // figure out which character was clicked on ! int xDelta = abs(Point.XPos() - (vCharRects[iCurLine][0].Left() + vOffsets[iCurLine].XPos() + TextRect.Left())); m_SelStart = 0; for (unsigned int i = 0; i < vCharRects[iCurLine].size(); ++i) { ! if (abs(Point.XPos() - (vCharRects[iCurLine][i].Right() + vOffsets[iCurLine].XPos() + TextRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)) < xDelta) { ! xDelta = abs(Point.XPos() - (vCharRects[iCurLine][i].Right() + vOffsets[iCurLine].XPos() + TextRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)); m_SelStart = i + 1; } --- 330,342 ---- } // 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; } *************** *** 372,376 **** { bool bHandled = false; - CRect TextRect(GetClientRect()); if (pMessage) --- 373,376 ---- *************** *** 396,399 **** --- 396,400 ---- if (pMouseMessage && m_bVisible && !m_bReadOnly) { + CPoint WindowPoint(ViewToWindow(pMouseMessage->Point)); //If the cursor is within the control then check to see if we've already // set the cursor to the I Beam, if we have, don't do anything. If we *************** *** 401,405 **** //Else if it's outside the control and the I Beam cursor is set, set it // back to a normal cursor. ! if (TextRect.HitTest(pMouseMessage->Point) == CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; --- 402,406 ---- //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; *************** *** 407,411 **** CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if (TextRect.HitTest(pMouseMessage->Point) != CRect::RELPOS_INSIDE && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; --- 408,412 ---- CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if (m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; *************** *** 430,436 **** // figure out which line was clicked on unsigned int iCurLine = 0; ! if (GetClientRect().HitTest(pMouseMessage->Point) == CRect::RELPOS_INSIDE) { ! iCurLine = (pMouseMessage->Point.YPos() - TextRect.Top()) / m_iRowHeight + m_pVerticalScrollBar->GetValue(); if (iCurLine >= m_iLineCount) { --- 431,437 ---- // figure out which line was clicked on unsigned int iCurLine = 0; ! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE) { ! iCurLine = (WindowPoint.YPos() - m_ClientRect.Top()) / m_iRowHeight + m_pVerticalScrollBar->GetValue(); if (iCurLine >= m_iLineCount) { *************** *** 438,442 **** } } ! else if (GetClientRect().HitTest(pMouseMessage->Point) == CRect::RELPOS_BELOW) { iCurLine = m_iLineCount - 1; --- 439,443 ---- } } ! else if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_BELOW) { iCurLine = m_iLineCount - 1; *************** *** 444,454 **** // figure out which character was clicked on ! int xDelta = abs(pMouseMessage->Point.XPos() - (vCharRects[iCurLine][0].Left() + vOffsets[iCurLine].XPos() + TextRect.Left())); std::string::size_type CursorPos = 0; for (unsigned int i = 0; i < vCharRects[iCurLine].size(); ++i) { ! if (abs(pMouseMessage->Point.XPos() - (vCharRects[iCurLine][i].Right() + vOffsets[iCurLine].XPos() + TextRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)) < xDelta) { ! xDelta = abs(pMouseMessage->Point.XPos() - (vCharRects[iCurLine][i].Right() + vOffsets[iCurLine].XPos() + TextRect.Left() - m_pHorizontalScrollBar->GetValue() * 10)); CursorPos = i + 1; } --- 445,457 ---- // 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; } Index: wg_frame.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_frame.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wg_frame.cpp 29 Jun 2004 18:03:40 -0000 1.23 --- wg_frame.cpp 30 Jun 2004 22:31:01 -0000 1.24 *************** *** 74,81 **** CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect, false, COLOR_LIGHTGRAY); ! Painter.DrawHLine(m_WindowRect.Left(), m_WindowRect.Right(), m_WindowRect.Bottom(), COLOR_DARKGRAY); ! Painter.DrawVLine(m_WindowRect.Top(), m_WindowRect.Bottom(), m_WindowRect.Right(), COLOR_DARKGRAY); ! CRect SubRect(m_WindowRect); SubRect.Grow(-1); Painter.DrawRect(SubRect, false, COLOR_BLACK); --- 74,81 ---- CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_LIGHTGRAY); ! Painter.DrawHLine(0, m_WindowRect.Width(), m_WindowRect.Height(), COLOR_DARKGRAY); ! Painter.DrawVLine(0, m_WindowRect.Height(), m_WindowRect.Width(), COLOR_DARKGRAY); ! CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); Painter.DrawRect(SubRect, false, COLOR_BLACK); *************** *** 102,112 **** if (m_pMenu) { ! m_pMenu->SetWindowRect(CRect(0, 0, m_WindowRect.Width() - 1, m_pMenu->GetWindowRect().Height())); ! m_ClientRect.SetTop(m_pMenu->GetWindowRect().Height() + 1); ! m_ClientRect.ClipTo(m_WindowRect); } else { ! m_ClientRect = m_WindowRect; } } --- 102,113 ---- if (m_pMenu) { ! int iMenuHeight = m_pMenu->GetWindowRect().Height(); ! m_pMenu->SetWindowRect(CRect(0, -iMenuHeight, m_WindowRect.Width() - 1, -1)); ! m_ClientRect.SetTop(iMenuHeight + 1); ! m_ClientRect.ClipTo(m_WindowRect.SizeRect()); } else { ! m_ClientRect = m_WindowRect.SizeRect(); } } *************** *** 142,148 **** if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { ! if (m_TitleBarRect.HitTest(Point) == CRect::RELPOS_INSIDE) { m_bDragMode = true; --- 143,149 ---- if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { ! if (m_TitleBarRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE) { m_bDragMode = true; |
|
From: Rob W. <gre...@us...> - 2004-06-30 22:31:14
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8424/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.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** TestView1.cpp 29 Jun 2004 18:03:41 -0000 1.69 --- TestView1.cpp 30 Jun 2004 22:31:02 -0000 1.70 *************** *** 107,111 **** m_pTextBox->SetWindowText("This is a multiline text box.\nThis should be the second line.\nThe third goes here.\nAnd this is a really long line that should extend beyond the right border.\nNow we follow with a bunch of newlines.\n\n\n\n\n\nThe End."); m_pGroupBox = new wGui::CGroupBox(wGui::CRect(225, 160, 470, 260), this, "GroupBox"); ! m_pBigassEditBox = new wGui::CEditBox(wGui::CRect(15, 15, 220, 65), m_pGroupBox, wGui::CApplication::Instance()->GetFontEngine("Vera.ttf", 25)); m_pBigassEditBox->SetWindowText("Big box to test stuff"); new wGui::CToolTip(m_pBigassEditBox, "This is a Big Ass Editbox"); --- 107,111 ---- m_pTextBox->SetWindowText("This is a multiline text box.\nThis should be the second line.\nThe third goes here.\nAnd this is a really long line that should extend beyond the right border.\nNow we follow with a bunch of newlines.\n\n\n\n\n\nThe End."); m_pGroupBox = new wGui::CGroupBox(wGui::CRect(225, 160, 470, 260), this, "GroupBox"); ! m_pBigassEditBox = new wGui::CEditBox(wGui::CRect(5, 5, 220, 60), m_pGroupBox, wGui::CApplication::Instance()->GetFontEngine("Vera.ttf", 25)); m_pBigassEditBox->SetWindowText("Big box to test stuff"); new wGui::CToolTip(m_pBigassEditBox, "This is a Big Ass Editbox"); *************** *** 175,179 **** pContextSubmenu3->InsertMenuItem(wGui::SMenuItem("Empty submenu", 0, pContextSubmenu4)); ! m_pDropDown = new wGui::CDropDown(wGui::CRect(15, 70, 205, 88), m_pGroupBox); m_pDropDown->AddItem(wGui::SListItem("Item1")); m_pDropDown->AddItem(wGui::SListItem("Item2", 0, wGui::COLOR_BLUE)); --- 175,179 ---- pContextSubmenu3->InsertMenuItem(wGui::SMenuItem("Empty submenu", 0, pContextSubmenu4)); ! m_pDropDown = new wGui::CDropDown(wGui::CRect(10, 70, 205, 88), m_pGroupBox); m_pDropDown->AddItem(wGui::SListItem("Item1")); m_pDropDown->AddItem(wGui::SListItem("Item2", 0, wGui::COLOR_BLUE)); |