mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-07-29 23:58:03 -05:00
*** empty log message ***
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2118 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,5 +1,21 @@
|
||||
2000-03-26 Dave Peticolas <peticola@cs.ucdavis.edu>
|
||||
|
||||
* src/register/splitreg.c: several new functions for saving and
|
||||
restore the contents of the cursor.
|
||||
|
||||
* src/SplitLedger.c (xaccSRRedrawRegEntry): always redraw, caller
|
||||
knows best!
|
||||
(LedgerMoveCursor): if we are leaving the pending transaction,
|
||||
commit it.
|
||||
(xaccSRLoadRegister): save and restore changed cursor values.
|
||||
(xaccSRSaveRegEntry): clear the register change flags.
|
||||
|
||||
2000-03-24 Dave Peticolas <peticola@cs.ucdavis.edu>
|
||||
|
||||
* src/register/gnome/quickfillcell-gnome.c (QuickFillDirect): if
|
||||
the cursor is in the selection, move it to the start of the
|
||||
selection.
|
||||
|
||||
* Makefile.common: add the value of DEFS to the compile flags
|
||||
|
||||
* Makefile.init.in: get the value for DEFS.
|
||||
|
||||
+42
-15
@@ -17,14 +17,14 @@ d'actions.
|
||||
Gnucash est convenablement configuré, et l'ordinateur hôte
|
||||
est connecté sur internet, le programme <tt>gnc-prices</tt> peut
|
||||
être utilisé pour récupérer les cotations
|
||||
des cours d'actions ou FCP et SICAV à partir de divers sites web
|
||||
directement dans GnuCash.
|
||||
des cours d'actions et de fonds communs (pas de FCP et de SICAV pour la
|
||||
france) à partir de divers sites web directement dans GnuCash.
|
||||
<p>Pour utiliser cette fonctionnalité, ce qui suit doit être
|
||||
fait:
|
||||
<ul>
|
||||
<li>
|
||||
Créer un compte et marquer le comme étant du type "FCP/SICAV"
|
||||
ou "Actions".</li>
|
||||
Créer un compte et marquer le comme étant du type "Fonds
|
||||
communs" ou "Actions".</li>
|
||||
|
||||
<li>
|
||||
Entrer un code de titre valide (ndt : code SICOVAM en france) dans le champ
|
||||
@@ -33,16 +33,43 @@ marqué "Valeur:"</li>
|
||||
<li>
|
||||
Sélectionner une source de cotations depuis le menu déroulant.
|
||||
Actuellement les sources de cotations supportés incluent <b>Yahoo</b>,
|
||||
<b>Fidelity
|
||||
Investments</b>, <b>T. Rowe Price</b> et le <b>Vanguard Group</b>. Noter
|
||||
que Yahoo fournira le cours des valeurs pour la plupart des fonds communs
|
||||
, <i>incluant</i> Fidelity, T.Rowe Price and Vanguard, et que les valeurs
|
||||
cotées à Yahoo devrait être identique à ceux
|
||||
qui sont sur les sites sources.(Autrement, quelqu'un rapportera une mauvaise
|
||||
information!)</li>
|
||||
<b>Yahoo
|
||||
Europe</b> , <b>Fidelity Investments</b>, <b>T. Rowe Price</b> et le <b>Vanguard
|
||||
Group</b>. Noter que Yahoo fournira le cours des valeurs pour la plupart
|
||||
des fonds communs , <i>incluant</i> Fidelity, T.Rowe Price and Vanguard,
|
||||
et que les cours des valeurs cotées à Yahoo devrait être
|
||||
identique à ceux qui sont sur les sites sources.(Autrement, quelqu'un
|
||||
rapportera une mauvaise information!).Si vous choisissez Yahoo Europe,
|
||||
vous devrez accoller le code du marché pour la valeur, tel que PA
|
||||
pour Paris, BE pour Berlin, etc. Example: 12150.PA (la valeur Peugot au
|
||||
marché de Paris).</li>
|
||||
|
||||
<li>
|
||||
Liste des codes de marchés européens:</li>
|
||||
</ul>
|
||||
Un exemple d'image est montré ci-dessous:
|
||||
<p><img SRC="Ticker-a.gif" NOSAVE height=347 width=405>
|
||||
value=PA>Paris
|
||||
<br> value=BC>Barcelone
|
||||
<br> value=BE>Berlin
|
||||
<br> value=BI>Bilbao
|
||||
<br> value=BM>Brême
|
||||
<br> value=CO>Copenhague
|
||||
<br> value=D>Dusseldorf
|
||||
<br> value=F>Francfort
|
||||
<br> value=H>Hambourg
|
||||
<br> value=HA>Hanovre
|
||||
<br> value=L>London
|
||||
<br> value=MA>Madrid
|
||||
<br> value=MC>Madrid
|
||||
(M.C.)
|
||||
<br> value=MI>Milan
|
||||
<br> value=MU>Munich
|
||||
<br> value=O>Oslo
|
||||
<br> value=ST>Stockholm
|
||||
<br> value=SG>Stuttgart
|
||||
<br> value=VA>Valence
|
||||
<br> value=FX>Xetra
|
||||
<p>Un exemple d'image est montré ci-dessous:
|
||||
<p><img SRC="pix/TICKER-A.GIF" NOSAVE height=347 width=405>
|
||||
<p>Pour mettre à jour les cours stockés dans un fichier de
|
||||
compte de gnucash, lancez en ligne de commande <tt>gnc-price</tt>, en specifiant
|
||||
le nom du fichier; par exemple:
|
||||
@@ -52,7 +79,7 @@ vers l'écran tandis qu'elle chargera les données. Elle fonctionner
|
||||
seulement quand l'ordinateur hôte est connecté à internet.
|
||||
Elle <i>peut</i> fonctionner ensemble avec un parefeu/firewall de style
|
||||
masqué. Elle ne fonctionne pas actuellement depuis derrière
|
||||
un proxy ou des parefeu de style socks.
|
||||
des parefeu de style socks.
|
||||
<p>La commande peut être lancée plusieurs fois dans une journée;
|
||||
pourtant, elle mettra les comptes à jour au maximum une fois avec
|
||||
les plus récentes données du cours des échanges de
|
||||
@@ -68,7 +95,7 @@ marquez simplement les données source pour ce compte comme "(aucun)".
|
||||
Vous pouvez le faire depuis la fenêtre "<tt>Afficher un compte</tt>".
|
||||
<p>Après avoir lancé gnc-prices pendant quelques jours, vos
|
||||
comptes commenceront à ressembler à ce qui suit:
|
||||
<p><img SRC="Ticker-b.gif" NOSAVE height=372 width=881>
|
||||
<p><img SRC="pix/TICKER-B.GIF" NOSAVE height=372 width=881>
|
||||
<hr>
|
||||
<br>Retour à la <a href="xacc-main.html">Page principale de la documentation.</a>
|
||||
</body>
|
||||
|
||||
@@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnucash 1.3.3\n"
|
||||
"POT-Creation-Date: 2000-03-24 14:08-0800\n"
|
||||
"PO-Revision-Date: 2000-03-23 22:24+0200\n"
|
||||
"PO-Revision-Date: 2000-03-25 10:05+0200\n"
|
||||
"Last-Translator: Yannick LE NY <y-le-ny@ifrance.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -2005,7 +2005,7 @@ msgstr "Affichage du format de date"
|
||||
|
||||
#: po/guile_strings.txt:114
|
||||
msgid "Ending"
|
||||
msgstr "Final"
|
||||
msgstr "Fin"
|
||||
|
||||
#: po/guile_strings.txt:115
|
||||
msgid "Reversed-balance account types"
|
||||
@@ -2799,49 +2799,43 @@ msgstr "Fonds communs"
|
||||
|
||||
#: src/gnome/glade-gnc-dialogs.c:786
|
||||
msgid "Print Dialog"
|
||||
msgstr ""
|
||||
msgstr "Dialogue d'impression"
|
||||
|
||||
#: src/gnome/glade-gnc-dialogs.c:794
|
||||
#, fuzzy
|
||||
msgid "Print Setup"
|
||||
msgstr "Imprimer chèque"
|
||||
msgstr "Configuration imprimante"
|
||||
|
||||
#: src/gnome/glade-gnc-dialogs.c:815
|
||||
#, fuzzy
|
||||
msgid "Printer:"
|
||||
msgstr "Imprimer"
|
||||
msgstr "Imprimante:"
|
||||
|
||||
#: src/gnome/glade-gnc-dialogs.c:823
|
||||
msgid "Paper size:"
|
||||
msgstr ""
|
||||
msgstr "Taille papier:"
|
||||
|
||||
#: src/gnome/glade-gnc-dialogs.c:831
|
||||
msgid "Pages to print:"
|
||||
msgstr ""
|
||||
msgstr "Pages à imprimer:"
|
||||
|
||||
#: src/gnome/glade-gnc-dialogs.c:876
|
||||
msgid "All"
|
||||
msgstr ""
|
||||
msgstr "Tous"
|
||||
|
||||
#: src/gnome/glade-gnc-dialogs.c:884
|
||||
#, fuzzy
|
||||
msgid "Selected"
|
||||
msgstr "Sélectionner un fichier"
|
||||
msgstr "Sélectionné"
|
||||
|
||||
#: src/gnome/glade-gnc-dialogs.c:906
|
||||
#, fuzzy
|
||||
msgid "From:"
|
||||
msgstr "Depuis"
|
||||
msgstr "Depuis:"
|
||||
|
||||
#: src/gnome/glade-gnc-dialogs.c:921
|
||||
#, fuzzy
|
||||
msgid "To:"
|
||||
msgstr "Vers"
|
||||
msgstr "Vers:"
|
||||
|
||||
#: src/gnome/glade-gnc-dialogs.c:943 src/gnome/glade-gnc-dialogs.c:950
|
||||
#, fuzzy
|
||||
msgid "Select..."
|
||||
msgstr "Tout sélectionner"
|
||||
msgstr "Sélectionner..."
|
||||
|
||||
#: src/gnome/glade-gnc-dialogs.c:986
|
||||
msgid "Preview"
|
||||
|
||||
+107
-71
@@ -218,14 +218,14 @@ xaccSRGetInfo(SplitRegister *reg)
|
||||
static gncUIWidget
|
||||
xaccSRGetParent(SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
|
||||
assert(reg != NULL);
|
||||
assert(reg != NULL);
|
||||
|
||||
if (info->get_parent == NULL)
|
||||
return NULL;
|
||||
if (info->get_parent == NULL)
|
||||
return NULL;
|
||||
|
||||
return (info->get_parent)(info->user_data);
|
||||
return (info->get_parent)(info->user_data);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -233,13 +233,13 @@ xaccSRSetData(SplitRegister *reg, void *user_data,
|
||||
SRGetParentCallback get_parent,
|
||||
SRSetHelpCallback set_help)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
|
||||
assert(reg != NULL);
|
||||
assert(reg != NULL);
|
||||
|
||||
info->user_data = user_data;
|
||||
info->get_parent = get_parent;
|
||||
info->set_help = set_help;
|
||||
info->user_data = user_data;
|
||||
info->get_parent = get_parent;
|
||||
info->set_help = set_help;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -339,62 +339,78 @@ gnc_copy_trans(Transaction *from, Transaction *to)
|
||||
*/
|
||||
|
||||
static void
|
||||
LedgerMoveCursor (Table *table,
|
||||
int *p_new_phys_row,
|
||||
int *p_new_phys_col,
|
||||
void * client_data)
|
||||
LedgerMoveCursor (Table *table,
|
||||
int *p_new_phys_row,
|
||||
int *p_new_phys_col,
|
||||
void * client_data)
|
||||
{
|
||||
int new_phys_row = *p_new_phys_row;
|
||||
int new_phys_col = *p_new_phys_col;
|
||||
SplitRegister *reg = (SplitRegister *) client_data;
|
||||
Transaction *newtrans = NULL;
|
||||
Locator *locator;
|
||||
int style;
|
||||
int new_phys_row = *p_new_phys_row;
|
||||
int new_phys_col = *p_new_phys_col;
|
||||
SplitRegister *reg = (SplitRegister *) client_data;
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
Transaction *newtrans;
|
||||
Transaction *trans;
|
||||
gncBoolean saved;
|
||||
Locator *locator;
|
||||
int style;
|
||||
|
||||
PINFO ("LedgerMoveCursor(): start callback %d %d \n",
|
||||
new_phys_row, new_phys_col);
|
||||
PINFO ("LedgerMoveCursor(): start callback %d %d \n",
|
||||
new_phys_row, new_phys_col);
|
||||
|
||||
/* The transaction where we are moving to */
|
||||
newtrans = xaccSRGetTrans(reg, new_phys_row, new_phys_col);
|
||||
/* The transaction we are coming from */
|
||||
trans = xaccSRGetCurrentTrans(reg);
|
||||
|
||||
/* commit the contents of the cursor into the database */
|
||||
xaccSRSaveRegEntry (reg, newtrans);
|
||||
xaccSRRedrawRegEntry (reg);
|
||||
/* The transaction where we are moving to */
|
||||
newtrans = xaccSRGetTrans(reg, new_phys_row, new_phys_col);
|
||||
|
||||
PINFO ("LedgerMoveCursor(): after redraw %d %d \n",
|
||||
new_phys_row, new_phys_col);
|
||||
/* commit the contents of the cursor into the database */
|
||||
saved = xaccSRSaveRegEntry (reg, newtrans);
|
||||
if ((info->pending_trans != NULL) &&
|
||||
(info->pending_trans == trans) &&
|
||||
(trans != newtrans))
|
||||
{
|
||||
xaccTransCommitEdit (trans);
|
||||
info->pending_trans = NULL;
|
||||
saved = GNC_T;
|
||||
}
|
||||
|
||||
reg->cursor_phys_row = new_phys_row;
|
||||
reg->cursor_phys_col = new_phys_col;
|
||||
if (saved)
|
||||
xaccSRRedrawRegEntry (reg);
|
||||
|
||||
locator = table->locators[new_phys_row][new_phys_col];
|
||||
reg->cursor_virt_row = locator->virt_row;
|
||||
PINFO ("LedgerMoveCursor(): after redraw %d %d \n",
|
||||
new_phys_row, new_phys_col);
|
||||
|
||||
/* if auto-expansion is enabled, we need to redraw the register
|
||||
* to expand out the splits at the new location. We do some
|
||||
* tomfoolery here to trick the code into expanding the new location.
|
||||
* This little futz is sleazy, but it does succeed in getting the
|
||||
* LoadRegister code into expanding the appropriate split.
|
||||
*/
|
||||
style = ((reg->type) & REG_STYLE_MASK);
|
||||
if ((REG_SINGLE_DYNAMIC == style) ||
|
||||
(REG_DOUBLE_DYNAMIC == style))
|
||||
{
|
||||
Split *split;
|
||||
reg->cursor_phys_row = new_phys_row;
|
||||
reg->cursor_phys_col = new_phys_col;
|
||||
|
||||
split = xaccGetUserData (reg->table, new_phys_row, new_phys_col);
|
||||
reg->table->current_cursor->user_data = (void *) split;
|
||||
locator = table->locators[new_phys_row][new_phys_col];
|
||||
reg->cursor_virt_row = locator->virt_row;
|
||||
|
||||
xaccRegisterRefresh (reg);
|
||||
gnc_refresh_main_window();
|
||||
/* if auto-expansion is enabled, we need to redraw the register
|
||||
* to expand out the splits at the new location. We do some
|
||||
* tomfoolery here to trick the code into expanding the new location.
|
||||
* This little futz is sleazy, but it does succeed in getting the
|
||||
* LoadRegister code into expanding the appropriate split.
|
||||
*/
|
||||
style = ((reg->type) & REG_STYLE_MASK);
|
||||
if ((REG_SINGLE_DYNAMIC == style) ||
|
||||
(REG_DOUBLE_DYNAMIC == style))
|
||||
{
|
||||
Split *split;
|
||||
|
||||
/* indicate what row we *should* have gone to */
|
||||
*p_new_phys_row = table->current_cursor_phys_row;
|
||||
*p_new_phys_col = table->current_cursor_phys_col;
|
||||
split = xaccGetUserData (reg->table, new_phys_row, new_phys_col);
|
||||
reg->table->current_cursor->user_data = (void *) split;
|
||||
|
||||
PINFO ("LedgerMoveCursor(): after dynamic %d %d stored val %d\n",
|
||||
*p_new_phys_row, *p_new_phys_col, reg->cursor_phys_row);
|
||||
}
|
||||
xaccRegisterRefresh (reg);
|
||||
gnc_refresh_main_window();
|
||||
|
||||
/* indicate what row we *should* have gone to */
|
||||
*p_new_phys_row = table->current_cursor_phys_row;
|
||||
*p_new_phys_col = table->current_cursor_phys_col;
|
||||
|
||||
PINFO ("LedgerMoveCursor(): after dynamic %d %d stored val %d\n",
|
||||
*p_new_phys_row, *p_new_phys_col, reg->cursor_phys_row);
|
||||
}
|
||||
}
|
||||
|
||||
/* ======================================================== */
|
||||
@@ -1076,22 +1092,15 @@ void
|
||||
xaccSRRedrawRegEntry (SplitRegister *reg)
|
||||
{
|
||||
Transaction *trans;
|
||||
unsigned int changed;
|
||||
|
||||
/* use the changed flag to avoid heavy-weight redraws
|
||||
* This will help cut down on uneccessary register redraws. */
|
||||
changed = xaccSplitRegisterGetChangeFlag (reg);
|
||||
if (!changed) return;
|
||||
|
||||
trans = xaccSRGetCurrentTrans (reg);
|
||||
|
||||
/* refresh the register windows */
|
||||
/* This split belongs to a transaction that might be displayed
|
||||
* in any number of windows. Changing any one split is likely
|
||||
* in any number of windows. Changing any one split is likely
|
||||
* to affect any account windows associated with the other splits
|
||||
* in this transaction. So basically, send redraw events to all
|
||||
* of the splits.
|
||||
*/
|
||||
* in this transaction. So basically, send redraw events to all
|
||||
* of the splits. */
|
||||
gnc_transaction_ui_refresh(trans);
|
||||
gnc_refresh_main_window();
|
||||
}
|
||||
@@ -1112,7 +1121,8 @@ xaccSRSaveRegEntry (SplitRegister *reg, Transaction *newtrans)
|
||||
* of the split & transaction fields. This will help
|
||||
* cut down on uneccessary register redraws. */
|
||||
changed = xaccSplitRegisterGetChangeFlag (reg);
|
||||
if (!changed) return GNC_F;
|
||||
if (!changed)
|
||||
return GNC_F;
|
||||
|
||||
style = (reg->type) & REG_STYLE_MASK;
|
||||
|
||||
@@ -1426,6 +1436,8 @@ xaccSRSaveRegEntry (SplitRegister *reg, Transaction *newtrans)
|
||||
info->pending_trans = NULL;
|
||||
}
|
||||
|
||||
xaccSplitRegisterClearChangeFlag(reg);
|
||||
|
||||
return GNC_T;
|
||||
}
|
||||
|
||||
@@ -1581,7 +1593,7 @@ xaccSRLoadRegEntry (SplitRegister *reg, Split *split)
|
||||
|
||||
/* ======================================================== */
|
||||
|
||||
static void
|
||||
static gncBoolean
|
||||
xaccSRCountRows (SplitRegister *reg, Split **slist)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
@@ -1659,9 +1671,8 @@ xaccSRCountRows (SplitRegister *reg, Split **slist)
|
||||
}
|
||||
}
|
||||
|
||||
/* if multi-line, then show all splits. If dynamic then
|
||||
* show all splits only if this is the hot split.
|
||||
*/
|
||||
/* if multi-line, then show all splits. If dynamic then
|
||||
* show all splits only if this is the hot split. */
|
||||
do_expand = multi_line;
|
||||
do_expand = do_expand ||
|
||||
(dynamic && xaccIsPeerSplit(split,save_current_split));
|
||||
@@ -1762,6 +1773,8 @@ xaccSRCountRows (SplitRegister *reg, Split **slist)
|
||||
reg->num_virt_rows = num_virt_rows;
|
||||
reg->cursor_phys_row = save_cursor_phys_row;
|
||||
reg->cursor_virt_row = save_cursor_virt_row;
|
||||
|
||||
return found_split;
|
||||
}
|
||||
|
||||
/* ======================================================== */
|
||||
@@ -1782,6 +1795,9 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist,
|
||||
int multi_line, dynamic;
|
||||
CellBlock *lead_cursor;
|
||||
gncBoolean found_pending = GNC_F;
|
||||
gncBoolean found_current = GNC_F;
|
||||
SplitRegisterBuffer *reg_buffer;
|
||||
unsigned int changed;
|
||||
|
||||
xaccSplitRegisterConfigColors (reg);
|
||||
|
||||
@@ -1810,7 +1826,19 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist,
|
||||
info->cursor_hint_trans = xaccSRGetCurrentTrans(reg);
|
||||
|
||||
/* count the number of rows */
|
||||
xaccSRCountRows (reg, slist);
|
||||
found_current = xaccSRCountRows (reg, slist);
|
||||
|
||||
/* If the current cursor has changed, and the 'current split'
|
||||
* is still among the living, we save the values for later
|
||||
* restoration. */
|
||||
changed = xaccSplitRegisterGetChangeFlag(reg);
|
||||
if (found_current && changed)
|
||||
{
|
||||
reg_buffer = xaccMallocSplitRegisterBuffer();
|
||||
xaccSplitRegisterSaveCursor(reg, reg_buffer);
|
||||
}
|
||||
else
|
||||
reg_buffer = NULL;
|
||||
|
||||
/* disable move callback -- we con't want the cascade of
|
||||
* callbacks while we are fiddling with loading the register */
|
||||
@@ -1873,7 +1901,7 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist,
|
||||
phys_row += reg->trans_cursor->numRows;
|
||||
|
||||
/* loop over all of the splits in the transaction. The
|
||||
* do..while will automaticaly put a blank (null) split
|
||||
* do..while will automatically put a blank (null) split
|
||||
* at the end. */
|
||||
trans = xaccSplitGetParent (split);
|
||||
j = 0;
|
||||
@@ -1979,6 +2007,14 @@ xaccSRLoadRegister (SplitRegister *reg, Split **slist,
|
||||
xaccMoveCursorGUI(table, row, col);
|
||||
reg->cursor_phys_row = row;
|
||||
reg->cursor_phys_col = col;
|
||||
|
||||
if (reg_buffer != NULL)
|
||||
{
|
||||
xaccSplitRegisterRestoreCursorChanged(reg, reg_buffer);
|
||||
xaccCommitCursor (reg->table);
|
||||
xaccDestroySplitRegisterBuffer(reg_buffer);
|
||||
reg_buffer = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
* XACC_CELL_ALLOW_SHADOW copy ("shadow") the contents
|
||||
* of register cells.
|
||||
*
|
||||
* If ALLOW_INPUT is not set, the cell is supposed to
|
||||
* If ALLOW_INPUT is not set, the cell is supposed to
|
||||
* to only display values, but not accept user input. If
|
||||
* set, then the callbacks below are used to when the
|
||||
* cell is entered.
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
|
||||
/* quickfillcell-gnome.c
|
||||
*
|
||||
* Implements gnome dependant quickfill cell functions.
|
||||
* Implements gnome dependent quickfill cell functions.
|
||||
*
|
||||
* Copyright (C) 2000 Dave Peticolas <peticola@cs.ucdavis.edu>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -58,6 +60,13 @@ QuickFillDirect (BasicCell *bcell,
|
||||
return GNC_F;
|
||||
}
|
||||
|
||||
if ((*start_selection <= *cursor_position) &&
|
||||
(*end_selection >= *cursor_position))
|
||||
*cursor_position = *start_selection;
|
||||
else if ((*end_selection <= *cursor_position) &&
|
||||
(*start_selection >= *cursor_position))
|
||||
*cursor_position = *end_selection;
|
||||
|
||||
match = xaccGetQuickFillStrLen(cell->qfRoot, oldval, *cursor_position);
|
||||
if (match == NULL)
|
||||
return GNC_T;
|
||||
|
||||
@@ -43,6 +43,34 @@
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static short module = MOD_REGISTER;
|
||||
|
||||
typedef struct _CellBuffer CellBuffer;
|
||||
struct _CellBuffer
|
||||
{
|
||||
char * value;
|
||||
unsigned int changed;
|
||||
};
|
||||
|
||||
struct _SplitRegisterBuffer
|
||||
{
|
||||
CellBuffer dateCell;
|
||||
CellBuffer numCell;
|
||||
CellBuffer descCell;
|
||||
CellBuffer recnCell;
|
||||
CellBuffer shrsCell;
|
||||
CellBuffer balanceCell;
|
||||
CellBuffer actionCell;
|
||||
CellBuffer xfrmCell;
|
||||
CellBuffer mxfrmCell;
|
||||
CellBuffer xtoCell;
|
||||
CellBuffer memoCell;
|
||||
CellBuffer creditCell;
|
||||
CellBuffer debitCell;
|
||||
CellBuffer priceCell;
|
||||
CellBuffer valueCell;
|
||||
CellBuffer ncreditCell;
|
||||
CellBuffer ndebitCell;
|
||||
};
|
||||
|
||||
static SplitRegisterColors reg_colors = {
|
||||
0xffdddd, /* pale red, single cursor active */
|
||||
0xccccff, /* pale blue, single cursor passive */
|
||||
@@ -1227,4 +1255,147 @@ xaccSplitRegisterGetCursorType (SplitRegister *reg)
|
||||
return CURSOR_NONE;
|
||||
}
|
||||
|
||||
/* ============================================== */
|
||||
|
||||
SplitRegisterBuffer *
|
||||
xaccMallocSplitRegisterBuffer ()
|
||||
{
|
||||
SplitRegisterBuffer *srb;
|
||||
|
||||
srb = calloc(1, sizeof(SplitRegisterBuffer));
|
||||
|
||||
assert(srb != NULL);
|
||||
|
||||
return srb;
|
||||
}
|
||||
|
||||
/* ============================================== */
|
||||
|
||||
static void
|
||||
destroyCellBuffer(CellBuffer *cb)
|
||||
{
|
||||
if (cb == NULL)
|
||||
return;
|
||||
|
||||
if (cb->value != NULL)
|
||||
free(cb->value);
|
||||
|
||||
cb->value = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
xaccDestroySplitRegisterBuffer (SplitRegisterBuffer *srb)
|
||||
{
|
||||
if (srb == NULL)
|
||||
return;
|
||||
|
||||
destroyCellBuffer(&srb->dateCell);
|
||||
destroyCellBuffer(&srb->numCell);
|
||||
destroyCellBuffer(&srb->descCell);
|
||||
destroyCellBuffer(&srb->recnCell);
|
||||
destroyCellBuffer(&srb->shrsCell);
|
||||
destroyCellBuffer(&srb->balanceCell);
|
||||
destroyCellBuffer(&srb->actionCell);
|
||||
destroyCellBuffer(&srb->xfrmCell);
|
||||
destroyCellBuffer(&srb->mxfrmCell);
|
||||
destroyCellBuffer(&srb->xtoCell);
|
||||
destroyCellBuffer(&srb->memoCell);
|
||||
destroyCellBuffer(&srb->creditCell);
|
||||
destroyCellBuffer(&srb->debitCell);
|
||||
destroyCellBuffer(&srb->priceCell);
|
||||
destroyCellBuffer(&srb->valueCell);
|
||||
destroyCellBuffer(&srb->ncreditCell);
|
||||
destroyCellBuffer(&srb->ndebitCell);
|
||||
|
||||
free(srb);
|
||||
}
|
||||
|
||||
/* ============================================== */
|
||||
|
||||
static void
|
||||
saveCell(BasicCell *bcell, CellBuffer *cb)
|
||||
{
|
||||
if ((bcell == NULL) || (cb == NULL))
|
||||
return;
|
||||
|
||||
if (cb->value != NULL)
|
||||
free(cb->value);
|
||||
|
||||
cb->value = bcell->value;
|
||||
|
||||
if (cb->value != NULL)
|
||||
{
|
||||
cb->value = strdup(cb->value);
|
||||
assert(cb->value != NULL);
|
||||
}
|
||||
|
||||
cb->changed = bcell->changed;
|
||||
}
|
||||
|
||||
void
|
||||
xaccSplitRegisterSaveCursor(SplitRegister *sr, SplitRegisterBuffer *srb)
|
||||
{
|
||||
if ((sr == NULL) || (srb == NULL))
|
||||
return;
|
||||
|
||||
saveCell(&sr->dateCell->cell, &srb->dateCell);
|
||||
saveCell(&sr->numCell->cell, &srb->numCell);
|
||||
saveCell(&sr->descCell->cell, &srb->descCell);
|
||||
saveCell(sr->recnCell, &srb->recnCell);
|
||||
saveCell(&sr->shrsCell->cell, &srb->shrsCell);
|
||||
saveCell(&sr->balanceCell->cell, &srb->balanceCell);
|
||||
saveCell(&sr->actionCell->cell, &srb->actionCell);
|
||||
saveCell(&sr->xfrmCell->cell, &srb->xfrmCell);
|
||||
saveCell(&sr->mxfrmCell->cell, &srb->mxfrmCell);
|
||||
saveCell(&sr->xtoCell->cell, &srb->xtoCell);
|
||||
saveCell(&sr->memoCell->cell, &srb->memoCell);
|
||||
saveCell(&sr->creditCell->cell, &srb->creditCell);
|
||||
saveCell(&sr->debitCell->cell, &srb->debitCell);
|
||||
saveCell(&sr->priceCell->cell, &srb->priceCell);
|
||||
saveCell(&sr->valueCell->cell, &srb->valueCell);
|
||||
saveCell(&sr->ncreditCell->cell, &srb->ncreditCell);
|
||||
saveCell(&sr->ndebitCell->cell, &srb->ndebitCell);
|
||||
}
|
||||
|
||||
/* ============================================== */
|
||||
|
||||
static void
|
||||
restoreCellChanged(BasicCell *bcell, CellBuffer *cb)
|
||||
{
|
||||
if ((bcell == NULL) || (cb == NULL))
|
||||
return;
|
||||
|
||||
if (cb->changed)
|
||||
{
|
||||
xaccSetBasicCellValue(bcell, cb->value);
|
||||
bcell->changed = cb->changed;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
xaccSplitRegisterRestoreCursorChanged(SplitRegister *sr,
|
||||
SplitRegisterBuffer *srb)
|
||||
{
|
||||
if ((sr == NULL) || (srb == NULL))
|
||||
return;
|
||||
|
||||
restoreCellChanged(&sr->dateCell->cell, &srb->dateCell);
|
||||
restoreCellChanged(&sr->numCell->cell, &srb->numCell);
|
||||
restoreCellChanged(&sr->descCell->cell, &srb->descCell);
|
||||
restoreCellChanged(sr->recnCell, &srb->recnCell);
|
||||
restoreCellChanged(&sr->shrsCell->cell, &srb->shrsCell);
|
||||
restoreCellChanged(&sr->balanceCell->cell, &srb->balanceCell);
|
||||
restoreCellChanged(&sr->actionCell->cell, &srb->actionCell);
|
||||
restoreCellChanged(&sr->xfrmCell->cell, &srb->xfrmCell);
|
||||
restoreCellChanged(&sr->mxfrmCell->cell, &srb->mxfrmCell);
|
||||
restoreCellChanged(&sr->xtoCell->cell, &srb->xtoCell);
|
||||
restoreCellChanged(&sr->memoCell->cell, &srb->memoCell);
|
||||
restoreCellChanged(&sr->creditCell->cell, &srb->creditCell);
|
||||
restoreCellChanged(&sr->debitCell->cell, &srb->debitCell);
|
||||
restoreCellChanged(&sr->priceCell->cell, &srb->priceCell);
|
||||
restoreCellChanged(&sr->valueCell->cell, &srb->valueCell);
|
||||
restoreCellChanged(&sr->ncreditCell->cell, &srb->ncreditCell);
|
||||
restoreCellChanged(&sr->ndebitCell->cell, &srb->ndebitCell);
|
||||
}
|
||||
|
||||
/* ============ END OF FILE ===================== */
|
||||
|
||||
+11
-2
@@ -22,7 +22,7 @@
|
||||
* Implements a basic display register/ledger.
|
||||
* This object makes specific cell have specific properties
|
||||
* (price, text, date, etc). and specific names that correspond.
|
||||
* it also determines the actual phyisical layout, arrengement
|
||||
* it also determines the actual physical layout, arrangement
|
||||
* of columns, etc.
|
||||
*
|
||||
* Handles splits
|
||||
@@ -79,7 +79,7 @@
|
||||
* REG_MULTI_LINE -- show multiple lines per transaction
|
||||
* REG_DYNAMIC -- dynamically expand edited transaction
|
||||
*/
|
||||
|
||||
|
||||
#define REG_SINGLE_LINE (1 << 8)
|
||||
#define REG_DOUBLE_LINE (2 << 8)
|
||||
#define REG_MULTI_LINE (3 << 8)
|
||||
@@ -119,6 +119,7 @@ typedef enum
|
||||
*/
|
||||
#define NUM_CELLS 25
|
||||
|
||||
typedef struct _SplitRegisterBuffer SplitRegisterBuffer;
|
||||
typedef struct _SplitRegister SplitRegister;
|
||||
|
||||
struct _SplitRegister {
|
||||
@@ -222,6 +223,14 @@ void xaccSplitRegisterClearChangeFlag (SplitRegister *reg);
|
||||
/* Returns the type of the current cursor */
|
||||
CursorType xaccSplitRegisterGetCursorType (SplitRegister *reg);
|
||||
|
||||
/* Functions for working with split register buffers */
|
||||
SplitRegisterBuffer * xaccMallocSplitRegisterBuffer ();
|
||||
void xaccDestroySplitRegisterBuffer (SplitRegisterBuffer *srb);
|
||||
|
||||
void xaccSplitRegisterSaveCursor(SplitRegister *sr, SplitRegisterBuffer *srb);
|
||||
void xaccSplitRegisterRestoreCursorChanged(SplitRegister *sr,
|
||||
SplitRegisterBuffer *srb);
|
||||
|
||||
|
||||
#endif /* __XACC_SPLITREG_H__ */
|
||||
|
||||
|
||||
@@ -353,10 +353,9 @@ xaccSetCursor (Table *table, CellBlock *curs,
|
||||
|
||||
table->rev_locators[virt_row][virt_col]->phys_row = phys_row_origin;
|
||||
table->rev_locators[virt_row][virt_col]->phys_col = phys_col_origin;
|
||||
|
||||
|
||||
/* intialize the mapping so that we will be able to find
|
||||
* the handler, given this range of physical cell addressses */
|
||||
* the handler, given this range of physical cell addresses */
|
||||
for (i=0; i<curs->numRows; i++) {
|
||||
for (j=0; j<curs->numCols; j++) {
|
||||
Locator *loc;
|
||||
|
||||
Reference in New Issue
Block a user