137 lines
3.4 KiB
C++
137 lines
3.4 KiB
C++
//## begin module.cm preserve=no
|
|
|
|
// %X% %Q% %Z% %W%
|
|
|
|
//## end module.cm
|
|
|
|
|
|
|
|
//## begin module.cp preserve=no
|
|
|
|
//## end module.cp
|
|
|
|
|
|
|
|
//## Module: Window; Pseudo Package specification
|
|
|
|
//## Subsystem: lab7
|
|
|
|
//## Source file: H:\kurs\avC++\lab7\Window.h
|
|
|
|
|
|
|
|
#ifndef Window_h
|
|
|
|
#define Window_h 1
|
|
|
|
|
|
|
|
//## begin module.additionalIncludes preserve=no
|
|
|
|
//## end module.additionalIncludes
|
|
|
|
|
|
|
|
//## begin module.includes preserve=yes
|
|
|
|
//## end module.includes
|
|
|
|
|
|
|
|
// Panel
|
|
|
|
#include "Panel.h"
|
|
|
|
// Graphics
|
|
|
|
#include "Graphics.h"
|
|
|
|
//## begin module.additionalDeclarations preserve=yes
|
|
|
|
//## end module.additionalDeclarations
|
|
|
|
|
|
|
|
|
|
|
|
//## Class: Window
|
|
|
|
//## Category: lab7
|
|
|
|
//## Subsystem: lab7
|
|
|
|
//## Persistence: Transient
|
|
|
|
//## Cardinality/Multiplicity: n
|
|
|
|
|
|
|
|
//## Uses: <unnamed>; Graphics { -> }
|
|
|
|
|
|
|
|
class Window
|
|
|
|
{
|
|
|
|
//## begin Window.initialDeclarations preserve=yes
|
|
|
|
//## end Window.initialDeclarations
|
|
|
|
|
|
|
|
public:
|
|
|
|
//## Constructors (generated)
|
|
|
|
Window();
|
|
|
|
|
|
|
|
//## Constructors (specified)
|
|
|
|
//## Operation: Window%940854119
|
|
|
|
Window (int xpos, int ypos, int width, int height, char* name);
|
|
|
|
|
|
|
|
//## Destructor (generated)
|
|
|
|
~Window();
|
|
|
|
|
|
|
|
|
|
|
|
//## Other Operations (specified)
|
|
|
|
//## Operation: draw%940929792
|
|
|
|
void draw (Graphics& g);
|
|
|
|
|
|
|
|
//## Operation: add%940943118
|
|
|
|
void add (Component* c);
|
|
|
|
|
|
|
|
//## Operation: isHit%941013988
|
|
|
|
bool isHit (int x, int y);
|
|
|
|
|
|
|
|
//## Operation: handleKeyEvent%941013989
|
|
|
|
void handleKeyEvent (Event e);
|
|
|
|
|
|
|
|
//## Operation: handleMouseEvent%941013990
|
|
|
|
void handleMouseEvent (Event e);
|
|
|
|
|
|
|
|
// Additional Public Declarations
|
|
|
|
//## begin Window.public preserve=yes
|
|
|
|
//## end Window.public
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Data Members for Class Attributes
|
|
|
|
|
|
|
|
//## Attribute: name
|
|
|
|
//## begin Window::name.attr preserve=no private: char* {U}
|
|
|
|
char* name;
|
|
|
|
//## end Window::name.attr
|
|
|
|
|
|
|
|
//## Attribute: xpos
|
|
|
|
//## begin Window::xpos.attr preserve=no protected: int {U}
|
|
|
|
int xpos;
|
|
|
|
//## end Window::xpos.attr
|
|
|
|
|
|
|
|
//## Attribute: ypos
|
|
|
|
//## begin Window::ypos.attr preserve=no protected: int {U}
|
|
|
|
int ypos;
|
|
|
|
//## end Window::ypos.attr
|
|
|
|
|
|
|
|
//## Attribute: width
|
|
|
|
//## begin Window::width.attr preserve=no protected: int {U}
|
|
|
|
int width;
|
|
|
|
//## end Window::width.attr
|
|
|
|
|
|
|
|
//## Attribute: height
|
|
|
|
//## begin Window::height.attr preserve=no protected: int {U}
|
|
|
|
int height;
|
|
|
|
//## end Window::height.attr
|
|
|
|
|
|
|
|
// Additional Protected Declarations
|
|
|
|
//## begin Window.protected preserve=yes
|
|
|
|
//## end Window.protected
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Additional Private Declarations
|
|
|
|
//## begin Window.private preserve=yes
|
|
|
|
//## end Window.private
|
|
|
|
|
|
|
|
private: //## implementation
|
|
|
|
// Data Members for Has Relationships
|
|
|
|
|
|
|
|
//## Documentation Window::panel.has
|
|
|
|
//## begin Window::panel.has preserve=no public: Panel {1 -> 1RO}
|
|
|
|
Panel *panel;
|
|
|
|
//## end Window::panel.has
|
|
|
|
|
|
|
|
// Additional Implementation Declarations
|
|
|
|
//## begin Window.implementation preserve=yes
|
|
|
|
//## end Window.implementation
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
//## begin Window.postscript preserve=yes
|
|
|
|
//## end Window.postscript
|
|
|
|
|
|
|
|
// Class Window
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//## begin module.epilog preserve=yes
|
|
|
|
//## end module.epilog
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|