Пример #1
0
void Account::EditProfile()
{
  clrscr();
  DrawBorder(25,8,59,16,0);
  gotoxy(24,11);
  cout<<"Please enter your first name : ";
  cin>>FName;
  cin.ignore();
  gotoxy(24,12);
  cout<<"Please enter your last name : ";
  cin>>LName;
  cin.ignore();

  clrscr();
  DrawBorder(25,8,59,16,0);
  gotoxy(24,11);
  cout<<"ID : ";
  cin>>ID;
  gotoxy(24,12);
  cout<<"Username : "******"Enter new Password : ";
  cin>>Password;
  cin.ignore();
}
Пример #2
0
//-----------Splash screens------------//
void SplashScreen (int ScreenType, char *FName)
{
  switch (ScreenType)
  {
    case 1 : 
      clrscr();
      DrawBorder(26,3,53,7,1);
      gotoxy(31,5);
      textcolor(12);
      cprintf("Welcome ");
      textcolor(7);
      cout<<FName;
      break;
    case 2 : 
      clrscr();
  		DrawBorder(16,7,63,16,1);
  		gotoxy(19,10);
    	textcolor(12);
    	cprintf("Thank you for using Intellisoft Job Portal");
    	gotoxy(24,12);
    	textcolor(7);
    	cprintf("Developed by Aniruddha Mysore");
    	gotoxy(26,13);
    	cprintf("Class 12-B | Roll No. 23");
    	getch();
    	exit(0);
  }
}
Пример #3
0
/*
 * DrawGridBorder:  Draw the border around the current room area.
 */
void DrawGridBorder(void)
{
	if (state == STATE_GAME && (GameGetState() == GAME_PLAY || GameGetState() == GAME_SELECT))
		if (GetFocus() == hMain)
			DrawBorder(&view, HIGHLIGHT_INDEX, &drawborderexcludeView);
		else
			//DrawBorder(view, border_index, &drawborderexcludeView);
			DrawBorder(&view, BORDER_INDEX, &drawborderexcludeView);
}
Пример #4
0
void MinerGob::Draw(DibBitmap *pbm, int xViewOrigin, int yViewOrigin, int nLayer)
{
#ifdef DRAW_OCCUPIED_TILE_INDICATOR
		{
			WRect wrcT;
			GetTilePaddedWRect(&wrcT);
			Rect rcT;
			rcT.FromWorldRect(&wrcT);
			rcT.Offset(-xViewOrigin, -yViewOrigin);
			DrawBorder(pbm, &rcT, 1, GetColor(kiclrWhite));
		}
#endif

	if (m_fHidden)
		return;

	MobileUnitGob::Draw(pbm, xViewOrigin, yViewOrigin, nLayer);

	if (m_st == kstMinerSuck && nLayer == knLayerDepthSorted) {
		SetAnimationStrip(&m_aniVacuum, m_ani.GetStrip());
		m_aniVacuum.Draw(pbm, PcFromUwc(m_wx) - xViewOrigin, PcFromUwc(m_wy) - yViewOrigin);
	} else if (nLayer == knLayerSelection && (m_ff & kfGobSelected)) {
		Rect rcT;
		rcT.FromWorldRect(&m_pmuntc->wrcUIBounds);
		rcT.Offset(PcFromUwc(m_wx) - xViewOrigin, PcFromUwc(m_wy) - yViewOrigin);
		DrawFullnessIndicator(pbm, &rcT, m_nGalaxiteAmount / knGalaxiteValue / 2, knMinerGalaxiteMax / knGalaxiteValue / 2);
	}
}
Пример #5
0
/*
 * InventoryBoxResize:  Resize the inventory box when the main window is resized
 *   to (xsize, ysize).  view is the current grid area view.
 */
void InventoryBoxResize(int xsize, int ysize, AREA *view)
{
    int old_cols = cols;
    int old_rows = rows;

    int yMiniMap, iHeightAvailableForMapAndStats, iHeightMiniMap;

    /* Turn off highlight */
    DrawBorder(&inventory_area, inventory_bg_index, NULL);

    inventory_area.x = view->x + view->cx + LEFT_BORDER + 3 * HIGHLIGHT_THICKNESS;
    inventory_area.cx = min(xsize - inventory_area.x - 3 * HIGHLIGHT_THICKNESS - EDGETREAT_WIDTH, INVENTORY_MAX_WIDTH);

//   inventory_area.y = 2 * TOP_BORDER + USERAREA_HEIGHT + GROUPBUTTONS_HEIGHT + EDGETREAT_HEIGHT;
//   inventory_area.cy = view->y + view->cy - inventory_area.y;

    yMiniMap = 2 * TOP_BORDER + USERAREA_HEIGHT + EDGETREAT_HEIGHT + MAPTREAT_HEIGHT;
    iHeightAvailableForMapAndStats = ysize - yMiniMap - 2 * HIGHLIGHT_THICKNESS - EDGETREAT_HEIGHT;
    iHeightMiniMap = (int)( iHeightAvailableForMapAndStats * PROPORTION_MINIMAP ) - HIGHLIGHT_THICKNESS - MAPTREAT_HEIGHT;
    iHeightMiniMap = min( iHeightMiniMap, MINIMAP_MAX_HEIGHT );

    inventory_area.y = yMiniMap + iHeightMiniMap + 3 * HIGHLIGHT_THICKNESS + MAPTREAT_HEIGHT + GROUPBUTTONS_HEIGHT + MAP_STATS_GAP_HEIGHT + 1;
    inventory_area.cy = ysize - EDGETREAT_HEIGHT - HIGHLIGHT_THICKNESS - inventory_area.y - STATS_BOTTOM_GAP_HEIGHT;

    InventoryComputeRowsCols();

    // If inventory gets bigger, go back to top
    if (cols > old_cols || rows > old_rows)
    {
        top_row = 0;
        SetScrollPos(hwndInvScroll, SB_CTL, 0, TRUE);
    }

    InventoryDisplayScrollbar();
}
Пример #6
0
/** Handle an expose event. */
char HandleExpose(const XExposeEvent *event)
{
   ClientNode *np;
   np = FindClientByParent(event->window);
   if(np) {
      if(event->count == 0) {
         DrawBorder(np);
      }
      return 1;
   } else {
      np = FindClientByWindow(event->window);
      if(np) {
         if(np->state.status & STAT_WMDIALOG) {

            /* Dialog expose events are handled elsewhere. */
            return 0;

         } else {

            /* Ignore other expose events for client windows. */
            return 1;

         }
      }
      return event->count ? 1 : 0;
   }
}
Пример #7
0
void CSMFGroundDrawer::Draw(const DrawPass::e& drawPass)
{
	// must be here because water renderers also call us
	if (!globalRendering->drawGround)
		return;
	// if entire map is under voidwater, no need to draw *ground*
	if (readMap->HasOnlyVoidWater())
		return;

	glDisable(GL_BLEND);
	glEnable(GL_CULL_FACE);
	glCullFace(GL_BACK);

	if (drawDeferred) {
		// do the deferred pass first, will allow us to re-use
		// its output at some future point and eventually draw
		// the entire map deferred
		DrawDeferredPass(drawPass, mapRendering->voidGround || (mapRendering->voidWater && drawPass != DrawPass::WaterReflection));
	}

	if (drawForward) {
		DrawForwardPass(drawPass, mapRendering->voidGround || (mapRendering->voidWater && drawPass != DrawPass::WaterReflection));
	}

	glDisable(GL_CULL_FACE);

	if (drawPass != DrawPass::Normal)
		return;

	if (drawWaterPlane)
		DrawWaterPlane(false);

	if (drawMapEdges)
		DrawBorder(drawPass);
}
Пример #8
0
static void 
_XmFastExpose(Widget widg)
{
  register int i;
  register Widget child;
  XmGrabShellWidget gs = (XmGrabShellWidget)widg;

  _XmProcessLock();
  (*(XtClass(widg)->core_class.expose)) (widg, NULL, NULL);
  _XmProcessUnlock();
  
  /* Process each windowed child */
  for (i = 0; i < gs->composite.num_children; i++)
    {
      child = gs->composite.children[i];
      
      if (XtIsWidget(child) && XtIsManaged(child)) {
        _XmProcessLock();
	(*(XtClass(child)->core_class.expose)) (child, NULL, NULL);
	_XmProcessUnlock();
      }
    }
  
  XFlush(XtDisplay(widg));
  DrawBorder(widg);
}
Пример #9
0
static void BorderElementDraw(
    void *clientData, void *elementRecord,
    Tk_Window tkwin, Drawable d, Ttk_Box b, unsigned int state)
{
    BorderElement *bd = elementRecord;
    Tk_3DBorder border = Tk_Get3DBorderFromObj(tkwin, bd->borderObj);
    XColor *borderColor = Tk_GetColorFromObj(tkwin, bd->borderColorObj);
    int borderWidth = 2;
    int relief = TK_RELIEF_FLAT;
    int defaultState = TTK_BUTTON_DEFAULT_DISABLED;

    /*
     * Get option values.
     */
    Tcl_GetIntFromObj(NULL, bd->borderWidthObj, &borderWidth);
    Tk_GetReliefFromObj(NULL, bd->reliefObj, &relief);
    Ttk_GetButtonDefaultStateFromObj(NULL, bd->defaultStateObj, &defaultState);

    if (defaultState == TTK_BUTTON_DEFAULT_ACTIVE) {
	GC gc = Tk_GCForColor(borderColor, d);
	XDrawRectangle(Tk_Display(tkwin), d, gc,
		b.x, b.y, b.width-1, b.height-1);
    }
    if (defaultState != TTK_BUTTON_DEFAULT_DISABLED) {
	/* Space for default ring: */
	b = Ttk_PadBox(b, Ttk_UniformPadding(1));
    }

    DrawBorder(tkwin, d, border, borderColor, b, borderWidth, relief);
}
Пример #10
0
void CXFA_FFCheckButton::RenderWidget(CFX_Graphics* pGS,
                                      CFX_Matrix* pMatrix,
                                      uint32_t dwStatus) {
  if (!IsMatchVisibleStatus(dwStatus)) {
    return;
  }
  CFX_Matrix mtRotate;
  GetRotateMatrix(mtRotate);
  if (pMatrix) {
    mtRotate.Concat(*pMatrix);
  }
  CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus);
  CXFA_Border borderUI = m_pDataAcc->GetUIBorder();
  DrawBorder(pGS, borderUI, m_rtUI, &mtRotate,
             m_pDataAcc->GetCheckButtonShape() == XFA_ATTRIBUTEENUM_Round
                 ? XFA_DRAWBOX_ForceRound
                 : 0);
  RenderCaption(pGS, &mtRotate);
  DrawHighlight(pGS, &mtRotate, dwStatus,
                m_pDataAcc->GetCheckButtonShape() == XFA_ATTRIBUTEENUM_Round);
  CFX_Matrix mt;
  mt.Set(1, 0, 0, 1, m_rtCheckBox.left, m_rtCheckBox.top);
  mt.Concat(mtRotate);
  GetApp()->GetWidgetMgrDelegate()->OnDrawWidget(m_pNormalWidget->GetWidget(),
                                                 pGS, &mt);
}
Пример #11
0
void TankGob::Draw(DibBitmap *pbm, int xViewOrigin, int yViewOrigin, int nLayer)
{
	if (nLayer == knLayerDepthSorted) {

#ifdef DRAW_OCCUPIED_TILE_INDICATOR
		{
			WRect wrcT;
			GetTilePaddedWRect(&wrcT);
			Rect rcT;
			rcT.FromWorldRect(&wrcT);
			rcT.Offset(-xViewOrigin, -yViewOrigin);
			DrawBorder(pbm, &rcT, 1, GetColor(kiclrWhite));
		}
#endif
		Side side = m_pplr->GetSide();
		if (m_ff & kfGobDrawFlashed)
			side = (Side)-1;

		// Draw base

		int x = PcFromUwc(m_wx) - xViewOrigin;
		int y = PcFromUwc(m_wy) - yViewOrigin;
		m_ani.Draw(pbm, x, y, side);

		// Draw turret
		// The turret is aligned with the base's special point

		Point ptBaseSpecial;
		m_ani.GetSpecialPoint(&ptBaseSpecial);
		m_aniTurret.Draw(pbm, x + ptBaseSpecial.x, y + ptBaseSpecial.y, side);
	} else {
		MobileUnitGob::Draw(pbm, xViewOrigin, yViewOrigin, nLayer);
	}
}
Пример #12
0
void CChart::PrintChart(CDC *pDC,int x , int y)
{
	
	int xPixel ;
	int yPixel  ;
	int oldmapmode ;

	CDC *dc = GetDC();
	
	xPixel = pDC->GetDeviceCaps(LOGPIXELSX);
	yPixel = pDC->GetDeviceCaps(LOGPIXELSY);
	
	//Calculate ratio to be zoomed.
	xPixel =  xPixel /dc->GetDeviceCaps(LOGPIXELSX);
	yPixel =  yPixel /dc->GetDeviceCaps(LOGPIXELSY);
	ReleaseDC(dc);
	
	oldmapmode = pDC->SetMapMode(MM_ANISOTROPIC);
	pDC->SetViewportExt(xPixel,yPixel);
	pDC->SetViewportOrg(x,y);

	DrawBorder(pDC);
	pDC->DrawEdge(m_ctlRect,BDR_SUNKENINNER|BDR_SUNKENOUTER, BF_RECT);
	DrawChartTitle(pDC);
	if ( bLogScale )
	   DrawLogGrid(pDC);
	DrawGrid(pDC);
	
	DrawAxis(pDC) ;
	DrawGridLabel(pDC);
	Plot(pDC) ;

	pDC->SetMapMode(oldmapmode);
}
Пример #13
0
void InputConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event))
{
  wxFont small_font(6, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
  const wxColour font_color{0xB8B8B8};

  g_controller_interface.UpdateInput();

  GamepadPage* const current_page =
      static_cast<GamepadPage*>(m_pad_notebook->GetPage(m_pad_notebook->GetSelection()));

  wxMemoryDC dc;
  auto lock = ControllerEmu::GetStateLock();
  for (ControlGroupBox* g : current_page->control_groups)
  {
    // Only if this control group has a bitmap
    if (!g->static_bitmap)
      continue;

    wxBitmap bitmap(g->static_bitmap->GetBitmap());
    // NOTE: Selecting the bitmap inherits the bitmap's ScaleFactor onto the DC as well.
    dc.SelectObjectAsSource(bitmap);
    dc.SetBackground(*wxWHITE_BRUSH);
    dc.Clear();

#ifdef __WXGTK20__
    int dc_height = 0;
    dc.SetFont(small_font);
    dc.GetTextExtent(g->control_group->name, nullptr, &dc_height);
#endif

    std::unique_ptr<wxGraphicsContext> gc{wxGraphicsContext::Create(dc)};
    gc->DisableOffset();
    gc->SetFont(small_font, font_color);

#ifdef __WXGTK20__
    double gc_height = 0;
    gc->GetTextExtent(g->control_group->name, nullptr, &gc_height);
    // On GTK2, wx creates a new empty Cairo/Pango context for the graphics context instead
    // of reusing the wxMemoryDC one, this causes it to forget the screen DPI so fonts stop
    // scaling, we need to scale it manually instead.
    if (std::ceil(gc_height) < dc_height)
    {
      wxFont fixed_font(small_font);
      fixed_font.SetPointSize(static_cast<int>(fixed_font.GetPointSize() * g->m_scale));
      gc->SetFont(fixed_font, font_color);
    }
#endif

    DrawControlGroupBox(gc.get(), g);
    DrawBorder(gc.get(), g->m_scale);

    // label for sticks and stuff
    if (g->HasBitmapHeading())
      gc->DrawText(StrToWxStr(g->control_group->name).Upper(), 4 * g->m_scale, 2 * g->m_scale);

    gc.reset();
    dc.SelectObject(wxNullBitmap);
    g->static_bitmap->SetBitmap(bitmap);
  }
}
Пример #14
0
/** Handle an expose event. */
int HandleExpose(const XExposeEvent *event) {

   ClientNode *np;

   np = FindClientByWindow(event->window);
   if(np) {
      if(event->window == np->parent) {
         DrawBorder(np, event);
         return 1;
      } else if(event->window == np->window
         && np->state.status & STAT_WMDIALOG) {

         /* Dialog expose events are handled elsewhere. */
         return 0;

      } else {

         /* Ignore other expose events. */
         return 1;

      }
   } else {
      return event->count ? 1 : 0;
   }

}
Пример #15
0
void MenuBar::DrawItem(GC &gc, int n)
{
	if (n<0 || n>=list.count()) return;
	
	UiCondList ucl;
	if (n == select && InFocus()) ucl.Set(uiCurrentItem, true);
		
	int color_text = UiGetColor(uiColor, uiItem, &ucl, 0x0);
	int color_bg = UiGetColor(uiBackground, uiItem, &ucl, 0xFFFFFF);

	gc.Set(GetFont());
	crect itemRect = ItemRect(n);

	gc.SetFillColor(color_bg);
	if (n == select && InFocus()) gc.FillRect(itemRect);	

	if (n == select) {
		DrawBorder(gc, itemRect, UiGetColor(uiCurrentItemFrame, uiItem, &ucl, 0xFFFFFF));
	}

	gc.SetTextColor( color_text );
	
	const unicode_t *text = list[n].text.ptr();
	cpoint tsize = gc.GetTextExtents(text);
	int x = itemRect.left + (itemRect.Width()-tsize.x)/2;
	int y = itemRect.top + (itemRect.Height()-tsize.y)/2;
	
#ifdef _WIN32	
	gc.TextOut(x,y,text);
#else	
	gc.TextOutF(x,y,text);
#endif	
}
Пример #16
0
/*
 * InactiveWindow - display a window as inactive
 */
void InactiveWindow( window_id wn )
{
    wind        *w;
    vi_color    c;

    if( wn == NO_WINDOW ) {
        return;
    }

    w = Windows[wn];
    if( w == NULL ) {
        return;
    }

    if( !w->has_border ) {
        return;
    }

    /*
     * change the border color
     */
    c = w->border_color1;
    w->border_color1 = EditVars.InactiveWindowColor;
    DrawBorder( wn );
    w->border_color1 = c;

} /* InactiveWindow */
Пример #17
0
void BorderFrame::FramePaint(Draw& draw, const Rect& r)
{
	Size sz = r.GetSize();
	int n = (int)(intptr_t)*border;
	if(sz.cx >= 2 * n && sz.cy >= 2 * n)
		DrawBorder(draw, r.left, r.top, r.Width(), r.Height(), border);
}
Пример #18
0
/***************************************************
OnDraw - overloaded CUGCellType::OnDraw
	Draws the push button in its current state,
	pressed or unpressed.
	The drawing of text is performed using the 
	CUGCellType's DrawText function, therefore it
	has all of the same text capabilities as the
	default celltype.

    **See CUGCellType::OnDraw for more details
	about this function
Params
	dc		- device context to draw the cell with
	rect	- rectangle to draw the cell in
	col		- column that is being drawn
	row		- row that is being drawn
	cell	- cell that is being drawn
	selected- TRUE if the cell is selected, otherwise FALSE
	current - TRUE if the cell is the current cell, otherwise FALSE
Return
	none
****************************************************/
void CUGButtonType::OnDraw(CDC *dc,RECT *rect,int col,long row,
						   CUGCell *cell,int selected,int current)
{
	if (!m_drawThemesSet)
		m_useThemes = cell->UseThemes();
	
	UGXPThemeState state = UGXPThemes::GetState(selected>0, current>0);

	if (m_btnDown && current)
	{
		state = ThemeStatePressed;
	}

	RECT rectout;

	if (m_useThemes && UGXPThemes::DrawBackground(NULL, *dc, XPCellTypeButton, state, rect, NULL))
	{
		UGXPThemes::DrawEdge(NULL, *dc, XPCellTypeButton, state, rect, 0, 0, &rectout);
		cell->SetXPStyle(XPCellTypeButton);
		DrawText(dc,rect,rect->right - rectout.right ,col,row,cell,selected,current);
	}
	else
	{
		//draw the button
		if(m_btnDown && current)
                {
			cell->SetBorder(UG_BDR_RECESSED);
			DrawBorder(dc,rect,&rectout,cell);
		}
		else
                {
			cell->SetBorder(UG_BDR_RAISED);
			DrawBorder(dc,rect,&rectout,cell);
		}
	
	//draw the text in using the default drawing routine
		DrawText(dc,&rectout,0,col,row,cell,selected,current);
	}

	if(cell->IsPropertySet(UGCELL_CELLTYPEEX_SET) && current)
	{
		if(cell->GetCellTypeEx()&UGCT_BUTTONNOFOCUS)
		{
			m_ctrl->TempDisableFocusRect();
		}
	}
}
Пример #19
0
void Graphics::Draw(Automaton &a)
{
    glPushMatrix();
    glTranslatef(dx,dy,0.0);
    DrawWithMap(a);
    DrawBorder();
    glPopMatrix();
}
Пример #20
0
void Graphics::Draw()
{
    glPushMatrix();
    glTranslatef(dx,dy,0.0);
    DrawGrid();
    DrawBorder();
    glPopMatrix();
}
Пример #21
0
void wxStdRenderer::DrawTextBorder(wxDC& dc,
                                   wxBorder border,
                                   const wxRect& rect,
                                   int flags,
                                   wxRect *rectIn)
{
    DrawBorder(dc, border, rect, flags, rectIn);
}
Пример #22
0
void CMeasuredGrid::Draw(Display::IDisplayPtr pDisplay)
{
	IMapGrid::Draw(pDisplay);

	DrawBorder(pDisplay);
	DrawGrid(pDisplay);
	DrawTick(pDisplay);
	DrawLabel(pDisplay);
}
Пример #23
0
FWL_ERR CFWL_CheckBoxImp::DrawWidget(CFX_Graphics* pGraphics,
                                     const CFX_Matrix* pMatrix) {
  if (!pGraphics)
    return FWL_ERR_Indefinite;
  if (!m_pProperties->m_pThemeProvider)
    return FWL_ERR_Indefinite;
  IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
  if (HasBorder()) {
    DrawBorder(pGraphics, FWL_PART_CKB_Border, m_pProperties->m_pThemeProvider,
               pMatrix);
  }
  if (HasEdge()) {
    DrawEdge(pGraphics, FWL_PART_CKB_Edge, pTheme, pMatrix);
  }
  int32_t dwStates = GetPartStates();
  {
    CFWL_ThemeBackground param;
    param.m_pWidget = m_pInterface;
    param.m_iPart = FWL_PART_CKB_Background;
    param.m_dwStates = dwStates;
    param.m_pGraphics = pGraphics;
    if (pMatrix) {
      param.m_matrix.Concat(*pMatrix);
    }
    param.m_rtPart = m_rtClient;
    if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) {
      param.m_pData = &m_rtFocus;
    }
    pTheme->DrawBackground(&param);
    param.m_iPart = FWL_PART_CKB_CheckBox;
    param.m_rtPart = m_rtBox;
    pTheme->DrawBackground(&param);
  }
  if (!m_pProperties->m_pDataProvider)
    return FWL_ERR_Indefinite;
  {
    CFX_WideString wsCaption;
    m_pProperties->m_pDataProvider->GetCaption(m_pInterface, wsCaption);
    int32_t iLen = wsCaption.GetLength();
    if (iLen <= 0)
      return FWL_ERR_Indefinite;
    CFWL_ThemeText textParam;
    textParam.m_pWidget = m_pInterface;
    textParam.m_iPart = FWL_PART_CKB_Caption;
    textParam.m_dwStates = dwStates;
    textParam.m_pGraphics = pGraphics;
    if (pMatrix) {
      textParam.m_matrix.Concat(*pMatrix);
    }
    textParam.m_rtPart = m_rtCaption;
    textParam.m_wsText = wsCaption;
    textParam.m_dwTTOStyles = m_dwTTOStyles;
    textParam.m_iTTOAlign = m_iTTOAlign;
    pTheme->DrawText(&textParam);
  }
  return FWL_ERR_Succeeded;
}
Пример #24
0
void wxStdRenderer::DrawStatusField(wxDC& dc,
                                    const wxRect& rect,
                                    const wxString& label,
                                    int flags,
                                    int style)
{
    wxRect rectIn;

    if ( style == wxSB_RAISED )
        DrawBorder(dc, wxBORDER_RAISED, rect, flags, &rectIn);
    else if ( style != wxSB_FLAT )
        DrawBorder(dc, wxBORDER_STATIC, rect, flags, &rectIn);

    rectIn.Deflate(GetStatusBarFieldMargins());

    wxDCClipper clipper(dc, rectIn);
    DrawLabel(dc, label, rectIn, flags, wxALIGN_LEFT | wxALIGN_CENTRE_VERTICAL);
}
Пример #25
0
/*! Comment       : 
//******************************************************************/
void CCSTMCombo::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	DefWindowProc( WM_PAINT, (WPARAM)dc.GetSafeHdc(), (LPARAM)0 );
	
	DrawBorder(&dc);
	
}
Пример #26
0
static
VOID
DrawProgressBar(
    IN PPROGRESSBAR Bar)
{
    COORD coPos;
    DWORD Written;
    PROGRESSBAR BarBorder = *Bar;
    CHAR TextBuffer[256];

    /* Draw the progress bar "border" border */
    if (Bar->DoubleEdge)
    {
        BarBorder.Top -= 5;
        BarBorder.Bottom += 2;
        BarBorder.Right += 5;
        BarBorder.Left -= 5;
        DrawThickBorder(&BarBorder);
    }

    /* Draw the progress bar border */
    DrawBorder(Bar);

    /* Display the description text */
    if (Bar->DescriptionText)
        CONSOLE_SetTextXY(Bar->TextTop, Bar->TextRight, Bar->DescriptionText);

    /* Always update and display the progress */
    if (Bar->UpdateProgressProc &&
        Bar->UpdateProgressProc(Bar, TRUE, TextBuffer, ARRAYSIZE(TextBuffer)))
    {
        coPos.X = Bar->Left + (Bar->Width - strlen(TextBuffer) + 1) / 2;
        coPos.Y = Bar->Top;
        WriteConsoleOutputCharacterA(StdOutput,
                                     TextBuffer,
                                     strlen(TextBuffer),
                                     coPos,
                                     &Written);
    }

    /* Draw the empty bar */
    coPos.X = Bar->Left + 1;
    for (coPos.Y = Bar->Top + 2; coPos.Y <= Bar->Bottom - 1; coPos.Y++)
    {
        FillConsoleOutputAttribute(StdOutput,
                                   Bar->ProgressColour,
                                   Bar->Width - 2,
                                   coPos,
                                   &Written);

        FillConsoleOutputCharacterA(StdOutput,
                                    ' ',
                                    Bar->Width - 2,
                                    coPos,
                                    &Written);
    }
}
/** draws high score */
void APlatformerHUD::DrawHighscore()
{
	const FText Highscore = LOCTEXT("Highscore", "High score");
	const float SizeX = Canvas->ClipX * 0.4f;
	const float SizeY = 1000 * UIScale;
	const float DrawX = (Canvas->ClipX - SizeX) / 2.0f;
	const float DrawY = (Canvas->ClipY - SizeY) / 2.0f;

	DrawBorder(DrawX, DrawY,  SizeX, SizeY, 1.0f, BlueBorder);

	const float TextScale = 1.4f;
	const float TextMargin = 0.03f;
	float StrSizeX, StrSizeY;
	Canvas->StrLen(HUDFont, Highscore.ToString(), StrSizeX, StrSizeY);
	StrSizeX = StrSizeX * TextScale * UIScale;
	StrSizeY = StrSizeY * TextScale * UIScale;

	FCanvasTextItem TextItem( FVector2D( (Canvas->ClipX - StrSizeX) / 2.0f, DrawY + SizeY * TextMargin ), 
		Highscore, HUDFont, FLinearColor::White );
	TextItem.Scale = FVector2D( TextScale * UIScale, TextScale * UIScale );
	TextItem.EnableShadow( FLinearColor::Transparent );
	Canvas->DrawItem( TextItem );

	const float BorderSize = BlueBorder.LeftBorder->Resource->GetSizeX() * UIScale;
	FCanvasTileItem TileItem(FVector2D(  DrawX + BorderSize, DrawY + SizeY * TextMargin + StrSizeY ), BlueBorder.TopBorder->Resource, 
		FVector2D( SizeX - 2* BorderSize, BlueBorder.TopBorder->Resource->GetSizeY() * UIScale ),
		FVector2D(0,0),FVector2D((SizeX - 2* BorderSize) / BlueBorder.TopBorder->Resource->GetSizeX() * UIScale,1), FLinearColor::White);
	TileItem.BlendMode = SE_BLEND_Translucent;
	Canvas->DrawItem(TileItem);


	const float StartY = DrawY + SizeY * TextMargin*3 + StrSizeY * TextScale * UIScale;

	const float ColWidths[] = {70*UIScale, 340*UIScale, 200*UIScale};
	
	const float TotalWidth = ColWidths[0]+ColWidths[1]+ColWidths[2];

	for (int32 i=0; i < 10; i++ )
	{
		FText Texts[] = { FText::Format(FText::FromString("{0}."), FText::AsNumber(i+1)),
			FText::FromString(UPlatformerBlueprintLibrary::DescribeTime(HighscoreTimes[i], false)),
			FText::FromString(HighscoreNames[i]) };
		float Offset = 0;
		for (uint8 column=0; column < 3; column++)
		{
			TextItem.Text = Texts[column]; 
			Canvas->StrLen(HUDFont, TextItem.Text.ToString(), StrSizeX, StrSizeY);
			StrSizeX = StrSizeX * TextScale * UIScale;
			StrSizeY = StrSizeY * TextScale * UIScale;
			TextItem.Position = FVector2D((Canvas->ClipX - TotalWidth) / 2.0f + Offset + ColWidths[column] - StrSizeX, StartY + i * StrSizeY);
			Canvas->DrawItem( TextItem );
			Offset += ColWidths[column];
		}

	}

}
Пример #28
0
/** Set the active client. */
void FocusClient(ClientNode *np)
{
   if(np->state.status & STAT_HIDDEN) {
      return;
   }
   if(!(np->state.status & (STAT_CANFOCUS | STAT_TAKEFOCUS))) {
      return;
   }

   if(activeClient != np || !(np->state.status & STAT_ACTIVE)) {

      if(activeClient) {
         activeClient->state.status &= ~STAT_ACTIVE;
         if(!(activeClient->state.status & STAT_OPACITY)) {
            SetOpacity(activeClient, settings.inactiveClientOpacity, 0);
         }
         DrawBorder(activeClient);
      }
      np->state.status |= STAT_ACTIVE;
      activeClient = np;
      if(!(np->state.status & STAT_OPACITY)) {
         SetOpacity(np, settings.activeClientOpacity, 0);
      }

      DrawBorder(np);
      RequirePagerUpdate();
      RequireTaskUpdate();

   }

   if(np->state.status & STAT_MAPPED) {
      UpdateClientColormap(np);
      SetWindowAtom(rootWindow, ATOM_NET_ACTIVE_WINDOW, np->window);
      if(np->state.status & STAT_CANFOCUS) {
         JXSetInputFocus(display, np->window, RevertToParent, eventTime);
      }
      if(np->state.status & STAT_TAKEFOCUS) {
         SendClientMessage(np->window, ATOM_WM_PROTOCOLS, ATOM_WM_TAKE_FOCUS);
      }
   } else {
      JXSetInputFocus(display, rootWindow, RevertToParent, eventTime);
   }

}
Пример #29
0
void CDreamSkinWindow::DrawItem(HDC hDC, SKINITEM *pItem, RECT rcItem, WCHAR *wstrTitle)
{
	RECT rcClient = GetItemRectClient(pItem, rcItem);
	DrawBackground(hDC, rcItem, &pItem->skinBk);

	DrawBorder(hDC, &pItem->skinLBorder, &pItem->skinRBorder, &pItem->skinTBorder, &pItem->skinBBorder, rcItem);

	if (wstrTitle)
		DrawTitle(hDC, &pItem->skinTxt, rcClient, wstrTitle);
}
Пример #30
0
void byoSnake::OnPaint(wxPaintEvent& event)
{
    wxSize size = GetClientSize();
    wxBitmap buffer(wxImage(size.GetWidth(),size.GetHeight()));
    wxBufferedPaintDC DC(this,buffer);
    DrawBorder(&DC);
    DrawSnake(&DC);
    DrawApple(&DC);
    DrawStats(&DC);
}