static vector<Area> scaleBoxes(const vector<Area> & boxes, double x, double y){ vector<Area> out; for (vector<Area>::const_iterator it = boxes.begin(); it != boxes.end(); it++){ out.push_back(scaleBox(*it, x, y)); } return out; }
int main (void) { bowl_init (); #if 0 twoButtonBox ("some sample text", "confirmation", "yes", "no"); #elif 0 problemBox (MSG_SILO_PROBLEM, MSG_PROBLEM); #elif 0 for (;;) { pleaseWaitBox (MSG_RUNNING_LILO); sleep (2); } #elif 0 inputBox (MSG_LINUX_AND_SWAP, MSG_NO_SWAP_PARTITION, "/dev/sda1"); #elif 1 { char buf[128]; enterDirBox ("Enter a directory", "Here you must type the directory name", "/debian", buf, 128); } #elif 1 { struct d_choices opt[30]; int i; for (i = 0; i < 30; i++) { opt[i].tag = malloc (16); sprintf (opt[i].tag, "таг %d", i); opt[i].string = malloc (128); sprintf (opt[i].string, "item %d", i); opt[i].state = i; } menuBox ("This is a little text", "I'm the title", opt, 30, 1); } #elif 1 { char *choices[30]; char values[30]; char *valuesp; int i; for (i = 0; i < 30; i++) { choices[i] = malloc (128); sprintf (choices[i], "item %d", i); values[i] = i % 2 ? '*' : ' '; } valuesp = values; checkBox ("This is a little text", "I'm the title", 10, 50, choices, &valuesp, 30); } #elif 0 { int i; scaleBox ("Installing rescue floppy...", "Please wait", 10, SCALE_CREATE); for (i = 0; i <= 10; i++) { scaleBox (NULL, NULL, i, SCALE_REFRESH); sleep (1); } } #elif 1 bowl_new_text (MSG_BAD_FLOPPY MSG_LINUX_AND_SWAP); bowl_title (MSG_NO_SWAP_PARTITION); bowl_new_button (MSG_YES, 0); bowl_new_button (MSG_NO, 0); bowl_new_button (_("Cancel"), 0); bowl_new_button ("Quit", 0); bowl_new_button ("Help", 0); bowl_layout (); bowl_run (); #endif return 0; }