mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2001-06-26 Dave Peticolas <dave@krondo.com>
* src/gnome/gnc-html.c: don't handle keypresses, let the gtkhtml object do it. 2001-06-25 Dave Peticolas <dave@krondo.com> * src/engine/sql/kvp-sql.c: include gnc-engine-util.h for stpcpy * src/engine/gnc-engine-util.c (gnc_stpcpy): add func * src/engine/gnc-engine-util.h: add definition of gnc_stpcpy. if stpcpy is not available, define stpcpy as gnc_stpcpy. * src/gnc-ui-util.c: remove gnc_stpcpy git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4805 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
f4c6c8ea97
commit
6ef776aab8
14
ChangeLog
14
ChangeLog
@ -1,5 +1,19 @@
|
|||||||
|
2001-06-26 Dave Peticolas <dave@krondo.com>
|
||||||
|
|
||||||
|
* src/gnome/gnc-html.c: don't handle keypresses, let the gtkhtml
|
||||||
|
object do it.
|
||||||
|
|
||||||
2001-06-25 Dave Peticolas <dave@krondo.com>
|
2001-06-25 Dave Peticolas <dave@krondo.com>
|
||||||
|
|
||||||
|
* src/engine/sql/kvp-sql.c: include gnc-engine-util.h for stpcpy
|
||||||
|
|
||||||
|
* src/engine/gnc-engine-util.c (gnc_stpcpy): add func
|
||||||
|
|
||||||
|
* src/engine/gnc-engine-util.h: add definition of gnc_stpcpy.
|
||||||
|
if stpcpy is not available, define stpcpy as gnc_stpcpy.
|
||||||
|
|
||||||
|
* src/gnc-ui-util.c: remove gnc_stpcpy
|
||||||
|
|
||||||
* src/gnome/window-main-summarybar.c: fix bug in euro profit
|
* src/gnome/window-main-summarybar.c: fix bug in euro profit
|
||||||
calculation. use share prices in calculating totals.
|
calculation. use share prices in calculating totals.
|
||||||
|
|
||||||
|
@ -279,6 +279,17 @@ gnc_strisnum(const char *s)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/********************************************************************\
|
||||||
|
* our own version of stpcpy
|
||||||
|
\********************************************************************/
|
||||||
|
|
||||||
|
char *
|
||||||
|
gnc_stpcpy (char *dest, const char *src)
|
||||||
|
{
|
||||||
|
strcpy (dest, src);
|
||||||
|
return (dest + strlen (src));
|
||||||
|
}
|
||||||
|
|
||||||
/********************************************************************\
|
/********************************************************************\
|
||||||
See header for docs.
|
See header for docs.
|
||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
|
@ -27,7 +27,9 @@
|
|||||||
#ifndef __GNC_ENGINE_UTIL_H__
|
#ifndef __GNC_ENGINE_UTIL_H__
|
||||||
#define __GNC_ENGINE_UTIL_H__
|
#define __GNC_ENGINE_UTIL_H__
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -211,6 +213,13 @@ char * ultostr (unsigned long val, int base);
|
|||||||
* whitespace. */
|
* whitespace. */
|
||||||
gboolean gnc_strisnum(const char *s);
|
gboolean gnc_strisnum(const char *s);
|
||||||
|
|
||||||
|
/* Define a gnucash stpcpy */
|
||||||
|
char * gnc_stpcpy (char *dest, const char *src);
|
||||||
|
|
||||||
|
#ifndef HAVE_STPCPY
|
||||||
|
#define stpcpy gnc_stpcpy
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************\
|
/***********************************************************************\
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "gnc-engine-util.h"
|
||||||
#include "kvp-sql.h"
|
#include "kvp-sql.h"
|
||||||
#include "PostgresBackend.h"
|
#include "PostgresBackend.h"
|
||||||
#include "putil.h"
|
#include "putil.h"
|
||||||
|
@ -765,15 +765,6 @@ gnc_pop_locale (void)
|
|||||||
g_free (saved_locale);
|
g_free (saved_locale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static char *
|
|
||||||
gnc_stpcpy (char *dest, const char *src)
|
|
||||||
{
|
|
||||||
strcpy(dest, src);
|
|
||||||
return(dest + strlen(src));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GNCPrintAmountInfo
|
GNCPrintAmountInfo
|
||||||
gnc_default_print_info (gboolean use_symbol)
|
gnc_default_print_info (gboolean use_symbol)
|
||||||
{
|
{
|
||||||
|
@ -721,71 +721,6 @@ gnc_html_set_base_cb(GtkHTML * gtkhtml, const gchar * base,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
|
||||||
* gnc_html_key_cb
|
|
||||||
********************************************************************/
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
gnc_html_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) {
|
|
||||||
gnc_html * hw = (gnc_html *) data;
|
|
||||||
|
|
||||||
GtkAdjustment * vadj =
|
|
||||||
gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(hw->container));
|
|
||||||
GtkAdjustment * hadj =
|
|
||||||
gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(hw->container));
|
|
||||||
|
|
||||||
gfloat v_value = vadj->value;
|
|
||||||
gfloat h_value = hadj->value;
|
|
||||||
|
|
||||||
switch (event->keyval)
|
|
||||||
{
|
|
||||||
case GDK_KP_Left:
|
|
||||||
case GDK_Left:
|
|
||||||
h_value -= hadj->step_increment;
|
|
||||||
break;
|
|
||||||
case GDK_KP_Right:
|
|
||||||
case GDK_Right:
|
|
||||||
h_value += hadj->step_increment;
|
|
||||||
break;
|
|
||||||
case GDK_KP_Up:
|
|
||||||
case GDK_Up:
|
|
||||||
v_value -= vadj->step_increment;
|
|
||||||
break;
|
|
||||||
case GDK_KP_Down:
|
|
||||||
case GDK_Down:
|
|
||||||
v_value += vadj->step_increment;
|
|
||||||
break;
|
|
||||||
case GDK_KP_Page_Up:
|
|
||||||
case GDK_Page_Up:
|
|
||||||
v_value -= vadj->page_increment;
|
|
||||||
break;
|
|
||||||
case GDK_KP_Page_Down:
|
|
||||||
case GDK_Page_Down:
|
|
||||||
case GDK_space:
|
|
||||||
v_value += vadj->page_increment;
|
|
||||||
break;
|
|
||||||
case GDK_KP_Home:
|
|
||||||
case GDK_Home:
|
|
||||||
v_value = vadj->lower;
|
|
||||||
break;
|
|
||||||
case GDK_KP_End:
|
|
||||||
case GDK_End:
|
|
||||||
v_value = vadj->upper;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
v_value = CLAMP(v_value, vadj->lower, vadj->upper - vadj->page_size);
|
|
||||||
h_value = CLAMP(h_value, hadj->lower, hadj->upper - hadj->page_size);
|
|
||||||
|
|
||||||
gtk_adjustment_set_value(vadj, v_value);
|
|
||||||
gtk_adjustment_set_value(hadj, h_value);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
* gnc_html_button_press_cb
|
* gnc_html_button_press_cb
|
||||||
* mouse button callback (if any)
|
* mouse button callback (if any)
|
||||||
@ -1316,9 +1251,6 @@ gnc_html_new(void) {
|
|||||||
GTK_SIGNAL_FUNC (gnc_html_button_press_cb),
|
GTK_SIGNAL_FUNC (gnc_html_button_press_cb),
|
||||||
(gpointer)retval);
|
(gpointer)retval);
|
||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT(retval->html), "key_press_event",
|
|
||||||
GTK_SIGNAL_FUNC(gnc_html_key_cb), (gpointer)retval);
|
|
||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT(retval->html), "submit",
|
gtk_signal_connect (GTK_OBJECT(retval->html), "submit",
|
||||||
GTK_SIGNAL_FUNC(gnc_html_submit_cb), (gpointer)retval);
|
GTK_SIGNAL_FUNC(gnc_html_submit_cb), (gpointer)retval);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user