GnuCash  5.6-150-g038405b370+
gnc-currency-edit.h File Reference

Currency selection widget. More...

#include "gnc-commodity.h"

Go to the source code of this file.

Macros

Basic Object Implementation
#define GNC_TYPE_CURRENCY_EDIT   (gnc_currency_edit_get_type())
 

Functions

Basic Object Implementation
GtkWidget * gnc_currency_edit_new (void)
 Create a new GNCCurrencyEdit widget which can be used to provide an easy way to enter ISO currency codes. More...
 
Get/Set Functions
void gnc_currency_edit_set_currency (GNCCurrencyEdit *gce, const gnc_commodity *currency)
 Set the widget to display a certain currency name. More...
 
gnc_commodity * gnc_currency_edit_get_currency (GNCCurrencyEdit *gce)
 Retrieve the displayed currency of the widget. More...
 
void gnc_currency_edit_clear_display (GNCCurrencyEdit *gce)
 Clear the displayed currency of the widget. More...
 

Detailed Description

Currency selection widget.

Author
Dave Peticolas dave@.nosp@m.kron.nosp@m.do.co.nosp@m.m
David Hampton hampt.nosp@m.on@e.nosp@m.mploy.nosp@m.ees..nosp@m.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.

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.h.