idTech4.UI.idListWindow.Draw C# (CSharp) Method

Draw() public method

public Draw ( float x, float y ) : void
x float
y float
return void
		public override void Draw(float x, float y)
		{
			idConsole.Warning("TODO: ListWindow Draw");
			/*idVec4 color;
			idStr work;
			int count = listItems.Num();
			idRectangle rect = textRect;
			float scale = textScale;
			float lineHeight = GetMaxCharHeight();

			float bottom = textRect.Bottom();
			float width = textRect.w;

			if ( scroller->GetHigh() > 0.0f ) {
				if ( horizontal ) {
					bottom -= sizeBias;
				} else {
					width -= sizeBias;
					rect.w = width;
				}
			}

			if ( noEvents || !Contains(gui->CursorX(), gui->CursorY()) ) {
				hover = false;
			}

			for (int i = top; i < count; i++) {
				if ( IsSelected( i ) ) {
					rect.h = lineHeight;
					dc->DrawFilledRect(rect.x, rect.y + pixelOffset, rect.w, rect.h, borderColor);
					if ( flags & WIN_FOCUS ) {
						idVec4 color = borderColor;
						color.w = 1.0f;
						dc->DrawRect(rect.x, rect.y + pixelOffset, rect.w, rect.h, 1.0f, color );
					}
				}
				rect.y ++;
				rect.h = lineHeight - 1;
				if ( hover && !noEvents && Contains(rect, gui->CursorX(), gui->CursorY()) ) {
					color = hoverColor;
				} else {
					color = foreColor;
				}
				rect.h = lineHeight + pixelOffset;
				rect.y --;

				if ( tabInfo.Num() > 0 ) {
					int start = 0;
					int tab = 0;
					int stop = listItems[i].Find('\t', 0);
					while ( start < listItems[i].Length() ) {
						if ( tab >= tabInfo.Num() ) {
							common->Warning( "idListWindow::Draw: gui '%s' window '%s' tabInfo.Num() exceeded", gui->GetSourceFile(), name.c_str() );
							break;
						}
						listItems[i].Mid(start, stop - start, work);

						rect.x = textRect.x + tabInfo[tab].x;
						rect.w = (tabInfo[tab].w == -1) ? width - tabInfo[tab].x : tabInfo[tab].w;
						dc->PushClipRect( rect );

						if ( tabInfo[tab].type == TAB_TYPE_TEXT ) {
							dc->DrawText(work, scale, tabInfo[tab].align, color, rect, false, -1);
						} else if (tabInfo[tab].type == TAB_TYPE_ICON) {
					
							const idMaterial	**hashMat;
							const idMaterial	*iconMat;

							// leaving the icon name empty doesn't draw anything
							if ( work[0] != '\0' ) {

								if ( iconMaterials.Get(work, &hashMat) == false ) {
									iconMat = declManager->FindMaterial("_default");
								} else {
									iconMat = *hashMat;
								}

								idRectangle iconRect;
								iconRect.w = tabInfo[tab].iconSize.x;
								iconRect.h = tabInfo[tab].iconSize.y;

								if(tabInfo[tab].align == idDeviceContext::ALIGN_LEFT) {
									iconRect.x = rect.x;
								} else if (tabInfo[tab].align == idDeviceContext::ALIGN_CENTER) {
									iconRect.x = rect.x + rect.w/2.0f - iconRect.w/2.0f;
								} else if (tabInfo[tab].align == idDeviceContext::ALIGN_RIGHT) {
									iconRect.x  = rect.x + rect.w - iconRect.w;
								}

								if(tabInfo[tab].valign == 0) { //Top
									iconRect.y = rect.y + tabInfo[tab].iconVOffset;
								} else if(tabInfo[tab].valign == 1) { //Center
									iconRect.y = rect.y + rect.h/2.0f - iconRect.h/2.0f + tabInfo[tab].iconVOffset;
								} else if(tabInfo[tab].valign == 2) { //Bottom
									iconRect.y = rect.y + rect.h - iconRect.h + tabInfo[tab].iconVOffset;
								}

								dc->DrawMaterial(iconRect.x, iconRect.y, iconRect.w, iconRect.h, iconMat, idVec4(1.0f,1.0f,1.0f,1.0f), 1.0f, 1.0f);

							}
						}

						dc->PopClipRect();

						start = stop + 1;
						stop = listItems[i].Find('\t', start);
						if ( stop < 0 ) {
							stop = listItems[i].Length();
						}
						tab++;
					}
					rect.x = textRect.x;
					rect.w = width;
				} else {
					dc->DrawText(listItems[i], scale, 0, color, rect, false, -1);
				}
				rect.y += lineHeight;
				if ( rect.y > bottom ) {
					break;
				}
			}*/
		}