* Added changing the looks, too, which shows some more problems.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32470 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-08-17 16:44:56 +00:00
parent e527d80934
commit 572d609ff0
2 changed files with 16 additions and 5 deletions
@@ -3,8 +3,7 @@ SubDir HAIKU_TOP src tests servers app window_invalidation ;
SetSubDirSupportedPlatformsBeOSCompatible ; SetSubDirSupportedPlatformsBeOSCompatible ;
AddSubDirSupportedPlatforms libbe_test ; AddSubDirSupportedPlatforms libbe_test ;
UseHeaders [ FDirName os app ] ; UsePrivateHeaders interface ;
UseHeaders [ FDirName os interface ] ;
Application WindowInvalidation : Application WindowInvalidation :
WindowInvalidation.cpp WindowInvalidation.cpp
@@ -7,13 +7,14 @@
*/ */
#include <stdlib.h>
#include <Application.h> #include <Application.h>
#include <MessageRunner.h> #include <MessageRunner.h>
#include <Window.h> #include <Window.h>
#include <View.h> #include <View.h>
//#include <stdio.h> #include <WindowPrivate.h>
#include <stdlib.h>
class ShowInvalidationView : public BView { class ShowInvalidationView : public BView {
@@ -108,7 +109,7 @@ void
ChangingWindow::MessageReceived(BMessage* message) ChangingWindow::MessageReceived(BMessage* message)
{ {
if (message->what == 'actn') { if (message->what == 'actn') {
switch (rand() % 3) { switch (rand() % 4) {
case 0: case 0:
{ {
// resize window // resize window
@@ -147,6 +148,17 @@ ChangingWindow::MessageReceived(BMessage* message)
SetTitle(kChoices[rand() % (sizeof(kChoices) / sizeof(char*))]); SetTitle(kChoices[rand() % (sizeof(kChoices) / sizeof(char*))]);
break; break;
} }
case 3:
{
// change look
static const window_look kLooks[]
= {B_TITLED_WINDOW_LOOK, B_DOCUMENT_WINDOW_LOOK,
B_FLOATING_WINDOW_LOOK, kLeftTitledWindowLook};
SetLook(kLooks[rand() % (sizeof(kLooks) / sizeof(kLooks[0]))]);
break;
}
} }
} else } else
BWindow::MessageReceived(message); BWindow::MessageReceived(message);