-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathview.cpp
87 lines (73 loc) · 2.42 KB
/
view.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*************************
* text_view.cpp
*
*
* editor: amo
*************************/
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <view.h>
/* -------------------------------------------------------------------- */
/* my define macro */
/* -------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* global variables */
/* -------------------------------------------------------------------- */
/* -------------------------------------------------------------------- */
/* implements */
/* -------------------------------------------------------------------- */
MyView::MyView(int l, int r, int t, int b){
std::cout << "[MyView::MyView()]: >>> MyView()" << std::endl;
left = l;
right = r;
top = t;
bottom = b;
id = 5566;
}
MyView::~MyView(){
#if 0
std::cout << "[MyView::~MyView()]: >>> ~MyView()" << std::endl;
std::cout << "[MyView::~MyView()]: release at left :" << left << std::endl;
std::cout << "[MyView::~MyView()]: release at right :" << right << std::endl;
std::cout << "[MyView::~MyView()]: release at top :" << top << std::endl;
std::cout << "[MyView::~MyView()]: release at bottom :" << bottom << std::endl;
#endif
}
void MyView::showPosition(){
std::cout << "[MyView]::showPosition(): >>> showPosition()" << std::endl;
std::cout << "[MyView]::showPosition(): now at left :" << left << std::endl;
std::cout << "[MyView]::showPosition(): now at right :" << right << std::endl;
std::cout << "[MyView]::showPosition(): now at top :" << top << std::endl;
std::cout << "[MyView]::showPosition(): now at bottom :" << bottom << std::endl;
}
void MyView::setLeft(int l){
left = l;
}
void MyView::setRight(int r){
right = r;
}
void MyView::setTop(int t){
top = t;
}
void MyView::setBottom(int b){
bottom = b;
}
int MyView::getLeft(){
return left;
}
int MyView::getRight(){
return right;
}
int MyView::getTop(){
return top;
}
int MyView::getBottom(){
return bottom;
}
void MyView::layout(int l, int r, int t, int b){
std::cout << "[MyView]::layout(): >>> layout()" << std::endl;
int changed = 1;
onLayout(changed, l, r, t, b);
}