ZCharacterView::ZCharacterView(const char* szName, MWidget* pParent, MListener* pListener) : ZMeshView(szName, pParent, pListener) { SetDrawInfo(false); m_fDist = 235.0f; m_fMaxDist = 400.0f; m_fMinDist = 120.0f; m_Eye = rvector(0.0f, 92, -m_fDist); m_At = rvector(0, 92, 0); m_Up = rvector(0, 1, 0); memset(&m_Info, 0, sizeof(ZCharacterViewInfo)); m_bVisibleEquipment = false; m_nVisualWeaponParts = MMCIP_PRIMARY; m_bAutoRotate = false; m_dwTime = GetGlobalTimeMS(); for(int i=0; i<MMCIP_END; i++) { m_ItemSlots[i].m_nItemID = 0; } RepositionItemSlots(); }
void ZCharacterView::SetCharacter( MUID uid ) { m_Info.UID = uid; MMatchObjCacheMap* pObjCacheMap = ZGetGameClient()->GetObjCacheMap(); for(MMatchObjCacheMap::iterator itor = pObjCacheMap->begin(); itor != pObjCacheMap->end(); ++itor) { MMatchObjCache* pObj = (*itor).second; if( pObj->GetUID() == m_Info.UID ) { InitCharParts( pObj->GetCostume()->nSex, pObj->GetCostume()->nHair, pObj->GetCostume()->nFace, pObj->GetCostume()->nEquipedItemID ); MCOLOR _color; char sp_name[255]; MMatchUserGradeID gid; if(GetUserInfoUID(m_Info.UID,_color,sp_name,gid)) { SetText( sp_name ); m_Info.nLevel = 0; } else { SetText( pObj->GetName() ); m_Info.nLevel = pObj->GetLevel(); } SetDrawInfo( true ); } } }
void InfoWidget::DrawInfoChanged(Draw *draw) { if (draw->GetSelected() == false) return; m_draw = draw; SetDrawInfo(draw); m_update_values = true; m_update_time = true; m_update_current_value = true; m_update_values = true; DoubleCursorMode(false); }
void StatDialog::ConfigurationWasReloaded(wxString prefix) { if (m_draw == NULL) return; if (m_param_prefix != prefix) return; if (m_tofetch > 0) { m_progress_frame->Destroy(); m_tofetch = 0; } SetDrawInfo(NULL); }
void StatDialog::OnDrawChange(wxCommandEvent &event) { if (m_draw_search->ShowModal() == wxID_CANCEL) return; #ifdef __WXMSW__ //what the hell Raise(); #endif long previous = -1; DrawInfo *choosen = m_draw_search->GetDrawInfo(&previous); if (choosen == NULL || choosen == m_draw) return; SetDrawInfo(choosen); }
void InfoWidget::DrawSelected(Draw *draw) { m_draw = draw; SetDrawInfo(draw); m_update_time = m_update_values = m_update_current_value = true; if (m_double_cursor) { const Draw::VT& vt = m_draw->GetValuesTable(); int end = vt.m_stats.m_end; double val = vt.Get(end).val; int idx = end - vt.m_view.Start(); SetOtherValue(val); SetOtherTime(m_draw->GetTimeOfIndex(idx)); } }
StatDialog::StatDialog(wxWindow *parent, wxString prefix, DatabaseManager *db, ConfigManager *cfg, RemarksHandler *rh, TimeInfo time, DrawInfoList user_draws) : szFrame(parent, wxID_ANY, _("Statistics window"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL), DBInquirer(db), m_period(time.period), m_start_time(time.begin_time), m_current_time(time.begin_time), m_end_time(time.end_time), m_tofetch(0) { SetHelpText(_T("draw3-ext-meanvalues")); cfg->RegisterConfigObserver(this); wxPanel* panel = new wxPanel(this); wxString period_choices[PERIOD_T_SEASON] = { _("DECADE"), _("YEAR"), _("MONTH"), _("WEEK"), _("DAY"), _("30 MINUTES") }; wxStaticText *label; wxStaticLine *line; wxButton *button; m_config_manager = cfg; m_database_manager = db; m_draw_search = new IncSearch(m_config_manager, rh, prefix, this, wxID_ANY, _("Choose draw"), false, true, true, m_database_manager); wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); label = new wxStaticText(panel, wxID_ANY, wxString(_T(" ")) + _("Choose graph parameters") + _T(": ")); sizer->Add(label, 0, wxALIGN_CENTER | wxALL, 5); wxStaticBoxSizer *sizer_1 = new wxStaticBoxSizer(wxVERTICAL, panel, wxString(_T(" ")) + _("Draw") + _T(": ")); button = new wxButton(panel, STAT_DRAW_BUTTON, _("Change draw")); sizer_1->Add(button, 1, wxEXPAND); sizer->Add(sizer_1, 0, wxEXPAND | wxALL, 5); wxStaticBoxSizer *sizer_2 = new wxStaticBoxSizer(wxVERTICAL, panel, wxString(_T(" ")) + _("Time range") + _T(": ")); wxFlexGridSizer* sizer_2_1 = new wxFlexGridSizer(2, 5, 5); sizer_2_1->AddGrowableCol(1); label = new wxStaticText(panel, wxID_ANY, _("Start time:")); sizer_2_1->Add(label, 0, wxALIGN_CENTER | wxALL, 5); button = new wxButton(panel, STAT_START_TIME, FormatTime(m_start_time.GetTime(), m_period)); button->SetFocus(); sizer_2_1->Add(button, 1, wxEXPAND); label = new wxStaticText(panel, wxID_ANY, _("End time:")); sizer_2_1->Add(label, 0, wxALIGN_CENTER | wxALL, 5); button = new wxButton(panel, STAT_END_TIME, FormatTime(m_end_time.GetTime(), m_period)); sizer_2_1->Add(button, 1, wxEXPAND); sizer_2->Add(sizer_2_1, 0, wxEXPAND | wxALL, 5); sizer->Add(sizer_2, 0, wxEXPAND | wxALL, 5); line = new wxStaticLine(panel); sizer->Add(line, 0, wxEXPAND, 5); wxStaticBoxSizer* sizer_3 = new wxStaticBoxSizer(wxVERTICAL, panel, wxString(_T(" ")) + _("Period") + _T(": ")); line = new wxStaticLine(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL); m_period_choice = new wxChoice(panel, STAT_CHOICE_PERIOD, wxDefaultPosition, wxDefaultSize, PERIOD_T_SEASON, period_choices); sizer_3->Add(m_period_choice, 0, wxALIGN_CENTER | wxALL, 5); sizer->Add(sizer_3, 0, wxEXPAND | wxALL, 5); wxStaticBoxSizer* sizer_4 = new wxStaticBoxSizer(wxVERTICAL, panel, wxString(_T(" ")) + _("Values") + _T(": ")); wxPanel *subpanel = new wxPanel(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS); wxFlexGridSizer *subpanel_sizer = new wxFlexGridSizer(2, 5, 5); subpanel_sizer->AddGrowableCol(2); label = new wxStaticText(subpanel, wxID_ANY, wxString(_("Minimum value")) + _T(":")); subpanel_sizer->Add(label, wxALIGN_LEFT | wxALL, 10); m_min_value_text = new wxStaticText(subpanel, wxID_ANY, _T("")); subpanel_sizer->Add(m_min_value_text, wxEXPAND | wxALL, 10); label = new wxStaticText(subpanel, wxID_ANY, wxString(_("Average value")) + _T(":")); subpanel_sizer->Add(label, wxALIGN_LEFT | wxLEFT | wxRIGHT, 20); m_avg_value_text = new wxStaticText(subpanel, wxID_ANY, _T("")); subpanel_sizer->Add(m_avg_value_text, wxEXPAND | wxLEFT | wxRIGHT, 20); label = new wxStaticText(subpanel, wxID_ANY, wxString(_("Standard deviation")) + _T(":")); subpanel_sizer->Add(label, wxALIGN_LEFT | wxLEFT | wxRIGHT, 20); m_stddev_value_text = new wxStaticText(subpanel, wxID_ANY, _T("")); subpanel_sizer->Add(m_stddev_value_text, wxEXPAND | wxLEFT | wxRIGHT, 20); label = new wxStaticText(subpanel, wxID_ANY, wxString(_("Maximum value")) + _T(":")); subpanel_sizer->Add(label, wxALIGN_LEFT | wxLEFT | wxRIGHT, 20); m_max_value_text = new wxStaticText(subpanel, wxID_ANY, _T("")); subpanel_sizer->Add(m_max_value_text, wxEXPAND | wxLEFT | wxRIGHT, 20); label = new wxStaticText(subpanel, wxID_ANY, wxString(_("Hour sum")) + _T(":")); subpanel_sizer->Add(label, wxALIGN_LEFT | wxLEFT | wxRIGHT, 20); m_hsum_value_text = new wxStaticText(subpanel, wxID_ANY, _T("")); subpanel_sizer->Add(m_hsum_value_text, wxEXPAND | wxLEFT | wxRIGHT, 20); subpanel->SetSizer(subpanel_sizer); sizer_4->Add(subpanel, 0, wxEXPAND, 0); sizer->Add(sizer_4, 0, wxEXPAND | wxALL, 10); wxBoxSizer *sizer_5 = new wxBoxSizer(wxHORIZONTAL); button = new wxButton(panel, wxID_OK, _("OK")); button->SetDefault(); sizer_5->Add(button, 0, wxALL, 10); button = new wxButton(panel, wxID_CLOSE , _("Close")); sizer_5->Add(button, 0, wxALL, 10); button = new wxButton(panel, wxID_HELP, _("Help")); sizer_5->Add(button, 0, wxALL, 10); sizer->Add(sizer_5, 1, wxALIGN_CENTER | wxALL, 10); panel->SetSizer(sizer); wxSizer *ws = new wxBoxSizer(wxHORIZONTAL); ws->Add(panel, 1, wxEXPAND); SetSizer(ws); ws->SetSizeHints(this); SetDrawInfo( user_draws.GetSelectedDraw() ); // use enum position m_period_choice->SetSelection(time.period); DrawInfoDropTarget* dt = new DrawInfoDropTarget(this); SetDropTarget(dt); Show(true); }
wxDragResult StatDialog::SetDrawInfo(wxCoord x, wxCoord y, DrawInfo *draw_info, wxDragResult def) { SetDrawInfo(draw_info); return def; }