Ejemplo n.º 1
0
void mmHomePagePanel::getData()
{
    m_frames["HTMLSCALE"] = wxString::Format("%d", mmIniOptions::instance().html_font_size_);
    if (Model_Setting::instance().DisplayInternetNews())
    {
        m_frames["WEBSITE_NEWS"] = displayWebsiteNews();
    }

    vAccts_ = Model_Setting::instance().ViewAccounts();
    date_range_->destroy();
    if (mmIniOptions::instance().ignoreFutureTransactions_)
        date_range_ = new mmCurrentMonthToDate;
    else
        date_range_ = new mmCurrentMonth;

    double tBalance = 0.0, cardBalance = 0.0;

    std::map<int, std::pair<double, double> > accountStats;
    get_account_stats(accountStats);

    m_frames["ACCOUNTS_INFO"] = displayAccounts(tBalance, accountStats);
    m_frames["CARD_ACCOUNTS_INFO"] = displayAccounts(cardBalance, accountStats, Model_Account::CREDIT_CARD);
    tBalance += cardBalance;

    double termBalance = 0.0;
    m_frames["TERM_ACCOUNTS_INFO"] = displayAccounts(termBalance, accountStats, Model_Account::TERM);
    tBalance += termBalance;

    //Stocks
    wxString stocks = "";
    htmlWidgetStocks stocks_widget;
    if (!Model_Stock::instance().all().empty())
    {
        stocks = stocks_widget.getHTMLText();
    }
    tBalance += stocks_widget.get_total();
    m_frames["STOCKS_INFO"] = stocks;

    m_frames["ASSETS_INFO"] = displayAssets(tBalance);
    m_frames["GRAND_TOTAL"] = displayGrandTotals(tBalance);

    //
    m_frames["INCOME_VS_EXPENSES"] = displayIncomeVsExpenses();

    htmlWidgetBillsAndDeposits bills_and_deposits(_("Upcoming Transactions"));
    m_frames["BILLS_AND_DEPOSITS"] = bills_and_deposits.getHTMLText();

    mmDateRange* date_range = new mmLast30Days();
    htmlWidgetTop7Categories top_trx(date_range);
    m_frames["TOP_CATEGORIES"] = top_trx.getHTMLText();

    m_frames["STATISTICS"] = getStatWidget();
    m_frames["TOGGLES"] = getToggles();

}
Ejemplo n.º 2
0
void ofxUIDropDownList::setSingleSelected(int index){
    
    vector<ofxUILabelToggle*> toggles = getToggles();
    if(index < toggles.size()){
        selected.clear();
        ofxUILabelToggle *lt = toggles.at(index);
        selected.push_back(lt);
        selectedIndeces.clear();
        selectedIndeces.push_back(index);
        setShowCurrentSelected(true);
    }else{
        ofLogWarning("index for ufxUIDropDownList::setSingleSelected is out of range");
    }
    
}