Changeset 349
- Timestamp:
- 12/29/07 20:59:27 (1 year ago)
- Files:
-
- trunk/src/gtk/ComboBox.d (modified) (1 diff)
- trunk/wrap/APILookupGtk.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/gtk/ComboBox.d
r348 r349 174 174 public void setActiveText(char[] text, bool insert=false) 175 175 { 176 int currActive = getActive();177 176 int active = 0; 178 setActive(active); 179 bool found = false; 180 while ( !found && active==getActive) 181 { 182 found = text==getActiveText(); 177 setActive(0); 178 while ( getActive >= 0 ) // returns -1 if end of list if reached 179 { 180 if( text == getActiveText() ) return; 183 181 ++active; 184 } 185 if ( !found ) 186 { 187 if ( insert ) 188 { 189 appendText(text); 190 setActive(active); 191 } 192 else 193 { 194 //setActive(currActive); 195 setActive(-1); 196 } 182 setActive(active); 183 } 184 // was not found, the combo has now nothing selected 185 if ( insert ) 186 { 187 appendText(text); 188 setActive(active); 197 189 } 198 190 } trunk/wrap/APILookupGtk.txt
r346 r349 3397 3397 public void setActiveText(char[] text, bool insert=false) 3398 3398 { 3399 int currActive = getActive(); 3400 int active = 0; 3401 setActive(active); 3402 bool found = false; 3403 while ( !found && active==getActive) 3404 { 3405 found = text==getActiveText(); 3406 ++active; 3407 } 3408 if ( !found ) 3409 { 3410 if ( insert ) 3411 { 3412 appendText(text); 3413 setActive(active); 3414 } 3415 else 3416 { 3417 //setActive(currActive); 3418 setActive(-1); 3419 } 3420 } 3399 int active = 0; 3400 setActive(0); 3401 while ( getActive >= 0 ) // returns -1 if end of list if reached 3402 { 3403 if( text == getActiveText() ) return; 3404 ++active; 3405 setActive(active); 3406 } 3407 // was not found, the combo has now nothing selected 3408 if ( insert ) 3409 { 3410 appendText(text); 3411 setActive(active); 3412 } 3421 3413 } 3422 3414
