 |
My Project
debian-1:4.1.1-p2+ds-4build2
|
#include <Win32Gui.h>
|
void | enterGui (int &argc, char **argv) |
|
void | enterWorld (const WorldDescription &wd) |
|
void | guiEnterSuite (const char *suiteName) |
|
void | guiEnterTest (const char *suiteName, const char *testName) |
|
void | yellowBar () |
|
void | redBar () |
|
void | leaveGui () |
|
| GuiListener () |
|
virtual | ~GuiListener () |
|
virtual void | runGui (int &argc, char **argv, TestListener &listener) |
|
virtual void | guiEnterWorld (unsigned) |
|
void | enterSuite (const SuiteDescription &d) |
|
void | enterTest (const TestDescription &d) |
|
void | leaveTest (const TestDescription &) |
|
void | leaveSuite (const SuiteDescription &) |
|
void | leaveWorld (const WorldDescription &) |
|
void | warning (const char *, unsigned, const char *) |
|
void | failedTest (const char *, unsigned, const char *) |
|
void | failedAssert (const char *, unsigned, const char *) |
|
void | failedAssertEquals (const char *, unsigned, const char *, const char *, const char *, const char *) |
|
void | failedAssertSameData (const char *, unsigned, const char *, const char *, const char *, const void *, const void *, unsigned) |
|
void | failedAssertDelta (const char *, unsigned, const char *, const char *, const char *, const char *, const char *, const char *) |
|
void | failedAssertDiffers (const char *, unsigned, const char *, const char *, const char *) |
|
void | failedAssertLessThan (const char *, unsigned, const char *, const char *, const char *, const char *) |
|
void | failedAssertLessThanEquals (const char *, unsigned, const char *, const char *, const char *, const char *) |
|
void | failedAssertPredicate (const char *, unsigned, const char *, const char *, const char *) |
|
void | failedAssertRelation (const char *, unsigned, const char *, const char *, const char *, const char *, const char *) |
|
void | failedAssertThrows (const char *, unsigned, const char *, const char *, bool) |
|
void | failedAssertThrowsNot (const char *, unsigned, const char *) |
|
| TestListener () |
|
virtual | ~TestListener () |
|
virtual void | trace (const char *, unsigned, const char *) |
|
|
void | parseCommandLine (int argc, char **argv) |
|
void | getTotalTests () |
|
void | getTotalTests (const WorldDescription &wd) |
|
void | startGuiThread () |
|
void | gui () |
|
void | registerWindowClass () |
|
void | createMainWindow () |
|
void | initCommonControls () |
|
void | createProgressBar () |
|
void | createStatusBar () |
|
void | setRatios (unsigned suiteNameRatio, unsigned suiteTimeRatio, unsigned testNameRatio, unsigned testTimeRatio, unsigned testsDoneRatio, unsigned worldTimeRatio) |
|
HWND | createWindow (LPCTSTR className, DWORD style, HWND parent=(HWND) NULL) |
|
void | progressBarMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0) |
|
void | centerMainWindow () |
|
void | getScreenArea (RECT &area) |
|
bool | getScreenAreaWithoutTaskbar (RECT &area) |
|
void | getWholeScreenArea (RECT &area) |
|
void | showMainWindow () |
|
void | showMainWindow (int mode) |
|
void | startTimer () |
|
void | reset (DWORD &tick) |
|
void | startTests () |
|
void | messageLoop () |
|
LRESULT | handle (HWND window, UINT message, WPARAM wParam, LPARAM lParam) |
|
void | resizeControls () |
|
void | setStatusParts (LONG width) |
|
void | statusBarMessage (UINT message, WPARAM wParam=0, const void *lParam=0) |
|
void | greenBar () |
|
void | setColor (BYTE, BYTE, BYTE) |
|
void | setIcon (LPCTSTR icon) |
|
HICON | loadStandardIcon (LPCTSTR icon) |
|
void | setTestCaption (const char *suiteName, const char *testName) |
|
void | setCaption (const char *a="", const char *b="", const char *c="", const char *d="") |
|
void | showSuiteName (const char *suiteName) |
|
void | showTestName (const char *testName) |
|
void | showTestsDone () |
|
void | updateTime () |
|
void | setStatusTime (unsigned part, DWORD start) |
|
bool | keep () |
|
void | showSummary () |
|
void | setStatusPart (unsigned part, const char *text) |
|
void | stopTimer () |
|
void | setSummaryStatusBar () |
|
void | setSummaryCaption () |
|
char * | allocate (unsigned length) |
|
void | deallocate (char *data) |
|
Definition at line 27 of file Win32Gui.h.
◆ anonymous enum
Enumerator |
---|
STATUS_SUITE_NAME | |
STATUS_SUITE_TIME | |
STATUS_TEST_NAME | |
STATUS_TEST_TIME | |
STATUS_TESTS_DONE | |
STATUS_WORLD_TIME | |
STATUS_TOTAL_PARTS | |
Definition at line 93 of file Win32Gui.h.
◆ anonymous enum
Enumerator |
---|
TIMER_ID | |
TIMER_DELAY | |
Definition at line 295 of file Win32Gui.h.
◆ allocate()
char* CxxTest::Win32Gui::allocate |
( |
unsigned |
length | ) |
|
|
inlineprivate |
Definition at line 519 of file Win32Gui.h.
521 return (
char *)HeapAlloc( GetProcessHeap(), 0,
length );
◆ centerMainWindow()
void CxxTest::Win32Gui::centerMainWindow |
( |
| ) |
|
|
inlineprivate |
Definition at line 244 of file Win32Gui.h.
249 LONG screenWidth = screen.right - screen.left;
250 LONG screenHeight = screen.bottom - screen.top;
252 LONG xCenter = (screen.right + screen.left) / 2;
253 LONG yCenter = (screen.bottom + screen.top) / 2;
255 LONG windowWidth = (screenWidth * 4) / 5;
256 LONG windowHeight = screenHeight / 10;
257 LONG minimumHeight = 2 * (GetSystemMetrics( SM_CYCAPTION ) + GetSystemMetrics( SM_CYFRAME ));
258 if ( windowHeight < minimumHeight )
259 windowHeight = minimumHeight;
262 xCenter - (windowWidth / 2), yCenter - (windowHeight / 2),
263 windowWidth, windowHeight, 0 );
◆ createMainWindow()
void CxxTest::Win32Gui::createMainWindow |
( |
| ) |
|
|
inlineprivate |
◆ createProgressBar()
void CxxTest::Win32Gui::createProgressBar |
( |
| ) |
|
|
inlineprivate |
Definition at line 199 of file Win32Gui.h.
203 #ifdef PBM_SETRANGE32
205 #else // No PBM_SETRANGE32, use PBM_SETRANGE
207 #endif // PBM_SETRANGE32
◆ createStatusBar()
void CxxTest::Win32Gui::createStatusBar |
( |
| ) |
|
|
inlineprivate |
◆ createWindow()
HWND CxxTest::Win32Gui::createWindow |
( |
LPCTSTR |
className, |
|
|
DWORD |
style, |
|
|
HWND |
parent = (HWND)NULL |
|
) |
| |
|
inlineprivate |
Definition at line 233 of file Win32Gui.h.
235 return CreateWindow( className,
NULL, style, 0, 0, 0, 0, parent,
236 (HMENU)
NULL, (HINSTANCE)
NULL, (LPVOID)
this );
◆ deallocate()
void CxxTest::Win32Gui::deallocate |
( |
char * |
data | ) |
|
|
inlineprivate |
Definition at line 524 of file Win32Gui.h.
526 HeapFree( GetProcessHeap(), 0, data );
◆ enterGui()
void CxxTest::Win32Gui::enterGui |
( |
int & |
argc, |
|
|
char ** |
argv |
|
) |
| |
|
inlinevirtual |
◆ enterWorld()
◆ getScreenArea()
void CxxTest::Win32Gui::getScreenArea |
( |
RECT & |
area | ) |
|
|
inlineprivate |
◆ getScreenAreaWithoutTaskbar()
bool CxxTest::Win32Gui::getScreenAreaWithoutTaskbar |
( |
RECT & |
area | ) |
|
|
inlineprivate |
Definition at line 272 of file Win32Gui.h.
274 return (SystemParametersInfo( SPI_GETWORKAREA,
sizeof(RECT), &area, 0 ) != 0);
◆ getTotalTests() [1/2]
void CxxTest::Win32Gui::getTotalTests |
( |
| ) |
|
|
inlineprivate |
◆ getTotalTests() [2/2]
◆ getWholeScreenArea()
void CxxTest::Win32Gui::getWholeScreenArea |
( |
RECT & |
area | ) |
|
|
inlineprivate |
Definition at line 277 of file Win32Gui.h.
279 area.left = area.top = 0;
280 area.right = GetSystemMetrics( SM_CXSCREEN );
281 area.bottom = GetSystemMetrics( SM_CYSCREEN );
◆ greenBar()
void CxxTest::Win32Gui::greenBar |
( |
| ) |
|
|
inlineprivate |
◆ gui()
void CxxTest::Win32Gui::gui |
( |
| ) |
|
|
inlineprivate |
◆ guiEnterSuite()
void CxxTest::Win32Gui::guiEnterSuite |
( |
const char * |
suiteName | ) |
|
|
inlinevirtual |
◆ guiEnterTest()
void CxxTest::Win32Gui::guiEnterTest |
( |
const char * |
suiteName, |
|
|
const char * |
testName |
|
) |
| |
|
inlinevirtual |
◆ guiThread()
static DWORD WINAPI CxxTest::Win32Gui::guiThread |
( |
LPVOID |
parameter | ) |
|
|
inlinestaticprivate |
Definition at line 141 of file Win32Gui.h.
143 ((Win32Gui *)parameter)->gui();
◆ handle()
LRESULT CxxTest::Win32Gui::handle |
( |
HWND |
window, |
|
|
UINT |
message, |
|
|
WPARAM |
wParam, |
|
|
LPARAM |
lParam |
|
) |
| |
|
inlineprivate |
Definition at line 337 of file Win32Gui.h.
350 default:
return DefWindowProc( window,
message, wParam, lParam );
◆ initCommonControls()
void CxxTest::Win32Gui::initCommonControls |
( |
| ) |
|
|
inlineprivate |
Definition at line 185 of file Win32Gui.h.
187 HMODULE dll = LoadLibraryA(
"comctl32.dll" );
191 typedef void (WINAPI *FUNC)( void );
192 FUNC func = (FUNC)GetProcAddress( dll,
"InitCommonControls" );
◆ keep()
bool CxxTest::Win32Gui::keep |
( |
| ) |
|
|
inlineprivate |
◆ leaveGui()
void CxxTest::Win32Gui::leaveGui |
( |
| ) |
|
|
inlinevirtual |
◆ loadStandardIcon()
HICON CxxTest::Win32Gui::loadStandardIcon |
( |
LPCTSTR |
icon | ) |
|
|
inlineprivate |
Definition at line 407 of file Win32Gui.h.
409 return LoadIcon( (HINSTANCE)
NULL, icon );
◆ messageLoop()
void CxxTest::Win32Gui::messageLoop |
( |
| ) |
|
|
inlineprivate |
Definition at line 315 of file Win32Gui.h.
318 while ( BOOL haveMessage = GetMessage( &
message,
NULL, 0, 0 ) )
319 if ( haveMessage != -1 )
◆ parseCommandLine()
void CxxTest::Win32Gui::parseCommandLine |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
|
inlineprivate |
Definition at line 106 of file Win32Gui.h.
111 for (
int i = 1;
i < argc; ++
i )
113 if ( !lstrcmpA( argv[
i],
"-minimized" ) )
115 else if ( !lstrcmpA( argv[
i],
"-keep" ) )
117 else if ( !lstrcmpA( argv[
i],
"-title" ) && (
i + 1 < argc) )
◆ progressBarMessage()
void CxxTest::Win32Gui::progressBarMessage |
( |
UINT |
message, |
|
|
WPARAM |
wParam = 0 , |
|
|
LPARAM |
lParam = 0 |
|
) |
| |
|
inlineprivate |
◆ redBar()
void CxxTest::Win32Gui::redBar |
( |
| ) |
|
|
inlinevirtual |
◆ registerWindowClass()
void CxxTest::Win32Gui::registerWindowClass |
( |
| ) |
|
|
inlineprivate |
◆ reset()
void CxxTest::Win32Gui::reset |
( |
DWORD & |
tick | ) |
|
|
inlineprivate |
Definition at line 305 of file Win32Gui.h.
307 tick = GetTickCount();
◆ resizeControls()
void CxxTest::Win32Gui::resizeControls |
( |
| ) |
|
|
inlineprivate |
Definition at line 355 of file Win32Gui.h.
359 LONG width = r.right - r.left;
360 LONG height = r.bottom - r.top;
363 LONG statusHeight = r.bottom - r.top;
364 LONG resizeGripWidth = statusHeight;
365 LONG progressHeight = height - statusHeight;
367 SetWindowPos(
_progressBar, HWND_TOP, 0, 0, width, progressHeight, 0 );
368 SetWindowPos(
_statusBar, HWND_TOP, 0, progressHeight, width, statusHeight, 0 );
◆ setCaption()
void CxxTest::Win32Gui::setCaption |
( |
const char * |
a = "" , |
|
|
const char * |
b = "" , |
|
|
const char * |
c = "" , |
|
|
const char * |
d = "" |
|
) |
| |
|
inlineprivate |
Definition at line 417 of file Win32Gui.h.
419 unsigned length = lstrlenA(
_title ) +
sizeof(
" - " ) +
420 lstrlenA( a ) + lstrlenA(
b ) + lstrlenA( c ) + lstrlenA( d );
423 lstrcatA(
name,
" - " );
◆ setColor()
void CxxTest::Win32Gui::setColor |
( |
BYTE |
, |
|
|
BYTE |
, |
|
|
BYTE |
|
|
) |
| |
|
inlineprivate |
◆ setIcon()
void CxxTest::Win32Gui::setIcon |
( |
LPCTSTR |
icon | ) |
|
|
inlineprivate |
◆ setRatios()
void CxxTest::Win32Gui::setRatios |
( |
unsigned |
suiteNameRatio, |
|
|
unsigned |
suiteTimeRatio, |
|
|
unsigned |
testNameRatio, |
|
|
unsigned |
testTimeRatio, |
|
|
unsigned |
testsDoneRatio, |
|
|
unsigned |
worldTimeRatio |
|
) |
| |
|
inlineprivate |
◆ setStatusPart()
void CxxTest::Win32Gui::setStatusPart |
( |
unsigned |
part, |
|
|
const char * |
text |
|
) |
| |
|
inlineprivate |
◆ setStatusParts()
void CxxTest::Win32Gui::setStatusParts |
( |
LONG |
width | ) |
|
|
inlineprivate |
◆ setStatusTime()
void CxxTest::Win32Gui::setStatusTime |
( |
unsigned |
part, |
|
|
DWORD |
start |
|
) |
| |
|
inlineprivate |
Definition at line 457 of file Win32Gui.h.
459 unsigned total = (GetTickCount() - start) / 1000;
460 unsigned hours = total / 3600;
461 unsigned minutes = (total / 60) % 60;
462 unsigned seconds = total % 60;
465 wsprintfA(
_timeString,
"%u:%02u:%02u", hours, minutes, seconds );
467 wsprintfA(
_timeString,
"%02u:%02u", minutes, seconds );
◆ setSummaryCaption()
void CxxTest::Win32Gui::setSummaryCaption |
( |
| ) |
|
|
inlineprivate |
◆ setSummaryStatusBar()
void CxxTest::Win32Gui::setSummaryStatusBar |
( |
| ) |
|
|
inlineprivate |
◆ setTestCaption()
void CxxTest::Win32Gui::setTestCaption |
( |
const char * |
suiteName, |
|
|
const char * |
testName |
|
) |
| |
|
inlineprivate |
◆ setUp()
static void CxxTest::Win32Gui::setUp |
( |
HWND |
window, |
|
|
LPCREATESTRUCT |
create |
|
) |
| |
|
inlinestaticprivate |
Definition at line 332 of file Win32Gui.h.
334 SetWindowLong( window, GWL_USERDATA, (
LONG)
create->lpCreateParams );
◆ showMainWindow() [1/2]
void CxxTest::Win32Gui::showMainWindow |
( |
| ) |
|
|
inlineprivate |
◆ showMainWindow() [2/2]
void CxxTest::Win32Gui::showMainWindow |
( |
int |
mode | ) |
|
|
inlineprivate |
◆ showSuiteName()
void CxxTest::Win32Gui::showSuiteName |
( |
const char * |
suiteName | ) |
|
|
inlineprivate |
◆ showSummary()
void CxxTest::Win32Gui::showSummary |
( |
| ) |
|
|
inlineprivate |
◆ showTestName()
void CxxTest::Win32Gui::showTestName |
( |
const char * |
testName | ) |
|
|
inlineprivate |
◆ showTestsDone()
void CxxTest::Win32Gui::showTestsDone |
( |
| ) |
|
|
inlineprivate |
◆ startGuiThread()
void CxxTest::Win32Gui::startGuiThread |
( |
| ) |
|
|
inlineprivate |
◆ startTests()
void CxxTest::Win32Gui::startTests |
( |
| ) |
|
|
inlineprivate |
◆ startTimer()
void CxxTest::Win32Gui::startTimer |
( |
| ) |
|
|
inlineprivate |
◆ statusBarMessage()
void CxxTest::Win32Gui::statusBarMessage |
( |
UINT |
message, |
|
|
WPARAM |
wParam = 0 , |
|
|
const void * |
lParam = 0 |
|
) |
| |
|
inlineprivate |
◆ stopTimer()
void CxxTest::Win32Gui::stopTimer |
( |
| ) |
|
|
inlineprivate |
◆ updateTime()
void CxxTest::Win32Gui::updateTime |
( |
| ) |
|
|
inlineprivate |
◆ windowProcedure()
static LRESULT CALLBACK CxxTest::Win32Gui::windowProcedure |
( |
HWND |
window, |
|
|
UINT |
message, |
|
|
WPARAM |
wParam, |
|
|
LPARAM |
lParam |
|
) |
| |
|
inlinestaticprivate |
Definition at line 323 of file Win32Gui.h.
326 setUp( window, (LPCREATESTRUCT)lParam );
328 Win32Gui *that = (Win32Gui *)GetWindowLong( window, GWL_USERDATA );
329 return that->handle( window,
message, wParam, lParam );
◆ yellowBar()
void CxxTest::Win32Gui::yellowBar |
( |
| ) |
|
|
inlinevirtual |
◆ _canStartTests
HANDLE CxxTest::Win32Gui::_canStartTests |
|
private |
◆ _gui
HANDLE CxxTest::Win32Gui::_gui |
|
private |
◆ _keep
bool CxxTest::Win32Gui::_keep |
|
private |
◆ _mainWindow
HWND CxxTest::Win32Gui::_mainWindow |
|
private |
◆ _numTotalTests
unsigned CxxTest::Win32Gui::_numTotalTests |
|
private |
◆ _progressBar
HWND CxxTest::Win32Gui::_progressBar |
|
private |
◆ _startMinimized
bool CxxTest::Win32Gui::_startMinimized |
|
private |
◆ _statusBar
HWND CxxTest::Win32Gui::_statusBar |
|
private |
◆ _statusOffsets
◆ _statusTestsDone
char CxxTest::Win32Gui::_statusTestsDone[sizeof("1000000000 of (100%)")+WorldDescription::MAX_STRLEN_TOTAL_TESTS] |
|
private |
◆ _statusTotal
unsigned CxxTest::Win32Gui::_statusTotal |
|
private |
◆ _statusWidths
◆ _strTotalTests
◆ _suiteStart
DWORD CxxTest::Win32Gui::_suiteStart |
|
private |
◆ _testsDone
unsigned CxxTest::Win32Gui::_testsDone |
|
private |
◆ _testStart
DWORD CxxTest::Win32Gui::_testStart |
|
private |
◆ _timeString
char CxxTest::Win32Gui::_timeString[sizeof("00:00:00")] |
|
private |
◆ _title
const char* CxxTest::Win32Gui::_title |
|
private |
◆ _windowClass
WNDCLASSEX CxxTest::Win32Gui::_windowClass |
|
private |
◆ _worldStart
DWORD CxxTest::Win32Gui::_worldStart |
|
private |
The documentation for this class was generated from the following file:
void setSummaryStatusBar()
HICON loadStandardIcon(LPCTSTR icon)
char _strTotalTests[WorldDescription::MAX_STRLEN_TOTAL_TESTS]
void getScreenArea(RECT &area)
unsigned _statusOffsets[STATUS_TOTAL_PARTS]
void setStatusParts(LONG width)
void setIcon(LPCTSTR icon)
void statusBarMessage(UINT message, WPARAM wParam=0, const void *lParam=0)
void showTestName(const char *testName)
static BOOLEAN length(leftv result, leftv arg)
unsigned failedTests() const
void initCommonControls()
void registerWindowClass()
void setColor(BYTE, BYTE, BYTE)
static DWORD WINAPI guiThread(LPVOID parameter)
void message(int i, int *reduc, int *olddeg, kStrategy strat, int red_result)
void setRatios(unsigned suiteNameRatio, unsigned suiteTimeRatio, unsigned testNameRatio, unsigned testTimeRatio, unsigned testsDoneRatio, unsigned worldTimeRatio)
bool getScreenAreaWithoutTaskbar(RECT &area)
static LRESULT CALLBACK windowProcedure(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
void setStatusTime(unsigned part, DWORD start)
char * allocate(unsigned length)
char _timeString[sizeof("00:00:00")]
void parseCommandLine(int argc, char **argv)
void progressBarMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
void showSuiteName(const char *suiteName)
int _statusWidths[STATUS_TOTAL_PARTS]
void setStatusPart(unsigned part, const char *text)
char name(const Variable &v)
void setTestCaption(const char *suiteName, const char *testName)
void deallocate(char *data)
void getWholeScreenArea(RECT &area)
HWND createWindow(LPCTSTR className, DWORD style, HWND parent=(HWND) NULL)
char _statusTestsDone[sizeof("1000000000 of (100%)")+WorldDescription::MAX_STRLEN_TOTAL_TESTS]
void setCaption(const char *a="", const char *b="", const char *c="", const char *d="")
static void setUp(HWND window, LPCREATESTRUCT create)