edge.h
Go to the documentation of this file.00001
00002
00004
00005
00006
00008
00009
#if !defined(AFX_CONTROLLIST_H__7FF8C61F_86BC_11D1_96A5_00C04FB177B1__INCLUDED_)
00010 #define AFX_CONTROLLIST_H__7FF8C61F_86BC_11D1_96A5_00C04FB177B1__INCLUDED_
00011
00012
#if _MSC_VER >= 1000
00013
#pragma once
00014
#endif // _MSC_VER >= 1000
00015
00016
#include "list.h"
00017
class CResizeControl;
00018
class CEdge;
00019
00020 class CControlList :
public CDPA
00021 {
00022
public:
00023
CControlList();
00024
virtual ~CControlList();
00025 CResizeControl *
GetControl(
int i) {
return (
CResizeControl*)GetPointer(i); }
00026 int GetControlCount()
const {
return GetNextFree(); }
00027 };
00028
00029 class CEdgeList :
public CDPA
00030 {
00031
public:
00032 CEdgeList() {};
00033 virtual ~CEdgeList() {};
00034 CEdge *
GetEdge(
int i) {
return (
CEdge*)GetPointer(i); }
00035 int GetEdgeCount()
const {
return GetNextFree(); }
00036 };
00037
00038
#endif // !defined(AFX_CONTROLLIST_H__7FF8C61F_86BC_11D1_96A5_00C04FB177B1__INCLUDED_)
00039
00040
00041
00042
00043
#if !defined(AFX_GUIDE_H__B2F750E1_7AF5_11D1_96A4_00C04FB177B1__INCLUDED_)
00044 #define AFX_GUIDE_H__B2F750E1_7AF5_11D1_96A4_00C04FB177B1__INCLUDED_
00045
00046
#if _MSC_VER >= 1000
00047
#pragma once
00048
#endif // _MSC_VER >= 1000
00049
00050
class CResizeControl;
00051
00052
#define PROPERTY(type, Name) void Set##Name( type v) { m_##Name=v; } type Get##Name() const {return m_##Name; }
00053
00054
00055
00056
00057
00058
00059
00060
00061 #define LEFT_AT 1
00062 #define RIGHT_AT 2
00063 #define TOP_AT 4
00064 #define BOTTOM_AT 8
00065
00066 class CGuide
00067 {
00068
public:
00069
int Attatchment();
00070
int NumAttatchments();
00071
void Adjust(
int adjust);
00072
BOOL IsEqual(
CGuide * guide);
00073
void Attatch(
CEdge * Control);
00074
void DeAttatch(
CEdge * Control);
00075
CGuide();
00076
CGuide(
int Position,
int Axis,
BOOL Flexible);
00077
virtual ~CGuide();
00078
PROPERTY(
int, Axis);
00079
PROPERTY(
int, Position);
00080
PROPERTY(
BOOL, Flexible);
00081
00082
CEdge *
GetEdge(
int i);
00083
00084 BOOL IsHorizontal() {
return m_Axis & (
BOTTOM_AT |
TOP_AT ) ; }
00085 BOOL IsVertical() {
return m_Axis & (
LEFT_AT |
RIGHT_AT ) ; }
00086
00087
00088
protected:
00089 int m_Axis;
00090 int m_Position;
00091 BOOL m_Flexible;
00092
00093
private:
00094 CEdgeList *
m_Attatched;
00095 };
00096
00097
#endif // !defined(AFX_GUIDE_H__B2F750E1_7AF5_11D1_96A4_00C04FB177B1__INCLUDED_)
00098
00099
#if !defined(AFX_EDGE_H__B2F750E2_7AF5_11D1_96A4_00C04FB177B1__INCLUDED_)
00100 #define AFX_EDGE_H__B2F750E2_7AF5_11D1_96A4_00C04FB177B1__INCLUDED_
00101
00102
#if _MSC_VER >= 1000
00103
#pragma once
00104
#endif // _MSC_VER >= 1000
00105
00106
#define PROPERTY(type, Name) void Set##Name( type v) { m_##Name=v; } type Get##Name() const {return m_##Name; }
00107
00108 class CEdge
00109 {
00110
public:
00111
int Attatchment();
00112
void Attatch(
CResizeControl * pC);
00113
CEdge();
00114
CEdge(
int Position,
int Axis,
BOOL Flexible,
int Offset);
00115
CEdge(
CGuide * pGuide,
int Offset);
00116
virtual ~CEdge();
00117
PROPERTY(
int, OffsetFromGuide);
00118 int GetAxis() {
return m_Guide->GetAxis(); }
00119 int GetPosition() {
return m_Guide->GetPosition() +
m_OffsetFromGuide; }
00120 BOOL GetFlexible() {
return m_Guide->GetFlexible(); }
00121 void SetPosition(
int p) {
m_Guide->SetPosition(p); }
00122
00123 CGuide *
GetGuide() {
return m_Guide; }
00124
void SetGuide(
CGuide * pGuide);
00125 void SetOffset(
int i) {
m_OffsetFromGuide = i ; }
00126 BOOL IsHorizontal() {
return m_Guide->
IsHorizontal(); }
00127 BOOL IsVertical() {
return m_Guide->
IsVertical(); }
00128 int GetControlCount() {
if(
m_Attatched)
return m_Attatched->
GetControlCount();
return 0; }
00129 CResizeControl *
GetControl(
int i) {
return m_Attatched->
GetControl(i); }
00130
00131
protected:
00132 CGuide *
m_Guide;
00133 int m_OffsetFromGuide;
00134 CControlList *
m_Attatched;
00135 };
00136
00137
#endif // !defined(AFX_EDGE_H__B2F750E2_7AF5_11D1_96A4_00C04FB177B1__INCLUDED_)
00138
00139
00140
00142
00143
#if !defined(AFX_EDGECACHE_H__B2F750E3_7AF5_11D1_96A4_00C04FB177B1__INCLUDED_)
00144 #define AFX_EDGECACHE_H__B2F750E3_7AF5_11D1_96A4_00C04FB177B1__INCLUDED_
00145
00146
#if _MSC_VER >= 1000
00147
#pragma once
00148
#endif // _MSC_VER >= 1000
00149
00150
#include "edge.h"
00151
#include "list.h"
00152
00153
00154
00155
00156
00157 #define PROPERTY(type, Name) void Set##Name( type v) { m_##Name=v; } type Get##Name() const {return m_##Name; }
00158
00159 class CEdgeCache :
public CDPA
00160 {
00161
public:
00162
BOOL AddEdge(
CEdge * );
00163
CEdgeCache();
00164
virtual ~CEdgeCache();
00165
CEdge *
Create(
int Position,
int Axis,
int Flexible=
FALSE,
int Accuracy=0);
00166
CEdge *
Create(
CGuide * guide,
int Offset);
00167 CEdge *
GetEdge(
int i) {
return (
CEdge *)GetPointer(i); }
00168
PROPERTY(
int, NumVert );
00169
PROPERTY(
int, NumHoriz );
00170
protected:
00171
00172
00173
00174 int m_NumVert;
00175 int m_NumHoriz;
00176 };
00177
00178
#endif // !defined(AFX_EDGECACHE_H__B2F750E3_7AF5_11D1_96A4_00C04FB177B1__INCLUDED_)
00179
00180
00181
00183
00184
#if !defined(AFX_CONSTRAINT_H__2DD7C182_88F3_11D1_BF15_0080C74378BF__INCLUDED_)
00185
#define AFX_CONSTRAINT_H__2DD7C182_88F3_11D1_BF15_0080C74378BF__INCLUDED_
00186
00187
#if _MSC_VER >= 1000
00188
#pragma once
00189
#endif // _MSC_VER >= 1000
00190
00191
#undef PROPERTY
00192
#define PROPERTY(type, Name) public: void Set##Name( type v) { m_##Name=v; } type Get##Name() const {return m_##Name; } private: type m_##Name; public:
00193
00194
class CConstraint
00195 {
00196
public:
00197 CConstraint();
00198
virtual ~CConstraint();
00199
00200
PROPERTY(
int, Col);
00201
PROPERTY(
int, Row);
00202
PROPERTY(
int, ColW);
00203
PROPERTY(
int, RowH);
00204
PROPERTY(
int, PadLeft);
00205
PROPERTY(
int, PadTop);
00206
PROPERTY(
int, PadRight);
00207
PROPERTY(
int, PadBottom);
00208
PROPERTY(
int, Alignment);
00209 };
00210
00211
#undef PROPERTY
00212
00213
#endif // !defined(AFX_CONSTRAINT_H__2DD7C182_88F3_11D1_BF15_0080C74378BF__INCLUDED_)
Generated on Sat May 15 19:39:48 2004 for test by
1.3.7