Changeset 54 in Sophya for trunk/SophyaPI/PI/pilistx.cc
- Timestamp:
- Aug 13, 1997, 6:13:59 PM (28 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pilistx.cc
r41 r54 22 22 23 23 pil = (PIListX *)usd ; 24 pil->ToggleSel(isel->item_position, true); 25 // printf("list_action/Debug: reason=%d itemPos= %d \n",26 //isel->reason, isel->item_position);24 // printf("list_action/Debug: reason=%d itemPos= %d \n", 25 // isel->reason, isel->item_position); 26 pil->ToggleSel(isel->item_position-1, true); 27 27 return; 28 28 } … … 82 82 83 83 /* --Methode-- */ 84 void PIListX::AppendItem(c har* item, PIMessage msg)84 void PIListX::AppendItem(const char * item, PIMessage msg) 85 85 { 86 86 … … 114 114 115 115 /* --Methode-- */ 116 void PIListX::DeleteItem(c har *item)116 void PIListX::DeleteItem(const char * item) 117 117 { 118 118 int n; … … 155 155 PIMessage PIListX::GetSelection(int num) 156 156 { 157 if ( (num < 0) || (num >= mNbSel) ) return(0); 157 158 return(ItemMsg(mSelNum[num])); 158 159 } … … 161 162 string PIListX::GetSelectionStr(int num) 162 163 { 164 if ( (num < 0) || (num >= mNbSel) ) return(""); 163 165 string s(ItemStr(mSelNum[num])); 164 166 return(s); … … 166 168 167 169 /* --Methode-- */ 168 void PIListX::SelectItem(c har * item)170 void PIListX::SelectItem(const char * item) 169 171 { 170 172 int n; 171 173 if ((n=GetNumItem(item)) < 0) return; 172 if ((!mMultSel) && (mNbSel > 0) && (mSelNum[0] != n))173 ClrSItem(mSelNum[0], false, true);174 if ((!mMultSel) && (mNbSel > 0)) 175 if (mSelNum[0] != n) ClrSItem(mSelNum[0], false, true); 174 176 SelItem(n, false, true); 175 177 return; … … 181 183 int n; 182 184 if ((n=GetNumItemMsg(msg)) < 0) return; 183 if ((!mMultSel) && (mNbSel > 0) && (mSelNum[0] != n))184 ClrSItem(mSelNum[0], false, true);185 if ((!mMultSel) && (mNbSel > 0)) 186 if (mSelNum[0] != n) ClrSItem(mSelNum[0], false, true); 185 187 SelItem(n, false, true); 186 188 return; … … 189 191 190 192 /* --Methode-- */ 191 void PIListX::ClearSelItem(c har * item)193 void PIListX::ClearSelItem(const char * item) 192 194 { 193 195 int n; … … 231 233 { 232 234 Arg warg[2]; 233 XmString *xmst ;235 XmString *xmst=NULL; 234 236 235 237 if ( (n < 0) || (n >= mNItem)) { mSItem[0] = '\0'; return(mSItem); } 236 238 mSItem[0] = '\0'; 237 239 XtSetArg(warg[0], XmNitems, &xmst); 238 240 XtGetValues(mlist, warg, 1); … … 242 244 243 245 /* --Methode-- */ 244 int PIListX::GetNumItem(c har *it)246 int PIListX::GetNumItem(const char *it) 245 247 { 246 248 for(int i=0; i<mNItem; i++) … … 343 345 XmListDeselectPos(mlist, n+1); 344 346 345 delete[] mSelNum;347 if (mSelNum) delete[] mSelNum; 346 348 if (mNbSel <= 0) 347 349 { mNSelMax = mNbSel = 0; mSelNum = NULL; }
Note:
See TracChangeset
for help on using the changeset viewer.