first commit
This commit is contained in:
commit
1b2bf174e8
164 files changed
+35594
No files matched your search
Binary file not shown.
@@ -0,0 +1,61 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: BeepingBH; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\BpngBttn.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
#include <windows.h>␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// BeepingBH␍
|
||||
#include "BpngBttn.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class BeepingBH ␍
|
||||
␍
|
||||
␍
|
||||
BeepingBH::BeepingBH()␍
|
||||
//## begin BeepingBH::BeepingBH%.hasinit preserve=no␍
|
||||
//## end BeepingBH::BeepingBH%.hasinit␍
|
||||
//## begin BeepingBH::BeepingBH%.initialization preserve=yes␍
|
||||
//## end BeepingBH::BeepingBH%.initialization␍
|
||||
{␍
|
||||
//## begin BeepingBH::BeepingBH%.body preserve=yes␍
|
||||
//## end BeepingBH::BeepingBH%.body␍
|
||||
}␍
|
||||
␍
|
||||
BeepingBH::~BeepingBH()␍
|
||||
{␍
|
||||
//## begin BeepingBH::~BeepingBH%.body preserve=yes␍
|
||||
//## end BeepingBH::~BeepingBH%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
void BeepingBH::doOnClick ()␍
|
||||
{␍
|
||||
//## begin BeepingBH::doOnClick%940854121.body preserve=yes␍
|
||||
MessageBeep(0xFFFFFFFF);␍
|
||||
//## end BeepingBH::doOnClick%940854121.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin BeepingBH.declarations preserve=yes␍
|
||||
//## end BeepingBH.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,89 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: BeepingBH; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\BpngBttn.h␍
|
||||
␍
|
||||
#ifndef BpngBttn_h␍
|
||||
#define BpngBttn_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Handler␍
|
||||
#include "Handler.h"␍
|
||||
// BH␍
|
||||
#include "BttnHndl.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: BeepingBH␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class BeepingBH : public Handler, //## Inherits: <unnamed>␍
|
||||
public BH //## Inherits: <unnamed>␍
|
||||
{␍
|
||||
//## begin BeepingBH.initialDeclarations preserve=yes␍
|
||||
//## end BeepingBH.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
␍
|
||||
//## Constructors (specified)␍
|
||||
//## Operation: BeepingBH%941014000␍
|
||||
BeepingBH ();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~BeepingBH();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: doOnClick%940854121␍
|
||||
void doOnClick ();␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin BeepingBH.public preserve=yes␍
|
||||
//## end BeepingBH.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Data Members for Class Attributes␍
|
||||
␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin BeepingBH.protected preserve=yes␍
|
||||
//## end BeepingBH.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin BeepingBH.private preserve=yes␍
|
||||
//## end BeepingBH.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin BeepingBH.implementation preserve=yes␍
|
||||
//## end BeepingBH.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin BeepingBH.postscript preserve=yes␍
|
||||
//## end BeepingBH.postscript␍
|
||||
␍
|
||||
// Class BeepingBH ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,54 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: BH; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\BttnHndl.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// BH␍
|
||||
#include "BttnHndl.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class BH ␍
|
||||
␍
|
||||
BH::BH()␍
|
||||
//## begin BH::BH%.hasinit preserve=no␍
|
||||
//## end BH::BH%.hasinit␍
|
||||
//## begin BH::BH%.initialization preserve=yes␍
|
||||
//## end BH::BH%.initialization␍
|
||||
{␍
|
||||
//## begin BH::BH%.body preserve=yes␍
|
||||
//## end BH::BH%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
BH::~BH()␍
|
||||
{␍
|
||||
//## begin BH::~BH%.body preserve=yes␍
|
||||
//## end BH::~BH%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin BH.declarations preserve=yes␍
|
||||
//## end BH.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
@@ -0,0 +1,80 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: BH; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\BttnHndl.h␍
|
||||
␍
|
||||
#ifndef BttnHndl_h␍
|
||||
#define BttnHndl_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: BH; Abstract␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class BH ␍
|
||||
{␍
|
||||
//## begin BH.initialDeclarations preserve=yes␍
|
||||
//## end BH.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
BH();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~BH();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: doOnClick%941103435␍
|
||||
virtual void doOnClick () = 0;␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin BH.public preserve=yes␍
|
||||
//## end BH.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin BH.protected preserve=yes␍
|
||||
//## end BH.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin BH.private preserve=yes␍
|
||||
//## end BH.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin BH.implementation preserve=yes␍
|
||||
//## end BH.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin BH.postscript preserve=yes␍
|
||||
//## end BH.postscript␍
|
||||
␍
|
||||
// Class BH ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Button; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Button.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
#include <iostream.h>␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Button␍
|
||||
#include "Button.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class Button ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
Button::Button()␍
|
||||
//## begin Button::Button%.hasinit preserve=no␍
|
||||
//## end Button::Button%.hasinit␍
|
||||
//## begin Button::Button%.initialization preserve=yes␍
|
||||
//## end Button::Button%.initialization␍
|
||||
{␍
|
||||
//## begin Button::Button%.body preserve=yes␍
|
||||
//## end Button::Button%.body␍
|
||||
}␍
|
||||
␍
|
||||
Button::Button (int xpos, int ypos, int width, int height, char* text)␍
|
||||
//## begin Button::Button%940854117.hasinit preserve=no␍
|
||||
//## end Button::Button%940854117.hasinit␍
|
||||
//## begin Button::Button%940854117.initialization preserve=yes␍
|
||||
//## end Button::Button%940854117.initialization␍
|
||||
{␍
|
||||
//## begin Button::Button%940854117.body preserve=yes␍
|
||||
Button::xpos = xpos;␍
|
||||
Button::ypos = ypos;␍
|
||||
Button::width = width;␍
|
||||
Button::height = height;␍
|
||||
Button::text = text;␍
|
||||
//## end Button::Button%940854117.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
Button::~Button()␍
|
||||
{␍
|
||||
//## begin Button::~Button%.body preserve=yes␍
|
||||
//## end Button::~Button%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
void Button::handleMouseEvent (Event e)␍
|
||||
{␍
|
||||
//## begin Button::handleMouseEvent%940929796.body preserve=yes␍
|
||||
the_BH->doOnClick();␍
|
||||
//## end Button::handleMouseEvent%940929796.body␍
|
||||
}␍
|
||||
␍
|
||||
void Button::draw (Graphics& g)␍
|
||||
{␍
|
||||
//## begin Button::draw%940929797.body preserve=yes␍
|
||||
Rectangle r;␍
|
||||
int absX, absY;␍
|
||||
␍
|
||||
getPpp()->getAbsPos(&r);␍
|
||||
␍
|
||||
absX = r.getXpos() + xpos;␍
|
||||
absY = r.getYpos() + ypos;␍
|
||||
␍
|
||||
g.drawButton(absX, absY, width, height, text);␍
|
||||
//## end Button::draw%940929797.body␍
|
||||
}␍
|
||||
␍
|
||||
void Button::handleKeyEvent (Event e)␍
|
||||
{␍
|
||||
//## begin Button::handleKeyEvent%941013995.body preserve=yes␍
|
||||
//## end Button::handleKeyEvent%941013995.body␍
|
||||
}␍
|
||||
␍
|
||||
bool Button::isHit (int x, int y)␍
|
||||
{␍
|
||||
//## begin Button::isHit%941013997.body preserve=yes␍
|
||||
return((x >= xpos) & (x < xpos + width) & (y >= ypos) & (y < ypos + height));␍
|
||||
//## end Button::isHit%941013997.body␍
|
||||
}␍
|
||||
␍
|
||||
void Button::setAction (BH* bh)␍
|
||||
{␍
|
||||
//## begin Button::setAction%941013999.body preserve=yes␍
|
||||
the_BH = bh;␍
|
||||
//## end Button::setAction%941013999.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin Button.declarations preserve=yes␍
|
||||
//## end Button.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Button; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Button.h␍
|
||||
␍
|
||||
#ifndef Button_h␍
|
||||
#define Button_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Component␍
|
||||
#include "Compnent.h"␍
|
||||
// Panel␍
|
||||
#include "Panel.h"␍
|
||||
// BH␍
|
||||
#include "BttnHndl.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: Button␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
//## Uses: <unnamed>; Panel { -> }␍
|
||||
␍
|
||||
class Button : public Component //## Inherits: <unnamed>␍
|
||||
{␍
|
||||
//## begin Button.initialDeclarations preserve=yes␍
|
||||
//## end Button.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
Button();␍
|
||||
␍
|
||||
//## Constructors (specified)␍
|
||||
//## Operation: Button%940854117␍
|
||||
Button (int xpos, int ypos, int width, int height, char* text);␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~Button();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: handleMouseEvent%940929796␍
|
||||
void handleMouseEvent (Event e);␍
|
||||
␍
|
||||
//## Operation: draw%940929797␍
|
||||
void draw (Graphics& g);␍
|
||||
␍
|
||||
//## Operation: handleKeyEvent%941013995␍
|
||||
void handleKeyEvent (Event e);␍
|
||||
␍
|
||||
//## Operation: isHit%941013997␍
|
||||
bool isHit (int x, int y);␍
|
||||
␍
|
||||
//## Operation: setAction%941013999␍
|
||||
void setAction (BH* bh);␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin Button.public preserve=yes␍
|
||||
//## end Button.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin Button.protected preserve=yes␍
|
||||
//## end Button.protected␍
|
||||
␍
|
||||
private:␍
|
||||
//## Get and Set Operations for Has Relationships (generated)␍
|
||||
␍
|
||||
//## Documentation Button::<the_BH>.has␍
|
||||
const BH * get_the_BH () const;␍
|
||||
void set_the_BH (BH * value);␍
|
||||
␍
|
||||
//## Get and Set Operations for Class Attributes (generated)␍
|
||||
␍
|
||||
//## Attribute: text␍
|
||||
const char* get_text () const;␍
|
||||
void set_text (char* value);␍
|
||||
␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin Button.private preserve=yes␍
|
||||
//## end Button.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Data Members for Has Relationships␍
|
||||
␍
|
||||
//## begin Button::<the_BH>.has preserve=no private: BH {1 -> 1RO}␍
|
||||
BH *the_BH;␍
|
||||
//## end Button::<the_BH>.has␍
|
||||
␍
|
||||
// Data Members for Class Attributes␍
|
||||
␍
|
||||
//## begin Button::text.attr preserve=no private: char* {U} ␍
|
||||
char* text;␍
|
||||
//## end Button::text.attr␍
|
||||
␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin Button.implementation preserve=yes␍
|
||||
//## end Button.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin Button.postscript preserve=yes␍
|
||||
//## end Button.postscript␍
|
||||
␍
|
||||
// Class Button ␍
|
||||
␍
|
||||
//## Get and Set Operations for Has Relationships (inline)␍
|
||||
␍
|
||||
inline const BH * Button::get_the_BH () const␍
|
||||
{␍
|
||||
//## begin Button::get_the_BH%.get preserve=no␍
|
||||
return the_BH;␍
|
||||
//## end Button::get_the_BH%.get␍
|
||||
}␍
|
||||
␍
|
||||
inline void Button::set_the_BH (BH * value)␍
|
||||
{␍
|
||||
//## begin Button::set_the_BH%.set preserve=no␍
|
||||
the_BH = value;␍
|
||||
//## end Button::set_the_BH%.set␍
|
||||
}␍
|
||||
␍
|
||||
//## Get and Set Operations for Class Attributes (inline)␍
|
||||
␍
|
||||
inline const char* Button::get_text () const␍
|
||||
{␍
|
||||
//## begin Button::get_text%.get preserve=no␍
|
||||
return text;␍
|
||||
//## end Button::get_text%.get␍
|
||||
}␍
|
||||
␍
|
||||
inline void Button::set_text (char* value)␍
|
||||
{␍
|
||||
//## begin Button::set_text%.set preserve=no␍
|
||||
text = value;␍
|
||||
//## end Button::set_text%.set␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,30 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: ComponentList; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\CmpnntLs.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// ComponentList␍
|
||||
#include "CmpnntLs.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## begin ComponentList.instantiation preserve=no␍
|
||||
template class List< Component* >;␍
|
||||
//## end ComponentList.instantiation␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,49 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: ComponentList; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\CmpnntLs.h␍
|
||||
␍
|
||||
#ifndef CmpnntLs_h␍
|
||||
#define CmpnntLs_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Component␍
|
||||
#include "Compnent.h"␍
|
||||
// XList␍
|
||||
#include "List.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
class Component;␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: ComponentList; Instantiated Class␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
//## Uses: <unnamed>; Component { -> }␍
|
||||
␍
|
||||
typedef List< Component* > ComponentList;␍
|
||||
␍
|
||||
//## begin ComponentList.postscript preserve=yes␍
|
||||
//## end ComponentList.postscript␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,124 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: CompositeComponent; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\CmpstCmp.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// CompositeComponent␍
|
||||
#include "CmpstCmp.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class CompositeComponent ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
CompositeComponent::CompositeComponent()␍
|
||||
//## begin CompositeComponent::CompositeComponent%.hasinit preserve=no␍
|
||||
//## end CompositeComponent::CompositeComponent%.hasinit␍
|
||||
//## begin CompositeComponent::CompositeComponent%.initialization preserve=yes␍
|
||||
//## end CompositeComponent::CompositeComponent%.initialization␍
|
||||
{␍
|
||||
//## begin CompositeComponent::CompositeComponent%.body preserve=yes␍
|
||||
//## end CompositeComponent::CompositeComponent%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
CompositeComponent::~CompositeComponent()␍
|
||||
{␍
|
||||
//## begin CompositeComponent::~CompositeComponent%.body preserve=yes␍
|
||||
//## end CompositeComponent::~CompositeComponent%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
void CompositeComponent::draw (Graphics& g)␍
|
||||
{␍
|
||||
//## begin CompositeComponent::draw%940929799.body preserve=yes␍
|
||||
Component *cTmp;␍
|
||||
␍
|
||||
if(!cList.isEmpty()){␍
|
||||
cTmp = cList.getFirst();␍
|
||||
cTmp->draw(g);␍
|
||||
␍
|
||||
while(!cList.isLast()){␍
|
||||
cTmp = cList.getNext(); ␍
|
||||
cTmp->draw(g); ␍
|
||||
}␍
|
||||
}␍
|
||||
//## end CompositeComponent::draw%940929799.body␍
|
||||
}␍
|
||||
␍
|
||||
void CompositeComponent::add (Component* c)␍
|
||||
{␍
|
||||
//## begin CompositeComponent::add%940945810.body preserve=yes␍
|
||||
cList.addElement(c);␍
|
||||
active = c;␍
|
||||
//## end CompositeComponent::add%940945810.body␍
|
||||
}␍
|
||||
␍
|
||||
void CompositeComponent::handleKeyEvent (Event e)␍
|
||||
{␍
|
||||
//## begin CompositeComponent::handleKeyEvent%941013991.body preserve=yes␍
|
||||
//## end CompositeComponent::handleKeyEvent%941013991.body␍
|
||||
}␍
|
||||
␍
|
||||
void CompositeComponent::handleMouseEvent (Event e)␍
|
||||
{␍
|
||||
//## begin CompositeComponent::handleMouseEvent%941013992.body preserve=yes␍
|
||||
Component *cTmp;␍
|
||||
␍
|
||||
if(!cList.isEmpty()){␍
|
||||
cTmp = cList.getFirst();␍
|
||||
if(cTmp->isHit(e.getxpos()-xpos, e.getypos()-ypos)){␍
|
||||
e.setxpos(e.getxpos()-xpos);␍
|
||||
e.setypos(e.getypos()-ypos);␍
|
||||
active = cTmp;␍
|
||||
cTmp->handleMouseEvent(e);␍
|
||||
}␍
|
||||
␍
|
||||
while(!cList.isLast()){␍
|
||||
cTmp = cList.getNext(); ␍
|
||||
if(cTmp->isHit(e.getxpos()-xpos, e.getypos()-ypos)){␍
|
||||
e.setxpos(e.getxpos()-xpos);␍
|
||||
e.setypos(e.getypos()-ypos);␍
|
||||
active = cTmp;␍
|
||||
cTmp->handleMouseEvent(e);␍
|
||||
}␍
|
||||
}␍
|
||||
}␍
|
||||
␍
|
||||
//## end CompositeComponent::handleMouseEvent%941013992.body␍
|
||||
}␍
|
||||
␍
|
||||
bool CompositeComponent::isHit (int x, int y)␍
|
||||
{␍
|
||||
//## begin CompositeComponent::isHit%941013998.body preserve=yes␍
|
||||
return((x >= xpos) & (x < xpos + width) & (y >= ypos) & (y < ypos + height));␍
|
||||
//## end CompositeComponent::isHit%941013998.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin CompositeComponent.declarations preserve=yes␍
|
||||
//## end CompositeComponent.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: CompositeComponent; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\CmpstCmp.h␍
|
||||
␍
|
||||
#ifndef CmpstCmp_h␍
|
||||
#define CmpstCmp_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Component␍
|
||||
#include "Compnent.h"␍
|
||||
// ComponentList␍
|
||||
#include "CmpnntLs.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: CompositeComponent␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class CompositeComponent : public Component //## Inherits: <unnamed>␍
|
||||
{␍
|
||||
//## begin CompositeComponent.initialDeclarations preserve=yes␍
|
||||
//## end CompositeComponent.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
CompositeComponent();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~CompositeComponent();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: draw%940929799␍
|
||||
void draw (Graphics& g);␍
|
||||
␍
|
||||
//## Operation: add%940945810␍
|
||||
void add (Component* c);␍
|
||||
␍
|
||||
//## Operation: handleKeyEvent%941013991␍
|
||||
void handleKeyEvent (Event e);␍
|
||||
␍
|
||||
//## Operation: handleMouseEvent%941013992␍
|
||||
void handleMouseEvent (Event e);␍
|
||||
␍
|
||||
//## Operation: isHit%941013998␍
|
||||
bool isHit (int x, int y);␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin CompositeComponent.public preserve=yes␍
|
||||
//## end CompositeComponent.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin CompositeComponent.protected preserve=yes␍
|
||||
//## end CompositeComponent.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin CompositeComponent.private preserve=yes␍
|
||||
//## end CompositeComponent.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Data Members for Has Relationships␍
|
||||
␍
|
||||
//## Documentation CompositeComponent::cList.has␍
|
||||
//## begin CompositeComponent::cList.has preserve=no private: ComponentList {1 -> 1VO}␍
|
||||
ComponentList cList;␍
|
||||
//## end CompositeComponent::cList.has␍
|
||||
␍
|
||||
//## Documentation CompositeComponent::active.has␍
|
||||
//## begin CompositeComponent::active.has preserve=no private: Component {1 -> RO}␍
|
||||
Component *active;␍
|
||||
//## end CompositeComponent::active.has␍
|
||||
␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin CompositeComponent.implementation preserve=yes␍
|
||||
//## end CompositeComponent.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin CompositeComponent.postscript preserve=yes␍
|
||||
//## end CompositeComponent.postscript␍
|
||||
␍
|
||||
// Class CompositeComponent ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,72 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Component; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Compnent.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Component␍
|
||||
#include "Compnent.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class Component ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
Component::Component()␍
|
||||
//## begin Component::Component%.hasinit preserve=no␍
|
||||
//## end Component::Component%.hasinit␍
|
||||
//## begin Component::Component%.initialization preserve=yes␍
|
||||
//## end Component::Component%.initialization␍
|
||||
{␍
|
||||
//## begin Component::Component%.body preserve=yes␍
|
||||
//## end Component::Component%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
Component::~Component()␍
|
||||
{␍
|
||||
//## begin Component::~Component%.body preserve=yes␍
|
||||
//## end Component::~Component%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
Panel* Component::getPpp ()␍
|
||||
{␍
|
||||
//## begin Component::getPpp%940945811.body preserve=yes␍
|
||||
return ppp;␍
|
||||
//## end Component::getPpp%940945811.body␍
|
||||
}␍
|
||||
␍
|
||||
void Component::setPpp (Panel* p)␍
|
||||
{␍
|
||||
//## begin Component::setPpp%940945812.body preserve=yes␍
|
||||
ppp = p;␍
|
||||
//## end Component::setPpp%940945812.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin Component.declarations preserve=yes␍
|
||||
//## end Component.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Component; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Compnent.h␍
|
||||
␍
|
||||
#ifndef Compnent_h␍
|
||||
#define Compnent_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Event␍
|
||||
#include "Event.h"␍
|
||||
// Graphics␍
|
||||
#include "Graphics.h"␍
|
||||
// Rectangle␍
|
||||
#include "Rectngle.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
class Panel;␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: Component; Abstract␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
//## Uses: <unnamed>; Event { -> }␍
|
||||
//## Uses: <unnamed>; Graphics { -> }␍
|
||||
//## Uses: <unnamed>; Rectangle { -> }␍
|
||||
␍
|
||||
class Component ␍
|
||||
{␍
|
||||
//## begin Component.initialDeclarations preserve=yes␍
|
||||
//## end Component.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
Component();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~Component();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: draw%940929791␍
|
||||
virtual void draw (Graphics& g) = 0;␍
|
||||
␍
|
||||
//## Operation: getPpp%940945811␍
|
||||
Panel* getPpp ();␍
|
||||
␍
|
||||
//## Operation: setPpp%940945812␍
|
||||
void setPpp (Panel* p);␍
|
||||
␍
|
||||
//## Operation: handleMouseEvent%941013993␍
|
||||
virtual void handleMouseEvent (Event e) = 0;␍
|
||||
␍
|
||||
//## Operation: handleKeyEvent%941013994␍
|
||||
virtual void handleKeyEvent (Event e) = 0;␍
|
||||
␍
|
||||
//## Operation: isHit%941013996␍
|
||||
virtual bool isHit (int x, int y) = 0;␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin Component.public preserve=yes␍
|
||||
//## end Component.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Data Members for Class Attributes␍
|
||||
␍
|
||||
//## Attribute: xpos␍
|
||||
//## begin Component::xpos.attr preserve=no protected: int {U} ␍
|
||||
int xpos;␍
|
||||
//## end Component::xpos.attr␍
|
||||
␍
|
||||
//## Attribute: ypos␍
|
||||
//## begin Component::ypos.attr preserve=no protected: int {U} ␍
|
||||
int ypos;␍
|
||||
//## end Component::ypos.attr␍
|
||||
␍
|
||||
//## Attribute: width␍
|
||||
//## begin Component::width.attr preserve=no protected: int {U} ␍
|
||||
int width;␍
|
||||
//## end Component::width.attr␍
|
||||
␍
|
||||
//## Attribute: height␍
|
||||
//## begin Component::height.attr preserve=no protected: int {U} ␍
|
||||
int height;␍
|
||||
//## end Component::height.attr␍
|
||||
␍
|
||||
//## Attribute: ppp␍
|
||||
//## begin Component::ppp.attr preserve=no protected: Panel* {U} ␍
|
||||
Panel* ppp;␍
|
||||
//## end Component::ppp.attr␍
|
||||
␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin Component.protected preserve=yes␍
|
||||
//## end Component.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin Component.private preserve=yes␍
|
||||
//## end Component.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin Component.implementation preserve=yes␍
|
||||
//## end Component.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin Component.postscript preserve=yes␍
|
||||
//## end Component.postscript␍
|
||||
␍
|
||||
// Class Component ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,137 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Desktop; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Desktop.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
#include <iostream.h>␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Desktop␍
|
||||
#include "Desktop.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class Desktop ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
Desktop::Desktop()␍
|
||||
//## begin Desktop::Desktop%.hasinit preserve=no␍
|
||||
//## end Desktop::Desktop%.hasinit␍
|
||||
//## begin Desktop::Desktop%.initialization preserve=yes␍
|
||||
//## end Desktop::Desktop%.initialization␍
|
||||
{␍
|
||||
//## begin Desktop::Desktop%.body preserve=yes␍
|
||||
//## end Desktop::Desktop%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
Desktop::~Desktop()␍
|
||||
{␍
|
||||
//## begin Desktop::~Desktop%.body preserve=yes␍
|
||||
//## end Desktop::~Desktop%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
void Desktop::handleMouseEvent (Event e)␍
|
||||
{␍
|
||||
//## begin Desktop::handleMouseEvent%940854123.body preserve=yes␍
|
||||
Window *wTmp;␍
|
||||
␍
|
||||
if(active->isHit(e.getxpos(),e.getypos()))␍
|
||||
active->handleMouseEvent(e);␍
|
||||
else if(!wList.isEmpty()){␍
|
||||
wTmp = wList.getFirst();␍
|
||||
if(wTmp->isHit(e.getxpos(),e.getypos())){␍
|
||||
active = wTmp;␍
|
||||
wTmp->handleMouseEvent(e);␍
|
||||
}␍
|
||||
while(!wList.isLast()){␍
|
||||
wTmp = wList.getNext(); ␍
|
||||
if(wTmp->isHit(e.getxpos(),e.getypos())){␍
|
||||
active = wTmp;␍
|
||||
wTmp->handleMouseEvent(e);␍
|
||||
}␍
|
||||
} ␍
|
||||
}␍
|
||||
␍
|
||||
//## end Desktop::handleMouseEvent%940854123.body␍
|
||||
}␍
|
||||
␍
|
||||
void Desktop::draw (Graphics& gd)␍
|
||||
{␍
|
||||
//## begin Desktop::draw%940929795.body preserve=yes␍
|
||||
Window *wTmp;␍
|
||||
␍
|
||||
if(!wList.isEmpty()){␍
|
||||
wTmp = wList.getFirst();␍
|
||||
wTmp->draw(gd);␍
|
||||
␍
|
||||
while(!wList.isLast()){␍
|
||||
wTmp = wList.getNext(); ␍
|
||||
wTmp->draw(gd); ␍
|
||||
}␍
|
||||
}␍
|
||||
active->draw(gd);␍
|
||||
//## end Desktop::draw%940929795.body␍
|
||||
}␍
|
||||
␍
|
||||
void Desktop::add (Window* w)␍
|
||||
{␍
|
||||
//## begin Desktop::add%940945814.body preserve=yes␍
|
||||
wList.addElement(w);␍
|
||||
active = w;␍
|
||||
//## end Desktop::add%940945814.body␍
|
||||
}␍
|
||||
␍
|
||||
void Desktop::run (EventReader& er, Graphics& gd)␍
|
||||
{␍
|
||||
//## begin Desktop::run%940945815.body preserve=yes␍
|
||||
Event ev;␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
while(1){␍
|
||||
ev = er.getEvent();␍
|
||||
switch(ev.getEventType()){␍
|
||||
case MOUSE_E: handleMouseEvent(ev);␍
|
||||
draw(gd);␍
|
||||
break;␍
|
||||
case KEY_E: handleKeyEvent(ev); ␍
|
||||
draw(gd);␍
|
||||
break;␍
|
||||
default: break;␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
}␍
|
||||
//## end Desktop::run%940945815.body␍
|
||||
}␍
|
||||
␍
|
||||
void Desktop::handleKeyEvent (Event e)␍
|
||||
{␍
|
||||
//## begin Desktop::handleKeyEvent%941013987.body preserve=yes␍
|
||||
//## end Desktop::handleKeyEvent%941013987.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin Desktop.declarations preserve=yes␍
|
||||
//## end Desktop.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Desktop; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Desktop.h␍
|
||||
␍
|
||||
#ifndef Desktop_h␍
|
||||
#define Desktop_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Window␍
|
||||
#include "Window.h"␍
|
||||
// EventReader␍
|
||||
#include "EvntRder.h"␍
|
||||
// Graphics␍
|
||||
#include "Graphics.h"␍
|
||||
// WindowList␍
|
||||
#include "WndwList.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: Desktop␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
//## Uses: <unnamed>; Graphics { -> }␍
|
||||
//## Uses: <unnamed>; EventReader { -> }␍
|
||||
␍
|
||||
class Desktop ␍
|
||||
{␍
|
||||
//## begin Desktop.initialDeclarations preserve=yes␍
|
||||
//## end Desktop.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
Desktop();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~Desktop();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: handleMouseEvent%940854123␍
|
||||
void handleMouseEvent (Event e);␍
|
||||
␍
|
||||
//## Operation: draw%940929795␍
|
||||
void draw (Graphics& gd);␍
|
||||
␍
|
||||
//## Operation: add%940945814␍
|
||||
void add (Window* w);␍
|
||||
␍
|
||||
//## Operation: run%940945815␍
|
||||
void run (EventReader& er, Graphics& gd);␍
|
||||
␍
|
||||
//## Operation: handleKeyEvent%941013987␍
|
||||
void handleKeyEvent (Event e);␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin Desktop.public preserve=yes␍
|
||||
//## end Desktop.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin Desktop.protected preserve=yes␍
|
||||
//## end Desktop.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin Desktop.private preserve=yes␍
|
||||
//## end Desktop.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Data Members for Has Relationships␍
|
||||
␍
|
||||
//## Documentation Desktop::active.has␍
|
||||
//## begin Desktop::active.has preserve=no private: Window {1 -> 1RO}␍
|
||||
Window *active;␍
|
||||
//## end Desktop::active.has␍
|
||||
␍
|
||||
//## Documentation Desktop::wList.has␍
|
||||
//## begin Desktop::wList.has preserve=no private: WindowList {1 -> 1VO}␍
|
||||
WindowList wList;␍
|
||||
//## end Desktop::wList.has␍
|
||||
␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin Desktop.implementation preserve=yes␍
|
||||
//## end Desktop.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin Desktop.postscript preserve=yes␍
|
||||
//## end Desktop.postscript␍
|
||||
␍
|
||||
// Class Desktop ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,98 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Event; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Event.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Event␍
|
||||
#include "Event.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class Event ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
Event::Event()␍
|
||||
//## begin Event::Event%.hasinit preserve=no␍
|
||||
//## end Event::Event%.hasinit␍
|
||||
//## begin Event::Event%.initialization preserve=yes␍
|
||||
//## end Event::Event%.initialization␍
|
||||
{␍
|
||||
//## begin Event::Event%.body preserve=yes␍
|
||||
//## end Event::Event%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
Event::~Event()␍
|
||||
{␍
|
||||
//## begin Event::~Event%.body preserve=yes␍
|
||||
//## end Event::~Event%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
EVENT_T Event::getEventType ()␍
|
||||
{␍
|
||||
//## begin Event::getEventType%941013981.body preserve=yes␍
|
||||
return eventType;␍
|
||||
//## end Event::getEventType%941013981.body␍
|
||||
}␍
|
||||
␍
|
||||
void Event::setEventType (EVENT_T e)␍
|
||||
{␍
|
||||
//## begin Event::setEventType%941013982.body preserve=yes␍
|
||||
eventType = e;␍
|
||||
//## end Event::setEventType%941013982.body␍
|
||||
}␍
|
||||
␍
|
||||
int Event::getxpos ()␍
|
||||
{␍
|
||||
//## begin Event::getxpos%941013983.body preserve=yes␍
|
||||
return xpos;␍
|
||||
//## end Event::getxpos%941013983.body␍
|
||||
}␍
|
||||
␍
|
||||
int Event::getypos ()␍
|
||||
{␍
|
||||
//## begin Event::getypos%941013984.body preserve=yes␍
|
||||
return ypos;␍
|
||||
//## end Event::getypos%941013984.body␍
|
||||
}␍
|
||||
␍
|
||||
void Event::setxpos (int x)␍
|
||||
{␍
|
||||
//## begin Event::setxpos%941013985.body preserve=yes␍
|
||||
xpos = x;␍
|
||||
//## end Event::setxpos%941013985.body␍
|
||||
}␍
|
||||
␍
|
||||
void Event::setypos (int y)␍
|
||||
{␍
|
||||
//## begin Event::setypos%941013986.body preserve=yes␍
|
||||
ypos = y;␍
|
||||
//## end Event::setypos%941013986.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin Event.declarations preserve=yes␍
|
||||
//## end Event.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Event; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Event.h␍
|
||||
␍
|
||||
#ifndef Event_h␍
|
||||
#define Event_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
typedef enum {NO_E, MOUSE_E, KEY_E} EVENT_T;␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: Event␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class Event ␍
|
||||
{␍
|
||||
//## begin Event.initialDeclarations preserve=yes␍
|
||||
//## end Event.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
Event();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~Event();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: getEventType%941013981␍
|
||||
EVENT_T getEventType ();␍
|
||||
␍
|
||||
//## Operation: setEventType%941013982␍
|
||||
void setEventType (EVENT_T e);␍
|
||||
␍
|
||||
//## Operation: getxpos%941013983␍
|
||||
int getxpos ();␍
|
||||
␍
|
||||
//## Operation: getypos%941013984␍
|
||||
int getypos ();␍
|
||||
␍
|
||||
//## Operation: setxpos%941013985␍
|
||||
void setxpos (int x);␍
|
||||
␍
|
||||
//## Operation: setypos%941013986␍
|
||||
void setypos (int y);␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin Event.public preserve=yes␍
|
||||
//## end Event.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Data Members for Class Attributes␍
|
||||
␍
|
||||
//## Attribute: eventType␍
|
||||
//## begin Event::eventType.attr preserve=no private: EVENT_T {U} ␍
|
||||
EVENT_T eventType;␍
|
||||
//## end Event::eventType.attr␍
|
||||
␍
|
||||
//## Attribute: xpos␍
|
||||
//## begin Event::xpos.attr preserve=no private: int {U} ␍
|
||||
int xpos;␍
|
||||
//## end Event::xpos.attr␍
|
||||
␍
|
||||
//## Attribute: ypos␍
|
||||
//## begin Event::ypos.attr preserve=no private: int {U} ␍
|
||||
int ypos;␍
|
||||
//## end Event::ypos.attr␍
|
||||
␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin Event.protected preserve=yes␍
|
||||
//## end Event.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin Event.private preserve=yes␍
|
||||
//## end Event.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin Event.implementation preserve=yes␍
|
||||
//## end Event.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin Event.postscript preserve=yes␍
|
||||
//## end Event.postscript␍
|
||||
␍
|
||||
// Class Event ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,61 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: EventReader; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\EvntRder.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// EventReader␍
|
||||
#include "EvntRder.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class EventReader ␍
|
||||
␍
|
||||
EventReader::EventReader()␍
|
||||
//## begin EventReader::EventReader%.hasinit preserve=no␍
|
||||
//## end EventReader::EventReader%.hasinit␍
|
||||
//## begin EventReader::EventReader%.initialization preserve=yes␍
|
||||
//## end EventReader::EventReader%.initialization␍
|
||||
{␍
|
||||
//## begin EventReader::EventReader%.body preserve=yes␍
|
||||
//## end EventReader::EventReader%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
EventReader::~EventReader()␍
|
||||
{␍
|
||||
//## begin EventReader::~EventReader%.body preserve=yes␍
|
||||
//## end EventReader::~EventReader%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin EventReader.declarations preserve=yes␍
|
||||
//## end EventReader.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
// Detached code regions:␍
|
||||
// WARNING: this code will be lost if code is regenerated.␍
|
||||
#if 0␍
|
||||
//## begin EventReader::getEvent%940854116.body preserve=no␍
|
||||
return (Event&)*this;␍
|
||||
//## end EventReader::getEvent%940854116.body␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,84 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: EventReader; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\EvntRder.h␍
|
||||
␍
|
||||
#ifndef EvntRder_h␍
|
||||
#define EvntRder_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Event␍
|
||||
#include "Event.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: EventReader; Abstract␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
//## Uses: <unnamed>; Event { -> }␍
|
||||
␍
|
||||
class EventReader ␍
|
||||
{␍
|
||||
//## begin EventReader.initialDeclarations preserve=yes␍
|
||||
//## end EventReader.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
EventReader();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~EventReader();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: getEvent%940854116␍
|
||||
virtual Event getEvent () = 0;␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin EventReader.public preserve=yes␍
|
||||
//## end EventReader.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin EventReader.protected preserve=yes␍
|
||||
//## end EventReader.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin EventReader.private preserve=yes␍
|
||||
//## end EventReader.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin EventReader.implementation preserve=yes␍
|
||||
//## end EventReader.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin EventReader.postscript preserve=yes␍
|
||||
//## end EventReader.postscript␍
|
||||
␍
|
||||
// Class EventReader ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,61 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: ExitBH; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\ExtBttnH.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
#include <stdlib.h>␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// ExitBH␍
|
||||
#include "ExtBttnH.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class ExitBH ␍
|
||||
␍
|
||||
ExitBH::ExitBH()␍
|
||||
//## begin ExitBH::ExitBH%.hasinit preserve=no␍
|
||||
//## end ExitBH::ExitBH%.hasinit␍
|
||||
//## begin ExitBH::ExitBH%.initialization preserve=yes␍
|
||||
//## end ExitBH::ExitBH%.initialization␍
|
||||
{␍
|
||||
//## begin ExitBH::ExitBH%.body preserve=yes␍
|
||||
//## end ExitBH::ExitBH%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
ExitBH::~ExitBH()␍
|
||||
{␍
|
||||
//## begin ExitBH::~ExitBH%.body preserve=yes␍
|
||||
//## end ExitBH::~ExitBH%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
void ExitBH::doOnClick ()␍
|
||||
{␍
|
||||
//## begin ExitBH::doOnClick%941103436.body preserve=yes␍
|
||||
exit(0);␍
|
||||
//## end ExitBH::doOnClick%941103436.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin ExitBH.declarations preserve=yes␍
|
||||
//## end ExitBH.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,82 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: ExitBH; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\ExtBttnH.h␍
|
||||
␍
|
||||
#ifndef ExtBttnH_h␍
|
||||
#define ExtBttnH_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// BH␍
|
||||
#include "BttnHndl.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: ExitBH␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class ExitBH : public BH //## Inherits: <unnamed>␍
|
||||
{␍
|
||||
//## begin ExitBH.initialDeclarations preserve=yes␍
|
||||
//## end ExitBH.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
ExitBH();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~ExitBH();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: doOnClick%941103436␍
|
||||
void doOnClick ();␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin ExitBH.public preserve=yes␍
|
||||
//## end ExitBH.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin ExitBH.protected preserve=yes␍
|
||||
//## end ExitBH.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin ExitBH.private preserve=yes␍
|
||||
//## end ExitBH.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin ExitBH.implementation preserve=yes␍
|
||||
//## end ExitBH.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin ExitBH.postscript preserve=yes␍
|
||||
//## end ExitBH.postscript␍
|
||||
␍
|
||||
// Class ExitBH ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,51 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Graphics; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Graphics.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Graphics␍
|
||||
#include "Graphics.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class Graphics ␍
|
||||
␍
|
||||
Graphics::Graphics()␍
|
||||
//## begin Graphics::Graphics%.hasinit preserve=no␍
|
||||
//## end Graphics::Graphics%.hasinit␍
|
||||
//## begin Graphics::Graphics%.initialization preserve=yes␍
|
||||
//## end Graphics::Graphics%.initialization␍
|
||||
{␍
|
||||
//## begin Graphics::Graphics%.body preserve=yes␍
|
||||
//## end Graphics::Graphics%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
Graphics::~Graphics()␍
|
||||
{␍
|
||||
//## begin Graphics::~Graphics%.body preserve=yes␍
|
||||
//## end Graphics::~Graphics%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin Graphics.declarations preserve=yes␍
|
||||
//## end Graphics.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,83 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Graphics; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Graphics.h␍
|
||||
␍
|
||||
#ifndef Graphics_h␍
|
||||
#define Graphics_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: Graphics; Abstract␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class Graphics ␍
|
||||
{␍
|
||||
//## begin Graphics.initialDeclarations preserve=yes␍
|
||||
//## end Graphics.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
Graphics();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~Graphics();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: drawWindow%940929793␍
|
||||
virtual void drawWindow (int xpos, int ypos, int width, int height, char* name) = 0;␍
|
||||
␍
|
||||
//## Operation: drawButton%940929794␍
|
||||
virtual void drawButton (int xpos, int ypos, int width, int height, char* text) = 0;␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin Graphics.public preserve=yes␍
|
||||
//## end Graphics.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin Graphics.protected preserve=yes␍
|
||||
//## end Graphics.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin Graphics.private preserve=yes␍
|
||||
//## end Graphics.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin Graphics.implementation preserve=yes␍
|
||||
//## end Graphics.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin Graphics.postscript preserve=yes␍
|
||||
//## end Graphics.postscript␍
|
||||
␍
|
||||
// Class Graphics ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,51 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Handler; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Handler.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Handler␍
|
||||
#include "Handler.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class Handler ␍
|
||||
␍
|
||||
Handler::Handler()␍
|
||||
//## begin Handler::Handler%.hasinit preserve=no␍
|
||||
//## end Handler::Handler%.hasinit␍
|
||||
//## begin Handler::Handler%.initialization preserve=yes␍
|
||||
//## end Handler::Handler%.initialization␍
|
||||
{␍
|
||||
//## begin Handler::Handler%.body preserve=yes␍
|
||||
//## end Handler::Handler%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
Handler::~Handler()␍
|
||||
{␍
|
||||
//## begin Handler::~Handler%.body preserve=yes␍
|
||||
//## end Handler::~Handler%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin Handler.declarations preserve=yes␍
|
||||
//## end Handler.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,75 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Handler; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Handler.h␍
|
||||
␍
|
||||
#ifndef Handler_h␍
|
||||
#define Handler_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: Handler␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class Handler ␍
|
||||
{␍
|
||||
//## begin Handler.initialDeclarations preserve=yes␍
|
||||
//## end Handler.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
Handler();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~Handler();␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin Handler.public preserve=yes␍
|
||||
//## end Handler.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin Handler.protected preserve=yes␍
|
||||
//## end Handler.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin Handler.private preserve=yes␍
|
||||
//## end Handler.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin Handler.implementation preserve=yes␍
|
||||
//## end Handler.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin Handler.postscript preserve=yes␍
|
||||
//## end Handler.postscript␍
|
||||
␍
|
||||
// Class Handler ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,51 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: KeyEvent; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\KeyEvent.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// KeyEvent␍
|
||||
#include "KeyEvent.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class KeyEvent ␍
|
||||
␍
|
||||
KeyEvent::KeyEvent()␍
|
||||
//## begin KeyEvent::KeyEvent%.hasinit preserve=no␍
|
||||
//## end KeyEvent::KeyEvent%.hasinit␍
|
||||
//## begin KeyEvent::KeyEvent%.initialization preserve=yes␍
|
||||
//## end KeyEvent::KeyEvent%.initialization␍
|
||||
{␍
|
||||
//## begin KeyEvent::KeyEvent%.body preserve=yes␍
|
||||
//## end KeyEvent::KeyEvent%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
KeyEvent::~KeyEvent()␍
|
||||
{␍
|
||||
//## begin KeyEvent::~KeyEvent%.body preserve=yes␍
|
||||
//## end KeyEvent::~KeyEvent%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin KeyEvent.declarations preserve=yes␍
|
||||
//## end KeyEvent.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,77 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: KeyEvent; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\KeyEvent.h␍
|
||||
␍
|
||||
#ifndef KeyEvent_h␍
|
||||
#define KeyEvent_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Event␍
|
||||
#include "Event.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: KeyEvent␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class KeyEvent : public Event //## Inherits: <unnamed>␍
|
||||
{␍
|
||||
//## begin KeyEvent.initialDeclarations preserve=yes␍
|
||||
//## end KeyEvent.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
KeyEvent();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~KeyEvent();␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin KeyEvent.public preserve=yes␍
|
||||
//## end KeyEvent.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin KeyEvent.protected preserve=yes␍
|
||||
//## end KeyEvent.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin KeyEvent.private preserve=yes␍
|
||||
//## end KeyEvent.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin KeyEvent.implementation preserve=yes␍
|
||||
//## end KeyEvent.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin KeyEvent.postscript preserve=yes␍
|
||||
//## end KeyEvent.postscript␍
|
||||
␍
|
||||
// Class KeyEvent ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
+8269
File diff suppressed because it is too large.
Load diff
+131
@@ -0,0 +1,131 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: List; Pseudo Package body␍
|
||||
//## Subsystem: figures␍
|
||||
//## Source file: H:\kurs\avC++\lab4\List.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// List␍
|
||||
#include "List.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Parameterized Class List ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
template <class T>␍
|
||||
List<T>::List()␍
|
||||
//## begin List::List%.hasinit preserve=no␍
|
||||
//## end List::List%.hasinit␍
|
||||
//## begin List::List%.initialization preserve=yes␍
|
||||
//## end List::List%.initialization␍
|
||||
{␍
|
||||
//## begin List::List%.body preserve=yes␍
|
||||
size = 0;␍
|
||||
head = NULL; ␍
|
||||
current = NULL; ␍
|
||||
//## end List::List%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
template <class T>␍
|
||||
List<T>::~List()␍
|
||||
{␍
|
||||
//## begin List::~List%.body preserve=yes␍
|
||||
while(head != NULL){␍
|
||||
current = head;␍
|
||||
head = current->getNext();␍
|
||||
delete current;␍
|
||||
}␍
|
||||
␍
|
||||
//## end List::~List%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
template <class T>␍
|
||||
T List<T>::getFirst ()␍
|
||||
{␍
|
||||
//## begin List::getFirst%937920679.body preserve=yes␍
|
||||
current = head;␍
|
||||
return head->getData(); ␍
|
||||
//## end List::getFirst%937920679.body␍
|
||||
}␍
|
||||
␍
|
||||
template <class T>␍
|
||||
T List<T>::getNext ()␍
|
||||
{␍
|
||||
//## begin List::getNext%937920680.body preserve=yes␍
|
||||
current = current->getNext();␍
|
||||
return current->getData();␍
|
||||
//## end List::getNext%937920680.body␍
|
||||
}␍
|
||||
␍
|
||||
template <class T>␍
|
||||
bool List<T>::isLast ()␍
|
||||
{␍
|
||||
//## begin List::isLast%937920681.body preserve=yes␍
|
||||
if(current == NULL)␍
|
||||
return false;␍
|
||||
return current->isLast();␍
|
||||
//## end List::isLast%937920681.body␍
|
||||
}␍
|
||||
␍
|
||||
template <class T>␍
|
||||
void List<T>::addElement (T element)␍
|
||||
{␍
|
||||
//## begin List::addElement%938503949.body preserve=yes␍
|
||||
Node<T>* temp;␍
|
||||
temp = new Node<T>(element);␍
|
||||
␍
|
||||
size++;␍
|
||||
if(head == NULL)␍
|
||||
head = temp;␍
|
||||
else{␍
|
||||
current = head;␍
|
||||
while(!current->isLast())␍
|
||||
current = current->getNext();␍
|
||||
current->setNext(temp);␍
|
||||
}␍
|
||||
//## end List::addElement%938503949.body␍
|
||||
}␍
|
||||
␍
|
||||
template <class T>␍
|
||||
bool List<T>::isEmpty ()␍
|
||||
{␍
|
||||
//## begin List::isEmpty%939023037.body preserve=yes␍
|
||||
if(head == NULL)␍
|
||||
return true;␍
|
||||
return false;␍
|
||||
//## end List::isEmpty%939023037.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin List.declarations preserve=yes␍
|
||||
//## end List.declarations␍
|
||||
␍
|
||||
template <class T>␍
|
||||
int List<T>::getSize ()␍
|
||||
{␍
|
||||
//## begin List::isEmpty%939023037.body preserve=yes␍
|
||||
return size;␍
|
||||
//## end List::isEmpty%939023037.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: List; Pseudo Package specification␍
|
||||
//## Subsystem: figures␍
|
||||
//## Source file: H:\kurs\avC++\lab4\List.h␍
|
||||
␍
|
||||
#ifndef List_h␍
|
||||
#define List_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Node␍
|
||||
#include "Node.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: List; Parameterized Class␍
|
||||
//## Category: Figures␍
|
||||
//## Subsystem: figures␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
template <class T>␍
|
||||
class List ␍
|
||||
{␍
|
||||
//## begin List.initialDeclarations preserve=yes␍
|
||||
//## end List.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
List();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~List();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: getFirst%937920679␍
|
||||
T getFirst ();␍
|
||||
␍
|
||||
//## Operation: getNext%937920680␍
|
||||
T getNext ();␍
|
||||
␍
|
||||
//## Operation: isLast%937920681␍
|
||||
bool isLast ();␍
|
||||
␍
|
||||
//## Operation: addElement%938503949␍
|
||||
void addElement (T element);␍
|
||||
␍
|
||||
//## Operation: isEmpty%939023037␍
|
||||
bool isEmpty ();␍
|
||||
␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin List.public preserve=yes␍
|
||||
int getSize ();␍
|
||||
//## end List.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin List.protected preserve=yes␍
|
||||
//## end List.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin List.private preserve=yes␍
|
||||
//## end List.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Data Members for Has Relationships␍
|
||||
␍
|
||||
//## Documentation List::head.has␍
|
||||
//## begin List::head.has preserve=no public: Node {1 -> 1UO}␍
|
||||
Node<T> *head;␍
|
||||
//## end List::head.has␍
|
||||
␍
|
||||
// Data Members for Class Attributes␍
|
||||
␍
|
||||
//## Attribute: current␍
|
||||
//## begin List::current.attr preserve=no private: Node<T> {R} ␍
|
||||
Node<T> *current;␍
|
||||
//## end List::current.attr␍
|
||||
␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin List.implementation preserve=yes␍
|
||||
int size;␍
|
||||
//## end List.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin List.postscript preserve=yes␍
|
||||
#include "list.cpp"␍
|
||||
//## end List.postscript␍
|
||||
␍
|
||||
// Parameterized Class List ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,56 @@
|
||||
//#␍
|
||||
//# main.cpp␍
|
||||
//#␍
|
||||
//# =======================================================␍
|
||||
//# Lab i Avacerad C++␍
|
||||
//# 7. User Interface␍
|
||||
//#␍
|
||||
//#␍
|
||||
//# Christian Ohlsson ␍
|
||||
//# Daniel Alfredsson␍
|
||||
//# Karlstads universitet␍
|
||||
//# 991131␍
|
||||
//# =======================================================␍
|
||||
␍
|
||||
#include <iostream.h>␍
|
||||
#include "Desktop.h"␍
|
||||
#include "Button.h"␍
|
||||
#include "BpngBttn.h"␍
|
||||
#include "ExtBttnH.h"␍
|
||||
#include "Panel.h"␍
|
||||
#include "NTConsle.h"␍
|
||||
#include "NTvntrdr.h"␍
|
||||
␍
|
||||
void main(void){␍
|
||||
NTEventReader e;␍
|
||||
Desktop d;␍
|
||||
NTConsole n;␍
|
||||
␍
|
||||
Panel p(14,2,15,10);␍
|
||||
Window w(10,5,30,15,"Window");␍
|
||||
␍
|
||||
/* TopDown td("File"); This is how it works␍
|
||||
mi = MenuItem("Open"); with TopDown menus.␍
|
||||
mi.setAction(&bh1);␍
|
||||
␍
|
||||
td.add(&mi);␍
|
||||
w.add(&td); */␍
|
||||
␍
|
||||
BeepingBH bh1;␍
|
||||
ExitBH bh2;␍
|
||||
␍
|
||||
Button b1(1,1,9,3,"Button");␍
|
||||
Button b2(1,6,9,3,"Exit");␍
|
||||
␍
|
||||
b1.setAction(&bh1);␍
|
||||
b2.setAction(&bh2);␍
|
||||
␍
|
||||
d.add(&w);␍
|
||||
␍
|
||||
p.add(&b1);␍
|
||||
p.add(&b2);␍
|
||||
w.add(&p);␍
|
||||
␍
|
||||
d.draw(n);␍
|
||||
d.run(e, n);␍
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
#include <windows.h>␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// MenuBH␍
|
||||
#include "Menu.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class MenuBH ␍
|
||||
␍
|
||||
MenuBH::MenuBH()␍
|
||||
//## begin MenuBH::MenuBH%.hasinit preserve=no␍
|
||||
//## end MenuBH::MenuBH%.hasinit␍
|
||||
//## begin MenuBH::MenuBH%.initialization preserve=yes␍
|
||||
//## end MenuBH::MenuBH%.initialization␍
|
||||
{␍
|
||||
//## begin MenuBH::MenuBH%.body preserve=yes␍
|
||||
//## end MenuBH::MenuBH%.body␍
|
||||
}␍
|
||||
␍
|
||||
MenuBH::~MenuBH()␍
|
||||
{␍
|
||||
//## begin MenuBH::~MenuBH%.body preserve=yes␍
|
||||
//## end MenuBH::~MenuBH%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
void MenuBH::doOnClick ()␍
|
||||
{␍
|
||||
//## begin MenuBH::doOnClick%940854121.body preserve=yes␍
|
||||
MessageBeep(0xFFFFFFFF);␍
|
||||
//## end MenuBH::doOnClick%940854121.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin MenuBH.declarations preserve=yes␍
|
||||
//## end MenuBH.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: MenuBH; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\BpngBttn.h␍
|
||||
␍
|
||||
#ifndef Menu_h␍
|
||||
#define Menu_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Handler␍
|
||||
#include "Handler.h"␍
|
||||
// BH␍
|
||||
#include "BttnHndl.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: MenuBH␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class MenuBH : public Handler, //## Inherits: <unnamed>␍
|
||||
public BH //## Inherits: <unnamed>␍
|
||||
{␍
|
||||
//## begin MenuBH.initialDeclarations preserve=yes␍
|
||||
//## end MenuBH.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
␍
|
||||
//## Constructors (specified)␍
|
||||
//## Operation: MenuBH%941014000␍
|
||||
MenuBH ();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~MenuBH();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: doOnClick%940854121␍
|
||||
void doOnClick ();␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin MenuBH.public preserve=yes␍
|
||||
//## end MenuBH.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Data Members for Class Attributes␍
|
||||
␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin MenuBH.protected preserve=yes␍
|
||||
//## end MenuBH.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin MenuBH.private preserve=yes␍
|
||||
//## end MenuBH.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin MenuBH.implementation preserve=yes␍
|
||||
//## end MenuBH.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin MenuBH.postscript preserve=yes␍
|
||||
//## end MenuBH.postscript␍
|
||||
␍
|
||||
// Class MenuBH ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,51 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: MouseEvent; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\MosEvent.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// MouseEvent␍
|
||||
#include "MosEvent.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class MouseEvent ␍
|
||||
␍
|
||||
MouseEvent::MouseEvent()␍
|
||||
//## begin MouseEvent::MouseEvent%.hasinit preserve=no␍
|
||||
//## end MouseEvent::MouseEvent%.hasinit␍
|
||||
//## begin MouseEvent::MouseEvent%.initialization preserve=yes␍
|
||||
//## end MouseEvent::MouseEvent%.initialization␍
|
||||
{␍
|
||||
//## begin MouseEvent::MouseEvent%.body preserve=yes␍
|
||||
//## end MouseEvent::MouseEvent%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
MouseEvent::~MouseEvent()␍
|
||||
{␍
|
||||
//## begin MouseEvent::~MouseEvent%.body preserve=yes␍
|
||||
//## end MouseEvent::~MouseEvent%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin MouseEvent.declarations preserve=yes␍
|
||||
//## end MouseEvent.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,77 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: MouseEvent; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\MosEvent.h␍
|
||||
␍
|
||||
#ifndef MosEvent_h␍
|
||||
#define MosEvent_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Event␍
|
||||
#include "Event.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: MouseEvent␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class MouseEvent : public Event //## Inherits: <unnamed>␍
|
||||
{␍
|
||||
//## begin MouseEvent.initialDeclarations preserve=yes␍
|
||||
//## end MouseEvent.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
MouseEvent();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~MouseEvent();␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin MouseEvent.public preserve=yes␍
|
||||
//## end MouseEvent.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin MouseEvent.protected preserve=yes␍
|
||||
//## end MouseEvent.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin MouseEvent.private preserve=yes␍
|
||||
//## end MouseEvent.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin MouseEvent.implementation preserve=yes␍
|
||||
//## end MouseEvent.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin MouseEvent.postscript preserve=yes␍
|
||||
//## end MouseEvent.postscript␍
|
||||
␍
|
||||
// Class MouseEvent ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,94 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Node; Pseudo Package body␍
|
||||
//## Subsystem: figures␍
|
||||
//## Source file: H:\kurs\avC++\lab4\Node.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
#include <string.h>␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Node␍
|
||||
#include "Node.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Parameterized Class Node ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
template <class T>␍
|
||||
Node<T>::Node (T _data)␍
|
||||
//## begin Node::Node%938587803.hasinit preserve=no␍
|
||||
//## end Node::Node%938587803.hasinit␍
|
||||
//## begin Node::Node%938587803.initialization preserve=yes␍
|
||||
//## end Node::Node%938587803.initialization␍
|
||||
{␍
|
||||
//## begin Node::Node%938587803.body preserve=yes␍
|
||||
data = _data;␍
|
||||
next = (Node<T>*)0;␍
|
||||
//## end Node::Node%938587803.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
template <class T>␍
|
||||
Node<T>::~Node()␍
|
||||
{␍
|
||||
//## begin Node::~Node%.body preserve=yes␍
|
||||
//## end Node::~Node%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
template <class T>␍
|
||||
T Node<T>::getData ()␍
|
||||
{␍
|
||||
//## begin Node::getData%938587800.body preserve=yes␍
|
||||
return data;␍
|
||||
//## end Node::getData%938587800.body␍
|
||||
}␍
|
||||
␍
|
||||
template <class T>␍
|
||||
bool Node<T>::isLast ()␍
|
||||
{␍
|
||||
//## begin Node::isLast%938587801.body preserve=yes␍
|
||||
if(next == (Node<T>*)0)␍
|
||||
return true;␍
|
||||
return false;␍
|
||||
//## end Node::isLast%938587801.body␍
|
||||
}␍
|
||||
␍
|
||||
template <class T>␍
|
||||
Node<T>* Node<T>::getNext ()␍
|
||||
{␍
|
||||
//## begin Node::getNext%938587802.body preserve=yes␍
|
||||
return next;␍
|
||||
//## end Node::getNext%938587802.body␍
|
||||
}␍
|
||||
␍
|
||||
template <class T>␍
|
||||
void Node<T>::setNext (Node<T>* newNode)␍
|
||||
{␍
|
||||
//## begin Node::setNext%938587804.body preserve=yes␍
|
||||
next = newNode; ␍
|
||||
//## end Node::setNext%938587804.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin Node.declarations preserve=yes␍
|
||||
//## end Node.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Node; Pseudo Package specification␍
|
||||
//## Subsystem: figures␍
|
||||
//## Source file: H:\kurs\avC++\lab4\Node.h␍
|
||||
␍
|
||||
#ifndef Node_h␍
|
||||
#define Node_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: Node; Parameterized Class␍
|
||||
//## Category: Figures␍
|
||||
//## Subsystem: figures␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
template <class T>␍
|
||||
class Node ␍
|
||||
{␍
|
||||
//## begin Node.initialDeclarations preserve=yes␍
|
||||
//## end Node.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (specified)␍
|
||||
//## Operation: Node%938587803␍
|
||||
Node (T _data);␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~Node();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: getData%938587800␍
|
||||
T getData ();␍
|
||||
␍
|
||||
//## Operation: isLast%938587801␍
|
||||
bool isLast ();␍
|
||||
␍
|
||||
//## Operation: getNext%938587802␍
|
||||
Node<T>* getNext ();␍
|
||||
␍
|
||||
//## Operation: setNext%938587804␍
|
||||
void setNext (Node<T>* newNode);␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin Node.public preserve=yes␍
|
||||
//## end Node.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin Node.protected preserve=yes␍
|
||||
//## end Node.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin Node.private preserve=yes␍
|
||||
//## end Node.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Data Members for Has Relationships␍
|
||||
␍
|
||||
//## Documentation Node::next.has␍
|
||||
//## begin Node::next.has preserve=no private: Node {1 -> 1RO}␍
|
||||
Node *next;␍
|
||||
//## end Node::next.has␍
|
||||
␍
|
||||
// Data Members for Class Attributes␍
|
||||
␍
|
||||
//## Attribute: data␍
|
||||
//## begin Node::data.attr preserve=no private: T {U} ␍
|
||||
T data;␍
|
||||
//## end Node::data.attr␍
|
||||
␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin Node.implementation preserve=yes␍
|
||||
//## end Node.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin Node.postscript preserve=yes␍
|
||||
#include "Node.cpp"␍
|
||||
//## end Node.postscript␍
|
||||
␍
|
||||
// Parameterized Class Node ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,121 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: NTConsole; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\NTConsle.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// NTConsole␍
|
||||
#include "NTConsle.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
#include <iostream.h>␍
|
||||
#include <windows.h>␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class NTConsole ␍
|
||||
␍
|
||||
NTConsole::NTConsole()␍
|
||||
//## begin NTConsole::NTConsole%.hasinit preserve=no␍
|
||||
//## end NTConsole::NTConsole%.hasinit␍
|
||||
//## begin NTConsole::NTConsole%.initialization preserve=yes␍
|
||||
//## end NTConsole::NTConsole%.initialization␍
|
||||
{␍
|
||||
//## begin NTConsole::NTConsole%.body preserve=yes␍
|
||||
//## end NTConsole::NTConsole%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
NTConsole::~NTConsole()␍
|
||||
{␍
|
||||
//## begin NTConsole::~NTConsole%.body preserve=yes␍
|
||||
//## end NTConsole::~NTConsole%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
void NTConsole::drawWindow (int xpos, int ypos, int width, int height, char* name)␍
|
||||
{␍
|
||||
//## begin NTConsole::drawWindow%940929802.body preserve=yes␍
|
||||
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);␍
|
||||
COORD ul;␍
|
||||
char buff[] = " ";␍
|
||||
LPVOID param;␍
|
||||
DWORD written=0;␍
|
||||
␍
|
||||
ul.X = xpos;␍
|
||||
ul.Y = ypos;␍
|
||||
SetConsoleCursorPosition(h,ul); ␍
|
||||
SetConsoleTextAttribute(h,FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_INTENSITY|BACKGROUND_BLUE|BACKGROUND_INTENSITY);␍
|
||||
␍
|
||||
// Print "titlebar"␍
|
||||
WriteConsole(h,buff,strlen(buff),&written,param); ␍
|
||||
WriteConsole(h,name,strlen(name),&written,param); ␍
|
||||
for(int j=0; j<(width-strlen(name)-1); j++)␍
|
||||
WriteConsole(h,buff,strlen(buff),&written,param); ␍
|
||||
␍
|
||||
// Print the rest if the window␍
|
||||
SetConsoleTextAttribute(h,FOREGROUND_BLUE|FOREGROUND_INTENSITY|BACKGROUND_BLUE|BACKGROUND_GREEN|BACKGROUND_RED);␍
|
||||
␍
|
||||
for(int i=1; i<height; i++){␍
|
||||
ul.X = xpos;␍
|
||||
ul.Y = ypos+i;␍
|
||||
SetConsoleCursorPosition(h,ul); ␍
|
||||
for(j=0; j<width; j++)␍
|
||||
WriteConsole(h,buff,strlen(buff),&written,param); ␍
|
||||
}␍
|
||||
␍
|
||||
cout << endl;␍
|
||||
␍
|
||||
//## end NTConsole::drawWindow%940929802.body␍
|
||||
}␍
|
||||
␍
|
||||
void NTConsole::drawButton (int xpos, int ypos, int width, int height, char* text)␍
|
||||
{␍
|
||||
//## begin NTConsole::drawButton%940929803.body preserve=yes␍
|
||||
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);␍
|
||||
COORD ul;␍
|
||||
char buff[] = " ";␍
|
||||
LPVOID param;␍
|
||||
DWORD written=0;␍
|
||||
␍
|
||||
ul.X = xpos;␍
|
||||
ul.Y = ypos;␍
|
||||
SetConsoleCursorPosition(h,ul); ␍
|
||||
SetConsoleTextAttribute(h,FOREGROUND_GREEN|FOREGROUND_RED|FOREGROUND_BLUE|BACKGROUND_BLUE|BACKGROUND_GREEN|BACKGROUND_RED|BACKGROUND_INTENSITY);␍
|
||||
␍
|
||||
WriteConsole(h,buff,strlen(buff),&written,param); ␍
|
||||
WriteConsole(h,text,strlen(text),&written,param); ␍
|
||||
for(int j=0; j<(width-strlen(text)-1); j++)␍
|
||||
WriteConsole(h,buff,strlen(buff),&written,param); ␍
|
||||
␍
|
||||
for(int i=1; i<height; i++){␍
|
||||
ul.X = xpos;␍
|
||||
ul.Y = ypos+i;␍
|
||||
SetConsoleCursorPosition(h,ul); ␍
|
||||
for(j=0; j<width; j++)␍
|
||||
WriteConsole(h,buff,strlen(buff),&written,param); ␍
|
||||
}␍
|
||||
␍
|
||||
//## end NTConsole::drawButton%940929803.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin NTConsole.declarations preserve=yes␍
|
||||
//## end NTConsole.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,85 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: NTConsole; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\NTConsle.h␍
|
||||
␍
|
||||
#ifndef NTConsle_h␍
|
||||
#define NTConsle_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Graphics␍
|
||||
#include "Graphics.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: NTConsole␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class NTConsole : public Graphics //## Inherits: <unnamed>␍
|
||||
{␍
|
||||
//## begin NTConsole.initialDeclarations preserve=yes␍
|
||||
//## end NTConsole.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
NTConsole();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~NTConsole();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: drawWindow%940929802␍
|
||||
void drawWindow (int xpos, int ypos, int width, int height, char* name);␍
|
||||
␍
|
||||
//## Operation: drawButton%940929803␍
|
||||
void drawButton (int xpos, int ypos, int width, int height, char* text);␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin NTConsole.public preserve=yes␍
|
||||
//## end NTConsole.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin NTConsole.protected preserve=yes␍
|
||||
//## end NTConsole.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin NTConsole.private preserve=yes␍
|
||||
//## end NTConsole.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin NTConsole.implementation preserve=yes␍
|
||||
//## end NTConsole.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin NTConsole.postscript preserve=yes␍
|
||||
//## end NTConsole.postscript␍
|
||||
␍
|
||||
// Class NTConsole ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,91 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: NTEventReader; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\NTvntRdr.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
#include <iostream.h>␍
|
||||
#include <windows.h>␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// NTEventReader␍
|
||||
#include "NTvntRdr.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class NTEventReader ␍
|
||||
␍
|
||||
NTEventReader::NTEventReader()␍
|
||||
//## begin NTEventReader::NTEventReader%.hasinit preserve=no␍
|
||||
//## end NTEventReader::NTEventReader%.hasinit␍
|
||||
//## begin NTEventReader::NTEventReader%.initialization preserve=yes␍
|
||||
//## end NTEventReader::NTEventReader%.initialization␍
|
||||
{␍
|
||||
//## begin NTEventReader::NTEventReader%.body preserve=yes␍
|
||||
//## end NTEventReader::NTEventReader%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
NTEventReader::~NTEventReader()␍
|
||||
{␍
|
||||
//## begin NTEventReader::~NTEventReader%.body preserve=yes␍
|
||||
//## end NTEventReader::~NTEventReader%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
Event NTEventReader::getEvent ()␍
|
||||
{␍
|
||||
//## begin NTEventReader::getEvent%940854115.body preserve=yes␍
|
||||
HANDLE hln = GetStdHandle(STD_INPUT_HANDLE);␍
|
||||
_INPUT_RECORD lpBuffer[5];␍
|
||||
DWORD length=1;␍
|
||||
DWORD lpNumberOfEventsRead=0;␍
|
||||
WORD key=0, scan=0;␍
|
||||
Event e;␍
|
||||
␍
|
||||
ReadConsoleInput(hln,&lpBuffer[0],length,&lpNumberOfEventsRead);␍
|
||||
␍
|
||||
for(DWORD i=0; i<lpNumberOfEventsRead; i++){␍
|
||||
INPUT_RECORD r=lpBuffer[i];␍
|
||||
switch(r.EventType){␍
|
||||
case MOUSE_EVENT: ␍
|
||||
switch(r.Event.MouseEvent.dwButtonState){␍
|
||||
case FROM_LEFT_1ST_BUTTON_PRESSED:␍
|
||||
e.setEventType(MOUSE_E);␍
|
||||
e.setxpos(r.Event.MouseEvent.dwMousePosition.X);␍
|
||||
e.setypos(r.Event.MouseEvent.dwMousePosition.Y);␍
|
||||
return e;␍
|
||||
break; ␍
|
||||
}␍
|
||||
; break;␍
|
||||
case KEY_EVENT: ; break;␍
|
||||
default: ; break;␍
|
||||
}␍
|
||||
cout.flush();␍
|
||||
}␍
|
||||
e.setEventType(NO_E);␍
|
||||
return e;␍
|
||||
␍
|
||||
//## end NTEventReader::getEvent%940854115.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin NTEventReader.declarations preserve=yes␍
|
||||
//## end NTEventReader.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,82 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: NTEventReader; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\NTvntRdr.h␍
|
||||
␍
|
||||
#ifndef NTvntRdr_h␍
|
||||
#define NTvntRdr_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// EventReader␍
|
||||
#include "EvntRder.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: NTEventReader␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class NTEventReader : public EventReader //## Inherits: <unnamed>␍
|
||||
{␍
|
||||
//## begin NTEventReader.initialDeclarations preserve=yes␍
|
||||
//## end NTEventReader.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
NTEventReader();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~NTEventReader();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: getEvent%940854115␍
|
||||
Event getEvent ();␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin NTEventReader.public preserve=yes␍
|
||||
//## end NTEventReader.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin NTEventReader.protected preserve=yes␍
|
||||
//## end NTEventReader.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin NTEventReader.private preserve=yes␍
|
||||
//## end NTEventReader.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin NTEventReader.implementation preserve=yes␍
|
||||
//## end NTEventReader.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin NTEventReader.postscript preserve=yes␍
|
||||
//## end NTEventReader.postscript␍
|
||||
␍
|
||||
// Class NTEventReader ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,96 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Panel; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Panel.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Panel␍
|
||||
#include "Panel.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class Panel ␍
|
||||
␍
|
||||
Panel::Panel()␍
|
||||
//## begin Panel::Panel%.hasinit preserve=no␍
|
||||
//## end Panel::Panel%.hasinit␍
|
||||
//## begin Panel::Panel%.initialization preserve=yes␍
|
||||
//## end Panel::Panel%.initialization␍
|
||||
{␍
|
||||
//## begin Panel::Panel%.body preserve=yes␍
|
||||
//## end Panel::Panel%.body␍
|
||||
}␍
|
||||
␍
|
||||
Panel::Panel (int xpos, int ypos, int width, int height)␍
|
||||
//## begin Panel::Panel%940854126.hasinit preserve=no␍
|
||||
//## end Panel::Panel%940854126.hasinit␍
|
||||
//## begin Panel::Panel%940854126.initialization preserve=yes␍
|
||||
//## end Panel::Panel%940854126.initialization␍
|
||||
{␍
|
||||
//## begin Panel::Panel%940854126.body preserve=yes␍
|
||||
Panel::xpos = xpos;␍
|
||||
Panel::ypos = ypos;␍
|
||||
Panel::width = width;␍
|
||||
Panel::height = height;␍
|
||||
//## end Panel::Panel%940854126.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
Panel::~Panel()␍
|
||||
{␍
|
||||
//## begin Panel::~Panel%.body preserve=yes␍
|
||||
//## end Panel::~Panel%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
void Panel::getAbsPos (Rectangle* r)␍
|
||||
{␍
|
||||
//## begin Panel::getAbsPos%940945807.body preserve=yes␍
|
||||
int x1,y1,x2,y2;␍
|
||||
␍
|
||||
x1 = xpos;␍
|
||||
y1 = ypos;␍
|
||||
x2 = width;␍
|
||||
y2 = height;␍
|
||||
␍
|
||||
if(getPpp() != 0){␍
|
||||
getPpp()->getAbsPos(r); ␍
|
||||
x1 += r->getXpos();␍
|
||||
y1 += r->getYpos();␍
|
||||
}␍
|
||||
␍
|
||||
r->setValue(x1, y1, x2, y2);␍
|
||||
␍
|
||||
//## end Panel::getAbsPos%940945807.body␍
|
||||
}␍
|
||||
␍
|
||||
void Panel::add (Component* c)␍
|
||||
{␍
|
||||
//## begin Panel::add%940945809.body preserve=yes␍
|
||||
c->setPpp(this);␍
|
||||
CompositeComponent::add(c);␍
|
||||
//## end Panel::add%940945809.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin Panel.declarations preserve=yes␍
|
||||
//## end Panel.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,90 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Panel; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Panel.h␍
|
||||
␍
|
||||
#ifndef Panel_h␍
|
||||
#define Panel_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// CompositeComponent␍
|
||||
#include "CmpstCmp.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
class CompositeComponent;␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: Panel␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class Panel : public CompositeComponent //## Inherits: <unnamed>␍
|
||||
{␍
|
||||
//## begin Panel.initialDeclarations preserve=yes␍
|
||||
//## end Panel.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
Panel();␍
|
||||
␍
|
||||
//## Constructors (specified)␍
|
||||
//## Operation: Panel%940854126␍
|
||||
Panel (int xpos, int ypos, int width, int height);␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~Panel();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: getAbsPos%940945807␍
|
||||
void getAbsPos (Rectangle* r);␍
|
||||
␍
|
||||
//## Operation: add%940945809␍
|
||||
void add (Component* c);␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin Panel.public preserve=yes␍
|
||||
//## end Panel.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin Panel.protected preserve=yes␍
|
||||
//## end Panel.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin Panel.private preserve=yes␍
|
||||
//## end Panel.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin Panel.implementation preserve=yes␍
|
||||
//## end Panel.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin Panel.postscript preserve=yes␍
|
||||
//## end Panel.postscript␍
|
||||
␍
|
||||
// Class Panel ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,95 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Rectangle; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Rectngle.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Rectangle␍
|
||||
#include "Rectngle.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class Rectangle ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
Rectangle::Rectangle()␍
|
||||
//## begin Rectangle::Rectangle%.hasinit preserve=no␍
|
||||
//## end Rectangle::Rectangle%.hasinit␍
|
||||
//## begin Rectangle::Rectangle%.initialization preserve=yes␍
|
||||
//## end Rectangle::Rectangle%.initialization␍
|
||||
{␍
|
||||
//## begin Rectangle::Rectangle%.body preserve=yes␍
|
||||
//## end Rectangle::Rectangle%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
Rectangle::~Rectangle()␍
|
||||
{␍
|
||||
//## begin Rectangle::~Rectangle%.body preserve=yes␍
|
||||
//## end Rectangle::~Rectangle%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
int Rectangle::getXpos ()␍
|
||||
{␍
|
||||
//## begin Rectangle::getXpos%940945803.body preserve=yes␍
|
||||
return xPos;␍
|
||||
//## end Rectangle::getXpos%940945803.body␍
|
||||
}␍
|
||||
␍
|
||||
int Rectangle::getYpos ()␍
|
||||
{␍
|
||||
//## begin Rectangle::getYpos%940945804.body preserve=yes␍
|
||||
return yPos;␍
|
||||
//## end Rectangle::getYpos%940945804.body␍
|
||||
}␍
|
||||
␍
|
||||
int Rectangle::getWidth ()␍
|
||||
{␍
|
||||
//## begin Rectangle::getWidth%940945805.body preserve=yes␍
|
||||
return width;␍
|
||||
//## end Rectangle::getWidth%940945805.body␍
|
||||
}␍
|
||||
␍
|
||||
int Rectangle::getHeight()␍
|
||||
{␍
|
||||
//## begin Rectangle::getHeight%940945806.body preserve=yes␍
|
||||
return height;␍
|
||||
//## end Rectangle::getHeight%940945806.body␍
|
||||
}␍
|
||||
␍
|
||||
void Rectangle::setValue (int x1, int y1, int x2, int y2)␍
|
||||
{␍
|
||||
//## begin Rectangle::setValue%940945813.body preserve=yes␍
|
||||
xPos = x1;␍
|
||||
yPos = y1;␍
|
||||
width = x2;␍
|
||||
height = y2;␍
|
||||
//## end Rectangle::setValue%940945813.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin Rectangle.declarations preserve=yes␍
|
||||
//## end Rectangle.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Rectangle; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Rectngle.h␍
|
||||
␍
|
||||
#ifndef Rectngle_h␍
|
||||
#define Rectngle_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: Rectangle␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
class Rectangle ␍
|
||||
{␍
|
||||
//## begin Rectangle.initialDeclarations preserve=yes␍
|
||||
//## end Rectangle.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
Rectangle();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~Rectangle();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: getXpos%940945803␍
|
||||
int getXpos ();␍
|
||||
␍
|
||||
//## Operation: getYpos%940945804␍
|
||||
int getYpos ();␍
|
||||
␍
|
||||
//## Operation: getWidth%940945805␍
|
||||
int getWidth ();␍
|
||||
␍
|
||||
//## Operation: getHeight%940945806␍
|
||||
int getHeight ();␍
|
||||
␍
|
||||
//## Operation: setValue%940945813␍
|
||||
void setValue (int x1, int y1, int x2, int y2);␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin Rectangle.public preserve=yes␍
|
||||
//## end Rectangle.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Data Members for Class Attributes␍
|
||||
␍
|
||||
//## Attribute: xPos␍
|
||||
//## begin Rectangle::xPos.attr preserve=no private: int {U} ␍
|
||||
int xPos;␍
|
||||
//## end Rectangle::xPos.attr␍
|
||||
␍
|
||||
//## Attribute: yPos␍
|
||||
//## begin Rectangle::yPos.attr preserve=no private: int {U} ␍
|
||||
int yPos;␍
|
||||
//## end Rectangle::yPos.attr␍
|
||||
␍
|
||||
//## Attribute: width␍
|
||||
//## begin Rectangle::width.attr preserve=no private: int {U} ␍
|
||||
int width;␍
|
||||
//## end Rectangle::width.attr␍
|
||||
␍
|
||||
//## Attribute: height␍
|
||||
//## begin Rectangle::height.attr preserve=no private: int {U} ␍
|
||||
int height;␍
|
||||
//## end Rectangle::height.attr␍
|
||||
␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin Rectangle.protected preserve=yes␍
|
||||
//## end Rectangle.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin Rectangle.private preserve=yes␍
|
||||
//## end Rectangle.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin Rectangle.implementation preserve=yes␍
|
||||
//## end Rectangle.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin Rectangle.postscript preserve=yes␍
|
||||
//## end Rectangle.postscript␍
|
||||
␍
|
||||
// Class Rectangle ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: Window; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\Window.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
#include <iostream.h>␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Window␍
|
||||
#include "Window.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
#include <string.h>␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Class Window ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
Window::Window()␍
|
||||
//## begin Window::Window%.hasinit preserve=no␍
|
||||
//## end Window::Window%.hasinit␍
|
||||
//## begin Window::Window%.initialization preserve=yes␍
|
||||
//## end Window::Window%.initialization␍
|
||||
{␍
|
||||
//## begin Window::Window%.body preserve=yes␍
|
||||
//## end Window::Window%.body␍
|
||||
}␍
|
||||
␍
|
||||
Window::Window (int xpos, int ypos, int width, int height, char* name)␍
|
||||
//## begin Window::Window%940854119.hasinit preserve=no␍
|
||||
//## end Window::Window%940854119.hasinit␍
|
||||
//## begin Window::Window%940854119.initialization preserve=yes␍
|
||||
//## end Window::Window%940854119.initialization␍
|
||||
{␍
|
||||
//## begin Window::Window%940854119.body preserve=yes␍
|
||||
␍
|
||||
Window::xpos = xpos;␍
|
||||
Window::ypos = ypos;␍
|
||||
Window::width = width;␍
|
||||
Window::height = height;␍
|
||||
//strcpy(Window::name, name);␍
|
||||
Window::name = name;␍
|
||||
␍
|
||||
panel = new Panel(xpos,ypos,width,height);␍
|
||||
panel->setPpp((Panel*) 0);␍
|
||||
//## end Window::Window%940854119.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
Window::~Window()␍
|
||||
{␍
|
||||
//## begin Window::~Window%.body preserve=yes␍
|
||||
delete panel;␍
|
||||
//## end Window::~Window%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
void Window::draw (Graphics& g)␍
|
||||
{␍
|
||||
//## begin Window::draw%940929792.body preserve=yes␍
|
||||
g.drawWindow(xpos,ypos,width,height,name);␍
|
||||
panel->draw(g);␍
|
||||
//## end Window::draw%940929792.body␍
|
||||
}␍
|
||||
␍
|
||||
void Window::add (Component* c)␍
|
||||
{␍
|
||||
//## begin Window::add%940943118.body preserve=yes␍
|
||||
panel->add(c);␍
|
||||
//## end Window::add%940943118.body␍
|
||||
}␍
|
||||
␍
|
||||
bool Window::isHit (int x, int y)␍
|
||||
{␍
|
||||
//## begin Window::isHit%941013988.body preserve=yes␍
|
||||
return panel->isHit(x,y);␍
|
||||
//## end Window::isHit%941013988.body␍
|
||||
}␍
|
||||
␍
|
||||
void Window::handleKeyEvent (Event e)␍
|
||||
{␍
|
||||
//## begin Window::handleKeyEvent%941013989.body preserve=yes␍
|
||||
␍
|
||||
//## end Window::handleKeyEvent%941013989.body␍
|
||||
}␍
|
||||
␍
|
||||
void Window::handleMouseEvent (Event e)␍
|
||||
{␍
|
||||
//## begin Window::handleMouseEvent%941013990.body preserve=yes␍
|
||||
panel->handleMouseEvent(e);␍
|
||||
␍
|
||||
//## end Window::handleMouseEvent%941013990.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin Window.declarations preserve=yes␍
|
||||
//## end Window.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
//## 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␍
|
||||
@@ -0,0 +1,30 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: WindowList; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\WndwList.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// WindowList␍
|
||||
#include "WndwList.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## begin WindowList.instantiation preserve=no␍
|
||||
template class List< Window* >;␍
|
||||
//## end WindowList.instantiation␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,48 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: WindowList; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\WndwList.h␍
|
||||
␍
|
||||
#ifndef WndwList_h␍
|
||||
#define WndwList_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// Window␍
|
||||
#include "Window.h"␍
|
||||
// XList␍
|
||||
#include "List.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: WindowList; Instantiated Class␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
//## Uses: <unnamed>; Window { -> }␍
|
||||
␍
|
||||
typedef List< Window* > WindowList;␍
|
||||
␍
|
||||
//## begin WindowList.postscript preserve=yes␍
|
||||
//## end WindowList.postscript␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
@@ -0,0 +1,62 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: XList; Pseudo Package body␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\XList.cpp␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
// XList␍
|
||||
#include "H:\kurs\avC++\lab7\XList.h"␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
// Parameterized Class XList ␍
|
||||
␍
|
||||
template <class T>␍
|
||||
XList<T>::XList()␍
|
||||
//## begin XList::XList%.hasinit preserve=no␍
|
||||
//## end XList::XList%.hasinit␍
|
||||
//## begin XList::XList%.initialization preserve=yes␍
|
||||
//## end XList::XList%.initialization␍
|
||||
{␍
|
||||
//## begin XList::XList%.body preserve=yes␍
|
||||
//## end XList::XList%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
template <class T>␍
|
||||
XList<T>::~XList()␍
|
||||
{␍
|
||||
//## begin XList::~XList%.body preserve=yes␍
|
||||
//## end XList::~XList%.body␍
|
||||
}␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (implementation)␍
|
||||
template <class T>␍
|
||||
void XList<T>::add (T element)␍
|
||||
{␍
|
||||
//## begin XList::add%940854125.body preserve=yes␍
|
||||
//## end XList::add%940854125.body␍
|
||||
}␍
|
||||
␍
|
||||
// Additional Declarations␍
|
||||
//## begin XList.declarations preserve=yes␍
|
||||
//## end XList.declarations␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
@@ -0,0 +1,81 @@
|
||||
//## begin module.cm preserve=no␍
|
||||
// %X% %Q% %Z% %W%␍
|
||||
//## end module.cm␍
|
||||
␍
|
||||
//## begin module.cp preserve=no␍
|
||||
//## end module.cp␍
|
||||
␍
|
||||
//## Module: XList; Pseudo Package specification␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Source file: H:\kurs\avC++\lab7\XList.h␍
|
||||
␍
|
||||
#ifndef XList_h␍
|
||||
#define XList_h 1␍
|
||||
␍
|
||||
//## begin module.additionalIncludes preserve=no␍
|
||||
//## end module.additionalIncludes␍
|
||||
␍
|
||||
//## begin module.includes preserve=yes␍
|
||||
//## end module.includes␍
|
||||
␍
|
||||
//## begin module.additionalDeclarations preserve=yes␍
|
||||
//## end module.additionalDeclarations␍
|
||||
␍
|
||||
␍
|
||||
//## Class: XList; Parameterized Class␍
|
||||
//## Category: lab7␍
|
||||
//## Subsystem: lab7␍
|
||||
//## Persistence: Transient␍
|
||||
//## Cardinality/Multiplicity: n␍
|
||||
␍
|
||||
template <class T>␍
|
||||
class XList ␍
|
||||
{␍
|
||||
//## begin XList.initialDeclarations preserve=yes␍
|
||||
//## end XList.initialDeclarations␍
|
||||
␍
|
||||
public:␍
|
||||
//## Constructors (generated)␍
|
||||
XList();␍
|
||||
␍
|
||||
//## Destructor (generated)␍
|
||||
~XList();␍
|
||||
␍
|
||||
␍
|
||||
//## Other Operations (specified)␍
|
||||
//## Operation: add%940854125␍
|
||||
void add (T element);␍
|
||||
␍
|
||||
// Additional Public Declarations␍
|
||||
//## begin XList.public preserve=yes␍
|
||||
//## end XList.public␍
|
||||
␍
|
||||
protected:␍
|
||||
// Additional Protected Declarations␍
|
||||
//## begin XList.protected preserve=yes␍
|
||||
//## end XList.protected␍
|
||||
␍
|
||||
private:␍
|
||||
// Additional Private Declarations␍
|
||||
//## begin XList.private preserve=yes␍
|
||||
//## end XList.private␍
|
||||
␍
|
||||
private: //## implementation␍
|
||||
// Additional Implementation Declarations␍
|
||||
//## begin XList.implementation preserve=yes␍
|
||||
//## end XList.implementation␍
|
||||
␍
|
||||
};␍
|
||||
␍
|
||||
//## begin XList.postscript preserve=yes␍
|
||||
//## end XList.postscript␍
|
||||
␍
|
||||
// Parameterized Class XList ␍
|
||||
␍
|
||||
␍
|
||||
␍
|
||||
//## begin module.epilog preserve=yes␍
|
||||
//## end module.epilog␍
|
||||
␍
|
||||
␍
|
||||
#endif␍
|
||||
Reference in new issue
Block a user