void DashboardInstrument_BaroHistory::Draw(wxGCDC* dc)
{
   m_WindowRect = GetClientRect();
   m_DrawAreaRect=GetClientRect();
   m_DrawAreaRect.SetHeight(m_WindowRect.height-m_TopLineHeight-m_TitleHeight);
   m_DrawAreaRect.SetX (m_LeftLegend+3);
   DrawBackground(dc);
   DrawForeground(dc);
}
Exemple #2
0
void
BitmapView::Draw(BRect updateRect)
{
	BRect bounds(Bounds());
	DrawBackground(bounds, updateRect);

	if (fBitmap == NULL)
		return;

	BRect bitmapBounds = fBitmap->Bounds();
	if (bitmapBounds.Width() <= 0.0f || bitmapBounds.Height() <= 0.0f)
		return;

	float scale = 1.0f;

	if (fScaleBitmap) {
		float hScale = bounds.Width() / bitmapBounds.Width();
		float vScale = bounds.Height() / bitmapBounds.Height();

		scale = std::min(hScale, vScale);
	}

	float width = bitmapBounds.Width() * scale;
	float height = bitmapBounds.Height() * scale;

	switch (LayoutAlignment().horizontal) {
		case B_ALIGN_LEFT:
			break;
		case B_ALIGN_RIGHT:
			bounds.left = floorf(bounds.right - width);
			break;
		default:
		case B_ALIGN_HORIZONTAL_CENTER:
			bounds.left = floorf(bounds.left
				+ (bounds.Width() - width) / 2.0f);
			break;
	}
	switch (LayoutAlignment().vertical) {
		case B_ALIGN_TOP:
			break;
		case B_ALIGN_BOTTOM:
			bounds.top = floorf(bounds.bottom - height);
			break;
		default:
		case B_ALIGN_VERTICAL_CENTER:
			bounds.top = floorf(bounds.top
				+ (bounds.Height() - height) / 2.0f);
			break;
	}

	bounds.right = ceilf(bounds.left + width);
	bounds.bottom = ceilf(bounds.top + height);

	SetDrawingMode(B_OP_OVER);
	DrawBitmap(fBitmap, bitmapBounds, bounds, B_FILTER_BITMAP_BILINEAR);
}
Exemple #3
0
void TitleScreenOutputFrame(void)
{
	DrawBackground(&BG, 0);

	HighScoreDisplayDraw(&HSD);

	for (int i = 0; i < MAX_PLAYERS; i++)
	{
		Tex t = GetControlTex(i);
		SDL_Rect dest =
		{
			SCREEN_X((i + 1) * FIELD_WIDTH / (MAX_PLAYERS + 1)) -
				t.W / 2,
			(SCREEN_HEIGHT - t.H) / 2 - SCREEN_X(PLAYER_RADIUS),
			t.W, t.H
		};
		RenderTex(t.T, NULL, &dest);
	}

	for (int i = 0; i < MAX_PLAYERS; i++)
	{
		PlayerDraw(&players[i], 0);
	}

	for (int i = 0; i < MAX_PLAYERS; i++)
	{
		BlockDraw(&blocks[i], 0);
	}

	DrawTitleImg();
	// Draw player icons if winners
	if (!Start)
	{
		const int left =
			(SCREEN_WIDTH - PLAYER_SPRITESHEET_WIDTH * winners) / 2;
		for (int i = 0; i < winners; i++)
		{
			const int playerIndex = winnerIndices[i];
			SDL_Rect src = {
				0, 0, PLAYER_SPRITESHEET_WIDTH, PLAYER_SPRITESHEET_HEIGHT
			};
			SDL_Rect dest =
			{
				left + i * PLAYER_SPRITESHEET_WIDTH,
				SCREEN_HEIGHT * 0.66f,
				src.w, src.h
			};
			RenderTex(PlayerSpritesheets[playerIndex].T, &src, &dest);
		}
	}
	SDL_Color c = { 177, 177, 177, 255 };
	TextRenderCentered(
		font, WelcomeMessage, (int)(SCREEN_HEIGHT * 0.75f), c);

	SDL_RenderPresent(Renderer);
}
Exemple #4
0
void InGameMenuScreen::render() {
	UIShader_Prepare();
	UIBegin();
	DrawBackground(1.0f);

	const char *title;
	if (UTF8StringHasNonASCII(game_title.c_str())) {
		title = "(can't display japanese title)";
	} else {
		title = game_title.c_str();
	}

	ui_draw2d.DrawText(UBUNTU48, title, dp_xres / 2, 30, 0xFFFFFFFF, ALIGN_HCENTER);

	int x = 30;
	int y = 50;
	UICheckBox(GEN_ID, x, y += 50, "Show Debug Statistics", ALIGN_TOPLEFT, &g_Config.bShowDebugStats);
	UICheckBox(GEN_ID, x, y += 50, "Show FPS", ALIGN_TOPLEFT, &g_Config.bShowFPSCounter);

	// TODO: Maybe shouldn't show this if the screen ratios are very close...
	UICheckBox(GEN_ID, x, y += 50, "Stretch to display", ALIGN_TOPLEFT, &g_Config.bStretchToDisplay);

	UICheckBox(GEN_ID, x, y += 50, "Hardware Transform", ALIGN_TOPLEFT, &g_Config.bHardwareTransform);
	bool fs = g_Config.iFrameSkip == 1;
	UICheckBox(GEN_ID, x, y += 50, "Frameskip", ALIGN_TOPLEFT, &fs);
	g_Config.iFrameSkip = fs ? 1 : 0;

	// TODO: Add UI for more than one slot.
	HLinear hlinear1(x, y + 80, 20);
	if (UIButton(GEN_ID, hlinear1, LARGE_BUTTON_WIDTH, "Save State", ALIGN_LEFT)) {
		SaveState::SaveSlot(0, 0, 0);
		screenManager()->finishDialog(this, DR_CANCEL);
	}
	if (UIButton(GEN_ID, hlinear1, LARGE_BUTTON_WIDTH, "Load State", ALIGN_LEFT)) {
		SaveState::LoadSlot(0, 0, 0);
		screenManager()->finishDialog(this, DR_CANCEL);
	}

	VLinear vlinear(dp_xres - 10, 160, 20);
	if (UIButton(GEN_ID, vlinear, LARGE_BUTTON_WIDTH, "Continue", ALIGN_RIGHT)) {
		screenManager()->finishDialog(this, DR_CANCEL);
	}
	if (UIButton(GEN_ID, vlinear, LARGE_BUTTON_WIDTH, "Return to Menu", ALIGN_RIGHT)) {
		screenManager()->finishDialog(this, DR_OK);
	}
	
	if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres - 10), LARGE_BUTTON_WIDTH*2, "Debug: Dump Next Frame", ALIGN_BOTTOMRIGHT)) {
		gpu->DumpNextFrame();
	}

	DrawWatermark();
	UIEnd();

	glsl_bind(UIShader_Get());
	ui_draw2d.Flush(UIShader_Get());
}
void DrawHighlightedButton(buttonT & button) {
    SetPenColor("ACTIVATED_BACKGROUND");
    DrawBackground(button);
    SetPenColor("ACTIVATED_INNERSHADE");
    DrawInnerShade(button);
    SetPenColor("ACTIVATED_BORDER");
    DrawOutline(button);
    SetPenColor("ACTIVATED_TEXT");
    DrawButtonText(button);
}
Exemple #6
0
void TacticsInstrument_WindDirHistory::Draw(wxGCDC* dc)
{
    m_WindowRect = GetClientRect();
    m_DrawAreaRect = GetClientRect();
    m_DrawAreaRect.SetHeight(m_WindowRect.height - m_TopLineHeight - m_TitleHeight);
    m_DrawAreaRect.SetX(m_LeftLegend + 3);
//  wxLogMessage("WindHist: m_WindowRect.height=%d,m_DrawAreaRect.height=%d,m_TopLineHeight=%d,m_TitleHeight=%d", m_WindowRect.height, m_DrawAreaRect.height, m_TopLineHeight, m_TitleHeight);
    DrawBackground(dc);
    DrawForeground(dc);
}
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);
}
void GBDebuggerView::Draw() {
	UpdateTarget();
	DrawBackground();
	GBRect box;
	if ( ! target ) {
		DrawStringLeft("No robot selected", 4, 20, 12);
		box.top = kEdgeSpace;
		box.bottom = box.top + kProfileBoxHeight;
		box.right = Width() - kEdgeSpace;
		box.left = box.right - kProfileBoxWidth;
		DrawProfileBox(box);
	} else {
	// draw robot name
		box.left = box.top = kEdgeSpace;
		box.right = Width() - kEdgeSpace;
		box.bottom = box.top + kStatusBoxHeight;
		DrawStatusBox(box);
	// get brain
		const GBStackBrain * sbrain = dynamic_cast<GBStackBrain *>(target->Brain());
		if ( sbrain ) {
		// draw pc
			box.top = box.bottom + kEdgeSpace;
			box.bottom = box.top + kPCBoxHeight;
			box.right -= kHardwareBoxWidth + kEdgeSpace;
			DrawPCBox(box, sbrain);
		// draw stack
			box.top = box.bottom + kEdgeSpace;
			box.bottom = box.top + kStackBoxHeight;
			box.right = (Width() - kHardwareBoxWidth - kEdgeSpace) / 2;
			DrawStackBox(box, sbrain);
		// draw return stack
			box.left = (Width() - kHardwareBoxWidth + kEdgeSpace) / 2;
			box.right = Width() - kHardwareBoxWidth - kEdgeSpace * 2;
			DrawReturnStackBox(box, sbrain);
		// draw variables
			box.top = box.bottom + kEdgeSpace;
			box.bottom = box.top + (sbrain->NumVariables() + sbrain->NumVectorVariables()) * 10 + 15;
			box.left = kEdgeSpace;
			DrawVariablesBox(box, sbrain);
		// draw prints
			box.top = box.bottom + kEdgeSpace;
			box.bottom = box.top + kPrintBoxHeight;
			DrawPrintBox(box, sbrain);
		}
	// draw hardware
		box.top = kStatusBoxHeight + kEdgeSpace * 2;
		box.right = Width() - kEdgeSpace;
		box.left = box.right - kHardwareBoxWidth;
		box.bottom = box.top + kHardwareBoxHeight;
		DrawHardwareBox(box);
	}
// record
	worldChanges = world.ChangeCount();
	redrawAnyway = false;
}
Exemple #9
0
void SystemScreen::render() {
	UIShader_Prepare();
	UIBegin(UIShader_Get());
	DrawBackground(1.0f);

	I18NCategory *s = GetI18NCategory("System");
	I18NCategory *g = GetI18NCategory("General");

	ui_draw2d.SetFontScale(1.5f, 1.5f);
	ui_draw2d.DrawText(UBUNTU24, s->T("System Settings"), dp_xres / 2, 20, 0xFFFFFFFF, ALIGN_HCENTER);
	ui_draw2d.SetFontScale(1.0f, 1.0f);

	if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres-10), LARGE_BUTTON_WIDTH, 0, g->T("Back"), ALIGN_RIGHT | ALIGN_BOTTOM)) {
		screenManager()->finishDialog(this, DR_OK);
	}

	int x = 30;
	int y = 30;
	int stride = 40;
	int columnw = 400;

	UICheckBox(GEN_ID, x, y += stride, s->T("Dynarec", "Dynarec (JIT)"), ALIGN_TOPLEFT, &g_Config.bJit);
	if (g_Config.bJit)
		UICheckBox(GEN_ID, x, y += stride, s->T("Fast Memory", "Fast Memory (unstable)"), ALIGN_TOPLEFT, &g_Config.bFastMemory);
	UICheckBox(GEN_ID, x, y += stride, s->T("Show Debug Statistics"), ALIGN_TOPLEFT, &g_Config.bShowDebugStats);
	UICheckBox(GEN_ID, x, y += stride, s->T("Show FPS"), ALIGN_TOPLEFT, &g_Config.bShowFPSCounter);

	VGrid vlang(530, 100, dp_yres - 50, 10, 10);

	for (size_t i = 0; i < langs_.size(); i++) {
		std::string code;
		size_t dot = langs_[i].name.find('.');
		if (dot != std::string::npos)
			code = langs_[i].name.substr(0, dot);

		std::string buttonTitle = langs_[i].name;
		if (!code.empty())
			buttonTitle = code;

		if (UIButton(GEN_ID_LOOP(i), vlang, LARGE_BUTTON_WIDTH, 0, buttonTitle.c_str(), ALIGN_TOPLEFT)) {
			std::string oldLang = g_Config.languageIni;
			g_Config.languageIni = code;
			if (i18nrepo.LoadIni(g_Config.languageIni)) {
				// Dunno what else to do here.

				// After this, g and s are no longer valid. Let's return, some flicker is okay.
				g = GetI18NCategory("General");
				s = GetI18NCategory("System");
			} else {
				g_Config.languageIni = oldLang;
			}
		}
	}
	UIEnd();
}
Exemple #10
0
void DeveloperScreen::render() {
	UIShader_Prepare();
	UIBegin(UIShader_Get());
	DrawBackground(1.0f);

	I18NCategory *g = GetI18NCategory("General");
	I18NCategory *d = GetI18NCategory("Developer");
	I18NCategory *s = GetI18NCategory("System");

	ui_draw2d.SetFontScale(1.5f, 1.5f);
	ui_draw2d.DrawText(UBUNTU24, d->T("Developer Tools"), dp_xres / 2, 10, 0xFFFFFFFF, ALIGN_HCENTER);
	ui_draw2d.SetFontScale(1.0f, 1.0f);

	int x = 50;
	int y = 40;
	const int stride = 40;
	const int w = 400;

	UICheckBox(GEN_ID, x, y += stride, s->T("Show Debug Statistics"), ALIGN_TOPLEFT, &g_Config.bShowDebugStats);

	bool reportingEnabled = Reporting::IsEnabled();
	const static std::string reportHostOfficial = "report.ppsspp.org";
	if (UICheckBox(GEN_ID, x, y += stride, s->T("Enable Compatibility Server Reports"), ALIGN_TOPLEFT, &reportingEnabled)) {
		g_Config.sReportHost = reportingEnabled ? reportHostOfficial : "";
	}

	VLinear vlinear(x, y + stride + 12, 16);

	if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres - 10), LARGE_BUTTON_WIDTH, 0, g->T("Back"), ALIGN_RIGHT | ALIGN_BOTTOM)) {
		screenManager()->finishDialog(this, DR_OK);
	}

	if (UIButton(GEN_ID, vlinear, w, 0, d->T("Load language ini"), ALIGN_LEFT)) {
		i18nrepo.LoadIni(g_Config.languageIni);
		// After this, g and s are no longer valid. Need to reload them.
		g = GetI18NCategory("General");
		d = GetI18NCategory("Developer");
	}

	if (UIButton(GEN_ID, vlinear, w, 0, d->T("Save language ini"), ALIGN_LEFT)) {
		i18nrepo.SaveIni(g_Config.languageIni);	
	}

	if (UIButton(GEN_ID, vlinear, w, 0, d->T("Run CPU tests"), ALIGN_LEFT)) {
		// TODO: Run tests
		RunTests();
		// screenManager()->push(new EmuScreen())
	}

	if (UIButton(GEN_ID, vlinear, w, 0, d->T("Dump frame to log"), ALIGN_LEFT)) {
		gpu->DumpNextFrame();
	}

	UIEnd();
}
Exemple #11
0
void CBarGraphEditor::OnPaint()
{
	ASSERT(m_pBackDC != NULL);

	CPaintDC dc(this);
	
	DrawBackground(m_pBackDC, m_iLevels, false, 0);
	DrawRange(m_pBackDC, m_iLevels, 0);

	// Return now if no sequence is selected
	if (!m_pSequence) {
		PaintBuffer(m_pBackDC, &dc);
		return;
	}

	// Draw items
	int Count = m_pSequence->GetItemCount();

	if (!Count) {
		PaintBuffer(m_pBackDC, &dc);
		return;
	}

	int StepWidth = GetItemWidth();
	int StepHeight = m_GraphRect.Height() / m_iLevels;

	if (m_iHighlightedValue > 0 && m_iHighlightedItem >= 0 && m_iHighlightedItem < Count) {
		int x = m_GraphRect.left + m_iHighlightedItem * StepWidth + 1;
		int y = m_GraphRect.top + StepHeight * (m_iLevels - m_iHighlightedValue);
		int w = StepWidth;
		int h = StepHeight * m_iHighlightedValue;
		DrawShadowRect(m_pBackDC, x, y, w, h);
	}

	// Draw items
	for (int i = 0; i < Count; i++) {
		int x = m_GraphRect.left + i * StepWidth + 1;
		int y = m_GraphRect.top + StepHeight * (m_iLevels - m_pSequence->GetItem(i));
		int w = StepWidth;
		int h = StepHeight * m_pSequence->GetItem(i);

		if (m_iCurrentPlayPos == i)
			DrawPlayRect(m_pBackDC, x, y, w, h);
		else if ((m_iHighlightedItem == i) && (m_pSequence->GetItem(i) >= m_iHighlightedValue) && !IsEditLine())
			DrawCursorRect(m_pBackDC, x, y, w, h);
		else
			DrawRect(m_pBackDC, x, y, w, h);
	}
	
	DrawLoopPoint(m_pBackDC, StepWidth);
	DrawReleasePoint(m_pBackDC, StepWidth);
	DrawLine(m_pBackDC);

	PaintBuffer(m_pBackDC, &dc);
}
Exemple #12
0
void GameOutputFrame(void)
{
	const float screenYOff =
		(float)MAX(-SCREEN_HEIGHT, SCREEN_Y(camera.Y) - SCREEN_HEIGHT / 2);
	// Draw the background.
	DrawBackground(&BG, screenYOff);

	SpaceDraw(&space, screenYOff);
	PickupsDraw(Screen, screenYOff);
	ParticlesDraw(Screen, screenYOff);

	int c = 0;
	for (int i = 0; i < MAX_PLAYERS; i++)
	{
		PlayerDraw(&players[i], screenYOff);

		if (!players[i].Enabled) continue;

		// Draw each player's current score.
		char buf[17];
		sprintf(buf, "%d", players[i].Score);
		const SDL_Color white = { 255, 255, 255, 255 };
#ifdef TTF
		SDL_Surface *t = TTF_RenderText_Blended(font, buf, white);
#endif
		const int x = (c + 1) * SCREEN_WIDTH / (PlayerEnabledCount() + 1);
#ifdef TTF
		const int wHalf = (t->w + PLAYER_SPRITESHEET_WIDTH) / 2;
#else
		const int wHalf = (16 + PLAYER_SPRITESHEET_WIDTH) / 2;
#endif
		// Draw the player icon, followed by the score number
		SDL_Rect src = {
			0, 0, PLAYER_SPRITESHEET_WIDTH, PLAYER_SPRITESHEET_HEIGHT
		};
		SDL_Rect dest = { (Sint16)(x - wHalf), 0, 0, 0 };
		SDL_BlitSurface(PlayerSpritesheets[i], &src, Screen, &dest);
		// Draw score number
		dest.x = (Sint16)(x - wHalf + PLAYER_SPRITESHEET_WIDTH);
#ifdef TTF
		dest.y = (Sint16)(PLAYER_SPRITESHEET_HEIGHT - t->h) / 2;
#else
		dest.y = (Sint16)(PLAYER_SPRITESHEET_HEIGHT - 16) / 2;
#endif
		
#ifdef TTF
		SDL_BlitSurface(t, NULL, Screen, &dest);
		SDL_FreeSurface(t);
#endif

		c++;
	}

	SDL_Flip(Screen);
}
void ControlToolBar::OnPaint(wxPaintEvent & evt)
{
   wxPaintDC dc(this);

   int width, height;
   GetSize(&width, &height);


   #if defined __WXMAC__
      // Mac has an Aqua background...
      DrawBackground(dc, width, height); 
   #else
      if (mShowTools)
      {
         //TODO: Get rid of all the magic numbers used in sizing.
         // On other platforms put the big buttons on a beveled platform.
         DrawBackground(dc, 81, height);
         // Width is reduced by an extra two pixels to visually separate
         // the control toolbar from the next grab bar on the right.
         wxRect bevelRect( 81, 0, width-84, height-1 );
         AColor::Bevel( dc, true, bevelRect );
      }
      else
      {
         DrawBackground(dc, width, height); 
         wxRect bevelRect(0, 0, width - 1, height - 1);
         AColor::Bevel(dc, true, bevelRect);
      }
   #endif

   #ifndef __WXMAC__
      if (mShowTools)
      {
         // JKC: Grey horizontal spacer line between buttons.
         // Not quite ideal, but seems the best solution to 
         // make the tool button heights add up to the 
         // main control button height.
         AColor::Dark( &dc, false);
         dc.DrawLine(0, 27, 81, 27);
      }
   #endif
}
Exemple #14
0
VOID EraseScreen(VOID)
{
    RC rc;
    HDC HdcSet();

    if(!FGetHdc())
        return;
    GetClientRect(hwndApp, (LPRECT) &rc);
    DrawBackground(rc.xLeft, rc.yTop, rc.xRight, rc.yBot);
    ReleaseHdc();
}
Exemple #15
0
void JMChattControl::SetBackImage(Bitmap* strImageFileName, bool bRedraw)
{

	__stScreenInfo.pBitmapBackground = strImageFileName;


	DrawBackground(__pCanvasBack);

	if( bRedraw )
		this->RequestRedraw();
}
void CSpaceInvadersAppView::Draw( const TRect& /*aRect*/ ) const
{
    // Get the standard graphics context
    CWindowGc& gc = SystemGc();
    DrawBackground(gc);
    DrawShip(gc);
    DrawAliens(gc);
    DrawPoints(gc);
    DrawQuitCommand(gc);

}
Exemple #17
0
void UpdateDisplay() {
    glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    DrawBackground();
    DrawGrid(game->GetGrid(), game->GetTextures());
    DrawTetromino(game->GetGrid(), game->GetTetromino(), game->GetTextures());
    DrawPreview();
    DrawText();
}
Exemple #18
0
void SystemScreen::render() {
	UIShader_Prepare();
	UIBegin(UIShader_Get());
	DrawBackground(1.0f);

	I18NCategory *s = GetI18NCategory("System");
	I18NCategory *g = GetI18NCategory("General");

	ui_draw2d.SetFontScale(1.5f, 1.5f);
	ui_draw2d.DrawText(UBUNTU24, s->T("System Settings"), dp_xres / 2, 10, 0xFFFFFFFF, ALIGN_HCENTER);
	ui_draw2d.SetFontScale(1.0f, 1.0f);

	if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres - 10), LARGE_BUTTON_WIDTH, 0, g->T("Back"), ALIGN_RIGHT | ALIGN_BOTTOM)) {
		screenManager()->finishDialog(this, DR_OK);
	}

	int x = 30;
	int y = 30;
	int stride = 40;
	int columnw = 400;

#ifdef IOS
	if(!isJailed)
		UICheckBox(GEN_ID, x, y += stride, s->T("Dynarec", "Dynarec (JIT)"), ALIGN_TOPLEFT, &g_Config.bJit);
	else
	{
		UICheckBox(GEN_ID, x, y += stride, s->T("DynarecisJailed", "Dynarec (JIT) - (Not jailbroken - JIT not available)"), ALIGN_TOPLEFT, &g_Config.bJit);
		g_Config.bJit = false;
	}
#else
	UICheckBox(GEN_ID, x, y += stride, s->T("Dynarec", "Dynarec (JIT)"), ALIGN_TOPLEFT, &g_Config.bJit);
#endif
	if (g_Config.bJit)
		UICheckBox(GEN_ID, x, y += stride, s->T("Fast Memory", "Fast Memory (unstable)"), ALIGN_TOPLEFT, &g_Config.bFastMemory);
	UICheckBox(GEN_ID, x, y += stride, s->T("Show Debug Statistics"), ALIGN_TOPLEFT, &g_Config.bShowDebugStats);
	UICheckBox(GEN_ID, x, y += stride, s->T("Show FPS"), ALIGN_TOPLEFT, &g_Config.bShowFPSCounter);
	UICheckBox(GEN_ID, x, y += stride, s->T("Encrypt Save"), ALIGN_TOPLEFT, &g_Config.bEncryptSave);
	UICheckBox(GEN_ID, x, y += stride, s->T("Use Button X to Confirm"), ALIGN_TOPLEFT, &g_Config.bButtonPreference); 
	bool tf = g_Config.itimeformat == 1;
	if (UICheckBox(GEN_ID, x, y += stride, s->T("12HR Time Format"), ALIGN_TOPLEFT, &tf)) {
		g_Config.itimeformat = tf ? 1 : 0;
	}

	bool reportingEnabled = Reporting::IsEnabled();
	const static std::string reportHostOfficial = "report.ppsspp.org";
	if (UICheckBox(GEN_ID, x, y += stride, s->T("Enable Compatibility Server Reports"), ALIGN_TOPLEFT, &reportingEnabled)) {
		g_Config.sReportHost = reportingEnabled ? reportHostOfficial : "";
	}

	if (UIButton(GEN_ID, Pos(x, y += stride * 3), LARGE_BUTTON_WIDTH, 0, s->T("Language"), ALIGN_BOTTOMLEFT)) {
		screenManager()->push(new LanguageScreen());
	}
	UIEnd();
}
// 初始化窗口背景皮肤(加载到背景内存dc)
void CDuiVisionDesignerView::InitWindowBkSkin()
{
	m_strBkImg = _T("skin:");

	int nType = 0;
	COLORREF clr = RGB(0,0,0);
	CString strImgFile = _T("");

	BOOL bRet = TRUE;
	if(!m_strBkImg.IsEmpty())	// 如果窗口设置了背景图片属性,就用此背景图片
	{
		// 通过Skin读取
		if(m_strBkImg.Find(_T("skin:")) == 0)
		{
			strImgFile = GetDuiVisionPluginPath() + _T("bkimg\\SKIN_PIC_0.png");//DuiSystem::Instance()->GetSkin(m_strBkImg);
		}else
		{
			strImgFile = m_strBkImg;
		}

		if(strImgFile.Find(_T(".")) != -1)	// 加载图片文件
		{
			nType = BKTYPE_IMAGE_FILE;
		}
	}else
	if(m_crlBack != RGB(0,0,0))	// 如果窗口设置了背景颜色属性,就用此背景颜色
	{
		nType = BKTYPE_COLOR;
		clr = m_crlBack;
	}else
	{
		// 调用DuiSystem从应用程序获取背景信息
		bRet = FALSE;//DuiSystem::Instance()->GetWindowBkInfo(nType, nIDResource, clr, strImgFile);
	}

	// 设置窗口背景皮肤
	if(bRet)
	{
		if(nType == BKTYPE_COLOR)	// 颜色
		{
			DrawBackground(clr);
		}else
		if(nType == BKTYPE_IMAGE_FILE)	// 图片文件
		{
			LoadBackgroundImage(strImgFile);
		}
	}else
	{
		// 默认加载第一张背景图片
		strImgFile = GetDuiVisionPluginPath() + _T("bkimg\\SKIN_PIC_0.png");//DuiSystem::Instance()->GetSkin(_T("SKIN_PIC_0"));
		LoadBackgroundImage(strImgFile);
	}
}
Exemple #20
0
Control* Window::RemoveControl(unsigned short i)
{
	if (i < Controls.size() ) {
		Control *ctrl = Controls[i];
		const Region& frame = ctrl->ControlFrame();
		DrawBackground(&frame); // paint over the spot the control occupied
		Controls.erase(Controls.begin()+i);
		ControlRemoved(ctrl);
		return ctrl;
	}
	return NULL;
}
void CDepartmentEstimationDialog::OnPaint()
{
	CPaintDC dc(this);

	DrawBackground(dc);
	DrawEstablishment(dc);
	DrawDepartmentsUserIsIn(dc);//DrawUserPositions(dc);
	DrawDepartments(dc);
	DrawSensors(dc);

	CTabDlg::OnPaint();
}
Exemple #22
0
void SystemScreen::render() {
	UIShader_Prepare();
	UIBegin(UIShader_Get());
	DrawBackground(1.0f);

	I18NCategory *s = GetI18NCategory("System");
	I18NCategory *g = GetI18NCategory("General");

	ui_draw2d.SetFontScale(1.5f, 1.5f);
	ui_draw2d.DrawText(UBUNTU24, s->T("System Settings"), dp_xres / 2, 10, 0xFFFFFFFF, ALIGN_HCENTER);
	ui_draw2d.SetFontScale(1.0f, 1.0f);

	if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres - 10), LARGE_BUTTON_WIDTH, 0, g->T("Back"), ALIGN_RIGHT | ALIGN_BOTTOM)) {
		screenManager()->finishDialog(this, DR_OK);
	}

	int x = 30;
	int y = 35;
	int stride = 40;
	int columnw = 400;

#ifdef IOS
	if(!isJailed)
		UICheckBox(GEN_ID, x, y += stride, s->T("Dynarec", "Dynarec (JIT)"), ALIGN_TOPLEFT, &g_Config.bJit);
	else
	{
		UICheckBox(GEN_ID, x, y += stride, s->T("DynarecisJailed", "Dynarec (JIT) - (Not jailbroken - JIT not available)"), ALIGN_TOPLEFT, &g_Config.bJit);
		g_Config.bJit = false;
	}
#else
	UICheckBox(GEN_ID, x, y += stride, s->T("Dynarec", "Dynarec (JIT)"), ALIGN_TOPLEFT, &g_Config.bJit);
#endif
	if (g_Config.bJit)
		UICheckBox(GEN_ID, x, y += stride, s->T("Fast Memory", "Fast Memory (unstable)"), ALIGN_TOPLEFT, &g_Config.bFastMemory);
	UICheckBox(GEN_ID, x, y += stride, s->T("Show FPS"), ALIGN_TOPLEFT, &g_Config.bShowFPSCounter);
	UICheckBox(GEN_ID, x, y += stride, s->T("Encrypt Save"), ALIGN_TOPLEFT, &g_Config.bEncryptSave);
	UICheckBox(GEN_ID, x, y += stride, s->T("Use Button X to Confirm"), ALIGN_TOPLEFT, &g_Config.bButtonPreference); 
	bool tf = g_Config.itimeformat == 1;
	if (UICheckBox(GEN_ID, x, y += stride, s->T("12HR Time Format"), ALIGN_TOPLEFT, &tf)) {
		g_Config.itimeformat = tf ? 1 : 0;
	}
	UICheckBox(GEN_ID, x, y += stride, s->T("Enable Cheats"), ALIGN_TOPLEFT, &g_Config.bEnableCheats);
	HLinear hlinear2(x, y += stride + 10, 20);
	if (UIButton(GEN_ID, hlinear2, LARGE_BUTTON_WIDTH + 150, 0, s->T("Reload Cheats"), ALIGN_TOPLEFT)) {
		g_Config.bReloadCheats = true;
	}
	if (UIButton(GEN_ID, hlinear2, LARGE_BUTTON_WIDTH, 0, s->T("Language"), ALIGN_TOPLEFT)) {
		screenManager()->push(new LanguageScreen());
	} 
	
	UIEnd();
}
Exemple #23
0
void GraphicsScreenP1::render() {
	UIShader_Prepare();
	UIBegin(UIShader_Get());
	DrawBackground(1.0f);

	I18NCategory *g = GetI18NCategory("General");
	I18NCategory *gs = GetI18NCategory("Graphics");

	ui_draw2d.SetFontScale(1.5f, 1.5f);
	ui_draw2d.DrawText(UBUNTU24, gs->T("Graphics Settings"), dp_xres / 2, 10, 0xFFFFFFFF, ALIGN_HCENTER);
	ui_draw2d.SetFontScale(1.0f, 1.0f);

	if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres - 10), LARGE_BUTTON_WIDTH, 0, g->T("Back"), ALIGN_BOTTOMRIGHT)) {
		screenManager()->finishDialog(this, DR_OK);
	}

	HLinear hlinear(10, dp_yres - 10, 20.0f);
	if (UIButton(GEN_ID, hlinear, LARGE_BUTTON_WIDTH + 10, 0, g->T("Prev Page"), ALIGN_BOTTOMLEFT)) {
		screenManager()->switchScreen(new GraphicsScreenP3());
	}
	if (UIButton(GEN_ID, hlinear, LARGE_BUTTON_WIDTH + 10, 0, g->T("Next Page"), ALIGN_BOTTOMLEFT)) {
		screenManager()->switchScreen(new GraphicsScreenP2());
	}

	int x = 30;
	int y = 35;
	int stride = 40;
	int columnw = 400;

	UICheckBox(GEN_ID, x, y += stride, gs->T("Media Engine"), ALIGN_TOPLEFT, &g_Config.bUseMediaEngine);
#ifndef __SYMBIAN32__
	UICheckBox(GEN_ID, x, y += stride, gs->T("Hardware Transform"), ALIGN_TOPLEFT, &g_Config.bHardwareTransform);
#endif
	UICheckBox(GEN_ID, x, y += stride, gs->T("Vertex Cache"), ALIGN_TOPLEFT, &g_Config.bVertexCache);
#ifndef __SYMBIAN32__
	UICheckBox(GEN_ID, x, y += stride, gs->T("Stream VBO"), ALIGN_TOPLEFT, &g_Config.bUseVBO);
#endif
	UICheckBox(GEN_ID, x, y += stride, gs->T("Mipmapping"), ALIGN_TOPLEFT, &g_Config.bMipMap);
	UICheckBox(GEN_ID, x, y += stride, gs->T("Display Raw Framebuffer"), ALIGN_TOPLEFT, &g_Config.bDisplayFramebuffer);
	if (UICheckBox(GEN_ID, x, y += stride, gs->T("Buffered Rendering"), ALIGN_TOPLEFT, &g_Config.bBufferedRendering)) {
		if (gpu)
			gpu->Resized();
	}
	if (g_Config.bBufferedRendering) {
		if (UICheckBox(GEN_ID, x + 60, y += stride, gs->T("AA", "Anti Aliasing"), ALIGN_TOPLEFT, &g_Config.SSAntiAliasing)) {
			if (gpu)
				gpu->Resized();
		}
	}

	UIEnd();
}
void Window::Render(){

   mutex.Lock();
   DrawBackground();
   for(atpm_int32 i=0;i<childs.size();++i){
	      childs[i]->Render();
   }
   BaseWindow::Render();
   mutex.Unlock();



}
void DrawNormalButton(buttonT & button) {
    SetPenColor("STANDARD_BACKGROUND");
    DrawBackground(button);
    SetPenColor("STANDARD_OUTERSHADE");
    DrawOuterShade(button);
    SetPenColor("STANDARD_INNERSHADE");
    DrawInnerShade(button);
    SetPenColor("STANDARD_HIGHLIGHT");
    DrawHighlight(button);
    SetPenColor("Black");
    DrawOutline(button);
    DrawButtonText(button);
}
Exemple #26
0
        virtual void Render(StyledWindow* window) const {
            wxAutoBufferedPaintDC deviceContext(window);

            auto textBox = static_cast<StyledTextBox*>(window);
            auto g = std::unique_ptr<wxGraphicsContext>(wxGraphicsContext::Create(deviceContext));

            auto context = g.get();

            DrawBackground(context, textBox);
            DrawSelection(context, textBox);
            DrawText(context, textBox);
            DrawCursor(context, textBox);
        }
void CPropPageFrameEx::OnPaint() 
{
	CPaintDC dc(this);
  CRect rect;
  GetClientRect(&rect);
  CMemDC memDC( &dc,&rect );

  // Draw the background.
  DrawBackground( &memDC );

  // Draw the title pane.
  Draw( &memDC );	
}
Exemple #28
0
/****************************************************************************
	Desc: グラフを描画する.
	 Arg: グラフの幅
		  グラフの高さ
  Return: ---
****************************************************************************/
void CStockGraph::Draw(CDC* pDC)
{
	DrawBackground(pDC);
	DrawKLine(pDC);
	DrawVolume(pDC);
	for (int iLine = 0; iLine < MA_LINE_MAX; iLine++)
	{
		DrawMovingAverages(pDC, iLine);
	}

	if (m_nMarkCount > 0)
		DrawMark(pDC);
}
Exemple #29
0
void EditToolBar::OnPaint(wxPaintEvent & evt)
{
   wxPaintDC dc(this);

   int width, height;
   GetSize(&width, &height);

   DrawBackground(dc, width, height);

   dc.SetPen(*wxBLACK_PEN);
//   for(int i=0; i<mNumDividers; i++)
//      dc.DrawLine(mDividers[i], 0, mDividers[i], mIdealSize.GetHeight());
}
Exemple #30
0
void GraphicsScreenP1::render() {
	UIShader_Prepare();
	UIBegin(UIShader_Get());
	DrawBackground(1.0f);

	I18NCategory *g = GetI18NCategory("General");
	I18NCategory *gs = GetI18NCategory("Graphics");

	ui_draw2d.SetFontScale(1.5f, 1.5f);
	ui_draw2d.DrawText(UBUNTU24, gs->T("Graphics Settings"), dp_xres / 2, 20, 0xFFFFFFFF, ALIGN_HCENTER);
	ui_draw2d.SetFontScale(1.0f, 1.0f);

	if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres - 10), LARGE_BUTTON_WIDTH, 0, g->T("Back"), ALIGN_RIGHT | ALIGN_BOTTOM)) {
		screenManager()->finishDialog(this, DR_OK);
	}

	if (UIButton(GEN_ID, Pos( 220 , dp_yres - 10), LARGE_BUTTON_WIDTH, 0, g->T("Next Page"), ALIGN_RIGHT | ALIGN_BOTTOM)) {
		screenManager()->push(new GraphicsScreenP2());
	}

	int x = 30;
	int y = 30;
	int stride = 40;
	int columnw = 400;

	UICheckBox(GEN_ID, x, y += stride, gs->T("Vertex Cache"), ALIGN_TOPLEFT, &g_Config.bVertexCache);
#ifndef __SYMBIAN32__
	UICheckBox(GEN_ID, x, y += stride, gs->T("Hardware Transform"), ALIGN_TOPLEFT, &g_Config.bHardwareTransform);
	UICheckBox(GEN_ID, x, y += stride, gs->T("Stream VBO"), ALIGN_TOPLEFT, &g_Config.bUseVBO);
#endif
	UICheckBox(GEN_ID, x, y += stride, gs->T("Media Engine"), ALIGN_TOPLEFT, &g_Config.bUseMediaEngine);
	UICheckBox(GEN_ID, x, y += stride, gs->T("Linear Filtering"), ALIGN_TOPLEFT, &g_Config.bLinearFiltering);
	bool enableFrameSkip = g_Config.iFrameSkip != 0;
	UICheckBox(GEN_ID, x, y += stride, gs->T("Frame Skipping"), ALIGN_TOPLEFT, &enableFrameSkip);
	if (enableFrameSkip) {
		// This one doesn't have the # of frame options, so only change the setting if they flipped it.
		// 3 means auto.
		if (g_Config.iFrameSkip == 0)
			g_Config.iFrameSkip = 3;
	}
	else {
		g_Config.iFrameSkip = 0;
	}

	UICheckBox(GEN_ID, x, y += stride, gs->T("Mipmapping"), ALIGN_TOPLEFT, &g_Config.bMipMap);
	if (UICheckBox(GEN_ID, x, y += stride, gs->T("Buffered Rendering"), ALIGN_TOPLEFT, &g_Config.bBufferedRendering)) {
		if (gpu)
			gpu->Resized();
	}
	UIEnd();
}