int SListViewItemLocatorFlex::Position2Item(int position) { if(!m_adapter) return -1; if(position<0 || position>=GetTotalHeight()) return -1; HSTREEITEM hItem = Offset2Branch(STVI_ROOT,position); SASSERT(hItem); int idx = Branch2Index(hItem); int offset = Branch2Offset(hItem); BranchInfo &bi = m_itemPosIndex.GetItemRef(hItem); SASSERT(bi.nBranchHei>=position-offset); int iSeg = idx/SEGMENT_SIZE; int nRemain = position - offset; SegmentInfo *psi = m_segments[iSeg]; for(int i=0;i<psi->nItems;i++) { int nItemHei = psi->pItemHeight[i]==-1?GetFixItemHeight():psi->pItemHeight[i]; if(nRemain<=nItemHei) return idx + i; nRemain -= nItemHei; } SASSERT(FALSE); return -1; }
void AwtChoice::Reshape(int x, int y, int w, int h) { // Choice component height is fixed (when rolled up) // so vertically center the choice in it's bounding box JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); jobject target = GetTarget(env); jobject parent = env->GetObjectField(target, AwtComponent::parentID); RECT rc; int fieldHeight = GetFieldHeight(); if ((parent != NULL && env->GetObjectField(parent, AwtContainer::layoutMgrID) != NULL) && fieldHeight > 0 && fieldHeight < h) { y += (h - fieldHeight) / 2; } int totalHeight = GetTotalHeight(); AwtComponent::Reshape(x, y, w, totalHeight); /* Bug 4255631 Solaris: Size returned by Choice.getSize() does not match * actual size * Fix: Set the Choice to its actual size in the component. */ ::GetClientRect(GetHWnd(), &rc); env->SetIntField(target, AwtComponent::widthID, (jint)rc.right); env->SetIntField(target, AwtComponent::heightID, (jint)rc.bottom); env->DeleteLocalRef(target); env->DeleteLocalRef(parent); }
int wxHtmlDCRenderer::Render(int x, int y, wxArrayInt& known_pagebreaks, int from, int dont_render, int to) { int pbreak, hght; if (m_Cells == NULL || m_DC == NULL) return 0; pbreak = (int)(from + m_Height); while (m_Cells->AdjustPagebreak(&pbreak, known_pagebreaks)) {} hght = pbreak - from; if(to < hght) hght = to; if (!dont_render) { wxHtmlRenderingInfo rinfo; wxDefaultHtmlRenderingStyle rstyle; rinfo.SetStyle(&rstyle); m_DC->SetBrush(*wxWHITE_BRUSH); m_DC->SetClippingRegion(x, y, m_Width, hght); m_Cells->Draw(*m_DC, x, (y - from), y, pbreak + (y /*- from*/), rinfo); m_DC->DestroyClippingRegion(); } if (pbreak < m_Cells->GetHeight()) return pbreak; else return GetTotalHeight(); }
int wxHtmlDCRenderer::Render(int x, int y, wxArrayInt& known_pagebreaks, int from, int dont_render, int to) { wxCHECK_MSG( m_Cells, 0, "SetHtmlText() must be called before Render()" ); wxCHECK_MSG( m_DC, 0, "SetDC() must be called before Render()" ); int pbreak, hght; pbreak = (int)(from + m_Height); while (m_Cells->AdjustPagebreak(&pbreak, known_pagebreaks)) {} hght = pbreak - from; if(to < hght) hght = to; if (!dont_render) { wxHtmlRenderingInfo rinfo; wxDefaultHtmlRenderingStyle rstyle; rinfo.SetStyle(&rstyle); m_DC->SetBrush(*wxWHITE_BRUSH); m_DC->SetClippingRegion(x, y, m_Width, hght); m_Cells->Draw(*m_DC, x, (y - from), y, y + hght, rinfo); m_DC->DestroyClippingRegion(); } if (pbreak < m_Cells->GetHeight()) return pbreak; else return GetTotalHeight(); }
/// Set up scrollbars, e.g. after a resize void InstanceCtrl::SetupScrollbars() { if (m_freezeCount) return; if (GetCount() == 0) { SetScrollbars(0, 0, 0, 0, 0, 0); return; } int pixelsPerUnit = 10; wxSize clientSize = GetClientSize(); int maxHeight = GetTotalHeight(); int unitsY = maxHeight / pixelsPerUnit; int startX, startY; GetViewStart(& startX, & startY); int maxtop = maxHeight - clientSize.y; if (maxtop % pixelsPerUnit) { maxtop = ((maxtop / pixelsPerUnit) + 1) * pixelsPerUnit; } int maxPositionY = (wxMax(maxtop , 0)) / pixelsPerUnit; // Move to previous scroll position if // possible SetScrollbars(0, pixelsPerUnit, 0, unitsY, 0, wxMin(maxPositionY, startY)); }
// Recalculate and set the drop-down height for the Choice. void AwtChoice::ResetDropDownHeight() { RECT rcWindow; ::GetWindowRect(GetHWnd(), &rcWindow); // resize the drop down to accomodate added/removed items int totalHeight = GetTotalHeight(); ::SetWindowPos(GetHWnd(), NULL, 0, 0, rcWindow.right - rcWindow.left, totalHeight, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER); }
void AwtChoice::Reshape( int x, int y, int w, int h ) { // Choice component height is fixed (when rolled up) // so vertically center the choice in it's bounding box int fieldHeight = GetFieldHeight(); if ( fieldHeight > 0 && fieldHeight < h ) { y += (h - fieldHeight) / 2; } AwtComponent::Reshape( x, y, w, GetTotalHeight() ); return; }
// ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- void ReAnimEntityWidget::paintEvent( QPaintEvent* _event ) { QPainter painter( this ); if( IsHighlighted() ) painter.fillRect( 0, 0, width(), height(), QColor( 0, 255, 0 ) ); else painter.fillRect( 0, 0, width(), height(), QColor( 0, 0, 0 ) ); painter.setPen( QColor( 0, 0, 0 ) ); painter.drawText( width() - 100, 0, QString( "%1" ).arg( GetTotalHeight() ) ); TSuper::paintEvent( _event ); }
FTetrisField::FTetrisField(int rows, int cols, FColor *color, FVertex *position, float width, float height, float scale, bool d3, float xrot, float yrot, float zrot):FGLDrawObject(color, new FVertex(position->GetX() * scale, position->GetY() * scale, position->GetZ()), xrot, yrot, zrot, true, false, 0, 0, 0) { this->rows = rows; this->cols = cols; this->height = height; this->width = width; this->scale = scale; this->border = .015; this->startx = -GetTotalWidth() / 2; this->starty = GetTotalHeight() / 2; delete position; this->d3 = d3; }
void AwtChoice::Reshape(int x, int y, int w, int h) { // Choice component height is fixed (when rolled up) // so vertically center the choice in it's bounding box JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2); jobject target = GetTarget(env); jobject parent = env->GetObjectField(target, AwtComponent::parentID); RECT rc; int fieldHeight = GetFieldHeight(); if ((parent != NULL && env->GetObjectField(parent, AwtContainer::layoutMgrID) != NULL) && fieldHeight > 0 && fieldHeight < h) { y += (h - fieldHeight) / 2; } /* Fix for 4783342 * Choice should ignore reshape on height changes, * as height is dependent on Font size only. */ AwtComponent* awtParent = GetParent(); BOOL bReshape = true; if (awtParent != NULL) { ::GetWindowRect(GetHWnd(), &rc); int oldW = rc.right - rc.left; RECT parentRc; ::GetWindowRect(awtParent->GetHWnd(), &parentRc); int oldX = rc.left - parentRc.left; int oldY = rc.top - parentRc.top; bReshape = (x != oldX || y != oldY || w != oldW); } if (bReshape) { int totalHeight = GetTotalHeight(); AwtComponent::Reshape(x, y, w, totalHeight); } /* Bug 4255631 Solaris: Size returned by Choice.getSize() does not match * actual size * Fix: Set the Choice to its actual size in the component. */ ::GetClientRect(GetHWnd(), &rc); env->SetIntField(target, AwtComponent::widthID, (jint)rc.right); env->SetIntField(target, AwtComponent::heightID, (jint)rc.bottom); env->DeleteLocalRef(target); env->DeleteLocalRef(parent); }
wxSize wxVListBoxComboPopup::GetAdjustedSize( int minWidth, int prefHeight, int maxHeight ) { int height = 250; maxHeight -= 2; // Must take borders into account if ( m_strings.GetCount() ) { if ( prefHeight > 0 ) height = prefHeight; if ( height > maxHeight ) height = maxHeight; int totalHeight = GetTotalHeight(); // + 3; // Take borders into account on Mac or scrollbars always appear #if defined(__WXMAC__) totalHeight += 2; #endif if ( height >= totalHeight ) { height = totalHeight; } else { // Adjust height to a multiple of the height of the first item // NB: Calculations that take variable height into account // are unnecessary. int fih = GetLineHeight(0); height -= height % fih; } } else height = 50; CalcWidths(); // Take scrollbar into account in width calculations int widestWidth = m_widestWidth + wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); return wxSize(minWidth > widestWidth ? minWidth : widestWidth, height+2); }
// Recalculate and set the drop-down height for the Choice. void AwtChoice::ResetDropDownHeight() { JNIEnv *env; if ( JVM->AttachCurrentThread( (void **)&env, 0 ) != 0 ) { return; } jobject target = env->GetObjectField( GetPeer(), WCachedIDs.PPCObjectPeer_targetFID ); CHECK_NULL( target, "null target" ); RECT rcWindow; ::GetWindowRect( GetHWnd(), &rcWindow ); // resize the drop down to accomodate added/removed items ::SetWindowPos( GetHWnd(), NULL, 0, 0, rcWindow.right - rcWindow.left, GetTotalHeight(), SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER ); return; }
int COXMultiComboBox::AdjustToFitSize() { int nResult; if(m_bFitToSize) { int nTotalWidth=GetTotalWidth()+2*GetSystemMetrics(SM_CXBORDER); int nTotalHeight=GetTotalHeight(); int nBorderHeight=GetSystemMetrics(SM_CYBORDER); int nScrollbarHeight=GetSystemMetrics(SM_CYHSCROLL); CRect rcDrop; GetDroppedControlRect(&rcDrop); if((nTotalHeight > rcDrop.Height()-2*nBorderHeight) || ((nTotalWidth > rcDrop.Width()) && (nTotalHeight > rcDrop.Height()-nScrollbarHeight-2*nBorderHeight))) { nTotalWidth+=::GetSystemMetrics(SM_CXVSCROLL); } int nScreenWidth=::GetSystemMetrics(SM_CXSCREEN); nTotalWidth=nTotalWidth>nScreenWidth ? nScreenWidth : nTotalWidth; nResult=SetDroppedWidth(nTotalWidth); } else nResult=SetDroppedWidth(1); if(nResult!=CB_ERR) { // ... To indicate that the scrollbars has to be re-adjusted m_fSizeChanged = TRUE; // Redraws the listbox if(::IsWindow(m_ComboLBox.m_hWnd)) { m_ComboLBox.RedrawWindow(NULL,NULL, RDW_ERASE|RDW_INVALIDATE|RDW_ERASENOW|RDW_UPDATENOW|RDW_FRAME); } } return nResult; }
void yatcStackPanel::ForceHeight(int height) { // TODO (nfries88): close windows if needed, resize bottom remaining window appropriately. SetHeight(GetTotalHeight()); }
void FTetrisField::InternDraw(bool standalone){ glPushMatrix(); glTranslatef(startx, starty, 0); DrawCubes(); float depth = this->GetBoxWidth()<this->GetBoxHeight()?-this->GetBoxWidth():-this->GetBoxHeight(); if(color) glColor4f(this->color->GetR() * 1.5, this->color->GetG() * 1.5,/* this->color->GetB() * 1.5*/1, this->color->GetA()); else MessageBox(0, "no color in ftetrisfield", "", 0); glPushMatrix(); /*if(d3){ glBegin(GL_QUADS); }else{ glBegin(GL_LINES); }*/ glBegin(GL_QUADS); for(int i = 1; i < rows; i ++){ glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, 0);//FRONT glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, 0); glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, 0); if(d3){ glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, depth);//BACK glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, depth); glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, depth);//LEFT glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, 0); glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, 0);//RIGHT glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, depth); glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, depth);//TOP glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, depth); glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, 0); glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() + GetBorder() / 2, 0); glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, 0);//BOTTOM glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(0, (float)i / (float)rows * -GetTotalHeight() - GetBorder() / 2, depth); } /*glVertex3f(0, (float)i / (float)rows * -GetTotalHeight(), 0); glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight(), 0); if(d3){ glVertex3f(GetTotalWidth(), (float)i / (float)rows * -GetTotalHeight(), depth); glVertex3f(0, (float)i / (float)rows * -GetTotalHeight(), depth); }*/ } for(int i = 1; i < cols; i ++){ glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, 0, 0);//FRONT glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, 0, 0); glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, -GetTotalHeight(), 0); glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, -GetTotalHeight(), 0); if(d3){ glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, 0, depth);//BACK glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, 0, depth); glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, -GetTotalHeight(), depth); glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, -GetTotalHeight(), depth); glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, 0, depth);//LEFT glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, 0, 0); glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, -GetTotalHeight(), 0); glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, -GetTotalHeight(), depth); glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, 0, 0);//RIGHT glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, 0, depth); glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, -GetTotalHeight(), depth); glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, -GetTotalHeight(), 0); glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, 0, depth);//TOP glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, 0, depth); glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, 0, 0); glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, 0, 0); glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, -GetTotalHeight(), 0); glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, -GetTotalHeight(), 0); glVertex3f((float)i / (float)cols * GetTotalWidth() + GetBorder() / 2, -GetTotalHeight(), depth); glVertex3f((float)i / (float)cols * GetTotalWidth() - GetBorder() / 2, -GetTotalHeight(), depth); } /*glVertex3f((float)i / (float)cols * width * scale, 0, 0); glVertex3f((float)i / (float)cols * width * scale, - height * scale, 0); if(d3){ glVertex3f((float)i / (float)cols * width * scale, - height * scale, depth); glVertex3f((float)i / (float)cols * width * scale, 0, depth); }*/ } glEnd(); glPopMatrix(); if(color) glColor4f(this->color->GetR(), this->color->GetG(), this->color->GetB(), this->color->GetA()); glBegin(GL_QUADS); glVertex3f(-GetBorder() / 2, GetBorder() / 2, 0);//LEFTFRONT glVertex3f(GetBorder() / 2, GetBorder() / 2, 0); glVertex3f(GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(-GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(-GetBorder() / 2, GetBorder() / 2, 0);//TOPFRONT glVertex3f(GetTotalWidth() + GetBorder() / 2, GetBorder() / 2, 0); glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetBorder() / 2, 0); glVertex3f(-GetBorder() / 2, -GetBorder() / 2, 0); glVertex3f(GetTotalWidth() - GetBorder() / 2, GetBorder() / 2, 0);//RIGHTFRONT glVertex3f(GetTotalWidth() + GetBorder() / 2, GetBorder() / 2, 0); glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(GetTotalWidth() - GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(-GetBorder() / 2, -GetTotalHeight() + GetBorder() / 2, 0);//BOTTOM glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() + GetBorder() / 2, 0); glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(-GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0); if(d3){ glVertex3f(-GetBorder() / 2, GetBorder() / 2, depth);//LEFTLEFT glVertex3f(-GetBorder() / 2, GetBorder() / 2, 0); glVertex3f(-GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(-GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(GetBorder() / 2, GetBorder() / 2, 0);//LEFTRIGHT glVertex3f(GetBorder() / 2, GetBorder() / 2, depth); glVertex3f(GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(GetBorder() / 2, GetBorder() / 2, depth);//LEFTBACK glVertex3f(-GetBorder() / 2, GetBorder() / 2, depth); glVertex3f(-GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(-GetBorder() / 2, GetBorder() / 2, depth);//TOPTOP glVertex3f(GetTotalWidth() + GetBorder() / 2, GetBorder() / 2, depth); glVertex3f(GetTotalWidth() + GetBorder() / 2, GetBorder() / 2, 0); glVertex3f(-GetBorder() / 2, GetBorder() / 2, 0); glVertex3f(-GetBorder() / 2, -GetBorder() / 2, 0);//TOPBOTTOM glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetBorder() / 2, 0); glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetBorder() / 2, depth); glVertex3f(-GetBorder() / 2, -GetBorder() / 2, depth); glVertex3f(GetTotalWidth() + GetBorder() / 2, GetBorder() / 2, depth);//TOPBACK glVertex3f(-GetBorder() / 2, GetBorder() / 2, depth); glVertex3f(-GetBorder() / 2, -GetBorder() / 2, depth); glVertex3f(GetTotalWidth() + GetBorder() / 2, - GetBorder() / 2, depth); glVertex3f(GetTotalWidth() + GetBorder() / 2, GetBorder() / 2, 0);//RIGHTRIGHT glVertex3f(GetTotalWidth() + GetBorder() / 2, GetBorder() / 2, depth); glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(GetTotalWidth() - GetBorder() / 2, GetBorder() / 2, depth);//RIGHTLEFT glVertex3f(GetTotalWidth() - GetBorder() / 2, GetBorder() / 2, 0); glVertex3f(GetTotalWidth() - GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(GetTotalWidth() - GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(GetTotalWidth() + GetBorder() / 2, GetBorder() / 2, depth);//RIGHTBACK glVertex3f(GetTotalWidth() - GetBorder() / 2, GetBorder() / 2, depth); glVertex3f(GetTotalWidth() - GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(-GetBorder() / 2, -GetTotalHeight() + GetBorder() / 2, depth);//BOTTOMTOP glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() + GetBorder() / 2, depth); glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() + GetBorder() / 2, 0); glVertex3f(-GetBorder() / 2, -GetTotalHeight() + GetBorder() / 2, 0); glVertex3f(-GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0);//BOTTOMBOTTOM glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, 0); glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(-GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() + GetBorder() / 2, depth);//BOTTOMBACK glVertex3f(-GetBorder() / 2, -GetTotalHeight() + GetBorder() / 2, depth); glVertex3f(-GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); glVertex3f(GetTotalWidth() + GetBorder() / 2, -GetTotalHeight() - GetBorder() / 2, depth); } glEnd(); /*if(d3){ glBegin(GL_QUADS); glVertex3f(0, 0, 0); glVertex3f(0, 0, depth); glVertex3f(GetTotalWidth(), 0, depth); glVertex3f(GetTotalWidth(), 0, 0); glVertex3f(0, 0, 0); glVertex3f(0, -GetTotalHeight(), 0); glVertex3f(0, -GetTotalHeight(), depth); glVertex3f(0, 0, depth); glVertex3f(0, -GetTotalHeight(), 0); glVertex3f(GetTotalWidth(), -GetTotalHeight(), 0); glVertex3f(GetTotalWidth(), -GetTotalHeight(), depth); glVertex3f(0, -GetTotalHeight(), depth); glVertex3f(GetTotalWidth(), 0, 0); glVertex3f(GetTotalWidth(), 0, depth); glVertex3f(GetTotalWidth(), -GetTotalHeight(), depth); glVertex3f(GetTotalWidth(), -GetTotalHeight(), 0); }else{ glBegin(GL_LINE_LOOP); glVertex3f(0, 0, 0); glVertex3f(width * scale, 0, 0); glVertex3f(width * scale, - height * scale, 0); glVertex3f(0, - height * scale, 0); }*/ //glEnd(); glPopMatrix(); }