Пример #1
0
void CObjectGroup::Draw()
{
	GR_IMAGE_INFO img_info;
	RECT rcOptionText;

	if(m_wid && m_gc && m_Image)
	{
		if(m_isOption)
		{
			GrGetImageInfo(m_Image[m_idxImage], &img_info);
			GrDrawImageToFit(m_wid, m_gc, m_rect.x, m_rect.y, img_info.width, img_info.height, m_Image[m_idxImage]);
			if(m_pszText)
			{
				memcpy(&rcOptionText, &m_rect, sizeof(RECT));
				rcOptionText.x += (img_info.width + 10);
				DrawTextRect(m_pszText, m_wid, m_gc, &rcOptionText, m_text_font, m_text_size, m_text_color, m_text_align);
			}
		}
		else
		{
			GrDrawImageToFit(m_wid, m_gc, m_rect.x, m_rect.y, m_rect.w, m_rect.h, m_Image[m_idxImage]);

			if(m_pszText)
			{
				DrawTextRect(m_pszText, m_wid, m_gc, &m_rect, m_text_font, m_text_size, m_text_color, m_text_align);
			}
		}
	}
}
Пример #2
0
void CObjectInput::Draw()
{
	DrawRect(m_rect.x, m_rect.y, m_rect.w, m_rect.h, m_wid, m_gc, m_Color_bg, TRUE);
	if(m_isFocus)
	{
		DrawRect(m_rect.x, m_rect.y, m_rect.w, m_rect.h, m_wid, m_gc, RGB(255,255,255), FALSE);
	//	DrawTextRect2(m_szInput, m_wid, m_gc, &m_rect, m_Font, m_Size, RGB(48,49,48), m_Color_fg, m_Align);
		DrawTextRect(m_szInput, m_wid, m_gc, &m_rect, m_Font, m_Size, m_Color_fg, m_Align);
	}
	else
	{
		DrawTextRect(m_szInput, m_wid, m_gc, &m_rect, m_Font, m_Size, m_Color_fg, m_Align);
	}
}
Пример #3
0
// draw zoomer
void Zoomer::Draw(int gu)
{
    // draw frame
    int xframe, yframe, wframe, hframe;
    GetWindowFrameRect(xframe, yframe, wframe, hframe);
    iv_windowframe(xframe, yframe, wframe, hframe, BLACK, WHITE, const_cast<char*>("@Zoom"), 0);

    // draw bitmap
    int xbitmap, ybitmap, wbitmap, hbitmap;
    GetBitmapFrameRect(xbitmap, ybitmap, wbitmap, hbitmap);
    DrawBitmap(xbitmap, ybitmap, &djvumode);

    // draw description
    char buffer[128] = {0};
    s_Strategies[m_Position]->GetDescription(buffer, sizeof(buffer));
    SetFont(menu_n_font, 0);
    DrawTextRect(xframe, yframe + hframe - 1.25 * menu_n_font->height, wframe, 1, buffer, ALIGN_CENTER);

    // current selection
    InvertAreaBW(xbitmap + m_IconWidth * m_Position, ybitmap, m_IconWidth, m_IconHeight);

	// update screen
	if (gu) {
		//PartialUpdate(xframe, yframe, wframe, hframe);
	} else {
		PartialUpdateBW(xframe, yframe, wframe, hframe);
	}
}
Пример #4
0
void CObjectPlatButton::Draw()
{
	if(m_wid && m_gc)
	{
		if(m_Image)
		{
			GrDrawImageToFit(m_wid, m_gc, m_rect.x, m_rect.y, m_rect.w, m_rect.h, m_Image);
		}

		if(m_pszText && m_font)
		{
			DrawTextRect(m_pszText, m_wid, m_gc, &m_rect, m_font, m_size, m_color, TXT_HALIGN_CENTER|TXT_VALIGN_MIDDLE);
		}
	}
}
Пример #5
0
static void draw_jump_info(char* text)
{
	int x, y, w, h;

	SetFont(menu_n_font, BLACK);
	w = StringWidth("999%") + 20;
	if (StringWidth(text) > w - 10) w = StringWidth(text) + 20;
	h = (menu_n_font->height * 3) / 2;
	x = ScreenWidth() - w - 5;
	y = ScreenHeight() - h - 30;
	FillArea(x + 1, y + 1, w - 2, h - 2, WHITE);
	DrawRect(x + 1, y, w - 2, h, BLACK);
	DrawRect(x, y + 1, w, h - 2, BLACK);
	DrawTextRect(x, y, w, h, text, ALIGN_CENTER | VALIGN_MIDDLE);
	PartialUpdateBW(x, y, w, h);
}
Пример #6
0
	static void draw_new_zoomer(int update)
	{
		char buf[80];
		int cw, ch;
		int deltaw = 36;

		iv_windowframe(dx, dy, dw, dh, BLACK, WHITE, "@Zoom", 0);
		DrawBitmap(dx + 40, dy + th + 8, bm_touchzoom);
		cw = bm_touchzoom->width / 6 - deltaw;
		ch = bm_touchzoom->height / 5 - 48;
		//    invert_item(dx+40+(cw + 6)*pos + 3, dy+th+8, cw, ch);

		SetFont(menu_n_font, 0);
		//    snprintf(buf, sizeof(buf), "%s", GetLangText("@Preview"));
		//    DrawTextRect(dx, dy + th + 8, dw, 1, buf, ALIGN_CENTER);
		//    snprintf(buf, sizeof(buf), "%s", GetLangText("@Normal_page"));
		//    DrawTextRect(dx, dy + th + 8 + ch + 48, dw, 1, buf, ALIGN_CENTER);
		//    snprintf(buf, sizeof(buf), "%s", GetLangText("@Reflow"));
		//    DrawTextRect(dx, dy + th + 8 + 48 + (ch + 24) * 3 + 24, dw, 1, buf, ALIGN_CENTER);

		DrawTextRect(dx + 40, dy + th + 8 + ch + 24, cw + deltaw, 1, "4", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 2, dy + th + 8 + ch + 24, cw + deltaw, 1, (char*)((GetOrientation() + 1) % 4 > 2 ? "6" : "9"),
		ALIGN_CENTER);
		snprintf(buf, sizeof(buf), "%s", GetLangText("@Fit_width"));
		//    DrawTextRect(dx + 40 + (cw + deltaw) * 4 - 30, dy + th + 8 + ch + 24, cw + deltaw + 60, 1, buf, ALIGN_CENTER);

		DrawTextRect(dx + 40, dy + th + 8 + (ch + 48) * 2 - 24, cw + deltaw, 1, "75%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + cw + deltaw, dy + th + 8 + (ch + 48) * 2 - 24, cw + deltaw, 1, "80%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 2, dy + th + 8 + (ch + 48) * 2 - 24, cw + deltaw, 1, "85%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 3, dy + th + 8 + (ch + 48) * 2 - 24, cw + deltaw, 1, "90%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 4, dy + th + 8 + (ch + 48) * 2 - 24, cw + deltaw, 1, "95%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 5, dy + th + 8 + (ch + 48) * 2 - 24, cw + deltaw, 1, "100%", ALIGN_CENTER);

		DrawTextRect(dx + 40, dy + th + 8 + (ch + 48) * 3 - 24, cw + deltaw, 1, "105%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + cw + deltaw, dy + th + 8 + (ch + 48) * 3 - 24, cw + deltaw, 1, "120%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 2, dy + th + 8 + (ch + 48) * 3 - 24, cw + deltaw, 1, "130%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 3, dy + th + 8 + (ch + 48) * 3 - 24, cw + deltaw, 1, "140%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 4, dy + th + 8 + (ch + 48) * 3 - 24, cw + deltaw, 1, "150%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 5, dy + th + 8 + (ch + 48) * 3 - 24, cw + deltaw, 1, "170%", ALIGN_CENTER);

		DrawTextRect(dx + 40, dy + th + 8 + (ch + 48) * 4 - 24, cw + deltaw, 1, "200%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + cw + deltaw, dy + th + 8 + (ch + 48) * 4 - 24, cw + deltaw, 1, "300%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 2, dy + th + 8 + (ch + 48) * 4 - 24, cw + deltaw, 1, "400%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 3, dy + th + 8 + (ch + 48) * 4 - 24, cw + deltaw, 1, "500%", ALIGN_CENTER);

		DrawTextRect(dx + 40, dy + th + 8 + (ch + 48) * 5 - 24, cw + deltaw, 1, "150%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + cw + deltaw, dy + th + 8 + (ch + 48) * 5 - 24, cw + deltaw, 1, "200%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 2, dy + th + 8 + (ch + 48) * 5 - 24, cw + deltaw, 1, "300%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 3, dy + th + 8 + (ch + 48) * 5 - 24, cw + deltaw, 1, "400%", ALIGN_CENTER);
		DrawTextRect(dx + 40 + (cw + deltaw) * 4, dy + th + 8 + (ch + 48) * 5 - 24, cw + deltaw, 1, "500%", ALIGN_CENTER);

		if (update) PartialUpdate(dx, dy, dw + 4, dh + 4);
	}
Пример #7
0
void DrawCalendar()
{
 int i, j, k;
 char s[100];

	if (GetOrientation() == 0 || GetOrientation() == 3) {
		months_by_x = 3;
		months_by_y = 4;
		dx = cpar->dx_p;
		dy = cpar->dy_p;
		sx = cpar->sx_p;
		sy = cpar->sy_p;
		aw = cpar->aw;
		lh = cpar->lh;
	} else {
		months_by_x = 4;
		months_by_y = 3;
		dx = cpar->dx_l;
		dy = cpar->dy_l;
		sx = cpar->sx_l;
		sy = cpar->sy_l;
		aw = cpar->aw;
		lh = cpar->lh;
	}

 ClearScreen();
 //FillArea(0, 0, 600, 800, BLACK);
 //FillArea(10, 10, 580, 780, WHITE);
 SetFont(cal_title_font, BLACK);
 sprintf(s, "\x11    %d    \x12", year);
 DrawTextRect(0, 5, ScreenWidth(), 30, s, ALIGN_CENTER);
 HeaderWidth = StringWidth(s);
 SymbolWidth = CharWidth('A');

 for (i=0; i<months_by_y; i++)
 	for (j=0; j<months_by_x; j++)
 		{
		 int mn = i*months_by_x + j;
 		 SetFont(cal_month_font, BLACK);
 		 DrawTextRect(sx+dx*j, sy-(lh*3)/2+dy*i, dx, 1, GetLangText(MonthName[mn]), ALIGN_CENTER);
 		 SetFont(cal_day_font, BLACK);
 		 for (k=0; k<6; k++)
	 		DrawTextRect(sx+4+dx*j-(IsRTL() ? 10 : 0), sy+lh*k+dy*i, 50, 1, GetLangText(WeekName[k]), ALIGN_LEFT | RTLAUTO);
  		 SetFont(cal_day_font, DGRAY);
		 DrawTextRect(sx+4+dx*j-(IsRTL() ? 10 : 0), sy+lh*6+dy*i, 50, 1, GetLangText(WeekName[6]), ALIGN_LEFT | RTLAUTO);
	 	 for (k=1; k<43; k++)
	 	 	 if (calendar[mn][k]>0)
	 	 	 	{
	 	 		 if (k%7!=0) 
	 	 		 	SetFont(cal_date_font, BLACK);
	 	 		 	else
	 	 		 	SetFont(cal_date2_font, DGRAY);
 		 	 	 sprintf(s, "%d", calendar[mn][k]);
				 DrawTextRect(sx+(aw*8)/5+( (int) ((k-1)/7) )*aw+dx*j, sy+lh*((k-1)%7)+dy*i, aw, 1, s, ALIGN_CENTER);
				}
 		}
 if (year==CurDate->tm_year+1900)
 	{
 	 k=1;
 	 while (calendar[CurDate->tm_mon][k]!=CurDate->tm_mday) k++;
 	 InvertArea(sx+(aw*8)/5+1+( (int) ((k-1)/7) )*aw+dx*(CurDate->tm_mon%months_by_x), sy+lh*((k-1)%7)+dy*(CurDate->tm_mon/months_by_x), aw-2, lh-1);
 	 DrawRect(sx+(aw*8)/5+( (int) ((k-1)/7) )*aw+dx*(CurDate->tm_mon%months_by_x), sy+lh*((k-1)%7)+dy*(CurDate->tm_mon/months_by_x)+1, aw, lh-3, BLACK);
 	}
// SetFont(cour32, BLACK);
// sprintf(s, "%d %s %d", CurDate->tm_mday, GetLangText(MonthName[CurDate->tm_mon]), CurDate->tm_year+1900);
// DrawTextRect(50, 720, 500, 30, s, ALIGN_CENTER);
// DitherArea(0, 0, 600, 800, 4, 1);
 DrawPanel(NULL, CurrentDateStr(), NULL, -1);
 FullUpdate();
}
Пример #8
0
void CObjectText::Draw()
{
	DrawTextRect(m_pText, m_wid, m_gc, &m_rect, m_Font, m_Size, m_Color, m_Align);
}