Permalink
Browse files

Merge https://github.com/jtappin/RPNcalc

Conflicts:
	src/utils.f90
	src/widgets.f90
  • Loading branch information...
2 parents f3eafc9 + c252b09 commit 97e382ebfc0bbb5acc8beb28def4f10c8e40980a @jtappin committed Nov 14, 2011
View
@@ -1,13 +1,14 @@
RNPcalc -- building and installing
==================================
-Needs: Fortran 95/2003 (for gfortran version >= 4.6)
+Needs: Fortran 95/2003 (for gfortran: Version >= 4.6)
GtkFortran, including gtk_hl
Step 0:
Get RPNcalc from https://github.com/jtappin/RPNcalc
Step 1:
+ cd src
Edit the Makefile. The lines you may need to edit are commented.
Step 2:
@@ -16,10 +17,10 @@ Step 2:
Possible problems:
1) Can't find the gtk-fortran pkg-config file.
a) pkg-config does not look in /usr/local, solution:
-export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
-b) GtkFortran is not installed, solution:
-Get GtkFortran from https://github.com/jerryd/gtk-fortran/
- and build & install it, using the cmake build instructions.
+ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
+ b) GtkFortran is not installed, solution:
+ Get GtkFortran from https://github.com/jerryd/gtk-fortran/
+ and build & install it, using the cmake build instructions.
2) gfortran has an internal error, solution:
Make sure you have gfortran 4.6 or better.
@@ -29,7 +30,3 @@ Step 3:
if you just want to try it out, run:
./rpncalc
in the rpncalc directory.
-
-
-Dedicated Server Powered by the Dedicated Servers and
-Cloud Computing of Rackspace Hosting®
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes.
@@ -1259,27 +1259,38 @@ subroutine show_help(widget, gdata) bind(c)
& 'Settings:'//c_new_line// &
& 'In the current version, there are 2 user-definable settings accessed'//c_new_line// &
& 'through the "Edit" menu:'//c_new_line// &
- & '"Result Format": Specify the format (using any Fortran formatting code'//c_new_line// &
- & 'valid for a REAL type) to use in the result box. You have the'//c_new_line// &
+ & '"Result Format": Specify the format to use in the result box. You have the'//c_new_line// &
& 'options to select one of the standard formats:'//c_new_line// &
& ' "Fixed": A fixed number of decimal places (set in the precision spin'//c_new_line// &
& ' box). The actual format used is "(F0.<n>)". WARNING: this may be a'//c_new_line// &
& ' GNU extension.'//c_new_line// &
& ' "Sci": Scientific format. Specify the number of decimals, and the'//c_new_line// &
& ' width of the exponent in the spin boxes. The total width is'//c_new_line// &
& ' calculated automatically.'//c_new_line// &
- & ' "Eng": Similar to scientific, except that the exponent is always a'//c_new_line// &
- & ' multiple of 3.'//c_new_line// &
- & ' "Free": Use a list-directed write.'//c_new_line// &
+ & ' "Eng": Engineering format, similar to scientific, except that the'//c_new_line// &
+ & ' exponent is always a multiple of 3.'//c_new_line// &
+ & ' "Free": Use a list-directed write (the default).'//c_new_line// &
& ''//c_new_line// &
& ' Alternatively you can type an explicit Fortran format statement into'//c_new_line// &
- & ' the combo box (with or without the enclosing parentheses). Setting it'//c_new_line// &
- & ' to "*" or an empty string will use the default list-directed output'//c_new_line// &
- & ' (as will an invalid format).'//c_new_line// &
+ & ' the combo box (with or without the enclosing parentheses). This may'//c_new_line// &
+ & ' be any Fortran formatting code valid for a REAL type. Setting it to'//c_new_line// &
+ & ' "*" or an empty string will use the default list-directed output (as'//c_new_line// &
+ & ' will an invalid format).'//c_new_line// &
& ''//c_new_line// &
& '"Hold Entry Focus": If this is enabled, then the input focus always'//c_new_line// &
& 'snaps back to the entry window after any operation.'//c_new_line// &
& ''//c_new_line// &
+ & 'Accelerators:'//c_new_line// &
+ & ''//c_new_line// &
+ & 'The menu items have accerators to save mouse clicking:'//c_new_line// &
+ & 'Save -- ctrl-s'//c_new_line// &
+ & 'Restore -- ctrl-o'//c_new_line// &
+ & 'Quit -- ctrl-q'//c_new_line// &
+ & 'Set Format -- ctrl-f'//c_new_line// &
+ & 'Help -- ctrl-h'//c_new_line// &
+ & 'About -- ctrl-a'//c_new_line// &
+ & 'About gtk-fortran -- ctrl-shift-a'//c_new_line// &
+ & ''//c_new_line// &
& '[*] This can be changed by editing the "maxreg" value in widgets.f90'//cnull &
& /) )
View
File renamed without changes.
File renamed without changes.
@@ -35,7 +35,8 @@ program rpncalc
&ry_new, gtk_expander_new, gtk_label_new, gtk_main, gtk_menu_item_new, gtk_menu&
&_new, gtk_radio_button_new, gtk_statusbar_new, gtk_table_attach, gtk_table_new&
&, gtk_widget_show, gtk_widget_show_all, gtk_window_new, gtk_init,&
- & gtk_expander_set_expanded, GTK_PACK_DIRECTION_LTR
+ & gtk_expander_set_expanded, GTK_PACK_DIRECTION_LTR, &
+ & GDK_CONTROL_MASK, GDK_SHIFT_MASK
use gtk_hl
use handlers
@@ -109,7 +110,7 @@ program rpncalc
! Create a window and put a vertical box into it
win = hl_gtk_window_new("RPN Calculator", destroy=c_funloc(my_destroy), &
- & resizable=FALSE)
+ & resizable=FALSE, accel_group=accel)
base = hl_gtk_box_new()
call gtk_container_add(win, base)
@@ -118,15 +119,19 @@ program rpncalc
call hl_gtk_box_pack(base, fmenu)
ffmenu = hl_gtk_menu_submenu_new(fmenu, "File"//cnull)
ksave = hl_gtk_menu_item_new(ffmenu, "Save"//cnull, &
- & activate=c_funloc(save_values))
+ & activate=c_funloc(save_values), accel_key="s"//cnull, &
+ & accel_group=accel)
krestore = hl_gtk_menu_item_new(ffmenu, "Restore"//cnull, &
- & activate=c_funloc(restore_values))
+ & activate=c_funloc(restore_values), accel_key="o"//cnull, &
+ & accel_group=accel)
kquit = hl_gtk_menu_item_new(ffmenu, "Quit"//cnull, &
- & activate=c_funloc(my_destroy))
+ & activate=c_funloc(my_destroy), accel_key="q"//cnull, &
+ & accel_group=accel)
femenu = hl_gtk_menu_submenu_new(fmenu, "Edit"//cnull)
kfedit = hl_gtk_menu_item_new(femenu, "Result Format"//cnull, &
- & activate=c_funloc(set_format_make))
+ & activate=c_funloc(set_format_make), accel_key="f"//cnull, &
+ & accel_group=accel)
kefocus = hl_gtk_check_menu_item_new(femenu, "Hold entry focus"//cnull, &
& toggled = c_funloc(set_entry_focus))
khrdeg = hl_gtk_check_menu_item_new(femenu, "Display degrees"//cnull, &
@@ -135,11 +140,14 @@ program rpncalc
fhmenu = hl_gtk_menu_submenu_new(fmenu, "Help"//cnull)
khelp = hl_gtk_menu_item_new(fhmenu, "Help"//cnull, &
- & activate=c_funloc(show_help))
+ & activate=c_funloc(show_help), accel_key="h"//cnull, &
+ & accel_group=accel)
kabout = hl_gtk_menu_item_new(fhmenu, "About: RPN Calculator"//cnull, &
- & activate=c_funloc(about_rpn))
+ & activate=c_funloc(about_rpn), accel_key="a"//cnull, &
+ & accel_group=accel)
kfabout = hl_gtk_menu_item_new(fhmenu, "About: Gtk-Fortran"//cnull, &
- & activate=c_funloc(about_gtkfortran))
+ & activate=c_funloc(about_gtkfortran), accel_key="a"//cnull, &
+ & accel_group=accel, accel_mods=ior(GDK_CONTROL_MASK, GDK_SHIFT_MASK))
! Value entry window.
jbase = hl_gtk_table_new(2, 2)
@@ -147,25 +147,36 @@ work.
Settings:
In the current version, there are 2 user-definable settings accessed
through the "Edit" menu:
-"Result Format": Specify the format (using any Fortran formatting code
-valid for a REAL type) to use in the result box. You have the
+"Result Format": Specify the format to use in the result box. You have the
options to select one of the standard formats:
"Fixed": A fixed number of decimal places (set in the precision spin
box). The actual format used is "(F0.<n>)". WARNING: this may be a
GNU extension.
"Sci": Scientific format. Specify the number of decimals, and the
width of the exponent in the spin boxes. The total width is
calculated automatically.
- "Eng": Similar to scientific, except that the exponent is always a
- multiple of 3.
- "Free": Use a list-directed write.
+ "Eng": Engineering format, similar to scientific, except that the
+ exponent is always a multiple of 3.
+ "Free": Use a list-directed write (the default).
Alternatively you can type an explicit Fortran format statement into
- the combo box (with or without the enclosing parentheses). Setting it
- to "*" or an empty string will use the default list-directed output
- (as will an invalid format).
+ the combo box (with or without the enclosing parentheses). This may
+ be any Fortran formatting code valid for a REAL type. Setting it to
+ "*" or an empty string will use the default list-directed output (as
+ will an invalid format).
"Hold Entry Focus": If this is enabled, then the input focus always
snaps back to the entry window after any operation.
+Accelerators:
+
+The menu items have accerators to save mouse clicking:
+Save -- ctrl-s
+Restore -- ctrl-o
+Quit -- ctrl-q
+Set Format -- ctrl-f
+Help -- ctrl-h
+About -- ctrl-a
+About gtk-fortran -- ctrl-shift-a
+
[*] This can be changed by editing the "maxreg" value in widgets.f90
File renamed without changes.
@@ -95,7 +95,7 @@ enum, bind(c) ! Function identifiers
! Menubar
type(c_ptr) :: fmenu, ffmenu, fhmenu, kabout, ksave, krestore, khelp, &
- & kfabout, femenu, kfedit, kefocus, khrdeg
+ & kfabout, femenu, kfedit, kefocus, khrdeg, accel
! Entry & result windows and stack display
type(c_ptr) :: fentry, fstack, sstack, fresult, sbar, fstatus, &

0 comments on commit 97e382e

Please sign in to comment.