コード例 #1
0
ファイル: menu.cpp プロジェクト: eugenesan/chrubuntu-script
void Menu::Header()
{
    SetCursor (0, 0);
    TextColor(BRIGHT, RED, BLACK);
    printf ("Plop");

    TextColor(BRIGHT, WHITE, BLACK);
    printf ("K");
    
    TextColor(BRIGHT, GREEN, BLACK);
    printf ("exec %s", version.c_str());
    
    //TextColor(DIM, GREEN, BLACK);
    TextColor(RESET, GREEN, BLACK);
    printf ("%s", title.c_str());
}
コード例 #2
0
ファイル: ui_mp_playersetup.c プロジェクト: Kiln707/KMQuake2
void PlayerConfig_DrawSkinSelection (void)
{
	char	scratch[MAX_QPATH];
	float	icon_x = SCREEN_WIDTH*0.5 - 5; //width - 325
	float	icon_y = SCREEN_HEIGHT - 108;
	float	icon_offset = 0;
	float	x, y, w, h;
	int		i, count, color[3];

	TextColor((int)Cvar_VariableValue("alt_text_color"), &color[0], &color[1], &color[2]);

	if (s_pmi[s_player_model_box.curvalue].nskins<NUM_SKINBOX_ITEMS || s_player_skin_box.curvalue<4)
		i=0;
	else if (s_player_skin_box.curvalue > s_pmi[s_player_model_box.curvalue].nskins-4)
		i=s_pmi[s_player_model_box.curvalue].nskins-NUM_SKINBOX_ITEMS;
	else
		i=s_player_skin_box.curvalue-3;

	// left arrow
	if (i>0)
		Com_sprintf (scratch, sizeof(scratch), "/gfx/ui/arrows/arrow_left.pcx");
	else
		Com_sprintf (scratch, sizeof(scratch), "/gfx/ui/arrows/arrow_left_d.pcx");
	SCR_DrawPic (icon_x-39, icon_y+2, 32, 32,  ALIGN_CENTER, scratch, 1.0);

	// background
	SCR_DrawFill (icon_x-3, icon_y-3, NUM_SKINBOX_ITEMS*34+4, 38, ALIGN_CENTER, 0,0,0,255);
	if (R_DrawFindPic("/gfx/ui/listbox_background.pcx")) {
		x = icon_x-2;	y = icon_y-2;	w = NUM_SKINBOX_ITEMS*34+2;	h = 36;
		SCR_AdjustFrom640 (&x, &y, &w, &h, ALIGN_CENTER);
		R_DrawTileClear ((int)x, (int)y, (int)w, (int)h, "/gfx/ui/listbox_background.pcx");
	}
	else
		SCR_DrawFill (icon_x-2, icon_y-2, NUM_SKINBOX_ITEMS*34+2, 36, ALIGN_CENTER, 60,60,60,255);
		
	for (count=0; count<NUM_SKINBOX_ITEMS; i++,count++)
	{
		if (i<0 || i>=s_pmi[s_player_model_box.curvalue].nskins)
			continue;

		Com_sprintf (scratch, sizeof(scratch), "/players/%s/%s_i.pcx", 
			s_pmi[s_player_model_box.curvalue].directory,
			s_pmi[s_player_model_box.curvalue].skindisplaynames[i] );

		if (i==s_player_skin_box.curvalue)
			SCR_DrawFill (icon_x + icon_offset-1, icon_y-1, 34, 34, ALIGN_CENTER, color[0],color[1],color[2],255);
		SCR_DrawPic (icon_x + icon_offset, icon_y, 32, 32,  ALIGN_CENTER, scratch, 1.0);
		icon_offset += 34;
	}

	// right arrow
	icon_offset = NUM_SKINBOX_ITEMS*34;
	if (s_pmi[s_player_model_box.curvalue].nskins-i>0)
		Com_sprintf (scratch, sizeof(scratch), "/gfx/ui/arrows/arrow_right.pcx");
	else
		Com_sprintf (scratch, sizeof(scratch), "/gfx/ui/arrows/arrow_right_d.pcx"); 
	SCR_DrawPic (icon_x+icon_offset+5, icon_y+2, 32, 32,  ALIGN_CENTER, scratch, 1.0);
}
コード例 #3
0
int main()
{
    group_is_off_no();
    ShowConsoleCursor(NO);
    TextColor(240);
    system("cls");
    TextColor(112);
    DrawBox0(0,1,80,23,177);
    TXTprintf("ASCS",19,6,121,05);
    TextColor(55);
    DrawBox0(19,16,44,5,32);
    LoadingAnimation(26,17,30,10,"Loading...",55);
    Sleep(100);
    TextColor(112);
    DrawBox0(14,16,44,5,177);
    main_menu();
    return 0;
}
コード例 #4
0
ファイル: menu.cpp プロジェクト: eugenesan/chrubuntu-script
void Menu::ClearCursor()
{
    TextColor(RESET, WHITE, BLACK);
    SetCursor (5, 6 + position);
    printf ("  ");

    SetCursor (cursor_right_x, 6 + position);
    printf ("  \n");
}
コード例 #5
0
void Maschera 
(   char Titolo [],     //Vettore per inserimento titolo
    int  Colore        //Variabile per scelta del colore
)
{   int  X        ;   //Variabile per posizionamento del titolo
    
    Clrscr();
    
    TextColor(Colore);
    
    Gotoxy (0, 0);   printf ("%80s", " ");
    Gotoxy (0,24);   printf ("%80s", " ");
    
    X = 40 - strlen(Titolo)/2 ; //Calcolo Posizione Titolo
    
    Gotoxy(X , 0);   printf(Titolo);
    Gotoxy(32,24);   printf("Created by Martin De Luca");
    
    Gotoxy(1,3);
    TextColor(0x0F);
}
コード例 #6
0
ファイル: Credits.c プロジェクト: yippee-ki-yay/ShootToKill
void CreditsInit()
{

    SDL_Color textColor = { 255, 255, 255 };
    ImageLoad("../../Resource/matrix.png", &c_background);
    TextLoad(&t, "../../Resource/alien.ttf", 30);
    TextPos(&t, 20, 250);
    TextColor(&t, &textColor);

    ButtonInit(&back, "../../Resource/back.png", 700, 500);

}
コード例 #7
0
ファイル: menu.cpp プロジェクト: eugenesan/chrubuntu-script
void Menu::PrintStatus ()
{

    if (info_display_wait == 0)
    {
	current_status = status;
    }
    
    SetCursor (4, 4);
    TextColor(BRIGHT, WHITE, BLACK);

    switch (current_status)
    {
        case 0:
            if (HasEntries())
            {
                printf ("Please select:                                  \n");
            }
            else
            {
                printf ("Waiting for a drive with Linux...               \n");
            }
            break;

        case 1:
            printf ("Scanning %s...                               \n", status_text.c_str());
            break;

        case 2:
            printf ("Selected: %s", entries[current_entry].menu_label.c_str());
            SetCursor (4, 6);
            printf ("Loading kernel...\n");
            break;

        case 3:
            TextColor (BRIGHT, RED, BLACK);
            printf ("Kexec error! See the log for more informations.\n");
            break;
    }
}
コード例 #8
0
ファイル: menu.cpp プロジェクト: eugenesan/chrubuntu-script
void Menu::PrintTimeout()
{
    TextColor(BRIGHT, GREEN, BLACK);     
    
    if (timeout > 0)
    {
        SetCursor (2, 6 + position);
        printf ("%02d", timeout - 1);
    }
    else
    {
        SetCursor (0, 6 + position);
        printf ("    ");
    }
}
コード例 #9
0
ファイル: SurfaceIO.c プロジェクト: susemeee/KUMarble
void SIO_TurnColor(int n)
{
	if (n == BG)
		TextColor(RGB8(0, 0, 0, 0)); // WHITE
	else if (n == NEUTRAL)
		TextColor(RGB8(0, 1, 0, 0)); // GREEN
	else if (n == P1)
		TextColor(RGB8(1, 0, 0, 1)); // RED
	else if (n == P2)
		TextColor(RGB8(0, 0, 1, 1)); // BLUE
	else if (n == P1_SEMI)
		TextColor(RGB8(1, 0, 0, 0)); // DARK RED
	else if (n == P2_SEMI)
		TextColor(RGB8(0, 0, 1, 0)); // DARK BLUE
	else if (n == CL_BT)
		TextColor(RGB8(0, 1, 0, 0)); // GREEN
}
コード例 #10
0
ファイル: menu.cpp プロジェクト: eugenesan/chrubuntu-script
void Menu::DrawCursor (int width)
{
    TextColor(BRIGHT, GREEN, BLACK);
    SetCursor (5, 6 + position);
    printf ("=>");

    cursor_right_x = 50;
    if (cursor_right_x < max_label_length + 16)
    {
	cursor_right_x = max_label_length + 16;
	if (cursor_right_x > width - 3)
	{
	    cursor_right_x = width - 3;
	}
	
    }
    SetCursor (cursor_right_x, 6 + position);
    printf ("<=\n");
}
コード例 #11
0
ファイル: mapview.cpp プロジェクト: Mileslee/wxgis
void wxGISMapView::DrawToolTip(wxClientDC& dc, const wxString& sText)
{
	wxSize size = GetClientSize();
	int nWidth, nHeight;

	dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
	dc.GetTextExtent(sText, &nWidth, &nHeight);

	wxBrush br(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK));
	dc.SetBrush(br);
	wxColor TextColor(wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT));

	wxPen pen(TextColor);
	dc.SetPen(pen);
	int x1 = (size.x - nWidth) / 2, y1 = (size.y - nHeight) - 50;
	dc.DrawRectangle( x1 - 5, y1 - 2, nWidth + 10, nHeight + 4);

	dc.SetTextBackground(TextColor);
	dc.SetTextForeground(TextColor);

	dc.DrawText(sText, x1, y1);
}
コード例 #12
0
ファイル: CONFIG.C プロジェクト: joncampbell123/16
void GetConfig(char *fname)
{
  strbuf=(char *) valloc(2000,"strbuf!",0);
  InitializeDefaults();
  if (!(cfg=fopen(fname,"r")))
  {
    printf("Unable to open config file. Using defaults... \n");
    return;
  }

  while (1)
  {
    fscanf(cfg,"%s",strbuf);

    if (!strcmp(strbuf,"difficulty"))
    { fscanf(cfg,"%s",strbuf);
      difficulty=atoi(strbuf); continue; }
    if (!strcmp(strbuf,"nocdaudio"))
    {
      //nocdaudio=1;
      continue;
    }
    if (!strcmp(strbuf,"vidmode"))
    { fscanf(cfg,"%s",strbuf);
      vm=atoi(strbuf); continue; }
    if (!strcmp(strbuf,"white"))
    { fscanf(cfg,"%s",strbuf);
      white=atoi(strbuf); brightw=atoi(strbuf);
      TextColor(atoi(strbuf)); continue; }
    if (!strcmp(strbuf,"black"))
    { fscanf(cfg,"%s",strbuf);
      black=atoi(strbuf); continue; }
    if (!strcmp(strbuf,"winbg"))
    { fscanf(cfg,"%s",strbuf);
      winbg=atoi(strbuf); continue; }
    if (!strcmp(strbuf,"shadow"))
    { fscanf(cfg,"%s",strbuf);
      darkw=atoi(strbuf); continue; }
    if (!strcmp(strbuf,"darkred"))
    { fscanf(cfg,"%s",strbuf);
      darkred=atoi(strbuf); continue; }
    if (!strcmp(strbuf,"titlebg"))
    { fscanf(cfg,"%s",strbuf);
      titlebg=atoi(strbuf); continue; }
    if (!strcmp(strbuf,"pad"))
    { fscanf(cfg,"%s",strbuf);
      pad=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "scrollmode"))
    { fscanf(cfg,"%s",strbuf);
      scrollmode=atoi(strbuf); continue; }
    // aen
    if (!strcmp(strbuf, "mouse_scroll"))
    { fscanf(cfg,"%s",strbuf);
      mouse_scroll=atoi(strbuf)&1; continue; }
    if (!strcmp(strbuf, "md_device"))
    { fscanf(cfg, "%s", strbuf);
      md_device=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "th"))
    { fscanf(cfg,"%s",strbuf);
      th=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "mh"))
    { fscanf(cfg,"%s",strbuf);
      mh=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "amxofs"))
    { fscanf(cfg,"%s",strbuf);
      amxofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "amyofs"))
    { fscanf(cfg,"%s",strbuf);
      amyofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "mmxofs"))
    { fscanf(cfg,"%s",strbuf);
      mmxofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "mmyofs"))
    { fscanf(cfg,"%s",strbuf);
      mmyofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "cnxofs"))
    { fscanf(cfg,"%s",strbuf);
      cnxofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "cnyofs"))
    { fscanf(cfg,"%s",strbuf);
      cnyofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "lmxofs"))
    { fscanf(cfg,"%s",strbuf);
      lmyofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "lmyofs"))
    { fscanf(cfg,"%s",strbuf);
      lmyofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "lvxofs"))
    { fscanf(cfg,"%s",strbuf);
      lvxofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "lvyofs"))
    { fscanf(cfg,"%s",strbuf);
      lvyofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "mpxofs"))
    { fscanf(cfg,"%s",strbuf);
      mpxofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "mpyofs"))
    { fscanf(cfg,"%s",strbuf);
      mpyofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "vaxofs"))
    { fscanf(cfg,"%s",strbuf);
      vaxofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "vayofs"))
    { fscanf(cfg,"%s",strbuf);
      vayofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "zexofs"))
    { fscanf(cfg,"%s",strbuf);
      zexofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "zeyofs"))
    { fscanf(cfg,"%s",strbuf);
      zeyofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "exofs"))
    { fscanf(cfg,"%s",strbuf);
      exofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "eyofs"))
    { fscanf(cfg,"%s",strbuf);
      eyofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "prxofs"))
    { fscanf(cfg,"%s",strbuf);
      prxofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "pryofs"))
    { fscanf(cfg,"%s",strbuf);
      pryofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "rsxofs"))
    { fscanf(cfg,"%s",strbuf);
      rsxofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf, "rsyofs"))
    { fscanf(cfg,"%s",strbuf);
      rsyofs=atoi(strbuf); continue; }
    if (!strcmp(strbuf,"vcedprog"))
    { fscanf(cfg,"%s",vcedprog);
      continue; }
    break;
  }
  fclose(cfg);
}
コード例 #13
0
QIcon PlatformStyle::TextColorIcon(const QIcon& icon) const
{
    return ColorizeIcon(icon, TextColor());
}
コード例 #14
0
QIcon PlatformStyle::TextColorIcon(const QString& filename) const
{
    return ColorizeIcon(filename, TextColor());
}
コード例 #15
0
ファイル: DC.cpp プロジェクト: AmbitiousG/development_misc
void DC::Text(int x, int y, const STD_STR& text, const Color& color) {
  Color oldColor=TextColor();
  TextColor(color);
  ::TextOut(dc_, x, y, text.c_str(), text.length());
  TextColor(oldColor);
}
コード例 #16
0
void make_ls_schedule()
{
int ms,i;
char file_name[20]=LS_SCHEDULE_FILE_NAME;
ls_group grp;
Time td,default_morning_start={1,0,0},default_night_start={14,0,0};
gotoxy(1,24);   printf("Choose one option.");
xnMenu mnu_mls;
mnu_mls.lx=25; mnu_mls.ly=2;mnu_mls.width=25;mnu_mls.items=3; mnu_mls.now_pos=1; mnu_mls.last_pos=1;
    mnu_mls.item_char[1]="Time Duration.";
    mnu_mls.item_char[2]="One day time";
    mnu_mls.item_char[3]="All week time";
print_xnMenu(mnu_mls);
ms=handle_xnMenu(mnu_mls);
    switch(ms){
        case 1:
            TextColor(112);
                system("cls");
                DrawBox1(0,1,80,23,32);
                gotoxy(1,24);   printf("This will make loadshedding schedule using default time.");
                gotoxy(1,3);    printf("Enter Duration of loadshedding(hh/mm/ss):");
                ShowConsoleCursor(YES);
                scanf("%d%d%d",&td.hour,&td.minute,&td.second);
                ShowConsoleCursor(NO);
                auto_schedule_make(file_name,td,default_morning_start,default_night_start);
                Sleep(200);
                gotoxy(1,24); printf("Schedule made successfuflly..                                                                      ");
                Sleep(1000);
                main_menu();
        break;
        case 2:
            TextColor(112);
                system("cls");
                DrawBox1(0,1,80,23,32);
                gotoxy(1,24);   printf("This will make loadshedding schedule using time you provide.");
                gotoxy(1,3);    printf("Enter Duration of loadshedding(hh/mm/ss):");
                ShowConsoleCursor(YES);
                scanf("%d%d%d",&td.hour,&td.minute,&td.second);
                gotoxy(1,4);
                printf("Enter least morning time to start loadshedding:");
                scanf("%d%d%d",&default_morning_start.hour,&default_morning_start.minute,&default_morning_start.second);
                gotoxy(1,5);
                printf("Enter least night time to start loadshedding:");
                scanf("%d%d%d",&default_night_start.hour,&default_night_start.minute,&default_night_start.second);
                ShowConsoleCursor(NO);
                auto_schedule_make(file_name,td,default_morning_start,default_night_start);
                Sleep(200);
                gotoxy(1,24); printf("Schedule made successfuflly..                                                                      ");
                Sleep(1000);
                main_menu();
        break;
        case 3:
            TextColor(112);
                system("cls");
                gotoxy(1,24);   printf("This will make loadshedding schedule using group-1 time.");
            for(i=1;i<=7;i++){
                DrawBox1(0,1,80,23,32);
                gotoxy(1,3);
                ShowConsoleCursor(YES);
                printf("Enter loadshedding time morning of day %d(hh/mm/ss):",i);
                scanf("%d%d%d",&grp.day[i].morning[0].hour,&grp.day[i].morning[0].minute,&grp.day[i].morning[0].second);
                gotoxy(1,4);    printf("to (hh/mm/ss):");
                scanf("%d%d%d",&grp.day[i].morning[1].hour,&grp.day[i].morning[1].minute,&grp.day[i].morning[1].second);
                gotoxy(1,5);    printf("Enter loadshedding time night of day %d(hh/mm/ss):",i);
                scanf("%d%d%d",&grp.day[i].night[0].hour,&grp.day[i].night[0].minute,&grp.day[i].night[0].second);
                gotoxy(1,6);    printf("to (hh/mm/ss):");
                scanf("%d%d%d",&grp.day[i].night[1].hour,&grp.day[i].night[1].minute,&grp.day[i].night[1].second);
            }
            auto_schedule_make_week_time(file_name,grp);
            Sleep(200);
                gotoxy(1,24); printf("Schedule made successfuflly..                                                                      ");
                Sleep(1000);
            main_menu();
        break;
        default:
            main_menu();
        break;
        }
    }
コード例 #17
0
void main_menu()
{
    char chs;
    TextColor(240);
    system("cls");
    int menu_s;
    xnMenu main_xnMenu;
    ShowConsoleCursor(NO);
    TextColor(112);
    DrawBox0(0,1,80,23,177);
    TXTprintf("ASCS",19,6,121,0);
    DrawHorizontalLine2(19,16,42);
    gotoxy(27,16);  printf("AutoShedding Control System.");
    gotoxy(3,0);    cprintf("Main Menu",128);
    TextColor(240);
    gotoxy(1,0);    printf("%c",240);
    gotoxy(1,24);   printf("Select One Option.");
    TextColor(128);
    main_xnMenu.lx=2;main_xnMenu.ly=1,main_xnMenu.items=5;main_xnMenu.width=30;main_xnMenu.now_pos=1;
    main_xnMenu.item_char[1]="Make LS schedule";
    main_xnMenu.item_char[2]="View LS schedule";
    main_xnMenu.item_char[3]="Power Control";
    main_xnMenu.item_char[4]="-";
    main_xnMenu.item_char[5]="Exit";
    GO_TOP
    while(!kbhit()){
            TextColor(240);
            gotoxy(52,0);   print_now_nepali_date();
            gotoxy(71,24);  print_now_nepali_time();
            Sleep(10);
    }
    chs=getch();
    if(chs=='m' || chs=='M' || chs==78){
        print_xnMenu(main_xnMenu);
        menu_s=handle_xnMenu(main_xnMenu);
    switch(menu_s){
    case 1:
            make_ls_schedule();
        break;
    case 2:
            show_now_loadshedding();
            main_menu();
        break;
    case 3:
            power_control();
        break;
    case 5:
        DrawBox2(0,20,80,4,32);
        gotoxy(2,21);
        printf("Are you sure to exit?(\"system may crash\")(y/n):");
        if(getchar()=='y' || getchar()=='Y')
            exit(EXIT_SUCCESS);
        else
            main_menu();
        break;
    default:
        main_menu();
        break;
    }
    }
    else
        main_menu();
}
コード例 #18
0
void setColour(int color)
{
    TextColor(color,BLACK,hScreen);

}
コード例 #19
0
ファイル: menu.cpp プロジェクト: eugenesan/chrubuntu-script
void Menu::Footer()
{
    SetCursor (0, GetScreenHeight() - 1);
    TextColor(RESET, WHITE, BLACK);
    for (int i = 0; i < GetScreenWidth(); i++)
    {
	printf ("=");
    }

    SetCursor (0, GetScreenHeight());
    TextColor(BRIGHT, WHITE, BLACK);
    printf ("     [E]");
    TextColor(RESET, WHITE, BLACK);
    printf ("dit before boot   ");
    TextColor(BRIGHT, WHITE, BLACK);
    printf ("[L]");
    TextColor(RESET, WHITE, BLACK);
    printf ("ogs   ");
    TextColor(BRIGHT, WHITE, BLACK);
    printf ("[P]");
    TextColor(RESET, WHITE, BLACK);
    printf ("ower off   ");
    TextColor(BRIGHT, WHITE, BLACK);
    printf ("[R]");
    TextColor(RESET, WHITE, BLACK);
    printf ("eboot   ");
    TextColor(BRIGHT, WHITE, BLACK);
    printf ("[S]");
    TextColor(RESET, WHITE, BLACK);
    printf ("hell   ");
#ifdef QUIT_KEY
    printf ("[Q]");
    TextColor(RESET, WHITE, BLACK);
    printf ("uit   ");
#endif
}
コード例 #20
0
ファイル: setcolors.cpp プロジェクト: gahr/fxite
static void SetTextColor(FXWindow*w)
{
  FXColor c=w->getApp()->getForeColor();
  TextColor(FXComboBox);
  TextColor(FXFoldingList);
  TextColor(FXGroupBox);
  TextColor(FXHeader);
  TextColor(FXIconList);
  TextColor(FXLabel);
  TextColor(FXList);
  TextColor(FXListBox);
  TextColor(FXMenuCaption);
  TextColor(FXProgressBar);
  TextColor(FXRealSpinner);
  TextColor(FXRuler);
  TextColor(FXSpinner);
  TextColor(FXText);
  TextColor(FXTextField);
  TextColor(FXToolTip);
  TextColor(FXTreeList);
}
コード例 #21
0
ファイル: menu.cpp プロジェクト: eugenesan/chrubuntu-script
void Menu::Print (bool force_clear)
{
    if (force_clear)
    {
	clear_screen = true;
    }

    if (clear_screen)
    {
	ClearScreen();
	Header();
    }

    if (offset < 0)
    {
	offset = 0;
    }
    int ofs = offset;

    PrintStatus();
    
    if (current_status == 2) // Loading kernel
    {
	SetCursor (0, 0);
	printf ("\n");

	return;
    }

    max_lines_on_screen = GetScreenHeight() - 9;

    lines = GetNumEntriesOfParent (current_parent);
    if (lines > max_lines_on_screen)
    {
	lines = max_lines_on_screen;
    }
    
    int line = 0;

    TextColor(BRIGHT, WHITE, BLACK);
    
    int width = GetScreenWidth();

    if (b_clear_line)
    {
	clear_line = "";
	for (int i = 0; i < width - 13 - 5; i++)
	{
	    clear_line += " ";
	}
    }

    for (int i = 0; i < entries.size(); i++)
    {
	if (entries[i].id_parent == current_parent)
	{
	    if (ofs > 0)
	    {
		ofs--;
	    }
	    else
	    {
		if (b_clear_line)
		{
		    SetCursor (8, 6 + line);
		    printf ("%s", clear_line.c_str());
		}
		
		SetCursor (8, 6 + line);
		if (entries[i].menu_label.length() + 13 > width - 5)
		{
		    string menu_label = entries[i].menu_label.substr (0, width - 13 - 5);
		    printf ("%s: %s", entries[i].device.c_str() + 5, menu_label.c_str());
		}
		else
		{
		    printf ("%s: %s", entries[i].device.c_str() + 5, entries[i].menu_label.c_str());
		}
		
		if (line == position)
		{
		    current_entry = i;
		}
		
		line++;
		if (line > max_lines_on_screen)
		{
		    break;
		}	    
	    }
	
	}    
    }
    
    if (entries.size() > 0)
    {
	PrintTimeout();
	DrawCursor (width);
    }
    else
    {
	SetCursor (8, 6);
	printf ("No Linux has been found.");
    }

    if (clear_screen)
    {
	Footer();

	SetCursor (0, 0);
	printf ("\n");
    }

    b_clear_line = false;
    clear_screen = false;
    
}