/** * * * @author jh */ void iwStatistics::Msg_PaintAfter() { // Die farbigen Boxen unter den Spielerportraits malen unsigned short startX = 126 - numPlayingPlayers * 17; unsigned pos = 0; for (unsigned i = 0; i < GAMECLIENT.GetPlayerCount(); ++i) { GameClientPlayer& player = GAMECLIENT.GetPlayer(i); if (!(player.ps == PS_KI || player.ps == PS_OCCUPIED)) { continue; } if (activePlayers[i]) { DrawRectangle(this->x_ + startX + pos * 34, this->y_ + 68, 34, 12, COLORS[player.color]); } pos++; } // Koordinatenachsen malen DrawAxis(); // Statistiklinien malen DrawStatistic(currentView); }
LONG CuDlgDomPropTableStatistic::OnLoad (WPARAM wParam, LPARAM lParam) { int nCount = 0; try { LPCTSTR pClass = (LPCTSTR)wParam; ASSERT (lstrcmp (pClass, "CuDomPropDataTableStatistic") == 0); CuDomPropDataTableStatistic* pData = (CuDomPropDataTableStatistic*)lParam; m_nOT = pData->m_statisticData.m_nOT; m_statisticData = pData->m_statisticData; InitializeStatisticHeader(m_statisticData.m_nOT); // // List of statistic columns; CaTableStatisticColumn* pColumn = NULL; while (!m_statisticData.m_listColumn.IsEmpty()) { pColumn = m_statisticData.m_listColumn.RemoveHead(); if (m_cListColumn.InsertItem (nCount, "") != -1) { m_cListColumn.SetItemData (nCount, (DWORD)pColumn); nCount++; } } UpdateDisplayList1(); m_bLoad = TRUE; // Prevent from calling OnItemchangedList1() m_cListColumn.SetItemState (pData->m_nSelectColumn, LVIS_SELECTED, LVIS_SELECTED); m_bLoad = FALSE; // // Draw statistic Items: DrawStatistic (); // // Extra information: m_bUniqueFlag = m_statisticData.m_bUniqueFlag; m_bCompleteFlag = m_statisticData.m_bCompleteFlag; m_strUniqueValues.Format (_T("%ld"), m_statisticData.m_lUniqueValue); m_strRepetitionFactors.Format (_T("%ld"), m_statisticData.m_lRepetitionFlag); UpdateData (FALSE); m_bExecuted = TRUE; } catch (CMemoryException* e) { VDBA_OutOfMemoryMessage(); e->Delete(); } catch (...) { //CString strMsg = _T("Internal error: cannot display the statistic of the table."); AfxMessageBox (VDBA_MfcResourceString(IDS_E_STAT_TABLE)); } EnableButtons(); return 0L; }
void CuDlgDomPropTableStatistic::OnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult) { NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; *pResult = 0; if (m_bLoad) return; CaTableStatisticColumn* pColumn = NULL; if (pNMListView->iItem >= 0 && pNMListView->uNewState > 0 && (pNMListView->uNewState&LVIS_SELECTED)) { CWaitCursor doWaitCursor; try { pColumn = (CaTableStatisticColumn*)m_cListColumn.GetItemData(pNMListView->iItem); CleanStatisticItem(); if (!pColumn) return; if (!pColumn->m_bHasStatistic) return; // // Query the statistic for this column: // Table_GetStatistics (pColumn, m_statisticData); // Extra information: m_bUniqueFlag = m_statisticData.m_bUniqueFlag; m_bCompleteFlag = m_statisticData.m_bCompleteFlag; m_strUniqueValues.Format (_T("%ld"), m_statisticData.m_lUniqueValue); m_strRepetitionFactors.Format (_T("%ld"), m_statisticData.m_lRepetitionFlag); DrawStatistic (); } catch (CMemoryException* e) { VDBA_OutOfMemoryMessage(); e->Delete(); } catch (...) { //CString strMsg = _T("Internal error: cannot display the statistic of the table."); AfxMessageBox (VDBA_MfcResourceString(IDS_E_STAT_TABLE)); } } UpdateData (FALSE); EnableButtons(); }
void iwMerchandiseStatistics::Msg_PaintAfter() { DrawRectangles(); DrawAxis(); DrawStatistic(); }