Public Member Functions | |
| TextBuffer () | |
| ~TextBuffer () | |
| int | GetNumberOfLines () |
| void | SetHeightOfPage (int a_height) |
| void | SetEndOfPage (int a_value) |
| int | GetEndOfPage () |
| void | IncrementEndOfPage () |
| void | DecrementEndOfPage () |
| void | JumpDownEndOfPage () |
| void | JumpUpEndOfPage () |
| G4bool | AppendString (char *a_string) |
| void | Draw (HDC a_hdc, RECT *a_rect) |
Private Attributes | |
| G4String * | lines |
| int | linen |
| int | linei |
| int | endOfPage |
| int | heightOfPage |
| char | spaces [256] |
|
|
Definition at line 81 of file G4UIWin32.cc. References linen, lines, and spaces.
|
|
|
Definition at line 88 of file G4UIWin32.cc. References lines.
00089 {
00090 delete [] lines;
00091 }
|
|
|
Definition at line 126 of file G4UIWin32.cc. References endOfPage, linei, linen, and lines.
00127 {
00128 G4bool value = false;
00129 if( (a_string==NULL) || (a_string[0]=='\0') ) return value;
00130 int length = strlen(a_string);
00131 if(a_string[length-1]=='\n') {
00132 lines[linei] += a_string;
00133 lines[linei] = lines[linei].strip(G4String::trailing,'\n');
00134 linei++;
00135 value = true;
00136 } else {
00137 lines[linei] += a_string;
00138 }
00139 if(linei>=linen) {
00140 for(int count=0;count<linen;count++) {
00141 lines[count] = "";
00142 }
00143 linei = 0;
00144 }
00145 if(value==true) endOfPage = linei-1;
00146 return value;
00147 }
|
|
|
Definition at line 108 of file G4UIWin32.cc. References endOfPage. Referenced by G4UIWin32::TextWindowProc().
|
|
||||||||||||
|
Definition at line 149 of file G4UIWin32.cc. References endOfPage, heightOfPage, linei, lines, and spaces. Referenced by G4UIWin32::TextWindowProc().
00150 {
00151 TEXTMETRIC tm;
00152 GetTextMetrics (a_hdc,&tm);
00153 short charWidth = (short)tm.tmAveCharWidth;
00154 short charHeight = (short)(tm.tmHeight + tm.tmExternalLeading);
00155 for(int row=0;row<heightOfPage;row++) {
00156 int rowi = endOfPage - row;
00157 short y = (short)(a_rect->bottom - charHeight * (row + 1));
00158 if((rowi>=0)&&(rowi<linei)) {
00159 TextOut (a_hdc,0,y,(char*)spaces,256); //Clear text background first.
00160 const char* string = lines[rowi].data();
00161 if(string!=NULL) {
00162 TextOut (a_hdc,0,y,(char*)string,strlen((char*)string));
00163 }
00164 }
00165 }
00166 }
|
|
|
Definition at line 64 of file G4UIWin32.cc. References endOfPage. Referenced by G4UIWin32::TextWindowProc().
00064 { return endOfPage; }
|
|
|
Definition at line 61 of file G4UIWin32.cc. References linei.
00061 { return linei;}
|
|
|
Definition at line 102 of file G4UIWin32.cc. References endOfPage, and linei. Referenced by G4UIWin32::TextWindowProc().
|
|
|
Definition at line 114 of file G4UIWin32.cc. References endOfPage, heightOfPage, and linei. Referenced by G4UIWin32::TextWindowProc().
|
|
|
Definition at line 120 of file G4UIWin32.cc. References endOfPage, and heightOfPage. Referenced by G4UIWin32::TextWindowProc().
00121 {
00122 endOfPage -= heightOfPage;
00123 if(endOfPage<0) endOfPage = 0;
00124 }
|
|
|
Definition at line 93 of file G4UIWin32.cc. References endOfPage, and linei. Referenced by G4UIWin32::TextWindowProc().
|
|
|
Definition at line 62 of file G4UIWin32.cc. References heightOfPage.
00062 { heightOfPage = a_height; }
|
|
|
Definition at line 77 of file G4UIWin32.cc. Referenced by AppendString(), DecrementEndOfPage(), Draw(), GetEndOfPage(), IncrementEndOfPage(), JumpDownEndOfPage(), JumpUpEndOfPage(), and SetEndOfPage(). |
|
|
Definition at line 77 of file G4UIWin32.cc. Referenced by Draw(), JumpDownEndOfPage(), JumpUpEndOfPage(), and SetHeightOfPage(). |
|
|
Definition at line 76 of file G4UIWin32.cc. Referenced by AppendString(), Draw(), GetNumberOfLines(), IncrementEndOfPage(), JumpDownEndOfPage(), and SetEndOfPage(). |
|
|
Definition at line 75 of file G4UIWin32.cc. Referenced by AppendString(), and TextBuffer(). |
|
|
Definition at line 74 of file G4UIWin32.cc. Referenced by AppendString(), Draw(), TextBuffer(), and ~TextBuffer(). |
|
|
Definition at line 78 of file G4UIWin32.cc. Referenced by Draw(), and TextBuffer(). |
1.3.4