// draws a bounding box around the popup. void SimplePopup::drawBoundingBox( float x, float y, float width, float height ) { //draw the corners string topCornerImageName = "top_corner.png"; string bottomCornerImageName = "bottom_corner.png"; string verticalBarImageName = "vert_bar.png"; string horizontalBarImageName = "top_bar.png"; const float boxWidth = ( width + 15 ) / 3.0f; const float boxHeight = ( height + 15 ) / 3.0f; drawHorzPole( horizontalBarImageName, false, false, x, y, boxWidth ); drawHorzPole( horizontalBarImageName, false, true, x, y + height, boxWidth ); drawVertPole( verticalBarImageName, false, false, x, y, boxHeight ); drawVertPole( verticalBarImageName, true, false, x + width, y, boxHeight ); drawCorner( topCornerImageName, false, false, x, y ); drawCorner( topCornerImageName, true, false, x + width, y ); drawCorner( bottomCornerImageName, false, false, x, y + height ); drawCorner( bottomCornerImageName, true, false, x + width, y + height ); }
void wAppIconPaint(WAppIcon *aicon) { WApplication *wapp; WScreen *scr = aicon->icon->core->screen_ptr; if (aicon->icon->owner) wapp = wApplicationOf(aicon->icon->owner->main_window); else wapp = NULL; wIconPaint(aicon->icon); # ifdef WS_INDICATOR if (aicon->docked && scr->dock && scr->dock==aicon->dock && aicon->yindex==0) updateDockNumbers(scr); # endif if (scr->dock_dots && aicon->docked && !aicon->running && aicon->command!=NULL) { XSetClipMask(dpy, scr->copy_gc, scr->dock_dots->mask); XSetClipOrigin(dpy, scr->copy_gc, 0, 0); XCopyArea(dpy, scr->dock_dots->image, aicon->icon->core->window, scr->copy_gc, 0, 0, scr->dock_dots->width, scr->dock_dots->height, 0, 0); } #ifdef HIDDENDOT if (wapp && wapp->flags.hidden) { XSetClipMask(dpy, scr->copy_gc, scr->dock_dots->mask); XSetClipOrigin(dpy, scr->copy_gc, 0, 0); XCopyArea(dpy, scr->dock_dots->image, aicon->icon->core->window, scr->copy_gc, 0, 0, 7, scr->dock_dots->height, 0, 0); } #endif /* HIDDENDOT */ if (aicon->omnipresent) drawCorner(aicon->icon); XSetClipMask(dpy, scr->copy_gc, None); if (aicon->launching) { XFillRectangle(dpy, aicon->icon->core->window, scr->stipple_gc, 0, 0, wPreferences.icon_size, wPreferences.icon_size); } }
void SlideNavmesh::draw(const float* view, const float zoom, bool highlight) { if (!visible(view)) return; drawCorner(!m_expanded); if (!m_expanded) return; glPushMatrix(); glTranslatef(m_pos[0],m_pos[1],0); // drawDropShadow(0,0, m_dim[0],m_dim[1], highlight ? 2 : 1); /* if (highlight) glColor4ub(255,255,255,128); else glColor4ub(255,255,255,96);*/ setcolor(COL_BACK); // drawBG(0,0,m_dim[0],m_dim[1]); glPushMatrix(); glTranslatef(PADDING_SIZE,PADDING_SIZE,0); drawBoundary(m_scene.boundary, m_scene.nboundary, zoom); // Draw navmesh if (m_drawGraph) navmeshDraw(m_scene.nav, zoom); // Draw Agent int aflags = 0; if (m_drawCorner) aflags |= AGENTDRAW_CORNER; if (m_drawCorridor) aflags |= AGENTDRAW_CORRIDOR; if (m_drawVisited) aflags |= AGENTDRAW_VISITED; NavmeshAgent* ag = &m_scene.agents[0]; agentTrailDraw(ag, m_scene.nav, zoom); agentDraw(ag, m_scene.nav, aflags, zoom); // Actual if (m_drawDelta) { glLineWidth(2.0f*zoom); setcolor(COL_DARK); drawarrow(ag->pos[0],ag->pos[1], ag->pos[0]+ag->vel[0], ag->pos[1]+ag->vel[1],0.1f); } glPopMatrix(); drawButtons(); /* setcolor(clerp(COL_DIM,COL_BACK,128)); glPointSize(1.0f); glLineWidth(1.0f); // drawtext(PADDING_SIZE,PADDING_SIZE/2, 0.07f, "M A S T E R P L A N"); const float ts = 0.07f; float sx; float x = PADDING_SIZE; float y = PADDING_SIZE/3; sx = x; drawtext(x,y, ts, "Corner"); x += 0.7f; drawtext(x,y, ts, "Corridor"); x += 0.7f; drawtext(x,y, ts, "Mesh"); x += 0.7f; glBegin(GL_LINES); glVertex2f(x,y+ts*1.5f); glVertex2f(sx,y+ts*1.5f); glEnd(); x += 0.5f; sx = x; drawtext(x,y, ts, "Straight"); x += 0.7f; drawtext(x,y, ts, "Smooth"); x += 0.7f; drawtext(x,y, ts, "Drunk"); x += 0.7f; glBegin(GL_LINES); glVertex2f(x,y+ts*1.5f); glVertex2f(sx,y+ts*1.5f); glEnd(); */ glPopMatrix(); }
void FalagardActionButton::drawSelf( float z ) { if (d_needsRedraw ) { d_renderCache.clearCachedImagery(); d_needsRedraw = false; const StateImagery* imagery; // get WidgetLookFeel for the assigned look. const WidgetLookFeel& wlf = WidgetLookManager::getSingleton().getWidgetLook(d_lookName); if( wlf.isStateImageryPresent( "BackgroundImage" ) ) { imagery = &wlf.getStateImagery( "BackgroundImage" ); // peform the rendering operation. imagery->render(*this); } // 画背景 d_BackImage.draw(d_renderCache); //Empty if(isEmpty()) { if((isHovering() || isPushed()) && !isDisabled(true) )//&& !isGloom()) { drawHover(z); } } else { //Draw normal image drawNormal(z); //Draw percentage Img if(isPercentagePresent()) { drawPercentageImg(z); } //Notin Dragging if(d_dragging && !isGloom()) { drawPushed(z); } else { //Draw disable mask only when disabled if (isDisabled(true) || isGloom() ) { drawDisabled(z); if (isPushed() || isChecked()) { drawPushed(z); } drawAnimate(z); } else { //If pushed or checked draw "Pushed" Layer if (isPushed() || isChecked()) { drawPushed(z); } //Draw "Hover" Layer if (isHovering() && !isChecked()) { drawHover(z); } drawAnimate(z); // If default if(isDefault()) { drawDefault(z); } } //Draw corner character drawCorner(z); drawFlash( z ); } } } Window::drawSelf(z); }
void FalagardActionButton::drawSelf( float z ) { if (d_needsRedraw ) { d_renderCache.clearCachedImagery(); d_needsRedraw = false; //Empty if(isEmpty()) { if((isHovering() || isPushed()) && !isDisabled(true) )//&& !isGloom()) { drawHover(z); } } else { //Draw normal image drawNormal(z); //Notin Dragging if(d_dragging && !isGloom()) { drawPushed(z); } else { //Draw disable mask only when disabled if (isDisabled(true) || isGloom() ) { drawDisabled(z); if (isPushed() || isChecked()) { drawPushed(z); } } else { //If pushed or checked draw "Pushed" Layer if (isPushed() || isChecked()) { drawPushed(z); } //Draw "Hover" Layer if (isHovering() && !isChecked()) { drawHover(z); } drawAnimate(z); // If default if(isDefault()) { drawDefault(z); } } //Draw corner character drawCorner(z); } } } Window::drawSelf(z); }