Changeset 1568 in Sophya
- Timestamp:
- Jul 6, 2001, 3:43:06 PM (24 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pidrawer.cc
r587 r1568 49 49 mDndfg = false; // Pour controle de l'appel de Detach() si delete 50 50 51 mFgHighLight = false; // Flag de control d'affichage en mode HighLight 52 51 53 mFCol = mBCol = PI_NotDefColor; 52 54 mLAtt = PI_NotDefLineAtt; … … 56 58 mMrk = PI_NotDefMarker; 57 59 mCmapid = CMAP_OTHER; 60 mRevCmap = false; 61 mFName = PI_DefaultFont; 58 62 } 59 63 … … 152 156 // Cette méthode doit calculer les limites (X/Y Min-Max) préferées par l'objet 153 157 // et doit appeler "SetLimits()". L'implementation par défaut ne fait rien. 158 // void HighLight(bool fgh) 159 // Rafraichit le dessin du PIDrawer sur tous les PIBaseWdg auxquel il est attaché, 160 // en mode "HighLight" si "fgh==true", en mode normal sinon. 154 161 // void AppendTextInfo(string& info, double xmin, double ymin, double xmax, double ymax) 155 162 // Méthode qui met à jour la chaîne "info", avec les informations (textuelles) de … … 171 178 (*it).wdg->CallDrawer((*it).id); 172 179 180 } 181 void 182 PIDrawer::HighLight(bool fgh) 183 { 184 mFgHighLight = fgh; 185 Refresh(); 186 mFgHighLight = false; 173 187 } 174 188 … … 182 196 // Modifie l'attribut type de ligne 183 197 // void SetFontAtt(PIFontSize fsz=PI_NotDefFontSize, PIFontAtt fat=PI_NotDefFontAtt) 184 // L'attribut Type de fonte 198 // Selection taille et attribut de fonte 199 // void SetFont(PIFontName fn, PIFontSize fsz=PI_NotDefFontSize, PIFontAtt fat=PI_NotDefFontAtt) 200 // Selection de type, taile et attribut de fonte 185 201 // void SetMarkerAtt(int sz=-1, PIMarker mrk=PI_NotDefMarker) 186 202 // L'attribut type et taille de marker 187 // void SetColMapId(CMapId cid=CMAP_OTHER )188 // L'attribut choix de la table de couleurs 203 // void SetColMapId(CMapId cid=CMAP_OTHER, bool rev=false) 204 // L'attribut choix de la table de couleurs, et son flag d'inversion 189 205 // void SelGraAtt(PIGraphicUC* g) 190 206 // Modifie les attributs graphiques de "g" à partir des attributs courant … … 207 223 // CMapId GetColMapId() 208 224 // Renvoie l'attribut de type de table de couleur 225 // CMapId GetColMapId(bool & rev) 226 // Renvoie l'attribut de type de table de couleur, 227 // et le flag d'inversion de la table de couleur 209 228 //-- 210 229 … … 230 249 231 250 void 251 PIDrawer::SetFont(PIFontName fn, PIFontSize fsz, PIFontAtt fat) 252 { 253 mFName = fn; 254 mFSz = fsz; 255 mFAtt = fat; 256 } 257 258 void 232 259 PIDrawer::SetMarkerAtt(int sz, PIMarker mrk) 233 260 { … … 237 264 238 265 void 239 PIDrawer::SetColMapId(CMapId cid )266 PIDrawer::SetColMapId(CMapId cid, bool rev) 240 267 { 241 268 mCmapid = cid; 269 mRevCmap = rev; 242 270 } 243 271 … … 248 276 if (mBCol != PI_NotDefColor) g->SelBackground(mBCol); 249 277 if (mLAtt != PI_NotDefLineAtt) g->SelLine(mLAtt); 250 if ( (mFSz != PI_NotDefFontSize) || (mFAtt != PI_NotDefFontAtt) ) 278 if (mFName != PI_DefaultFont) { 279 PIFont myfont(mFName); 280 myfont.SetFontAtt(mFAtt); 281 myfont.SetFontSz(mFSz); 282 g->SelFont(myfont); 283 } 284 else if ( (mFSz != PI_NotDefFontSize) || (mFAtt != PI_NotDefFontAtt) ) 251 285 g->SelFont(mFSz, mFAtt); 252 286 if ( (mMrk != PI_NotDefMarker) || (mMSz >= 0) ) … … 287 321 mGrUC->SetUCS(xMin, xMax, yMin, yMax, aXFlg, aYFlg); 288 322 if (aXlog || aYlog) mGrUC->SetLogScale(aXlog, aYlog); 323 if (mFgHighLight) mGrUC->SelGOMode(PI_GOInvert); 289 324 return(mGrUC); 290 325 } … … 647 682 void PIElDrawer::Draw(PIGraphicUC* g, double /*xmin*/, double /*ymin*/, double /*xmax*/, double /*ymax*/) 648 683 { 684 SelGraAtt(g); // DrawAxes change certains attributs graphiques 649 685 DrawAxes(g); // Trace des axes 650 651 686 SelGraAtt(g); // DrawAxes change certains attributs graphiques 687 652 688 if (mFSz == PI_NotDefFontSize) g->SelFont(PI_NormalSizeFont); 653 689 // Trace des titres -
trunk/SophyaPI/PI/pidrawer.h
r505 r1568 45 45 virtual void UpdateLimits(); // Calcule et change les limites 46 46 47 // Gestion d'affichage en mode HighLight : fgh=true -> highlight =false -> normal 48 virtual void HighLight(bool fgh); 49 47 50 inline double XMin() const {return xMin;} 48 51 inline double XMax() const {return xMax;} … … 67 70 virtual void SetFontAtt(PIFontSize fsz=PI_NotDefFontSize, 68 71 PIFontAtt fat=PI_NotDefFontAtt); 72 virtual void SetFont(PIFontName fn, PIFontSize fsz=PI_NotDefFontSize, 73 PIFontAtt fat=PI_NotDefFontAtt); 69 74 virtual void SetMarkerAtt(int sz=-1, PIMarker mrk=PI_NotDefMarker); 70 virtual void SetColMapId(CMapId cid=CMAP_OTHER );75 virtual void SetColMapId(CMapId cid=CMAP_OTHER, bool rev=false); 71 76 72 77 void SelGraAtt(PIGraphicUC* g); … … 78 83 inline PIFontSize GetFontSz() { return(mFSz); } 79 84 inline PIFontAtt GetFontAtt() { return(mFAtt); } 85 inline PIFontName GetFontName() { return(mFName);} 80 86 inline int GetMarkerSz() { return(mMSz); } 81 87 inline PIMarker GetMarker() { return(mMrk); } 82 88 inline CMapId GetColMapId() { return(mCmapid); } 89 inline CMapId GetColMapId(bool & rev) { rev = mRevCmap; return(mCmapid); } 83 90 84 91 … … 127 134 PIGraphicUC* mGrUC; 128 135 136 // Flag de control d'affichage en mode HighLight 137 bool mFgHighLight; 138 129 139 list<DrwBWId> mBWdgList; 130 140 bool mDndfg; … … 133 143 PIColors mFCol, mBCol; 134 144 PILineAtt mLAtt; 145 PIFontName mFName; 135 146 PIFontSize mFSz; 136 147 PIFontAtt mFAtt; … … 138 149 PIMarker mMrk; 139 150 CMapId mCmapid; 140 151 bool mRevCmap; 152 141 153 }; 142 154
Note:
See TracChangeset
for help on using the changeset viewer.