2001-06-26 Dave Peticolas <dave@krondo.com>

* src/register/gnome/gnucash-sheet.c
	(gnucash_sheet_key_press_event): allow shift-pgup and shift-pgdn
	to go to top & bottom of register respectively.

	* src/register/gnome/datecell-gnome.c (DateDirect): allow '-'
	hotkey to work if there is a full date there, or the cell is
	blank.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4809 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-06-26 10:46:34 +00:00
parent 7b7cb97c79
commit e5e161fa7e
3 changed files with 41 additions and 8 deletions

View File

@ -1,5 +1,13 @@
2001-06-26 Dave Peticolas <dave@krondo.com>
* src/register/gnome/gnucash-sheet.c
(gnucash_sheet_key_press_event): allow shift-pgup and shift-pgdn
to go to top & bottom of register respectively.
* src/register/gnome/datecell-gnome.c (DateDirect): allow '-'
hotkey to work if there is a full date there, or the cell is
blank.
* src/gnome/gnc-html.c: don't handle keypresses, let the gtkhtml
object do it.

View File

@ -590,8 +590,22 @@ DateDirect (BasicCell *bcell,
break;
case GDK_minus:
if (dateSeparator () == '-')
if ((bcell->value_len != 0) && (dateSeparator () == '-'))
{
int i;
int count;
/* rough check for existing date */
for (i = count = 0; i < bcell->value_len; i++)
{
if (bcell->value_w[i] == '-')
count++;
}
if (count < 2)
return FALSE;
}
/* fall through */
case GDK_KP_Subtract:
case GDK_underscore:

View File

@ -1591,17 +1591,28 @@ gnucash_sheet_key_press_event (GtkWidget *widget, GdkEventKey *event)
case GDK_Page_Up:
direction = GNC_TABLE_TRAVERSE_UP;
new_virt_loc.phys_col_offset = 0;
if (event->state & GDK_SHIFT_MASK)
new_virt_loc.vcell_loc.virt_row = 1;
else
{
distance = sheet->num_visible_phys_rows - 1;
gnc_table_move_vertical_position (table, &new_virt_loc,
-distance);
gnc_table_move_vertical_position
(table, &new_virt_loc, -distance);
}
break;
case GDK_KP_Page_Down:
case GDK_Page_Down:
direction = GNC_TABLE_TRAVERSE_DOWN;
new_virt_loc.phys_col_offset = 0;
if (event->state & GDK_SHIFT_MASK)
new_virt_loc.vcell_loc.virt_row =
sheet->num_virt_rows - 1;
else
{
distance = sheet->num_visible_phys_rows - 1;
gnc_table_move_vertical_position (table, &new_virt_loc,
distance);
gnc_table_move_vertical_position
(table, &new_virt_loc, distance);
}
break;
case GDK_KP_Up:
case GDK_Up: