GnuCash c935c2f+
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 1560 of file assistant-stock-transaction.cpp.

Constructor & Destructor Documentation

◆ GncAmountEdit()

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

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

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

Member Function Documentation

◆ attach()

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

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

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

◆ connect()

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

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

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

◆ get()

gnc_numeric GncAmountEdit::get ( )

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

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

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

◆ widget()

GtkWidget * GncAmountEdit::widget ( )
inline

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

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

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