Changeset 64 in Sophya
- Timestamp:
- Dec 22, 1997, 5:54:25 PM (28 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 6 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/piapplmac.cc
r34 r64 11 11 #include <SIOUX.h> 12 12 #include <LAttachment.h> 13 14 class PIInit { 15 public: 16 PIInit() { 17 SIOUXSettings.initializeTB = false; 18 SIOUXSettings.standalone = false; 19 SIOUXSettings.setupmenus = false; 20 SIOUXSettings.showstatusline = true; 21 } 22 }; 23 24 PIInit piInit; 13 25 14 26 class PISIOUXAttachment : public LAttachment { … … 52 64 new LGrowZone(20000); // Install a GrowZone function to catch 53 65 // low memory situations. 66 67 // Register functions to create core PowerPlant classes 68 69 RegisterAllPPClasses(); 54 70 55 71 macAppli = new PIPPApplMac; … … 57 73 58 74 menubar = new PIMenubar(this, "DefMenubar"); 59 topcont = new PIWindowMac(this, "TopLevel", PIW indowKind(2), sx, sy, 10, 45);75 topcont = new PIWindowMac(this, "TopLevel", PIWK_floating, sx, sy, 10, 45); 60 76 } 61 77 -
trunk/SophyaPI/PI/pibwdgmac.cc
r63 r64 69 69 } 70 70 71 /* --Methode-- */ 72 void PIBaseWdgMac::DrawOpaqueString(int x, int y, char* s, int /*pos*/) 73 { 74 if (mPane->FocusDraw()) { 75 LocalToMacPortPoint(x, y, x, y); 76 ::MoveTo(x, y); 77 LStr255 ps = s; 78 ::TextFont(applFont); 79 Rect box; 80 box.left = x; 81 box.bottom = y; 82 int iWidth = TextWidth(s,0,strlen(s)); 83 box.right = box.left + iWidth; 84 int z; 85 box.top = box.bottom + GetFontHeight(z,z); 86 ::TETextBox(s,strlen(s),&box,teForceLeft); 87 } 88 } 71 89 72 90 /* --Methode-- */ … … 518 536 519 537 538 539 void PIBaseWdgMac::DrawPixmap(int x, int y, unsigned char *pix, 540 int sx, int sy, PIColorMap* cmap) 541 { 542 Rect frame; 543 SetRect(&frame, 0, 0, sx, sy); 544 Rect dstFrame; 545 SetRect(&dstFrame, x, y, sx, sy); 546 GWorldPtr gWorld; 547 ThrowIfOSErr_(NewGWorld(&gWorld, 8, &frame, cmap->GetCTab(), nil, 0)); 548 PixMapHandle pmh = GetGWorldPixMap(gWorld); 549 ::LockPixels (pmh); 550 Ptr pmap = GetPixBaseAddr(pmh); 551 memcpy(pmap, pix, sx*sy); 552 ::ForeColor (blackColor); 553 ::BackColor (whiteColor); 554 ::CopyBits((BitMap *) (*pmh), 555 &mPane->GetMacPort()->portBits, 556 &frame, &dstFrame, srcCopy, nil); 557 ::UnlockPixels (pmh); 558 DisposeGWorld(gWorld); 559 } 560 561 void PIBaseWdgMac::SetClipRectangle(int x0, int y0, int dx, int dy) 562 { // $CHECK$ 563 } 564 565 void PIBaseWdgMac::ClearClipRectangle() 566 { // $CHECK$ 567 } 568 569 /* --Methode-- */ 570 int PIBaseWdgMac::GetFontHeight(int& asc, int& desc) 571 { 572 if (mPane->FocusDraw()) { 573 FontInfo info; 574 GetFontInfo(&info); 575 asc = info.ascent; 576 desc = info.descent; 577 return (asc + desc); 578 } else { 579 return 0; 580 } 581 } -
trunk/SophyaPI/PI/pibwdgmac.h
r63 r64 37 37 virtual void DrawMarker(int x0, int y0); 38 38 virtual void DrawMarkers(int *x, int *y, int n); 39 40 virtual void DrawPixmap(int x, int y, unsigned char *pix, 41 int sx, int sy, PIColorMap* cmap); 39 42 40 43 virtual int CalcStringWidth(char const* s); … … 50 53 virtual void SelMarker(int msz, PIMarker mrk=PI_DotMarker); 51 54 55 // Selection de zone de trace (clip) 56 virtual void SetClipRectangle(int x0, int y0, int dx, int dy); 57 virtual void ClearClipRectangle(); 52 58 53 59 // Acces aux attributs graphiques … … 61 67 virtual PIMarker GetMarker(); 62 68 virtual int GetMarkerSize(); 69 virtual int GetFontHeight(int& asc, int& desc); 63 70 64 71 -
trunk/SophyaPI/PI/picmapgen.h
r63 r64 28 28 virtual void FreeColors()=0; // Desalloue les couleurs 29 29 30 virtual int TotNbColors()=0;// Donne le nombre total de couleurs disponibles30 virtual long TotNbColors()=0; // Donne le nombre total de couleurs disponibles 31 31 virtual int NbAllocColors()=0; // Nb de couleurs deja allouees 32 32 protected: -
trunk/SophyaPI/PI/picmapmac.cc
r63 r64 2 2 #include <UDebugging.h> 3 3 4 PIColorMapMac::PIColorMapMac(CMapId id) 5 : PIColorMapGen(id), mPalette(NULL), mCTab(NULL) 4 static int NTotAllocCol; 5 6 7 PIColorMapMac::PIColorMapMac() 8 : PIColorMapGen(), mPalette(NULL), mCTab(NULL) 6 9 { 7 10 } 8 11 9 PIColorMapMac::PIColorMapMac( CMapId id, int i) // Fait une veritable allocation10 : PIColorMapGen(id, i)12 PIColorMapMac::PIColorMapMac(int id, int nc, string const& nom) 13 : PIColorMapGen(id, nc, nom) 11 14 { 12 int n = n Cols[id-1];15 int n = nc+2; 13 16 mCTab = (CTabHandle) ::NewHandle(sizeof(long) + 14 17 sizeof(short) + sizeof(short) + 15 256L*sizeof(ColorSpec));18 n*sizeof(ColorSpec)); 16 19 (**mCTab).ctFlags = 0; 17 20 (**mCTab).ctSeed = GetCTSeed(); 18 (**mCTab).ctSize = n +2;21 (**mCTab).ctSize = n; 19 22 ColorSpec* sp = (**mCTab).ctTable; 20 23 sp[0].rgb.red = 0; … … 26 29 sp[1].rgb.blue = 65535; 27 30 sp[1].value = 1; 31 for (int i=2; i<n; i++) { 32 sp[i].rgb.red = 0; 33 sp[i].rgb.green = 0; 34 sp[i].rgb.blue = 0; 35 sp[i].value = i; 36 } 37 mPalette = NewPalette(mNCol,mCTab,pmTolerant,0); 28 38 } 29 39 30 31 PIColorMapMac::PIColorMapMac(string const& nom, int nCol) 32 : PIColorMapGen(nom, nCol) 40 PIColorMapMac::~PIColorMapMac() 33 41 { 34 mCTab = (CTabHandle) ::NewHandle(sizeof(long) + 35 sizeof(short) + sizeof(short) + 36 256L*sizeof(ColorSpec)); 37 (**mCTab).ctFlags = 0; 38 (**mCTab).ctSeed = GetCTSeed(); 39 (**mCTab).ctSize = nCol+2; 40 ColorSpec* sp = (**mCTab).ctTable; 41 sp[0].rgb.red = 0; 42 sp[0].rgb.green = 0; 43 sp[0].rgb.blue = 0; 44 sp[0].value = 0; 45 sp[1].rgb.red = 65535; 46 sp[1].rgb.green = 65535; 47 sp[1].rgb.blue = 65535; 48 sp[1].value = 1; 42 DisposePalette(mPalette); 43 DisposeHandle((Handle)mCTab); 49 44 } 50 45 … … 58 53 return(picr); 59 54 60 ColorSpec& sp = (**mCTab).ctTable[n+2]; 61 picr.red = sp.rgb.red; 62 picr.green = sp.rgb.green; 63 picr.blue = sp.rgb.blue; 55 RGBColor qdCol; 56 GetEntryColor(mPalette,n+2,&qdCol); 57 58 picr.red = qdCol.red; 59 picr.green = qdCol.green; 60 picr.blue = qdCol.blue; 64 61 65 62 return(picr); … … 69 66 bool PIColorMapMac::AllocColor(PIColor const& col, int index) 70 67 { 71 ColorSpec& sp = (**mCTab).ctTable[index+2]; 72 sp.rgb.red = col.red; 73 sp.rgb.green = col.green; 74 sp.rgb.blue = col.blue; 75 sp.value = index+2; 68 if (!mPalette) return false; 69 if ((index < 0) || (index > mNCol)) return(false); 70 71 RGBColor srcRGB; 72 srcRGB.red = col.red; 73 srcRGB.green = col.green; 74 srcRGB.blue = col.blue; 75 76 SetEntryColor(mPalette,index+2,&srcRGB); 77 ((**mCTab).ctTable)[index+2].rgb = srcRGB; 78 NTotAllocCol++; 76 79 return true; // $CHECK$ retourne true si OK - Reza 01/12/97 77 80 } 78 81 79 void PIColorMapMac::MakeColMap()82 long PIColorMapMac::TotNbColors() 80 83 { 81 PIColorMapGen::MakeColMap(); 82 mPalette = NewPalette(mNCol,mCTab,pmTolerant,0); 84 PixMapHandle pmh = ((CGrafPort*)qd.thePort)->portPixMap; 85 int depth = (**pmh).cmpSize * (**pmh).cmpCount; 86 long nbcol = 1; 87 for (int i=0; i<depth; i++) 88 nbcol *= 2; 89 return nbcol; 83 90 } 84 91 … … 90 97 } 91 98 99 int PIColorMapMac::NbAllocColors() 100 { 101 return(NTotAllocCol); 102 } 103 104 92 105 void PIColorMapMac::CopyFrom(PIColorMapGen* x) 93 106 { -
trunk/SophyaPI/PI/picmapmac.h
r63 r64 8 8 class PIColorMapMac : public PIColorMapGen { 9 9 public: 10 friend class PIColorMapGen;11 friend class PIPixmapMac;12 PIColorMapMac(CMapId);13 PIColorMapMac(string const& nom, int nCol);10 PIColorMapMac(); 11 PIColorMapMac(int id, int nc, string const& nom); 12 ~PIColorMapMac(); 13 14 14 virtual PIColor GetColor(int n); 15 15 virtual bool AllocColor(PIColor const& col, int index); // $CHECK$ Reza 01/12/97(Modif) 16 16 virtual void FreeColors(); 17 virtual void MakeColMap(); 18 virtual int TotNbColor(); // A faire $CHECK$ Reza 01/12/97 19 virtual int NbAllocColors(); // A faire " " " 17 18 virtual long TotNbColors(); 19 virtual int NbAllocColors(); 20 21 CTabHandle GetCTab() {return mCTab;} 20 22 protected: 21 PIColorMapMac(CMapId id, int i); // Fait une veritable allocation22 23 void CopyFrom(PIColorMapGen*); 23 24 24 25 CTabHandle mCTab; 25 26 PaletteHandle mPalette; 27 28 friend class PIColorMapGen; 29 friend class PIPixmapMac; 26 30 }; 27 31 -
trunk/SophyaPI/PI/picmapx.cc
r63 r64 135 135 136 136 /* --Methode-- */ 137 intPIColorMapX::TotNbColors()137 long PIColorMapX::TotNbColors() 138 138 { 139 139 if (NTotColors > 0) return(NTotColors); -
trunk/SophyaPI/PI/picmapx.h
r63 r64 20 20 virtual void FreeColors(); 21 21 22 virtual intTotNbColors();22 virtual long TotNbColors(); 23 23 virtual int NbAllocColors(); 24 24 -
trunk/SophyaPI/PI/picontainermac.cc
r15 r64 5 5 : PIContainerGen(par, nom, sx, sy, px, py) 6 6 { 7 // Par dfaut, un container est invisible. 8 UnManage(); 7 9 } 8 10 … … 10 12 {} 11 13 12 /* --Methode-- */13 void PIContainerMac::Show()14 {15 PIContainerGen::Show();16 mPane->Show();17 //((LWindow*)mPane)->Select();18 }19 20 /* --Methode-- */21 void PIContainerMac::Hide()22 {23 PIContainerGen::Hide();24 mPane->Hide();25 }26 27 -
trunk/SophyaPI/PI/picontainermac.h
r15 r64 12 12 virtual ~PIContainerMac(); 13 13 14 virtual void Show();15 virtual void Hide();16 17 14 protected: 18 15 -
trunk/SophyaPI/PI/pifilechomac.cc
r23 r64 3 3 string PathNameFromDirID(long dirID, short vRefNum); 4 4 5 string PIGetFileName(string dir); 6 string PIGetExistingFileName(string dir); 5 7 6 8 string PIGetFileName(string dir) … … 11 13 string fName; 12 14 int i = dir.rfind(':'); 13 if (i == NPOS)15 if (i == string::npos) 14 16 fName = dir; 15 17 else if (i == dir.length()) … … 104 106 105 107 void 106 PIFileChooserMac::SetPath(string const& path) {}108 PIFileChooserMac::SetPath(string const& /*path*/) {} 107 109 void 108 PIFileChooserMac::SetFileName(string const& fname) {}110 PIFileChooserMac::SetFileName(string const& /*fname*/) {} 109 111 110 112 string -
trunk/SophyaPI/PI/pimenubarmac.cc
r34 r64 4 4 PIMenubarMac::PIMenubarMac(PIApplicationGen* par, char* nom) 5 5 :PIMenubarGen(par, nom) 6 {} 6 { 7 } 7 8 8 9 PIMenubarMac::~PIMenubarMac() -
trunk/SophyaPI/PI/pioptmenumac.cc
r23 r64 7 7 { 8 8 delete mPane; 9 LStr255 titre(Nom().c_str()); 9 //LStr255 titre(Nom().c_str()); 10 LStr255 titre(""); 10 11 11 12 StTextState textState; … … 15 16 int titleWidth = ::StringWidth(titre); 16 17 17 mPane = new LStdPopupMenu(mPaneInfo, msg_Click, 0, 200, titleWidth+5, popupMenuProc/*+popupVariableWidth*/, 0, titre, 0, 1);18 mPane = new LStdPopupMenu(mPaneInfo, msg_Click, 0, 200, titleWidth+5, popupMenuProc/*+popupVariableWidth*/, 130, titre, 0, 1); 18 19 //macMenu = ((LStdPopupMenu*)mPane)->GetMacMenuH(); 19 20 … … 26 27 27 28 ((LStdPopupMenu*)mPane)->AddListener(this); 29 Manage(); 28 30 } 29 31 … … 74 76 if (n < 0) return; 75 77 78 StopListening(); 76 79 ((LStdPopupMenu*)mPane)->SetValue(n+1); 80 StartListening(); 77 81 mStext = mPUMenu->GetMenuItemText(n); 78 82 mSmsg = msg; -
trunk/SophyaPI/PI/pipixmapmac.cc
r15 r64 30 30 void 31 31 PIPixmapMac::Refresh() 32 { 33 PIPixmapGen::Refresh(); 34 } 35 36 void 37 PIPixmapMac::DrawOff() 32 38 { 33 39 if (mGWorld) { … … 65 71 66 72 mPane->FocusDraw(); 67 SetPalette(mPane->GetMacPort(),cmap->mPalette, true); 68 PIPixmapGen::Refresh(); 73 // SetPalette(mPane->GetMacPort(),cmap->mPalette, true); 74 // PIPixmapGen::Refresh(); 75 } 76 77 void 78 PIPixmapMac::Draw(int,int,int,int) 79 { 80 Draw(); 69 81 } 70 82 … … 72 84 PIPixmapMac::Draw() 73 85 { 86 DrawOff(); 74 87 if (!mGWorld) return; 75 88 mPane->FocusDraw(); … … 85 98 &offsFrame, &paneFrame, srcCopy, nil); 86 99 ::UnlockPixels (mGWorld->portPixMap); 87 88 100 DisposeGWorld(mGWorld); 101 mGWorld = 0; 89 102 } -
trunk/SophyaPI/PI/pipixmapmac.h
r15 r64 13 13 virtual void SetPixmap(unsigned char *pix, int sx, int sy, bool refr=true); 14 14 virtual void Draw(); 15 virtual void Draw(int x0, int y0, int dx, int dy); 15 16 virtual void Refresh(); 17 virtual void DrawOff(); 16 18 virtual void Resize(); 17 19 protected: -
trunk/SophyaPI/PI/pippapplmac.cc
r34 r64 2 2 #include "piupdattachment.h" 3 3 #include "pippmenubar.h" 4 #include <LClipboard.h> 4 5 5 6 PIPPApplMac::PIPPApplMac() 6 7 :LApplication() 7 {} 8 { 9 AddAttachment(new LClipboard); 10 } 8 11 9 12 -
trunk/SophyaPI/PI/pistdwdgmac.cc
r34 r64 12 12 delete mPane; 13 13 LStr255 titre(nom); 14 mPane = new LCaption(mPaneInfo, titre, 0);14 mPane = new LCaption(mPaneInfo, titre, 130); 15 15 } 16 16 … … 28 28 delete mPane; 29 29 LStr255 titre(nom); 30 mPane = new LStdButton(mPaneInfo, msg_Click, 0, titre);30 mPane = new LStdButton(mPaneInfo, msg_Click, 130, titre); 31 31 ((LStdButton*)mPane)->AddListener(this); 32 32 } … … 52 52 delete mPane; 53 53 LStr255 titre(nom); 54 mPane = new LEditField(mPaneInfo, titre, 0, 255, true, true, NULL, LCommander::GetTopCommander());54 mPane = new LEditField(mPaneInfo, titre, 130, 255, true, true, NULL, LCommander::GetTopCommander()); 55 55 } 56 56 … … 100 100 LStr255 titre(nom); 101 101 mPane = new LStdControl(mPaneInfo, msg_Click, 1, 1, 10, 102 scrollBarProc, 0, titre, (Int32) this);102 scrollBarProc, 130, titre, (Int32) this); 103 103 ((LStdControl*)mPane)->AddListener(this); 104 104 … … 129 129 PIScaleMac::SetValue(int val) 130 130 { 131 StopListening(); 131 132 ((LStdControl*)mPane)->SetValue(val); 133 StartListening(); 132 134 } 133 135 … … 188 190 delete mPane; 189 191 LStr255 titre(nom); 190 mPane = new LStdCheckBox(mPaneInfo, msg_Click, 0, 0, titre);192 mPane = new LStdCheckBox(mPaneInfo, msg_Click, 0, 130, titre); 191 193 ((LStdCheckBox*)mPane)->AddListener(this); 192 194 } … … 205 207 PICheckBoxMac::SetState(bool st) 206 208 { 209 StopListening(); 207 210 ((LStdCheckBox*)mPane)->SetValue(st ? 1 : 0); 211 StartListening(); 208 212 } 209 213 -
trunk/SophyaPI/PI/piwdgmac.cc
r63 r64 17 17 :PIWdgGen(par, nom, sx, sy, px, py), mNom(nom) 18 18 { 19 mPaneInfo.paneID = 'PIWD'; 20 mPaneInfo.width = sx; 21 mPaneInfo.height = sy; 22 mPaneInfo.visible = true; 23 mPaneInfo.enabled = true; 24 mPaneInfo.bindings.left = 25 mPaneInfo.bindings.top = 26 mPaneInfo.bindings.right = 27 mPaneInfo.bindings.bottom = false; 28 mPaneInfo.left = px; 29 mPaneInfo.top = py; 30 mPaneInfo.userCon = 'PIWD'; 31 mPaneInfo.superView = par ? (LView*) (((PIContainerMac*)(par))->mPane) : NULL; 19 mAdapterPaneInfo.paneID = 0; 20 mAdapterPaneInfo.width = sx; 21 mAdapterPaneInfo.height = sy; 22 mAdapterPaneInfo.visible = true; 23 mAdapterPaneInfo.enabled = true; 24 mAdapterPaneInfo.bindings.left = 25 mAdapterPaneInfo.bindings.top = 26 mAdapterPaneInfo.bindings.right = 27 mAdapterPaneInfo.bindings.bottom = false; 28 mAdapterPaneInfo.left = px; 29 mAdapterPaneInfo.top = py; 30 mAdapterPaneInfo.userCon = 0; 31 mAdapterPaneInfo.superView = par ? (LView*) (((PIContainerMac*)(par))->mPane) : NULL; 32 33 mAdapterViewInfo.imageSize.width = sx; 34 mAdapterViewInfo.imageSize.height = sy; 35 mAdapterViewInfo.scrollPos.h = 36 mAdapterViewInfo.scrollPos.v = 37 mAdapterViewInfo.scrollUnit.h = 38 mAdapterViewInfo.scrollUnit.v = 0; 39 mAdapterViewInfo.reconcileOverhang = 0; 40 41 mAdapter = new PIPPViewAdapter(mAdapterPaneInfo, mAdapterViewInfo); 42 43 mPaneInfo.paneID = 'PIWD'; 44 mPaneInfo.width = sx; 45 mPaneInfo.height = sy; 46 mPaneInfo.visible = true; 47 mPaneInfo.enabled = true; 48 mPaneInfo.bindings.left = 49 mPaneInfo.bindings.top = 50 mPaneInfo.bindings.right = 51 mPaneInfo.bindings.bottom = true; 52 mPaneInfo.left = 0; 53 mPaneInfo.top = 0; 54 mPaneInfo.userCon = 'PIWD'; 55 mPaneInfo.superView = mAdapter; 32 56 33 57 mViewInfo.imageSize.width = sx; … … 40 64 41 65 mPane = new LView(mPaneInfo, mViewInfo); 66 ((LView*)mAdapter)->CalcPortOrigin(); 42 67 ((LView*)mPane)->CalcPortOrigin(); 43 68 } … … 47 72 { 48 73 delete mPane; 74 delete mAdapter; 49 75 } 50 76 … … 71 97 PIWdgMac::SetSize(int sx, int sy) 72 98 { 99 if (mAdapter) 100 mAdapter->ResizeFrameTo(sx, sy, true); 101 else 73 102 mPane->ResizeFrameTo(sx, sy, true); 74 103 } … … 77 106 PIWdgMac::SetPos(int px, int py) 78 107 { 108 if (mAdapter) 109 mAdapter->MoveBy(px-XPos(), py-YPos(), false); 110 else 79 111 mPane->MoveBy(px-XPos(), py-YPos(), false); 80 112 } … … 83 115 PIWdgMac::SetBinding(PIBindingKind left, PIBindingKind top, 84 116 PIBindingKind right, PIBindingKind bottom) 85 // $CHECK$ Reza 13/10/96 Code a modifier 86 { 87 SBooleanRect r; 88 r.left = left; 89 r.top = top; 90 r.right = right; 91 r.bottom = bottom; 92 mPane->SetFrameBinding(r); 117 { 118 if (mAdapter) 119 mAdapter->SetBinding(left, top, right, bottom); 120 //else 121 // mPane->SetBinding(left, top, right, bottom); 93 122 } 94 123 … … 132 161 else return(false); 133 162 } 163 164 165 // Gestion de Copier/Coller 166 #include <LClipboard.h> 167 /* --Methode-- */ 168 // COPY 169 bool PIWdgMac::ClaimSelection() 170 { 171 int l; 172 char* txt = SelectionString(l); 173 LClipboard::GetClipboard()->SetData('TEXT',txt,l,true); 174 delete[] txt; 175 return (true); 176 } 177 178 /* --Methode-- */ 179 void PIWdgMac::LoseSelection() 180 { 181 } 182 183 /* --Methode-- */ 184 // PASTE 185 void PIWdgMac::RequestSelection() 186 { 187 Handle h = NewHandle(0); 188 Int32 l = LClipboard::GetClipboard()->GetData('TEXT', h); 189 if (l) { 190 CopyFromSelection(*h, l); 191 } 192 } 193 194 /* --Methode-- */ 195 void PIWdgMac::CopyFromSelection(char * sv, int l) 196 { 197 char* buff = new char[l+2]; 198 strncpy(buff, sv, l); 199 buff[l] = '\0'; 200 printf("PIWdgMac::RequestSelection() L=%d [%s] \n", l, buff); 201 delete buff; 202 return; 203 } 204 205 /* --Methode-- */ 206 char* PIWdgMac::SelectionString(int& len) 207 { 208 char *rs = new char[60]; 209 strcpy(rs, "Test-of-PIWdgMac::SelectionString()"); 210 len = strlen(rs); 211 return(rs); 212 } 213 214 215 /* --Methode-- */ 216 void PIWdgMac::Manage() 217 { 218 if (mAdapter) mAdapter->Show(); 219 mPane->Show(); 220 } 221 222 /* --Methode-- */ 223 void PIWdgMac::UnManage() 224 { 225 mPane->Hide(); 226 if (mAdapter) mAdapter->Hide(); 227 } 228 229 /* --Methode-- */ 230 bool PIWdgMac::IfManaged() 231 { 232 return(mPane->IsVisible()); 233 } -
trunk/SophyaPI/PI/piwdgmac.h
r63 r64 3 3 4 4 #include "piwdggen.h" 5 #include "pippviewadapter.h" 5 6 #include <LPane.h> 6 7 #include <LListener.h> … … 32 33 virtual bool IfManaged(); 33 34 virtual bool IsVisible(); 35 36 // Gestion de copier-coller 37 virtual bool ClaimSelection(); 38 virtual void LoseSelection(); 39 virtual void RequestSelection(); 40 virtual void CopyFromSelection(char *, int l); 41 virtual char* SelectionString(int& len); 34 42 35 43 protected: 36 44 LPane* mPane; 45 PIPPViewAdapter* mAdapter; 46 SPaneInfo mAdapterPaneInfo; 47 SViewInfo mAdapterViewInfo; 37 48 SPaneInfo mPaneInfo; 38 49 SViewInfo mViewInfo; -
trunk/SophyaPI/PI/piwindowmac.cc
r9 r64 5 5 { 6 6 delete mPane; 7 delete mAdapter; 8 mAdapter = NULL; 7 9 mWindowInfo.WINDid = 1000+k; 8 10 mWindowInfo.attributes = windAttr_EraseOnUpdate | … … 36 38 mWindowInfo.userCon = 0; 37 39 38 mPane = new LWindow(mWindowInfo); 40 //mPane = new LWindow(mWindowInfo); 41 mPane = LWindow::CreateWindow(1000+k,LCommander::GetTopCommander()); 39 42 Rect r = {py, px, py+sy, px+sx}; 40 43 ((LWindow*) mPane)->DoSetBounds(r); 41 44 SetLabel(nom); 42 ((LWindow*) mPane)->SetSuperCommander(LCommander::GetTopCommander());45 //((LWindow*) mPane)->SetSuperCommander(LCommander::GetTopCommander()); 43 46 } 44 47 … … 56 59 PIWindowGen::Show(); 57 60 } 61 62 void 63 PIWindowMac::SetSize(int sx, int sy) 64 { 65 ((LWindow*) mPane)->ResizeWindowTo(sx, sy); 66 } 67 68 void 69 PIWindowMac::SetPos(int px, int py) 70 { 71 ((LWindow*) mPane)->MoveWindowTo(px-XPos(), py-YPos()); 72 } -
trunk/SophyaPI/PI/piwindowmac.h
r2 r64 12 12 virtual ~PIWindowMac(); 13 13 virtual void Show(); 14 virtual void SetSize(int sx, int sy); 15 virtual void SetPos(int px, int py); 14 16 15 17 protected:
Note:
See TracChangeset
for help on using the changeset viewer.