ROVLib2
RISCOSC++applicationdevelopmentlibrary
src-tutorials
tut2.cpp
1
#include "task.h"
2
#include "applicationicon.h"
3
4
using namespace
rov2
;
5
6
namespace
tutorial2
7
{
9
class
MyIcon
:
public
CApplicationIcon
10
{
11
public
:
13
MyIcon
() :
CApplicationIcon
(
"!system"
) {}
14
16
~MyIcon
() {}
17
18
bool
Clicked
(
const
tMouseClickBlock
& rkmcbClickBlock)
19
{
20
/* When this icon is clicked on, stop the poll loop */
21
CTask::CurrentTask
()->
Stop
();
22
return
true
;
23
}
24
25
};
26
}
27
28
using namespace
tutorial2
;
29
30
/* We can create a class like this... */
31
static
CTask
* pTask =
new
CTask
(
"Second ROVLib2 app!"
);
32
33
int
main(
int
argc,
char
** argv)
34
{
35
/* Create our application icon */
36
MyIcon
* pIcon =
new
MyIcon
();
37
38
/* And create a second one which does nothing */
39
CApplicationIcon
* pIcon2 =
new
CApplicationIcon
(
"file_ff8"
);
40
41
/* Poll until we want to stop*/
42
pTask->
Poll
();
43
44
/* Delete everything */
45
delete
(pIcon2);
46
delete
(pIcon);
47
48
return
0;
49
}
tutorial2
Definition:
tut2.cpp:6
tutorial2::MyIcon::MyIcon
MyIcon()
Definition:
tut2.cpp:13
rov2::CApplicationIcon
Definition:
applicationicon.h:12
tutorial2::MyIcon::Clicked
bool Clicked(const tMouseClickBlock &rkmcbClickBlock)
Definition:
tut2.cpp:18
tutorial2::MyIcon::~MyIcon
~MyIcon()
Definition:
tut2.cpp:16
rov2::CTask::Poll
void Poll()
Definition:
task.cpp:35
rov2::CTask::Stop
void Stop()
Definition:
task.h:23
tMouseClickBlock
Definition:
wimp_messages.h:77
rov2::CTask::CurrentTask
static CTask * CurrentTask()
Definition:
task.h:70
tutorial2::MyIcon
Definition:
tut2.cpp:9
rov2::CTask
Definition:
task.h:13
rov2
Definition:
aboutbox.cpp:15
Generated by
1.8.13