I think by interpreting lpString
, TabbedTextOut
itself can figure out how many "\t"s there are and thus the sixth parameter nTabPositions
and the seventh lpnTabStopPositions
, which together indicate the number and the positions of the tabs in lpString, do not make any sense. Besides, for example, when I call TabbedTextOut
the following way, int nTabStopPositions[] = { 105,110,120 }; TabbedTextOut(hdc, 100, 100, "aaa\tbbb\tccc", 11, 3, nTabStopPositions, 50);
Supposing the map mode is MM_TEXT,and the char width is 5. TabbedTextOut
will draw the string where it is 100 pixels to the left and 100 pixels to the top of the client area, breaking the string with tabs at 100+3*5 and 100+6*5+8( a tab equals 8 blanks ). This is the way I think how TabbedTextOut
works, but it seems not working that way. Thus I don't understand how the last three parameters work. thank you
crossie
Posts
-
How to use TabbedTextOut? -
split string - better way?Can I ask what
CPMRU
is short for? -
How to use TabbedTextOut?LONG TabbedTextOut( HDC hDC, // handle to DC int X, // x-coord of start int Y, // y-coord of start LPCTSTR lpString, // character string int nCount, // number of characters int nTabPositions, // number of tabs in array CONST LPINT lpnTabStopPositions, // array of tab positions int nTabOrigin // start of tab expansion );
I thought the number of tabs and the positions of tabs are determined by the "\t"s contained in lpString, but it does not turn out to be that simple. What is TabbedTextOut's behavior if the number of "\t"s does not equal nTabPositons? I simiply thought that TabbedTextOut would simply replace those "\t"s in lpString with blanks and the last three parameters did not make any sense. But the fact is the width positions of these "\t"s are depent on the last three parameters. How do these three parameters work? thank you.