GnuCash 038f90a+
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 1966 of file assistant-stock-transaction.cpp.

Constructor & Destructor Documentation

◆ PageStockValue()

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

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

1991 : m_page(get_widget(builder, "stock_value_page")),
1992 m_value(builder, gnc_account_get_currency_or_parent(account)),
1993 m_price(get_widget(builder, "stock_price_amount")),
1994 m_memo(get_widget(builder, "stock_memo_entry"))
1995{
1996 m_value.attach(builder, "stock_value_table", "stock_value_label", 0);
1997}
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 2000 of file assistant-stock-transaction.cpp.

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

◆ get_memo()

const char * PageStockValue::get_memo ( )

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

2019{
2020 return gtk_entry_get_text(GTK_ENTRY (m_memo));
2021}

◆ prepare()

void PageStockValue::prepare ( StockTransactionEntry entry)

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

2009{
2010 entry->set_memo(get_memo());
2011 if (!gnc_numeric_check(m_value.get()))
2012 entry->set_value(m_value.get());
2013 set_price(entry->print_price());
2014 g_signal_connect(m_page, "focus", G_CALLBACK(assistant_page_set_focus), m_value.widget());
2015}
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 2024 of file assistant-stock-transaction.cpp.

2025{
2026 gtk_label_set_text(GTK_LABEL(this->m_price), val);
2027};

◆ value_edit()

GncAmountEdit & PageStockValue::value_edit ( )
inline

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

1978{ return m_value; }

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