Definition at line 646 of file TextEdit.h. References OglGui::OglWindow::mOglWnd, and PrintBuf(). Referenced by DrawText(). 00647 { 00648 string str = buf; 00649 00650 if (str.find_first_of("\t") == string::npos) 00651 return PrintBuf(x, y, buf); 00652 00653 string tabStr; 00654 int tabPos, tabInd = 0; 00655 int totWidth = 0, tabCnt = 0; 00656 int w, h; 00657 int tabWidth; 00658 void* font; 00659 00660 FindOglFont(mOglWnd, &font, NULL); 00661 oglSys.AbstFontTextSize(mOglWnd, font, " ", &tabWidth, &h); 00662 00663 while ((tabPos = str.find_first_of("\t", tabInd)) != string::npos) 00664 { 00665 tabStr = str.substr(tabInd, tabPos-tabInd); 00666 PrintBuf(x + totWidth, y, tabStr.c_str()); 00667 00668 oglSys.AbstFontTextSize(mOglWnd, font, tabStr.c_str(), &w, &h); 00669 tabCnt = (totWidth + w) / tabWidth + 1; 00670 totWidth = tabCnt * tabWidth; 00671 tabInd = tabPos+1; 00672 } 00673 if (tabInd < str.length()) 00674 { 00675 tabStr = str.substr(tabInd, str.length()-tabInd); 00676 PrintBuf(x + totWidth, y, tabStr.c_str()); 00677 } 00678 }
Here is the call graph for this function:
|