GnuCash 7574033+
Loading...
Searching...
No Matches
GncAmountEdit Class Reference

C++ wrapper for GncAmountEdit, see gnucash/gnome-utils/gnc-amount-edit.h. More...

Public Member Functions

 GncAmountEdit (GtkBuilder *builder, gnc_commodity *commodity)
void attach (GtkBuilder *builder, const char *table_id, const char *label_ID, int row)
GtkWidget * widget ()
gnc_numeric get ()
void connect (GCallback cb, gpointer data)
void set_owner (gpointer obj)

Detailed Description

Constructor & Destructor Documentation

◆ GncAmountEdit()

GncAmountEdit::GncAmountEdit ( GtkBuilder * builder,
gnc_commodity * commodity )

Definition at line 1586 of file assistant-stock-transaction.cpp.

1586 :
1587 m_edit{gnc_amount_edit_new()}
1588{
1589 // shares amount
1590 auto info = gnc_commodity_print_info(commodity, true);
1591 gnc_amount_edit_set_evaluate_on_enter(GNC_AMOUNT_EDIT(m_edit), TRUE);
1592 gnc_amount_edit_set_print_info(GNC_AMOUNT_EDIT(m_edit), info);
1593}

Member Function Documentation

◆ attach()

void GncAmountEdit::attach ( GtkBuilder * builder,
const char * table_id,
const char * label_ID,
int row )

Definition at line 1596 of file assistant-stock-transaction.cpp.

1598{
1599 auto table = get_widget(builder, table_ID);
1600 auto label = get_widget(builder, label_ID);
1601 gtk_grid_attach(GTK_GRID(table), m_edit, 1, row, 1, 1);
1602 gtk_widget_show(m_edit);
1603 gnc_amount_edit_make_mnemonic_target(GNC_AMOUNT_EDIT(m_edit), label);
1604}

◆ connect()

void GncAmountEdit::connect ( GCallback cb,
gpointer data )

Definition at line 1616 of file assistant-stock-transaction.cpp.

1617{
1618 g_signal_connect(m_edit, "changed", cb, data);
1619}

◆ get()

gnc_numeric GncAmountEdit::get ( )

Definition at line 1607 of file assistant-stock-transaction.cpp.

1608{
1609 gnc_numeric amt;
1610 if (!gnc_amount_edit_expr_is_valid (GNC_AMOUNT_EDIT(m_edit), &amt, true, nullptr))
1611 return amt;
1613}
gnc_numeric gnc_numeric_error(GNCNumericErrorCode error_code)
Create a gnc_numeric object that signals the error condition noted by error_code, rather than a numbe...
@ GNC_ERROR_ARG
Argument is not a valid number.

◆ set_owner()

void GncAmountEdit::set_owner ( gpointer obj)

Definition at line 1622 of file assistant-stock-transaction.cpp.

1623{
1624 g_object_set_data(G_OBJECT (m_edit), "owner", obj);
1625}

◆ widget()

GtkWidget * GncAmountEdit::widget ( )
inline

Definition at line 1568 of file assistant-stock-transaction.cpp.

1568 {
1569 return gnc_amount_edit_gtk_entry(GNC_AMOUNT_EDIT(m_edit));
1570 }

The documentation for this class was generated from the following file: