Changeset 401
- Timestamp:
- 05/28/07 20:19:36 (18 months ago)
- Location:
- trunk/orca/qt
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/orca/qt/project.r
r108 r401 17 17 ] 18 18 linux [ 19 libs %fam19 ;libs %fam 20 20 libs %bz2 21 21 ;libs_from %/usr/X11R6/lib -
trunk/orca/qt/qorca.cpp
r146 r401 324 324 325 325 326 static const char* valueStr( OValue* val ) 327 { 328 OString* str = orSTRING( val ); 329 orTermCStr( str ); 330 return orStrChars( str, val ); 326 static void valueToQString( const OValue* val, QString& str ) 327 { 328 if( orIsString( val->type ) ) 329 { 330 str = cstring( val ); 331 } 332 else if( val->type == OT_INTEGER ) 333 { 334 str.setNum( val->integer ); 335 } 336 else if( val->type == OT_DECIMAL ) 337 { 338 str.setNum( val->num.decimal ); 339 } 340 else if( val->type == OT_NONE ) 341 { 342 str.clear(); 343 } 344 else 345 { 346 AOString ts; 347 str = ts.mold( val ); 348 } 331 349 } 332 350 … … 414 432 parent.addWidget( pw ); 415 433 setWID( setWord, pw->_wid ); 416 pw->setText( valueStr( cbp.values + 1 ) ); 434 435 val = cbp.values + 1; 436 if( orIs(val, OT_WORD) ) 437 { 438 orWordVal( val, blk, val ); 439 } 440 QString txt; 441 valueToQString( val, txt ); 442 pw->setText( txt ); 443 417 444 wid = pw; 418 445 } … … 427 454 parent.addWidget( pw ); 428 455 setWID( setWord, pw->_wid ); 429 pw->setText( valueStr( cbp.values + 1 ) );456 pw->setText( cstring( cbp.values + 1 ) ); 430 457 pw->setBlock( cbp.values + 2 ); 431 458 wid = pw; … … 441 468 parent.addWidget( pw ); 442 469 setWID( setWord, pw->_wid ); 443 pw->setText( valueStr( cbp.values + 1 ) );470 pw->setText( cstring( cbp.values + 1 ) ); 444 471 wid = pw; 445 472 } … … 466 493 { 467 494 if( orIs(it, OT_STRING) ) 468 pw->addItem( valueStr( it ) );495 pw->addItem( cstring( it ) ); 469 496 ++it; 470 497 } … … 472 499 else 473 500 { 474 pw->addItem( valueStr( val ) );501 pw->addItem( cstring( val ) ); 475 502 } 476 503 } … … 496 523 case LD_TIP: 497 524 if( wid ) 498 wid->setToolTip( valueStr(cbp.values + 1) );525 wid->setToolTip( cstring(cbp.values + 1) ); 499 526 break; 500 527 … … 502 529 { 503 530 if( qEnv.curWidget ) 504 qEnv.curWidget->setWindowTitle( valueStr(cbp.values + 1) );531 qEnv.curWidget->setWindowTitle( cstring(cbp.values + 1) ); 505 532 } 506 533 break; … … 528 555 529 556 if( match->integer == LD_LINE_EDITS ) 530 pw->setText( valueStr( cbp.values + 1 ) );557 pw->setText( cstring( cbp.values + 1 ) ); 531 558 } 532 559 break; … … 545 572 if( match->integer == LD_TEXT_EDITS ) 546 573 { 547 const char* str = valueStr( cbp.values + 1 );574 const char* str = cstring( cbp.values + 1 ); 548 575 if( *str == '<' ) 549 576 pw->setHtml( str ); … … 565 592 566 593 val = cbp.values + 1; 567 pw->setTitle( valueStr( val ) );594 pw->setTitle( cstring( val ) ); 568 595 569 596 ++val; … … 598 625 if( combo ) 599 626 { 600 combo->addItem( valueStr( cbp.values ) );627 combo->addItem( cstring( cbp.values ) ); 601 628 break; 602 629 } … … 605 632 if( texted ) 606 633 { 607 const char* str = valueStr( cbp.values );634 const char* str = cstring( cbp.values ); 608 635 if( *str == '<' ) 609 636 texted->setHtml( str ); … … 982 1009 break; 983 1010 } 984 }985 }986 987 988 static void valueToQString( const OValue* val, QString& str )989 {990 if( orIsString( val->type ) )991 {992 str = cstring( val );993 }994 else if( val->type == OT_INTEGER )995 {996 str.setNum( val->integer );997 }998 else if( val->type == OT_DECIMAL )999 {1000 str.setNum( val->num.decimal );1001 }1002 else if( val->type == OT_NONE )1003 {1004 str.clear();1005 }1006 else1007 {1008 AOString ts;1009 str = ts.mold( val );1010 1011 } 1011 1012 } … … 1226 1227 " 2 ['spacer]\n" 1227 1228 " 3 ['label string!]\n" 1229 " 3 ['label word!]\n" 1228 1230 " 4 ['button string! block!]\n" 1229 1231 " 5 ['checkbox string!]\n"
