first commit
This commit is contained in:
BIN
Lab7/Documentation.doc
Normal file
BIN
Lab7/Documentation.doc
Normal file
Binary file not shown.
61
Lab7/bpngbttn.cpp
Normal file
61
Lab7/bpngbttn.cpp
Normal file
@@ -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
|
||||
89
Lab7/bpngbttn.h
Normal file
89
Lab7/bpngbttn.h
Normal file
@@ -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 ();
|
||||
54
Lab7/bttnhndl.cpp
Normal file
54
Lab7/bttnhndl.cpp
Normal file
@@ -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
|
||||
|
||||
80
Lab7/bttnhndl.h
Normal file
80
Lab7/bttnhndl.h
Normal file
@@ -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)
|
||||
|
||||
113
Lab7/button.cpp
Normal file
113
Lab7/button.cpp
Normal file
@@ -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
|
||||
160
Lab7/button.h
Normal file
160
Lab7/button.h
Normal file
@@ -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
|
||||
|
||||
|
||||
|
||||
30
Lab7/cmpnntls.cpp
Normal file
30
Lab7/cmpnntls.cpp
Normal file
@@ -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
|
||||
|
||||
49
Lab7/cmpnntls.h
Normal file
49
Lab7/cmpnntls.h
Normal file
@@ -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
|
||||
124
Lab7/cmpstcmp.cpp
Normal file
124
Lab7/cmpstcmp.cpp
Normal file
@@ -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
|
||||
|
||||
108
Lab7/cmpstcmp.h
Normal file
108
Lab7/cmpstcmp.h
Normal file
@@ -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);
|
||||
|
||||
|
||||
|
||||
72
Lab7/compnent.cpp
Normal file
72
Lab7/compnent.cpp
Normal file
@@ -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
|
||||
|
||||
{
|
||||
|
||||
133
Lab7/compnent.h
Normal file
133
Lab7/compnent.h
Normal file
@@ -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;
|
||||
|
||||
|
||||
137
Lab7/desktop.cpp
Normal file
137
Lab7/desktop.cpp
Normal file
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
115
Lab7/desktop.h
Normal file
115
Lab7/desktop.h
Normal file
@@ -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);
|
||||
|
||||
|
||||
98
Lab7/event.cpp
Normal file
98
Lab7/event.cpp
Normal file
@@ -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 ()
|
||||
|
||||
113
Lab7/event.h
Normal file
113
Lab7/event.h
Normal file
@@ -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 ();
|
||||
|
||||
|
||||
61
Lab7/evntrder.cpp
Normal file
61
Lab7/evntrder.cpp
Normal file
@@ -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
|
||||
|
||||
{
|
||||
84
Lab7/evntrder.h
Normal file
84
Lab7/evntrder.h
Normal file
@@ -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();
|
||||
|
||||
61
Lab7/extbttnh.cpp
Normal file
61
Lab7/extbttnh.cpp
Normal file
@@ -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
|
||||
82
Lab7/extbttnh.h
Normal file
82
Lab7/extbttnh.h
Normal file
@@ -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();
|
||||
|
||||
|
||||
|
||||
51
Lab7/graphics.cpp
Normal file
51
Lab7/graphics.cpp
Normal file
@@ -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()
|
||||
83
Lab7/graphics.h
Normal file
83
Lab7/graphics.h
Normal file
@@ -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();
|
||||
|
||||
|
||||
51
Lab7/handler.cpp
Normal file
51
Lab7/handler.cpp
Normal file
@@ -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()
|
||||
75
Lab7/handler.h
Normal file
75
Lab7/handler.h
Normal file
@@ -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();
|
||||
51
Lab7/keyevent.cpp
Normal file
51
Lab7/keyevent.cpp
Normal file
@@ -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()
|
||||
77
Lab7/keyevent.h
Normal file
77
Lab7/keyevent.h
Normal file
@@ -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)
|
||||
8269
Lab7/lab7.mdl
Normal file
8269
Lab7/lab7.mdl
Normal file
File diff suppressed because it is too large
Load Diff
131
Lab7/list.cpp
Normal file
131
Lab7/list.cpp
Normal file
@@ -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
|
||||
|
||||
}
|
||||
113
Lab7/list.h
Normal file
113
Lab7/list.h
Normal file
@@ -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
|
||||
56
Lab7/main.cpp
Normal file
56
Lab7/main.cpp
Normal file
@@ -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;
|
||||
|
||||
|
||||
|
||||
45
Lab7/menu.cpp
Normal file
45
Lab7/menu.cpp
Normal file
@@ -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()
|
||||
|
||||
{
|
||||
89
Lab7/menu.h
Normal file
89
Lab7/menu.h
Normal file
@@ -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 ();
|
||||
51
Lab7/mosevent.cpp
Normal file
51
Lab7/mosevent.cpp
Normal file
@@ -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()
|
||||
77
Lab7/mosevent.h
Normal file
77
Lab7/mosevent.h
Normal file
@@ -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)
|
||||
94
Lab7/node.cpp
Normal file
94
Lab7/node.cpp
Normal file
@@ -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
|
||||
|
||||
106
Lab7/node.h
Normal file
106
Lab7/node.h
Normal file
@@ -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
|
||||
|
||||
121
Lab7/ntconsle.cpp
Normal file
121
Lab7/ntconsle.cpp
Normal file
@@ -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);
|
||||
|
||||
|
||||
85
Lab7/ntconsle.h
Normal file
85
Lab7/ntconsle.h
Normal file
@@ -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();
|
||||
91
Lab7/ntvntrdr.cpp
Normal file
91
Lab7/ntvntrdr.cpp
Normal file
@@ -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
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
82
Lab7/ntvntrdr.h
Normal file
82
Lab7/ntvntrdr.h
Normal file
@@ -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();
|
||||
|
||||
|
||||
|
||||
96
Lab7/panel.cpp
Normal file
96
Lab7/panel.cpp
Normal file
@@ -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
|
||||
|
||||
}
|
||||
|
||||
90
Lab7/panel.h
Normal file
90
Lab7/panel.h
Normal file
@@ -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);
|
||||
|
||||
95
Lab7/rectngle.cpp
Normal file
95
Lab7/rectngle.cpp
Normal file
@@ -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
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
114
Lab7/rectngle.h
Normal file
114
Lab7/rectngle.h
Normal file
@@ -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
|
||||
|
||||
119
Lab7/window.cpp
Normal file
119
Lab7/window.cpp
Normal file
@@ -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);
|
||||
136
Lab7/window.h
Normal file
136
Lab7/window.h
Normal file
@@ -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);
|
||||
|
||||
30
Lab7/wndwlist.cpp
Normal file
30
Lab7/wndwlist.cpp
Normal file
@@ -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
|
||||
|
||||
48
Lab7/wndwlist.h
Normal file
48
Lab7/wndwlist.h
Normal file
@@ -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"
|
||||
|
||||
62
Lab7/xlist.cpp
Normal file
62
Lab7/xlist.cpp
Normal file
@@ -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
|
||||
|
||||
81
Lab7/xlist.h
Normal file
81
Lab7/xlist.h
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user