GnuCash 2.4.99
Data Structures | Defines | Typedefs
gnc-currency-edit.c File Reference

Currency selection widget. More...

#include "config.h"
#include <gtk/gtk.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include "gnc-currency-edit.h"
#include "gnc-commodity.h"
#include "gnc-gtk-utils.h"
#include "gnc-ui-util.h"

Go to the source code of this file.

Data Structures

struct  _GNCCurrencyEditPrivate

Defines

#define GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_CURRENCY_EDIT, GNCCurrencyEditPrivate))

Typedefs

typedef struct
_GNCCurrencyEditPrivate 
GNCCurrencyEditPrivate

Functions

Basic Object Implementation
GType gnc_currency_edit_get_type (void)
GtkWidget * gnc_currency_edit_new (void)
Get/Set Functions
void gnc_currency_edit_set_currency (GNCCurrencyEdit *gce, const gnc_commodity *currency)
gnc_commoditygnc_currency_edit_get_currency (GNCCurrencyEdit *gce)

Detailed Description

Currency selection widget.

Author:
Dave Peticolas <dave@krondo.com>
David Hampton <hampton@employees.org>

This widget is a GtkComboBox that is wrapped with support functions for building/selecting from a list of ISO4217 currency names. All data is maintained within the widget itself, which makes the name/item lookup functions somewhat complicated. The alternative coding would be to keep an auxiliary list of strings attacked to the widget for lookup purposes, but that would be 100% redundant information.

This function currently builds a new GtkListStore for each widget created. It could be optimized to build a single list store and share across all extant version of the widget, or even build the list store once and maintain for the life of the application.

When the GtkComboCellEntry widget supports completion, this Gnucash widget should be modified so that it is based upon that widget. That would give users the capability to select a currency by typing its ISO 4217 code (e.g. USD, GBP, etc). Moving to that widget today, however, would cause more problems that its worth. There is currently no way to get access to the embedded GtkEntry widget, and therefore no way to implement completion in gnucash or prevent the user from typing in random data.

Definition in file gnc-currency-edit.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines