Last change
on this file since 90eaad2 was 1a1aebd, checked in by dportnoy <dmp1488@…>, 12 years ago |
Updated client Visual Studio files
|
-
Property mode
set to
100644
|
File size:
773 bytes
|
Rev | Line | |
---|
[87b3ee2] | 1 | #include "Window.h"
|
---|
| 2 |
|
---|
| 3 | Window::Window(int x, int y, int width, int height) :
|
---|
| 4 | GuiComponent(x, y, width, height, NULL)
|
---|
| 5 | {
|
---|
| 6 | }
|
---|
| 7 |
|
---|
| 8 | Window::~Window(void)
|
---|
| 9 | {
|
---|
[1a1aebd] | 10 | for(unsigned int x=0; x<this->vctGui.size(); x++)
|
---|
[87b3ee2] | 11 | delete this->vctGui[x];
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | void Window::addComponent(GuiComponent *comp)
|
---|
| 15 | {
|
---|
| 16 | this->vctGui.push_back(comp);
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | GuiComponent* Window::getComponent(int x)
|
---|
| 20 | {
|
---|
| 21 | return this->vctGui[x];
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | void Window::draw(ALLEGRO_DISPLAY *display)
|
---|
| 25 | {
|
---|
| 26 | al_clear_to_color(al_map_rgb(0, 0, 0));
|
---|
| 27 |
|
---|
[1a1aebd] | 28 | for(unsigned int x=0; x<this->vctGui.size(); x++)
|
---|
[87b3ee2] | 29 | this->vctGui[x]->draw(display);
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | bool Window::handleEvent(ALLEGRO_EVENT& e)
|
---|
| 33 | {
|
---|
[1a1aebd] | 34 | for(unsigned int x=0; x<this->vctGui.size(); x++) {
|
---|
[87b3ee2] | 35 | if(this->vctGui[x]->handleEvent(e)) {
|
---|
| 36 | return true;
|
---|
| 37 | }
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | return false;
|
---|
| 41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.