Changeset 3470 in Sophya for trunk/SophyaPI
- Timestamp:
- Feb 14, 2008, 10:43:34 AM (18 years ago)
- Location:
- trunk/SophyaPI/PI/Quartz
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Quartz/PIControl.cpp
r3326 r3470 9 9 10 10 #include "PIControl.h" 11 #include "pistdwdggen.h" 12 #include "PIContainerQuartz.h" 11 13 12 14 PIControl::PIControl(PIContainerGen *par, const char *nom,int sx, int sy, int px, int py) 13 15 :PIWdgQuartz(par, nom, sx, sy, px, py) 14 16 { 17 wParent = ((PIContainer *)par)->GetWindowPtr(); 18 SetPortWindowPort(wParent); 19 SetRect(&wdgRect,px,py,px+sx,py+sy); 15 20 contH = NULL; 16 21 } -
trunk/SophyaPI/PI/Quartz/pistdwdgmosx.cpp
r3326 r3470 17 17 : PILabelGen(par, nom, sx, sy, px, py) 18 18 { 19 OSStatus err; 20 21 string sNom(nom); 22 wParent = ((PIContainer *)par)->GetWindowPtr(); 23 SetPortWindowPort(wParent); 24 SetRect(&wdgRect,px,py,px+sx,py+sy); 25 cfsrLabel = CFStringCreateWithCString(kCFAllocatorDefault,nom,kCFStringEncodingMacRoman); 26 err = CreateStaticTextControl (wParent, &wdgRect, cfsrLabel, NULL, &contH); 19 27 } 20 28 … … 30 38 31 39 cfsrLabel = CFStringCreateWithCString(kCFAllocatorDefault,sLabel.c_str(),kCFStringEncodingMacRoman); 32 err = DrawThemeTextBox (cfsrLabel, 33 kThemeSystemFont, 34 kThemeStateInactive, 35 false, 36 &wdgRect, 37 teJustLeft, 38 NULL); 39 40 return; 41 } 40 SetPortWindowPort(wParent); 41 42 err = SetControlData (contH,0,kControlEditTextCFStringTag,sizeof(cfsrLabel),(Ptr)&cfsrLabel); 43 44 return; 45 } 42 46 43 47 … … 46 50 /* --Methode-- */ 47 51 PITextQuartz::PITextQuartz(PIContainerGen *par, const char *nom, int sx, int sy, int px, int py) 52 : PITextGen(par, nom, sx, sy, px, py) 53 { 54 OSStatus err; 55 wParent = ((PIContainer *)par)->GetWindowPtr(); 56 SetRect(&wdgRect,px,py,px+sx,py+sy); 57 } 58 59 /* --Methode-- */ 60 PITextQuartz::PITextQuartz(PIContainerGen* par, const char* nom, bool vsb, bool hsb, 61 int sx, int sy, int px, int py) 62 : PITextGen(par, nom, vsb, hsb, sx, sy, px, py) 63 { 64 } 65 66 /* --Methode-- */ 67 PITextQuartz::~PITextQuartz() 68 { 69 } 70 71 72 /* --Methode-- */ 73 void PITextQuartz::SetText(string const& s) 74 { 75 OSStatus err; 76 77 unicodeText = CFStringCreateWithCString (NULL,(char *)s.c_str(), kCFStringEncodingMacRoman); 78 err = CreateEditUnicodeTextControl (wParent,&wdgRect,unicodeText,false,NULL,&contH); 79 80 return; 81 } 82 83 /* --Methode-- */ 84 string PITextQuartz::GetText() const 85 { 86 char* cText; 87 88 cText = (char *)CFStringGetCStringPtr(unicodeText,kCFStringEncodingMacRoman); 89 string sText(cText); 90 return (sText); 91 } 92 93 94 /* --Methode-- */ 95 void PITextQuartz::SetMutiLineMode(bool mlm) 96 { 97 return; 98 } 99 100 101 /* --Methode-- */ 102 void PITextQuartz::SetTextEditable(bool te) 103 { 104 return; 105 } 106 107 108 /* --Methode-- */ 109 void PITextQuartz::SetMsg(PIMessage msg) 110 { 111 112 } 113 114 115 /* ========== PIHITextViewQuartz ========== */ 116 117 /* --Methode-- */ 118 PIHITextViewQuartz::PIHITextViewQuartz(PIContainerGen *par, const char *nom, int sx, int sy, int px, int py) 48 119 : PITextGen(par, nom, sx, sy, px, py) 49 120 { … … 59 130 fx = px+sx-mx; 60 131 fy = py+sy-my; 61 132 SetRect(&wdgRect,px,py,px+sx,py+sy); 133 62 134 SetRect(&userPaneRect,ox,oy,fx,fy); 63 135 hiRect.origin.x = ox; … … 71 143 72 144 /* --Methode-- */ 73 PI TextQuartz::PITextQuartz(PIContainerGen* par, const char* nom, bool vsb, bool hsb,145 PIHITextViewQuartz::PIHITextViewQuartz(PIContainerGen* par, const char* nom, bool vsb, bool hsb, 74 146 int sx, int sy, int px, int py) 75 147 : PITextGen(par, nom, vsb, hsb, sx, sy, px, py) … … 78 150 79 151 /* --Methode-- */ 80 PI TextQuartz::~PITextQuartz()81 { 82 } 83 84 85 /* --Methode-- */ 86 void PI TextQuartz::SetText(string const& s)152 PIHITextViewQuartz::~PIHITextViewQuartz() 153 { 154 } 155 156 157 /* --Methode-- */ 158 void PIHITextViewQuartz::SetText(string const& s) 87 159 { 88 160 OSStatus err; … … 105 177 106 178 /* --Methode-- */ 107 string PI TextQuartz::GetText() const179 string PIHITextViewQuartz::GetText() const 108 180 { 109 181 CFStringRef str; … … 124 196 125 197 /* --Methode-- */ 126 void PI TextQuartz::SetMutiLineMode(bool mlm)127 { 128 return; 129 } 130 131 132 /* --Methode-- */ 133 void PI TextQuartz::SetTextEditable(bool te)134 { 135 return; 136 } 137 138 139 /* --Methode-- */ 140 void PI TextQuartz::SetMsg(PIMessage msg)141 { 142 143 } 198 void PIHITextViewQuartz::SetMutiLineMode(bool mlm) 199 { 200 return; 201 } 202 203 204 /* --Methode-- */ 205 void PIHITextViewQuartz::SetTextEditable(bool te) 206 { 207 return; 208 } 209 210 211 /* --Methode-- */ 212 void PIHITextViewQuartz::SetMsg(PIMessage msg) 213 { 214 215 } -
trunk/SophyaPI/PI/Quartz/pistdwdgmosx.h
r3326 r3470 21 21 }; 22 22 23 typedef PILabelQuartz PILabel;24 25 23 class PITextQuartz : public PITextGen 26 24 { … … 41 39 42 40 protected: 41 CFStringRef unicodeText; 42 }; 43 44 45 class PIHITextViewQuartz : public PITextGen 46 { 47 public: 48 PIHITextViewQuartz(PIContainerGen *par, const char *nom, 49 int sx=10, int sy=10, int px=0, int py=0); 50 51 PIHITextViewQuartz(PIContainerGen* par, const char* nom, bool vsb, bool hsb, 52 int sx=100, int sy=100, int px=0, int py=0); 53 virtual ~PIHITextViewQuartz(); 54 virtual void SetText(string const&); 55 virtual string GetText() const; 56 57 virtual void SetMutiLineMode(bool mlm=false); 58 virtual void SetTextEditable(bool te=true); 59 60 virtual void SetMsg(PIMessage msg=0); 61 62 protected: 43 63 UniChar* uniChars; 44 64 CFIndex textLength; 45 65 HIViewRef outTextView; 46 WindowRef wParent;47 66 HIRect hiRect; 48 67 ControlRef fUserPane; … … 50 69 }; 51 70 71 72 73 typedef PILabelQuartz PILabel; 52 74 typedef PITextQuartz PIText; 75 typedef PIHITextViewQuartz PITextView; 53 76 54 77 #endif -
trunk/SophyaPI/PI/Quartz/piwdgmosx.cpp
r3326 r3470 16 16 fflush (stdout); 17 17 title = CFStringCreateWithCString (NULL, nom, kCFStringEncodingMacRoman); 18 SetRect(&wdgRect,px,py,px+sx,py+sy);19 18 contH = NULL; 20 19 wPtr = NULL; 20 wParent = NULL; 21 21 mFCol = mBCol = PI_NotDefColor; 22 22 } -
trunk/SophyaPI/PI/Quartz/piwdgmosx.h
r3326 r3470 14 14 15 15 #include "piwdggen.h" 16 17 16 18 17 … … 102 101 ControlRef contH; 103 102 WindowPtr wPtr; 103 WindowRef wParent; 104 104 // pas utilisable dans MOSX/Carbon 105 105 PIColors mFCol, mBCol;
Note:
See TracChangeset
for help on using the changeset viewer.