2 * Copyright 2006, Haiku Inc.
3 * Distributed under the terms of the MIT License.
6 * Axel Dörfler, axeld@pinc-software.de
10 #include <Application.h>
21 class View
: public BView
{
26 virtual void AttachedToWindow();
30 const uint8 kCursorData
[68] = {
33 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
34 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
35 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
36 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
38 0xff, 0xff, 0x80, 0x01, 0x80, 0x01, 0x8f, 0xf1,
39 0x88, 0x11, 0x88, 0x11, 0x88, 0x11, 0x89, 0x91,
40 0x89, 0x91, 0x88, 0x11, 0x88, 0x11, 0x88, 0x11,
41 0x8f, 0xf1, 0x80, 0x01, 0x80, 0x01, 0xff, 0xff,
47 View::View(BRect rect
)
48 : BView(rect
, "desktop view", B_FOLLOW_ALL
, B_WILL_DRAW
)
50 SetViewColor(0, 150, 0);
60 View::AttachedToWindow()
62 BCursor
cursor(kCursorData
);
63 SetViewCursor(&cursor
);
70 class Window
: public BWindow
{
75 virtual bool QuitRequested();
80 : BWindow(BRect(100, 100, 400, 400), "Cursor-Test",
81 B_TITLED_WINDOW
, B_ASYNCHRONOUS_CONTROLS
)
83 BView
*view
= new View(Bounds().InsetByCopy(30, 30));
94 Window::QuitRequested()
96 be_app
->PostMessage(B_QUIT_REQUESTED
);
104 class Application
: public BApplication
{
108 virtual void ReadyToRun();
112 Application::Application()
113 : BApplication("application/x-vnd.haiku-cursor_test")
119 Application::ReadyToRun()
121 Window
*window
= new Window();
127 SetCursor(B_I_BEAM_CURSOR
);
135 main(int argc
, char **argv
)
137 if (argc
> 1 && !strcmp(argv
[1], "hide"))