GnuCash 038f90a+
Loading...
Searching...
No Matches
Public Member Functions
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

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

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

Constructor & Destructor Documentation

◆ GncAmountEdit()

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

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

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

Member Function Documentation

◆ attach()

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

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

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

◆ connect()

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

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

1619{
1620 g_signal_connect(m_edit, "changed", cb, data);
1621}

◆ get()

gnc_numeric GncAmountEdit::get ( )

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

1610{
1611 gnc_numeric amt;
1612 if (!gnc_amount_edit_expr_is_valid (GNC_AMOUNT_EDIT(m_edit), &amt, true, nullptr))
1613 return amt;
1615}
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 1624 of file assistant-stock-transaction.cpp.

1625{
1626 g_object_set_data(G_OBJECT (m_edit), "owner", obj);
1627}

◆ widget()

GtkWidget * GncAmountEdit::widget ( )
inline

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

1570 {
1571 return gnc_amount_edit_gtk_entry(GNC_AMOUNT_EDIT(m_edit));
1572 }

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