GnuCash c935c2f+
Loading...
Searching...
No Matches
Public Member Functions
PageStockValue Class Reference

Stock Value page. More...

Public Member Functions

 PageStockValue (GtkBuilder *builder, Account *account)
 
const char * get_memo ()
 
void connect (StockTransactionEntry *entry)
 
void prepare (StockTransactionEntry *entry)
 
GncAmountEditvalue_edit ()
 
void set_price (const gchar *val)
 

Detailed Description

Stock Value page.

It collects the currency value of the stock traded and computes and displays the resulting price. It also collects the memo for the primary stock split.

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

Constructor & Destructor Documentation

◆ PageStockValue()

PageStockValue::PageStockValue ( GtkBuilder *  builder,
Account account 
)

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

1988 : m_page(get_widget(builder, "stock_value_page")),
1989 m_value(builder, gnc_account_get_currency_or_parent(account)),
1990 m_price(get_widget(builder, "stock_price_amount")),
1991 m_memo(get_widget(builder, "stock_memo_entry"))
1992{
1993 m_value.attach(builder, "stock_value_table", "stock_value_label", 0);
1994}
gnc_commodity * gnc_account_get_currency_or_parent(const Account *account)
Returns a gnc_commodity that is a currency, suitable for being a Transaction's currency.
Definition Account.cpp:3415

Member Function Documentation

◆ connect()

void PageStockValue::connect ( StockTransactionEntry entry)

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

1998{
1999 m_value.connect(G_CALLBACK (page_stock_value_changed_cb), entry);
2000 m_value.set_owner (static_cast<gpointer>(this));
2001 g_signal_connect (m_memo, "changed", G_CALLBACK(text_entry_changed_cb), entry);
2002}

◆ get_memo()

const char * PageStockValue::get_memo ( )

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

2016{
2017 return gtk_entry_get_text(GTK_ENTRY (m_memo));
2018}

◆ prepare()

void PageStockValue::prepare ( StockTransactionEntry entry)

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

2006{
2007 entry->set_memo(get_memo());
2008 if (!gnc_numeric_check(m_value.get()))
2009 entry->set_value(m_value.get());
2010 set_price(entry->print_price());
2011 g_signal_connect(m_page, "focus", G_CALLBACK(assistant_page_set_focus), m_value.widget());
2012}
virtual const char * print_price() const
GNCNumericErrorCode gnc_numeric_check(gnc_numeric in)
Check for error signal in value.

◆ set_price()

void PageStockValue::set_price ( const gchar *  val)

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

2022{
2023 gtk_label_set_text(GTK_LABEL(this->m_price), val);
2024};

◆ value_edit()

GncAmountEdit & PageStockValue::value_edit ( )
inline

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

1975{ return m_value; }

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