Changeset 315916e in tol
- Timestamp:
- Mar 25, 2011, 6:49:40 PM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 2075779
- Parents:
- eb5dfc6
- Location:
- tol
- Files:
-
- 2 edited
-
bbasic/tol_btext.h (modified) (2 diffs)
-
btol/text_type/txtgra.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol/bbasic/tol_btext.h
reb5dfc6 r315916e 388 388 BBool Match (const BText pattern, BBool caseSensitive=BFALSE) const; 389 389 390 //! Returns the wrapped text \a txt compacted 391 BText Wrap ( 392 int lineSize, 393 const BText& wordSep_, 394 const BText& prefix_); 395 390 396 friend ostream& operator<<(ostream& os, const BText& txt); 391 397 … … 411 417 //! Returns the text \a txt compacted 412 418 friend BText Compact (const BText& txt); 419 413 420 414 421 friend BText TmpFileName(const BText& path=BText::None(), const BText& prefix=BText::None()); -
tol/btol/text_type/txtgra.cpp
reb5dfc6 r315916e 2554 2554 } 2555 2555 #endif /* __USE_TC__ */ 2556 2557 //-------------------------------------------------------------------- 2558 DeclareContensClass(BText, BTxtTemporary, BTextClassApi); 2559 DefExtOpr(1, BTextClassApi, "ClassApi", 1, 1, "Text", 2560 "(Text className)", 2561 I2("Returns the API of a previously defined class.", 2562 "Devuelve la API de una clase definida previamente."), 2563 BOperClassify::System_); 2564 void BTextClassApi::CalcContens() 2565 //-------------------------------------------------------------------- 2566 { 2567 BText name = Text(Arg(1)); 2568 BClass* cls = FindClass(name, true); 2569 if(cls) 2570 { 2571 contens_ = cls->Dump(); 2572 } 2573 } 2574 2575 //-------------------------------------------------------------------- 2576 DeclareContensClass(BText, BTxtTemporary, BTexWrap); 2577 DefExtOpr(1, BTexWrap, "Wrap", 2, 4, "Text Real Text Text", 2578 "(Text textToWrap, Real maxLineLength [, " 2579 "Text wordSeparators=" ", Text prefix=""])", 2580 I2("Breaks lines with more than <maxLineLength> characters.\n" 2581 "Only when a character in <wordSeparators> it will insert a line break.\n" 2582 "If <prefix> is not empty it will be insert after each new break line.\n", 2583 "Rompe las líneas con más de <maxLineLength> caracteres.\n" 2584 "Sólo cuando se encuentre un caracter de <wordSeparators> se podrá " 2585 "insertar un salto de línea. \n" 2586 "Si <prefix> no está vacío será insertar después de cada salto de línea " 2587 "nueva.\n"), 2588 BOperClassify::System_); 2589 void BTexWrap::CalcContens() 2590 //-------------------------------------------------------------------- 2591 { 2592 BText textToWrap = Text(Arg(1)); 2593 int maxLineLength = (int)Real(Arg(2)); 2594 BText wordSeparators = " "; 2595 BText prefix = ""; 2596 if(Arg(3)) { wordSeparators = Text(Arg(3)); } 2597 if(Arg(4)) { prefix = Text(Arg(4)); } 2598 contens_ = textToWrap.Wrap(maxLineLength, wordSeparators, prefix); 2599 }
Note: See TracChangeset
for help on using the changeset viewer.
