exposurses

Check-in [338867e3ed]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Tweak menu widths, make future adjustment more flexible
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 338867e3edc36701444059739ce038a595e4ef9de24074290078d5ea988dc369
User & Date: base@atomicules.co.uk 2013-09-18 14:21:27
Context
2013-09-18
21:35
Add screenshot to README check-in: 2a307b38c7 user: base@atomicules.co.uk tags: origin/master, trunk
14:21
Tweak menu widths, make future adjustment more flexible check-in: 338867e3ed user: base@atomicules.co.uk tags: origin/master, trunk
13:34
Remove some spurious trailing tabs check-in: fee7533a30 user: base@atomicules.co.uk tags: origin/master, trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to exposurses.c.

   104    104   /* No one will ever need more than 9 bytes! */
   105    105   char exposure_sel[9] = "";
   106    106   char iso_sel[9] = "";
   107    107   char shutter_sel[9] = "";
   108    108   char aperture_sel[9] = "";
   109    109   int selection_counter = 1;
   110    110   int menu_counter = 1;
          111  +int menu_width = 25;
          112  +int menu_padding = 3;
   111    113   
   112    114   int main() {
   113    115   	int c;
   114    116   	MENU **menu;
   115    117   	WINDOW **win;
   116    118   	int i;
   117    119   	int n_exposure;
................................................................................
   139    141   	aperture_items = add_item(aperture_array, n_aperture);
   140    142   	shutter_items = add_item(shutter_array, n_shutter);
   141    143   	exposure_menu = add_menu(exposure_items);
   142    144   	iso_menu = add_menu(iso_items);
   143    145   	shutter_menu = add_menu(shutter_items);
   144    146   	aperture_menu = add_menu(aperture_items);
   145    147   	exposure_win = add_window(4, "EV");
   146         -	iso_win = add_window(45, "ISO");
   147         -	shutter_win = add_window(86, "Shutter");
   148         -	aperture_win = add_window(127, "Aperture");
   149         -	/* Don't know how to avoid the repition below */
          148  +	iso_win = add_window(4 + menu_width + menu_padding, "ISO");
          149  +	shutter_win = add_window(4 + 2*(menu_width + menu_padding), "Shutter");
          150  +	aperture_win = add_window(4 + 3*(menu_width + menu_padding), "Aperture");
          151  +	/* Don't know how to avoid the repetion below */
   150    152   	set_menu_win(exposure_menu, exposure_win);
   151    153   	set_menu_win(iso_menu, iso_win);
   152    154   	set_menu_win(shutter_menu, shutter_win);
   153    155   	set_menu_win(aperture_menu, aperture_win);
   154         -	set_menu_sub(exposure_menu, derwin(exposure_win, 6, 38, 3, 1));
   155         -	set_menu_sub(iso_menu, derwin(iso_win, 6, 38, 3, 1));
   156         -	set_menu_sub(shutter_menu, derwin(shutter_win, 6, 38, 3, 1));
   157         -	set_menu_sub(aperture_menu, derwin(aperture_win, 6, 38, 3, 1));
          156  +	set_menu_sub(exposure_menu, derwin(exposure_win, 6, menu_width, 3, 1));
          157  +	set_menu_sub(iso_menu, derwin(iso_win, 6, menu_width, 3, 1));
          158  +	set_menu_sub(shutter_menu, derwin(shutter_win, 6, menu_width, 3, 1));
          159  +	set_menu_sub(aperture_menu, derwin(aperture_win, 6, menu_width, 3, 1));
   158    160   	post_menu(exposure_menu);
   159    161   	post_menu(iso_menu);
   160    162   	post_menu(shutter_menu);
   161    163   	post_menu(aperture_menu);
   162    164   	wrefresh(exposure_win);
   163    165   	wrefresh(iso_win);
   164    166   	wrefresh(shutter_win);
................................................................................
   325    327   	set_menu_mark(local_menu, " * ");
   326    328   	return local_menu;
   327    329   }
   328    330   
   329    331   WINDOW *add_window(int xpos, char *title) {
   330    332   	WINDOW *local_win;
   331    333   
   332         -	local_win = newwin(10, 40, 4, xpos);
          334  +	local_win = newwin(10, menu_width+2, 4, xpos);
   333    335   	keypad(local_win, TRUE);
   334    336   	box(local_win, 0, 0);
   335         -	print_in_middle(local_win, 1, 0, 40, title, COLOR_PAIR(1));
          337  +	print_in_middle(local_win, 1, 0, menu_width+2, title, COLOR_PAIR(1));
   336    338   	mvwaddch(local_win, 2, 0, ACS_LTEE);
   337         -	mvwhline(local_win, 2, 1, ACS_HLINE, 38);
   338         -	mvwaddch(local_win, 2, 39, ACS_RTEE);
          339  +	mvwhline(local_win, 2, 1, ACS_HLINE, menu_width);
          340  +	mvwaddch(local_win, 2, menu_width+1, ACS_RTEE);
   339    341   	return local_win;
   340    342   }
   341    343   
   342    344   void remove_menu(ITEM **items, MENU *men, int n) {
   343    345   	int i;
   344    346   
   345    347   	unpost_menu(men);