本文整理汇总了C++中DrawInfo::GetBasePrefix方法的典型用法代码示例。如果您正苦于以下问题:C++ DrawInfo::GetBasePrefix方法的具体用法?C++ DrawInfo::GetBasePrefix怎么用?C++ DrawInfo::GetBasePrefix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DrawInfo
的用法示例。
在下文中一共展示了DrawInfo::GetBasePrefix方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemarksReceived
void RemarksFetcher::RemarksReceived(std::vector<Remark>& remarks) {
Draw* d = m_draws_controller->GetSelectedDraw();
if (d == NULL)
return;
DrawInfo* di = d->GetDrawInfo();
wxDateTime start = d->GetTimeOfIndex(0);
wxDateTime end = d->GetTimeOfIndex(d->GetValuesTable().size());
wxString prefix = di->GetBasePrefix();
wxString set = di->GetSetName();
std::vector<wxDateTime> remarks_times;
for (std::vector<Remark>::iterator i = remarks.begin(); i != remarks.end(); i++) {
wxDateTime rt = i->GetTime();
std::wstring rset = i->GetSet();
if (prefix != i->GetAttachedPrefix()
|| (!rset.empty() && set != rset)
|| rt < start
|| rt >= end)
continue;
remarks_times.push_back(rt);
m_remarks[i->GetId()] = *i;
}
if (remarks_times.size()) {
d->SetRemarksTimes(remarks_times);
}
}
示例2: DrawCurrentParamName
void WxGraphs::DrawCurrentParamName(wxDC *dc) {
DrawInfo *di = m_draws_wdg->GetCurrentDrawInfo();
if (di == NULL)
return;
wxFont f = GetFont();
int ps = f.GetPointSize();
int fw = f.GetWeight();
f.SetWeight(wxFONTWEIGHT_BOLD);
f.SetPointSize(ps * 1.25);
dc->SetFont(f);
wxString text = m_cfg_mgr->GetConfigTitles()[di->GetBasePrefix()] + _T(":") + di->GetParamName();
int tw, th;
dc->GetTextExtent(text, &tw, &th);
int w, h;
GetSize(&w, &h);
dc->SetTextForeground(di->GetDrawColor());
dc->SetBrush(*wxBLACK_BRUSH);
dc->SetPen(*wxWHITE_PEN);
dc->DrawRectangle(w / 2 - tw / 2 - 1, h / 2 - th / 2 - 1, tw + 2, th + 2);
dc->DrawText(text, w / 2 - tw / 2, h / 2 - th / 2);
f.SetPointSize(ps);
f.SetWeight(fw);
dc->SetFont(f);
}
示例3: GetClicked
void
SelectDrawWidget::OnPSC(wxCommandEvent &event) {
int i = GetClicked(event);
if (i == -1)
return;
DrawInfo* info = m_draws_wdg->GetDrawInfo(i);
m_cfg->EditPSC(info->GetBasePrefix(), info->GetParamName());
}
示例4: OnMouseRightDown
void WxGraphs::OnMouseRightDown(wxMouseEvent &event) {
if (m_draws_wdg->GetSelectedDrawIndex() == -1)
return;
Draw *d = m_draws[m_draws_wdg->GetSelectedDrawIndex()];
DrawInfo *di = d->GetDrawInfo();
SetInfoDataObject wido(di->GetBasePrefix(), di->GetSetName(), d->GetPeriod(), d->GetCurrentTime().GetTicks(), m_draws_wdg->GetSelectedDrawIndex());
wxDropSource ds(wido, this);
ds.DoDragDrop(0);
}
示例5: CopyToClipboard
void DrawsWidget::CopyToClipboard() {
Draw *d = m_draws_controller->GetSelectedDraw();
if (d == NULL)
return;
if (wxTheClipboard->Open() == false)
return;
DrawInfo *di = d->GetDrawInfo();
SetInfoDataObject* wido =
new SetInfoDataObject(di->GetBasePrefix(), di->GetSetName(), d->GetPeriod(), d->GetCurrentTime().GetTicks(), d->GetDrawNo());
wxTheClipboard->SetData(wido);
wxTheClipboard->Close();
}
示例6: OnEditParam
void SelectDrawWidget::OnEditParam(wxCommandEvent &event) {
int i = GetClicked(event);
if (i == -1)
return;
DrawInfo *d = m_draws_wdg->GetDrawInfo(i);
DefinedParam *dp = dynamic_cast<DefinedParam*>(d->GetParam());
if (dp == NULL)
return;
wxWindow *w = this;
while (!w->IsTopLevel())
w = w->GetParent();
ParamEdit pe(w, m_cfg, m_dbmgr, m_remarks_handler);
pe.SetCurrentConfig(d->GetBasePrefix());
pe.Edit(dp);
}
示例7: Fetch
void RemarksFetcher::Fetch() {
if (!m_remarks_handler->Configured())
return;
Draw* d = m_draws_controller->GetSelectedDraw();
if (d == NULL)
return;
wxDateTime start = d->GetTimeOfIndex(0);
if (!start.IsValid())
return;
wxDateTime end = d->GetTimeOfIndex(d->GetValuesTable().size());
DrawInfo *di = d->GetDrawInfo();
m_remarks_handler->GetStorage()->GetRemarks(
di->GetBasePrefix(),
di->GetSetName(),
start.GetTicks(),
end.GetTicks(),
this);
}
示例8: OnFormulaInsertParam
void ParamEdit::OnFormulaInsertParam(wxCommandEvent &event) {
DrawsSets* drawsets = m_cfg_mgr->GetConfigByPrefix(m_base_prefix);
assert(drawsets);
wxString ct = drawsets->GetID();
if (m_inc_search == NULL)
m_inc_search = new IncSearch(m_cfg_mgr, m_remarks_handler, ct, this, -1, _("Find"), false, false);
else
m_inc_search->SetConfigName(ct);
if (m_inc_search->ShowModal() != wxID_OK)
return;
long prev = -1;
DrawInfo *draw;
while ((draw = m_inc_search->GetDrawInfo(&prev)) != NULL) {
DrawParam *p = draw->GetParam();
wxString pname = p->GetParamName();
m_formula_input->AddText(wxString::Format(_T("p(\"%s:%s\", t, pt) "), draw->GetBasePrefix().c_str(), pname.c_str()));
}
}