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);
	}
Exemple #2
0
void __fastcall TMDIChild::m_HexEditorMouseMove(TObject *Sender,
        TShiftState Shift, int X, int Y)
{
    if(m_LMouseDown)
    {
        char	*pointer = m_HexEditor->GetFastPointer(0, m_HexEditor->DataSize);
        int pos = m_HexEditor->SelStart;
        int selSize = m_HexEditor->SelCount;
        memWatch->Text = GetLangText(pointer+pos, selSize);
        RefreshStateBar();
    }
}
Exemple #3
0
static void search_timer()
{
	FixedPoint xMin = 0, yMin = 0, xMax = 9999999, yMax = 9999999;
	unsigned int ucs4[32];
	unsigned int ucs4_len;
	int i, pw, ph, marginx, marginy;
	double sres;

	if (stext == NULL || ! search_mode) return;
	//fprintf(stderr, "%i\n", spage);

	if (spage < 1 || spage > npages)
	{
		HideHourglass();
		Message(ICON_INFORMATION, GetLangText("@Search"), GetLangText("@No_more_matches"), 2000);
		nresults = 0;
		return;
	}

	getpagesize(spage, &pw, &ph, &sres, &marginx, &marginy);

	/*
	  void displayPage(OutputDev *out, int page,
		 double hDPI, double vDPI, int rotate,
		 GBool useMediaBox, GBool crop, GBool printing,
		 GBool (*abortCheckCbk)(void *data) = NULL,
		 void *abortCheckCbkData = NULL,
			   GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = NULL,
			   void *annotDisplayDecideCbkData = NULL);
	*/

	searchout->found = 0;
	doc->displayPage(searchout, spage, sres, sres, 0, false, false, false);
	if (! searchout->found)
	{
		spage += sdir;
		SetHardTimer("SEARCH", search_timer, 1);
		return;
	}

	doc->displayPage(textout, spage, sres, sres, 0, false, true, false);
	TextPage* textPage = textout->takeText();

	xMin = yMin = 0;
	ucs4_len = utf2ucs4(stext, (unsigned int*)ucs4, 32);

	nresults = 0;
	while (textPage->findText(ucs4, ucs4_len,
							  gFalse, gTrue, gTrue, gFalse, gFalse, gFalse, &xMin, &yMin, &xMax, &yMax))
	{
		i = nresults++;
		results[i].x = (int)xMin - 2;
		results[i].y = (int)yMin - 2;
		results[i].w = (int)(xMax - xMin) + 4;
		results[i].h = (int)(yMax - yMin) + 4;
		if (i == MAXRESULTS - 1) break;
	}

	if (nresults > 0)
	{
		cpage = spage;
		out_page(1);
	}
	else
	{
		spage += sdir;
		SetHardTimer("SEARCH", search_timer, 1);
	}

	delete textPage;
}
Exemple #4
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();
}