mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2002-11-03 Joshua Sled <jsled@asynchronous.org>
* src/gnome/dialog-sxsincelast.c: Use GNCSplitReg over GNCRegWidget. * src/gnome/dialog-scheduledxaction.c (schedXact_editor_create_ledger): Use GNCSplitReg over GNCRegWidget. * src/gnome/glade/register.glade: Moved a bunch of the previously-shared widget definitions into seperate places to be accessed by window-register.c and gnc-split-reg.c. * src/gnome/window-register.c: Massive code-sucking into gnc-split-reg.c; this file now only handles the details of being the register window: dealing with dates and the extended menus and whatnot. * src/gnome/gnc-split-reg.c: Added; a better implementation of gnc-regWidget. All the "common" register-editing code has been moved here from window-register.c. * src/register/ledger-core/gnc-regwidget.c: Removed; replaced with src/gnome/gnc-split-reg.c. * src/register/register-gnome/gnucash-date-picker.c (gnc_date_picker_new): Call gtk_widget_show_all rather than gtk_widget_realize in order to setup the calendar to a state sufficient for subsequent calls. * HACKING: Added description of how to start GnuCash in GDB. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7437 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
2db34dcb9f
commit
0f08ff10aa
32
ChangeLog
32
ChangeLog
@ -1,3 +1,35 @@
|
||||
2002-11-03 Joshua Sled <jsled@asynchronous.org>
|
||||
|
||||
* src/gnome/dialog-sxsincelast.c: Use GNCSplitReg over
|
||||
GNCRegWidget.
|
||||
|
||||
* src/gnome/dialog-scheduledxaction.c
|
||||
(schedXact_editor_create_ledger): Use GNCSplitReg over
|
||||
GNCRegWidget.
|
||||
|
||||
* src/gnome/glade/register.glade: Moved a bunch of the
|
||||
previously-shared widget definitions into seperate places to be
|
||||
accessed by window-register.c and gnc-split-reg.c.
|
||||
|
||||
* src/gnome/window-register.c: Massive code-sucking into
|
||||
gnc-split-reg.c; this file now only handles the details of being
|
||||
the register window: dealing with dates and the extended menus and
|
||||
whatnot.
|
||||
|
||||
* src/gnome/gnc-split-reg.c: Added; a better implementation of
|
||||
gnc-regWidget. All the "common" register-editing code has been
|
||||
moved here from window-register.c.
|
||||
|
||||
* src/register/ledger-core/gnc-regwidget.c: Removed; replaced with
|
||||
src/gnome/gnc-split-reg.c.
|
||||
|
||||
* src/register/register-gnome/gnucash-date-picker.c
|
||||
(gnc_date_picker_new): Call gtk_widget_show_all rather than
|
||||
gtk_widget_realize in order to setup the calendar to a state
|
||||
sufficient for subsequent calls.
|
||||
|
||||
* HACKING: Added description of how to start GnuCash in GDB.
|
||||
|
||||
2002-11-03 Derek Atkins <derek@ihtfp.com>
|
||||
* engine/gnc-be-utils.h: implement macro helpers for begin/commit functions
|
||||
* business/business-core/*.c: Implement BeginEdit()/CommitEdit() functions
|
||||
|
8
HACKING
8
HACKING
@ -66,3 +66,11 @@ Scheme:
|
||||
|
||||
Dave Peticolas <dave@krondo.com>
|
||||
August 22, 2000
|
||||
|
||||
--------------------------------------------------
|
||||
|
||||
Starting GnuCash in GDB -- Oct 2002
|
||||
|
||||
% gnucash-env gdb /path/to/guile
|
||||
[gdb output]
|
||||
% gdb> run -e main -s /path/to/devel-gnucash/libexec/overrides/gnucash --g-fatal-warnings
|
||||
|
@ -44,6 +44,7 @@ libgncgnome_la_SOURCES = \
|
||||
druid-loan.c \
|
||||
druid-stock-split.c \
|
||||
gnc-splash.c \
|
||||
gnc-split-reg.c \
|
||||
mainwindow-account-tree.c \
|
||||
reconcile-list.c \
|
||||
tip-of-the-day.c \
|
||||
@ -80,6 +81,7 @@ noinst_HEADERS = \
|
||||
druid-loan.h \
|
||||
gnc-network.h \
|
||||
gnc-splash.h \
|
||||
gnc-split-reg.h \
|
||||
gw-gnc.h \
|
||||
mainwindow-account-tree.h \
|
||||
reconcile-list.h \
|
||||
|
@ -48,7 +48,7 @@
|
||||
#include "window-help.h"
|
||||
#include "window-register.h"
|
||||
|
||||
#include "gnc-regwidget.h"
|
||||
#include "gnc-split-reg.h"
|
||||
|
||||
/* FIXME: temp until variable-related-stuff settled. */
|
||||
#include "dialog-sxsincelast.h"
|
||||
@ -1333,7 +1333,7 @@ schedXact_editor_create_ledger( SchedXactionEditorDialog *sxed )
|
||||
{
|
||||
GtkFrame *tempxaction_frame;
|
||||
SplitRegister *splitreg;
|
||||
GtkWidget *regWidget, *vbox;
|
||||
GtkWidget *gsr, *vbox;
|
||||
int numLedgerLines = NUM_LEDGER_LINES_DEFAULT;
|
||||
|
||||
tempxaction_frame =
|
||||
@ -1349,39 +1349,39 @@ schedXact_editor_create_ledger( SchedXactionEditorDialog *sxed )
|
||||
(int)gnc_lookup_number_option( SX_OPT_STR,
|
||||
"Template Register Lines",
|
||||
NUM_LEDGER_LINES_DEFAULT );
|
||||
gnucash_register_set_initial_rows(numLedgerLines);
|
||||
gsr = gnc_split_reg_new( sxed->ledger, GTK_WINDOW(sxed->dialog),
|
||||
numLedgerLines,
|
||||
(CREATE_TOOLBAR | CREATE_POPUP | CREATE_MENUS),
|
||||
(CAP_JUMP | CAP_SCHEDULE) );
|
||||
|
||||
regWidget = gnc_regWidget_new( sxed->ledger,
|
||||
GTK_WINDOW(sxed->dialog),
|
||||
CAP_SCHEDULE | CAP_JUMP );
|
||||
gtk_box_pack_start( GTK_BOX(vbox),
|
||||
gnc_regWidget_get_toolbar( GNC_REGWIDGET(regWidget) ),
|
||||
gnc_split_reg_get_toolbar( GNC_SPLIT_REG(gsr) ),
|
||||
FALSE, TRUE, 2 );
|
||||
{
|
||||
GtkWidget *popup, *tmpMenu, *tmpMI;
|
||||
/* Fixup the popup menu with the menus that would normally be in the
|
||||
* menu-bar of the window-register. */
|
||||
popup = gnc_regWidget_get_popup( GNC_REGWIDGET(regWidget) );
|
||||
popup = gnc_split_reg_get_popup( GNC_SPLIT_REG(gsr) );
|
||||
gtk_menu_append( GTK_MENU(popup), gtk_menu_item_new() );
|
||||
|
||||
tmpMenu = gnc_regWidget_get_edit_menu( GNC_REGWIDGET(regWidget) );
|
||||
tmpMenu = gnc_split_reg_get_edit_menu( GNC_SPLIT_REG(gsr) );
|
||||
tmpMI = gtk_menu_item_new_with_label( N_("Edit") );
|
||||
gtk_menu_item_set_submenu( GTK_MENU_ITEM(tmpMI), tmpMenu );
|
||||
gtk_menu_append( GTK_MENU(popup), tmpMI );
|
||||
|
||||
tmpMenu = gnc_regWidget_get_style_menu( GNC_REGWIDGET(regWidget) );
|
||||
tmpMenu = gnc_split_reg_get_style_menu( GNC_SPLIT_REG(gsr) );
|
||||
tmpMI = gtk_menu_item_new_with_label( N_("Style") );
|
||||
gtk_menu_item_set_submenu( GTK_MENU_ITEM(tmpMI), tmpMenu );
|
||||
gtk_menu_append( GTK_MENU(popup), tmpMI );
|
||||
|
||||
tmpMenu = gnc_regWidget_get_sort_menu( GNC_REGWIDGET(regWidget) );
|
||||
tmpMenu = gnc_split_reg_get_sort_menu( GNC_SPLIT_REG(gsr) );
|
||||
tmpMI = gtk_menu_item_new_with_label( N_("Sort") );
|
||||
gtk_menu_item_set_submenu( GTK_MENU_ITEM(tmpMI), tmpMenu );
|
||||
gtk_menu_append( GTK_MENU(popup), tmpMI );
|
||||
|
||||
gtk_widget_show_all( popup );
|
||||
}
|
||||
gtk_box_pack_start( GTK_BOX(vbox), regWidget, TRUE, TRUE, 2 );
|
||||
gtk_box_pack_start( GTK_BOX(vbox), gsr, TRUE, TRUE, 2 );
|
||||
|
||||
/* configure... */
|
||||
/* don't use double-line */
|
||||
|
@ -73,7 +73,7 @@
|
||||
#include "split-register.h"
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnucash-sheet.h"
|
||||
#include "gnc-regwidget.h"
|
||||
#include "gnc-split-reg.h"
|
||||
|
||||
#include "dialog-sxsincelast.h"
|
||||
#include "dialog-scheduledxaction.h"
|
||||
@ -278,13 +278,13 @@ typedef struct _sxSinceLastData {
|
||||
gint autoCreatedCount;
|
||||
|
||||
GNCLedgerDisplay *ac_ledger;
|
||||
GNCRegWidget *ac_regWidget;
|
||||
GNCSplitReg *ac_gsr;
|
||||
|
||||
GNCLedgerDisplay *created_ledger;
|
||||
GNCRegWidget *created_regWidget;
|
||||
GNCSplitReg *created_gsr;
|
||||
|
||||
GNCLedgerDisplay *to_create_ledger;
|
||||
GNCRegWidget *to_create_regWidget;
|
||||
GNCSplitReg *to_create_gsr;
|
||||
|
||||
} sxSinceLastData;
|
||||
|
||||
@ -2825,7 +2825,7 @@ sxsincelast_tc_row_sel( GtkCTree *ct,
|
||||
sxGUIDstr = guid_to_string( xaccSchedXactionGetGUID( tci->parentTCT->sx ) );
|
||||
|
||||
sxsld->to_create_ledger = gnc_ledger_display_template_gl( sxGUIDstr );
|
||||
gnc_regWidget_set_ledger_display( sxsld->to_create_regWidget,
|
||||
gnc_split_reg_set_ledger_display( sxsld->to_create_gsr,
|
||||
sxsld->to_create_ledger );
|
||||
}
|
||||
|
||||
@ -3493,19 +3493,20 @@ create_autoCreate_ledger( sxSinceLastData *sxsld )
|
||||
sxsld_ledger_get_parent );
|
||||
gnc_ledger_display_set_user_data( sxsld->ac_ledger, (gpointer)sxsld );
|
||||
splitreg = gnc_ledger_display_get_split_register( sxsld->ac_ledger );
|
||||
/* FIXME: make configurable? */
|
||||
gnucash_register_set_initial_rows( 4 );
|
||||
|
||||
sxsld->ac_regWidget =
|
||||
GNC_REGWIDGET(gnc_regWidget_new( sxsld->ac_ledger,
|
||||
/* FIXME: Make numRows configurable. */
|
||||
sxsld->ac_gsr =
|
||||
gnc_split_reg_new( sxsld->ac_ledger,
|
||||
GTK_WINDOW( sxsld->sincelast_window ),
|
||||
CAP_SCHEDULE ));
|
||||
4,
|
||||
(CREATE_TOOLBAR | CREATE_POPUP),
|
||||
CAP_SCHEDULE );
|
||||
|
||||
vbox = glade_xml_get_widget( sxsld->gxml, AUTO_CREATE_VBOX );
|
||||
toolbar = gnc_regWidget_get_toolbar( sxsld->ac_regWidget );
|
||||
toolbar = gnc_split_reg_get_toolbar( sxsld->ac_gsr );
|
||||
|
||||
gtk_box_pack_start( GTK_BOX(vbox), toolbar, FALSE, FALSE, 2 );
|
||||
gtk_box_pack_end( GTK_BOX(vbox), GTK_WIDGET(sxsld->ac_regWidget), TRUE, TRUE, 2 );
|
||||
gtk_box_pack_end( GTK_BOX(vbox), GTK_WIDGET(sxsld->ac_gsr), TRUE, TRUE, 2 );
|
||||
|
||||
/* FIXME: we should do all the happy-fun register stuff... button bar
|
||||
* controls ... popups ... */
|
||||
@ -3541,19 +3542,19 @@ create_created_ledger( sxSinceLastData *sxsld )
|
||||
sxsld_ledger_get_parent );
|
||||
gnc_ledger_display_set_user_data( sxsld->created_ledger, (gpointer)sxsld );
|
||||
splitreg = gnc_ledger_display_get_split_register( sxsld->created_ledger );
|
||||
/* FIXME: make configurable? */
|
||||
gnucash_register_set_initial_rows( 4 );
|
||||
|
||||
sxsld->created_regWidget =
|
||||
GNC_REGWIDGET(gnc_regWidget_new( sxsld->created_ledger,
|
||||
/* FIXME: make numRows configurable? */
|
||||
sxsld->created_gsr =
|
||||
gnc_split_reg_new( sxsld->created_ledger,
|
||||
GTK_WINDOW( sxsld->sincelast_window ),
|
||||
CAP_SCHEDULE ));
|
||||
4,
|
||||
( CREATE_TOOLBAR | CREATE_POPUP ),
|
||||
CAP_SCHEDULE );
|
||||
|
||||
vbox = glade_xml_get_widget( sxsld->gxml, CREATED_VBOX );
|
||||
toolbar = gnc_regWidget_get_toolbar( sxsld->created_regWidget );
|
||||
toolbar = gnc_split_reg_get_toolbar( sxsld->created_gsr );
|
||||
|
||||
gtk_box_pack_start( GTK_BOX(vbox), toolbar, FALSE, FALSE, 2 );
|
||||
gtk_box_pack_end( GTK_BOX(vbox), GTK_WIDGET(sxsld->created_regWidget), TRUE, TRUE, 2 );
|
||||
gtk_box_pack_end( GTK_BOX(vbox), GTK_WIDGET(sxsld->created_gsr), TRUE, TRUE, 2 );
|
||||
|
||||
|
||||
/* FIXME: we should do all the happy-fun register stuff... button bar
|
||||
@ -3590,17 +3591,17 @@ create_to_create_ledger( sxSinceLastData *sxsld )
|
||||
sxsld_ledger_get_parent );
|
||||
gnc_ledger_display_set_user_data( sxsld->to_create_ledger, (gpointer)sxsld );
|
||||
splitreg = gnc_ledger_display_get_split_register( sxsld->to_create_ledger );
|
||||
/* FIXME: make configurable? */
|
||||
gnucash_register_set_initial_rows( 4 );
|
||||
|
||||
sxsld->to_create_regWidget =
|
||||
GNC_REGWIDGET(gnc_regWidget_new( sxsld->to_create_ledger,
|
||||
/* FIXME: make numRows configurable? */
|
||||
sxsld->to_create_gsr =
|
||||
gnc_split_reg_new( sxsld->to_create_ledger,
|
||||
GTK_WINDOW( sxsld->sincelast_window ),
|
||||
CAP_SCHEDULE ));
|
||||
4,
|
||||
( CREATE_TOOLBAR | CREATE_POPUP ),
|
||||
( CAP_READ_ONLY | CAP_SCHEDULE) );
|
||||
|
||||
txn_reg_frame = glade_xml_get_widget( sxsld->gxml, TO_CREATE_TXN_REG_FRAME );
|
||||
gtk_container_add( GTK_CONTAINER( txn_reg_frame ),
|
||||
GTK_WIDGET( sxsld->to_create_regWidget ) );
|
||||
GTK_WIDGET( sxsld->to_create_gsr ) );
|
||||
|
||||
|
||||
/* configure... */
|
||||
|
File diff suppressed because it is too large
Load Diff
2240
src/gnome/gnc-split-reg.c
Normal file
2240
src/gnome/gnc-split-reg.c
Normal file
File diff suppressed because it is too large
Load Diff
277
src/gnome/gnc-split-reg.h
Normal file
277
src/gnome/gnc-split-reg.h
Normal file
@ -0,0 +1,277 @@
|
||||
/********************************************************************\
|
||||
* gnc-split-reg.h -- A widget for the common register look-n-feel. *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* Copyright (C) 1997-1998 Linas Vepstas <linas@linas.org> *
|
||||
* Copyright (C) 1998 Rob Browning <rlb@cs.utexas.edu> *
|
||||
* Copyright (C) 1999-2000 Dave Peticolas <dave@krondo.com> *
|
||||
* Copyright (C) 2001 Gnumatic, Inc. *
|
||||
* Copyright (C) 2002 Joshua Sled <jsled@asynchronous.org> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Another take at the gnc-reg-widget.
|
||||
* 2002.10.27 -- jsled
|
||||
*
|
||||
* To be explained:
|
||||
* . inserting controls
|
||||
* . menus, toolbar
|
||||
* . gtk_{menu,toolbar}_{append,prepend,insert} is good; callers need to know indexes
|
||||
* . gint gnc_reg_widget_get_toolbar_index( GNCRegWidget, GNC_REG_WIDGET_ITEM )
|
||||
* . gint gnc_reg_widget_get_menu_index ( GNCRegWidget, GNC_REG_WIDGET_ITEM )
|
||||
* . gint gnc_reg_widget_get_popup_index ( GNCRegWidget, GNC_REG_WIDGET_ITEM )
|
||||
*
|
||||
* . created status-display widgets [checkboxes in menus, &c.]
|
||||
* . i/f to changing?
|
||||
* . gnc_reg_widget_set_split_state( GNCRegWidget, gboolean split )
|
||||
* . gnc_reg_widget_set_double_line( GNCRegWidget, gboolean doubleLine )
|
||||
*
|
||||
* Questionable Features:
|
||||
* . File
|
||||
* . new account
|
||||
* . print
|
||||
* . print check
|
||||
* . save (as)...
|
||||
* . close
|
||||
* . exit
|
||||
* . view
|
||||
* . date range
|
||||
* . edit
|
||||
* . find
|
||||
* . actions
|
||||
* . transfer
|
||||
* . reconcile
|
||||
* . stock split
|
||||
* . check and repair
|
||||
* . reports
|
||||
* . tools
|
||||
**/
|
||||
|
||||
#ifndef GNC_SPLIT_REG_H
|
||||
#define GNC_SPLIT_REG_H
|
||||
|
||||
#include <libguile.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "config.h"
|
||||
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnucash-sheet.h"
|
||||
|
||||
#define GNC_SPLIT_REG(obj) GTK_CHECK_CAST( obj, gnc_split_reg_get_type(), GNCSplitReg )
|
||||
#define GNC_SPLIT_REG_CLASS(klass) GTK_CHECK_CLASS_CAST( klass, gnc_split_reg_get_type(), GNCSplitRegClass )
|
||||
#define IS_GNC_SPLIT_REG(obj) GTK_CHECK_TYPE( obj, gnc_split_reg_get_type() )
|
||||
|
||||
typedef struct _GNCSplitReg GNCSplitReg;
|
||||
typedef struct _GNCSplitRegClass GNCSplitRegClass;
|
||||
|
||||
struct _GNCSplitReg {
|
||||
/* The "parent" widget. */
|
||||
GtkVBox vbox;
|
||||
|
||||
/* The containing window. */
|
||||
GtkWidget *window;
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
SCM toolbar_change_callback_id;
|
||||
GtkWidget *toolbar;
|
||||
GtkWidget *summarybar;
|
||||
|
||||
GtkWidget *popup_menu;
|
||||
|
||||
GtkWidget *edit_menu;
|
||||
GtkWidget *view_menu;
|
||||
GtkWidget *style_submenu;
|
||||
GtkWidget *sort_submenu;
|
||||
GtkWidget *action_menu;
|
||||
|
||||
GtkWidget * double_line_check;
|
||||
|
||||
GtkWidget *split_button;
|
||||
GtkWidget *split_menu_check;
|
||||
GtkWidget *split_popup_check;
|
||||
|
||||
GtkWidget *balance_label;
|
||||
GtkWidget *cleared_label;
|
||||
GtkWidget *reconciled_label;
|
||||
GtkWidget *future_label;
|
||||
GtkWidget *shares_label;
|
||||
GtkWidget *value_label;
|
||||
|
||||
/** The current ledger display. **/
|
||||
GNCLedgerDisplay *ledger;
|
||||
/** The actual sheet widget. **/
|
||||
GnucashRegister *reg;
|
||||
|
||||
gint numRows;
|
||||
gint createFlags;
|
||||
gint disallowedCaps;
|
||||
|
||||
gint sort_type;
|
||||
|
||||
gboolean read_only;
|
||||
};
|
||||
|
||||
struct _GNCSplitRegClass {
|
||||
GtkVBoxClass parent_class;
|
||||
|
||||
/* Signal defaults */
|
||||
void (*enter_ent_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*cancel_ent_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*delete_ent_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*reinit_ent_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*dup_ent_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*schedule_ent_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*expand_ent_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*blank_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*jump_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*cut_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*cut_txn_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*copy_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*copy_txn_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*paste_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*paste_txn_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
void (*help_changed_cb) ( GNCSplitReg *w, gpointer user_data );
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
ENTER,
|
||||
CANCEL,
|
||||
DELETE,
|
||||
REINIT,
|
||||
DUPLICATE,
|
||||
SCHEDULE,
|
||||
SPLIT,
|
||||
BLANK,
|
||||
JUMP,
|
||||
CUT,
|
||||
CUT_TXN,
|
||||
COPY,
|
||||
COPY_TXN,
|
||||
PASTE,
|
||||
PASTE_TXN,
|
||||
SORT_ORDER_SUBMENU,
|
||||
STYLE_SUBMENU,
|
||||
} GNC_SPLIT_REG_ITEM;
|
||||
|
||||
/* Easy way to pass the sort-type */
|
||||
typedef enum {
|
||||
BY_NONE = 0,
|
||||
BY_STANDARD,
|
||||
BY_DATE,
|
||||
BY_DATE_ENTERED,
|
||||
BY_DATE_RECONCILED,
|
||||
BY_NUM,
|
||||
BY_AMOUNT,
|
||||
BY_MEMO,
|
||||
BY_DESC
|
||||
} SortType;
|
||||
|
||||
/**
|
||||
* Flags for creation-time selection of what subwidgets are to be created.
|
||||
**/
|
||||
#define CREATE_TOOLBAR (1 << 0)
|
||||
#define CREATE_MENUS (1 << 1)
|
||||
#define CREATE_POPUP (1 << 2)
|
||||
#define CREATE_SUMMARYBAR (1 << 3)
|
||||
|
||||
/**
|
||||
* Flags for various capabilities of the GNCSplitReg; these are used to
|
||||
* disable specific functionality.
|
||||
**/
|
||||
#define CAP_READ_ONLY (1 << 0) /**< A read-only register. **/
|
||||
#define CAP_DELETE (1 << 1) /**< Deleting items. **/
|
||||
#define CAP_JUMP (1 << 2) /**< Jumping to the related transaction. **/
|
||||
#define CAP_SCHEDULE (1 << 3) /**< Scheduling transactions. **/
|
||||
|
||||
/**
|
||||
* GTK-related; gets an identifier for the class of GNCSplitRegs.
|
||||
**/
|
||||
guint gnc_split_reg_get_type(void);
|
||||
|
||||
/**
|
||||
* Creates and returns a GNCSplitReg.
|
||||
* @param ld The GNCLedgerDisplay to use for display.
|
||||
* @param parent The containing window.
|
||||
* @param numberOfLines The initial number of lines for the register.
|
||||
* @param createFlags A set of flags for the sub-widgets to create.
|
||||
* @param disallowCaps A set of flags for capabilities which should be
|
||||
* disallowed.
|
||||
**/
|
||||
GtkWidget* gnc_split_reg_new( GNCLedgerDisplay *ld,
|
||||
GtkWindow *parent,
|
||||
gint numberOfLines,
|
||||
gint createFlags,
|
||||
gint disallowCaps );
|
||||
|
||||
/**
|
||||
* Changes the ledger display being used by the GNCSplitReg.
|
||||
**/
|
||||
void gnc_split_reg_set_ledger_display( GNCSplitReg *gsr,
|
||||
GNCLedgerDisplay *ld );
|
||||
|
||||
/**
|
||||
* Returns the GnucashRegister in effect for this GNCSplitReg.
|
||||
**/
|
||||
GnucashRegister *gnc_split_reg_get_register( GNCSplitReg *gsr );
|
||||
|
||||
/**
|
||||
* Gets/sets the sort-type of the GNCSplitReg.
|
||||
**/
|
||||
SortType gnc_split_reg_get_sort_type( GNCSplitReg *gsr );
|
||||
void gnc_split_reg_set_sort_type( GNCSplitReg *gsr, SortType t );
|
||||
|
||||
/**
|
||||
* Retreives the various menus created by the GNCSplitReg. Callers may want
|
||||
* to put these in a more traditional menu bar, for instance.
|
||||
**/
|
||||
GtkWidget *gnc_split_reg_get_edit_menu ( GNCSplitReg *gsr );
|
||||
GtkWidget *gnc_split_reg_get_view_menu ( GNCSplitReg *gsr );
|
||||
GtkWidget *gnc_split_reg_get_style_menu ( GNCSplitReg *gsr );
|
||||
GtkWidget *gnc_split_reg_get_sort_menu ( GNCSplitReg *gsr );
|
||||
GtkWidget *gnc_split_reg_get_action_menu ( GNCSplitReg *gsr );
|
||||
|
||||
/**
|
||||
* Can return NULL if the indicated subwidget was not created.
|
||||
**/
|
||||
GtkWidget *gnc_split_reg_get_toolbar ( GNCSplitReg *gsr );
|
||||
GtkWidget *gnc_split_reg_get_summarybar( GNCSplitReg *gsr );
|
||||
GtkWidget *gnc_split_reg_get_popup ( GNCSplitReg *gsr );
|
||||
|
||||
/**
|
||||
* These will manipulate the in-GNCSplitReg state-reflecting widgets as
|
||||
* appropriate.
|
||||
**/
|
||||
void gnc_split_reg_set_split_state( GNCSplitReg *gsr, gboolean split );
|
||||
void gnc_split_reg_set_double_line( GNCSplitReg *gsr, gboolean doubleLine );
|
||||
|
||||
/**
|
||||
* Convenience function for users. Returns the popup menu containing what
|
||||
* would normally be the menu-bar-placed menu items. Callers may not have a
|
||||
* menu bar, but wish to provide full functionality.
|
||||
*
|
||||
* The menu-bar items will be at the bottom of the popup menu, seperated.
|
||||
* The menu-bar items will be created if they were not originally created.
|
||||
**/
|
||||
GtkWidget *gnc_split_reg_get_popup_extended( GNCSplitReg *gsr );
|
||||
|
||||
gboolean gnc_split_reg_check_close( GNCSplitReg *gsr );
|
||||
|
||||
#endif /* GNC_SPLIT_REG_H */
|
File diff suppressed because it is too large
Load Diff
@ -12,8 +12,7 @@ libgncmod_ledger_core_la_SOURCES = \
|
||||
split-register-load.c \
|
||||
split-register-model.c \
|
||||
split-register-model-save.c \
|
||||
split-register-util.c \
|
||||
gnc-regwidget.c
|
||||
split-register-util.c
|
||||
|
||||
noinst_HEADERS = \
|
||||
gnc-ledger-display.h \
|
||||
@ -22,8 +21,7 @@ noinst_HEADERS = \
|
||||
split-register-layout.h \
|
||||
split-register-model.h \
|
||||
split-register-model-save.h \
|
||||
split-register-p.h \
|
||||
gnc-regwidget.h
|
||||
split-register-p.h
|
||||
|
||||
libgncmod_ledger_core_la_LDFLAGS = -module
|
||||
libgncmod_ledger_core_la_LIBADD = \
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,124 +0,0 @@
|
||||
/********************************************************************\
|
||||
* gnc-regwidget.h -- A widget for the common register look-n-feel. *
|
||||
* Copyright (C) 2001 Joshua Sled <jsled@asynchronous.org> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef GNC_REGWIDGET_H
|
||||
#define GNC_REGWIDGET_H
|
||||
|
||||
#include <libguile.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "config.h"
|
||||
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnucash-sheet.h"
|
||||
|
||||
#define GNC_REGWIDGET(obj) GTK_CHECK_CAST( obj, gnc_regWidget_get_type(), GNCRegWidget )
|
||||
#define GNC_REGWIDGET_CLASS(klass) GTK_CHECK_CLASS_CAST( klass, gnc_regWidget_get_type(), GNCRegWidgetClass )
|
||||
#define IS_GNC_REGWIDGET(obj) GTK_CHECK_TYPE( obj, gnc_regWidget_get_type() )
|
||||
|
||||
typedef struct _GNCRegWidget GNCRegWidget;
|
||||
typedef struct _GNCRegWidgetClass GNCRegWidgetClass;
|
||||
|
||||
struct _GNCRegWidget {
|
||||
/* The "parent" widget */
|
||||
GtkVBox vbox;
|
||||
|
||||
/* Top level/containing window */
|
||||
/* jsled: used by the jump cbs; can we get by w/o knowing this? investigate
|
||||
* layering */
|
||||
GtkWidget * window;
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
SCM toolbar_change_callback_id;
|
||||
GtkWidget * toolbar;
|
||||
GtkWidget * statusbar;
|
||||
|
||||
GtkWidget * popup_menu;
|
||||
|
||||
GtkWidget * style_menu;
|
||||
GtkWidget * sort_menu;
|
||||
GtkWidget * edit_menu;
|
||||
GtkWidget * transaction_menu;
|
||||
GtkWidget * help_menu;
|
||||
|
||||
GtkWidget * double_line_check;
|
||||
|
||||
GtkWidget * split_button;
|
||||
GtkWidget * split_menu_check;
|
||||
GtkWidget * split_popup_check;
|
||||
|
||||
GNCLedgerDisplay * ledger;
|
||||
/* The actual sheet widget */
|
||||
GnucashRegister *reg;
|
||||
|
||||
gint disallowedCaps;
|
||||
|
||||
gint sort_type;
|
||||
};
|
||||
|
||||
struct _GNCRegWidgetClass {
|
||||
GtkVBoxClass parent_class;
|
||||
|
||||
/* Signal prototype holders */
|
||||
void (*enter_ent_cb)( GNCRegWidget *w, gpointer user_data );
|
||||
void (*cancel_ent_cb)( GNCRegWidget *w, gpointer user_data );
|
||||
void (*delete_ent_cb)( GNCRegWidget *w, gpointer user_data );
|
||||
void (*dup_ent_cb)( GNCRegWidget *w, gpointer user_data );
|
||||
void (*schedule_ent_cb)( GNCRegWidget *w, gpointer user_data );
|
||||
void (*expand_ent_cb)( GNCRegWidget *w, gpointer user_data );
|
||||
void (*blank_cb)( GNCRegWidget *w, gpointer user_data );
|
||||
void (*jump_cb)( GNCRegWidget *w, gpointer user_data );
|
||||
};
|
||||
|
||||
#define CAP_DELETE (1 << 0)
|
||||
#define CAP_JUMP (1 << 1)
|
||||
#define CAP_SCHEDULE (1 << 2)
|
||||
|
||||
guint gnc_regWidget_get_type( void );
|
||||
|
||||
/**
|
||||
* Create a new GNCRegWidget for the given ledger display, parent window and
|
||||
* disallowing the given capabilities. Disallowed capabilities result in
|
||||
* inactive widgets.
|
||||
*
|
||||
* @param disallowCapabilities A bit-mask of 'CAP_' values to disallow access
|
||||
* to; use 0 to allow everything.
|
||||
**/
|
||||
GtkWidget *gnc_regWidget_new( GNCLedgerDisplay *ld,
|
||||
GtkWindow *parent,
|
||||
int disallowCapabilities );
|
||||
|
||||
void gnc_regWidget_set_ledger_display( GNCRegWidget *gncrw, GNCLedgerDisplay *ld );
|
||||
|
||||
GnucashRegister *gnc_regWidget_get_register( GNCRegWidget *rw );
|
||||
|
||||
GtkWidget *gnc_regWidget_get_style_menu( GNCRegWidget *rw );
|
||||
GtkWidget *gnc_regWidget_get_sort_menu( GNCRegWidget *rw );
|
||||
GtkWidget *gnc_regWidget_get_edit_menu( GNCRegWidget *rw );
|
||||
GtkWidget *gnc_regWidget_get_transaction_menu( GNCRegWidget *rw );
|
||||
GtkWidget *gnc_regWidget_get_help_menu( GNCRegWidget *rw );
|
||||
|
||||
GtkWidget *gnc_regWidget_get_toolbar( GNCRegWidget *rw );
|
||||
GtkWidget *gnc_regWidget_get_statusbar( GNCRegWidget *rw );
|
||||
GtkWidget *gnc_regWidget_get_popup( GNCRegWidget *rw );
|
||||
|
||||
#endif /* !defined(GNC_REGWIDGET_H) */
|
@ -119,7 +119,6 @@ gnc_date_picker_key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gnc_date_picker_class_init (GNCDatePickerClass *date_picker_class)
|
||||
{
|
||||
@ -167,7 +166,6 @@ gnc_date_picker_class_init (GNCDatePickerClass *date_picker_class)
|
||||
date_picker_class->key_press_event = NULL;
|
||||
}
|
||||
|
||||
|
||||
GtkType
|
||||
gnc_date_picker_get_type (void)
|
||||
{
|
||||
@ -233,8 +231,8 @@ gnc_date_picker_new (GnomeCanvasGroup *parent)
|
||||
"x", -10000.0,
|
||||
"y", -10000.0,
|
||||
NULL);
|
||||
|
||||
gtk_widget_realize (calendar);
|
||||
gtk_widget_realize( hbox );
|
||||
gtk_widget_show_all( hbox );
|
||||
|
||||
gtk_widget_size_request (calendar, &requisition);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user