source: Sophya/trunk/Poubelle/PI/pibwdgmac.cc@ 222

Last change on this file since 222 was 222, checked in by ansari, 26 years ago

Creation module DPC/PI Reza 09/04/99

File size: 2.6 KB
Line 
1#include <stdio.h>
2
3#include <LString.h>
4#include "pibwdgmac.h"
5#include "piupdattachment.h"
6#include <algobase.h>
7#include <string.h>
8
9#define mGraphic mWGrC
10
11// Les methodes de la classe PIBWdgGen
12
13/* --Methode-- */
14PIBaseWdgMac::PIBaseWdgMac(PIContainerGen *par, char *nom,
15 int sx, int sy, int px, int py) :
16PIBaseWdgGen(par, nom, sx, sy, px, py)
17{
18 mGraphic = new PIGraphicMac(this);
19
20 mAdapter->AddAttachment(new PIUpdAttachment(this));
21 mPane->AddAttachment(new PIUpdAttachment(this));
22 cursor = NULL;
23
24
25}
26
27
28/* --Methode-- */
29PIBaseWdgMac::~PIBaseWdgMac()
30{
31}
32
33/* --Methode-- */
34void PIBaseWdgMac::ActivatePtrCross()
35{
36// toujours actif pour le moment
37}
38
39/* --Methode-- */
40void PIBaseWdgMac::ActivateButton(int /*bid*/)
41{
42}
43
44/* --Methode-- */
45void PIBaseWdgMac::ActivateMove(int /*bid*/)
46{
47}
48
49/* --Methode-- */
50void PIBaseWdgMac::ActivateKeyboard()
51{
52}
53
54/* --Methode-- */
55void PIBaseWdgMac::EraseWindow(int x0, int y0, int dx, int dy)
56{
57 if (mPane->FocusDraw()) {
58 GrafPtr p = mPane->GetMacPort();
59 if (p) EraseRgn(p->visRgn);
60// Rect r;
61// mPane->CalcPortFrameRect(r);
62// EraseRect(&r);
63 }
64}
65
66
67
68/* --Methode-- */
69void PIBaseWdgMac::SelPointerShape(PIPointer ptr)
70{
71 CursHandle c;
72 if (mPane->FocusDraw()) {
73 switch(ptr) {
74 case PI_ArrowPointer:
75 cursor = &qd.arrow;
76 break;
77 case PI_CrossPointer:
78 c = GetCursor(crossCursor);
79 HLock((Handle)c);
80 cursor = c ? *c : NULL;
81 break;
82 case PI_HandPointer:
83 c = GetCursor(128);
84 HLock((Handle)c);
85 cursor = c ? *c : NULL;
86 break;
87 }
88 }
89 mPtrS = ptr;
90}
91
92
93
94/* --Methode-- */
95PIPointer PIBaseWdgMac::GetPointerShape()
96{
97return (mPtrS);
98}
99
100
101
102/* --Methode-- */
103bool PIBaseWdgMac::AdjustCursor()
104{
105 if (cursor) {
106 ::SetCursor(cursor);
107 return true;
108 }
109 return false;
110}
111
112/* --Methode--
113void PIBaseWdgMac::Refresh()
114{
115if (mPane->IsVisible())
116 Draw();
117}
118 J'ai mis cette fonction ds PIWdgMac::IsVisible() Reza $CHECK$ 01/12/97
119*/
120
121
122
123void PIBaseWdgMac::SetBackgroundColor(PIColors col)
124{
125 if (mPane->FocusDraw()) {
126 long color;
127 switch (col) {
128 case PI_Black:
129 color = blackColor;
130 break;
131 case PI_White:
132 color = whiteColor;
133 break;
134 case PI_Red:
135 color = redColor;
136 break;
137 case PI_Blue:
138 color = blueColor;
139 break;
140 case PI_Green:
141 color = greenColor;
142 break;
143 case PI_Yellow:
144 color = yellowColor;
145 break;
146 default:
147 color = blackColor;
148 }
149 mBCol = col;
150 ::BackColor(color);
151 }
152}
153
154PIColors PIBaseWdgMac::GetBackgroundColor()
155{
156return (mBCol);
157}
Note: See TracBrowser for help on using the repository browser.