Diff of /trunk/src/geomath.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 225 by harbaum, Tue Dec 1 20:07:19 2009 UTC revision 226 by harbaum, Wed Dec 2 20:05:52 2009 UTC
# Line 116  static void on_calc_clicked(GtkButton *b Line 116  static void on_calc_clicked(GtkButton *b
116    }    }
117  }  }
118    
119    static void table_attach_button(GtkWidget *table, GtkWidget *button, int x, int y) {
120    #ifndef FREMANTLE
121      gtk_table_attach_defaults(GTK_TABLE(table), button, x, x+1, y, y+1);
122    #else
123      gtk_table_attach(GTK_TABLE(table), button, x, x+1, y, y+1, GTK_EXPAND | GTK_FILL, 0, 0, 0);
124    #endif
125    }
126    
127  void geomath_dialog(appdata_t *appdata) {  void geomath_dialog(appdata_t *appdata) {
128    static pos_t pos1 = { 0.0, 0.0 }, pos2 = { 0.0, 0.0 };    static pos_t pos1 = { 0.0, 0.0 }, pos2 = { 0.0, 0.0 };
129    static float dist1 = 0.0;    static float dist1 = 0.0;
# Line 160  void geomath_dialog(appdata_t *appdata) Line 168  void geomath_dialog(appdata_t *appdata)
168    
169    /* ------------------------- input area ------------------------- */    /* ------------------------- input area ------------------------- */
170    GtkWidget *table = gtk_table_new(5, 5, FALSE);    GtkWidget *table = gtk_table_new(5, 5, FALSE);
171      gtk_table_set_col_spacing(GTK_TABLE(table), 0, 20);
172    gtk_table_set_col_spacing(GTK_TABLE(table), 2, 20);    gtk_table_set_col_spacing(GTK_TABLE(table), 2, 20);
173    
174    gtk_table_attach_defaults(GTK_TABLE(table), left_label_new(_("Latitude:")),              0, 1, 1, 2);    gtk_table_attach_defaults(GTK_TABLE(table), left_label_new(_("Latitude:")),              0, 1, 1, 2);
175    gtk_table_attach_defaults(GTK_TABLE(table), left_label_new(_("Longitude:")),             0, 1, 2, 3);    gtk_table_attach_defaults(GTK_TABLE(table), left_label_new(_("Longitude:")),             0, 1, 2, 3);
176    
177    gtk_table_attach_defaults(GTK_TABLE(table), left_label_new(_("Coordinate 1")),           1, 3, 0, 1);  #ifndef FREMANTLE
178    gtk_table_attach_defaults(GTK_TABLE(table), state.lat1 = lat_entry_new(pos1.lat),        1, 2, 1, 2);    gtk_table_attach_defaults(GTK_TABLE(table), gtk_label_new(_("Coordinate 1")),           1, 3, 0, 1);
179    gtk_table_attach_defaults(GTK_TABLE(table), state.lon1 = lon_entry_new(pos1.lon),        1, 2, 2, 3);  #endif
180    gtk_table_attach_defaults(GTK_TABLE(table), preset_coordinate_picker(appdata, state.lat1, state.lon1),  2, 3, 1, 2);    table_attach_button(table, state.lat1 = lat_entry_new(pos1.lat),        1, 1);
181      table_attach_button(table, state.lon1 = lon_entry_new(pos1.lon),        1, 2);
182    gtk_table_attach_defaults(GTK_TABLE(table), left_label_new(_("Coordinate 2")),           3, 5, 0, 1);    table_attach_button(table, preset_coordinate_picker(appdata, state.lat1, state.lon1),  2,1);
183    gtk_table_attach_defaults(GTK_TABLE(table), state.lat2 = lat_entry_new(pos2.lat),        3, 4, 1, 2);  
184    gtk_table_attach_defaults(GTK_TABLE(table), state.lon2 = lon_entry_new(pos2.lon),        3, 4, 2, 3);  #ifndef FREMANTLE
185    gtk_table_attach_defaults(GTK_TABLE(table), preset_coordinate_picker(appdata, state.lat2, state.lon2),  4, 5, 1, 2);    gtk_table_attach_defaults(GTK_TABLE(table), gtk_label_new(_("Coordinate 2")),           3, 5, 0, 1);
186    #endif
187      table_attach_button(table, state.lat2 = lat_entry_new(pos2.lat),        3, 1);
188      table_attach_button(table, state.lon2 = lon_entry_new(pos2.lon),        3, 2);
189      table_attach_button(table, preset_coordinate_picker(appdata, state.lat2, state.lon2),  4, 1);
190    
191    gtk_table_attach_defaults(GTK_TABLE(table), left_label_new(_("Distance:")),              0, 1, 3, 4);    gtk_table_attach_defaults(GTK_TABLE(table), left_label_new(_("Distance:")),              0, 1, 3, 4);
192    gtk_table_attach_defaults(GTK_TABLE(table), state.dist1 = dist_entry_new(dist1, appdata->imperial), 1, 3, 3, 4);    table_attach_button(table, state.dist1 = dist_entry_new(dist1, appdata->imperial), 1,3);
193    
194    gtk_table_attach_defaults(GTK_TABLE(table), left_label_new(_("Direction:")),             0, 1, 4, 5);    gtk_table_attach_defaults(GTK_TABLE(table), left_label_new(_("Direction:")),             0, 1, 4, 5);
195    gtk_table_attach_defaults(GTK_TABLE(table), state.dir1 = angle_entry_new(dir1),        1, 3, 4, 5);    table_attach_button(table, state.dir1 = angle_entry_new(dir1),          1,4);
196    
197    gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, TRUE, 0);    gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, TRUE, 0);
198    

Legend:
Removed from v.225  
changed lines
  Added in v.226