当前位置: 首页>>代码示例>>C++>>正文


C++ DrawInfo::GetBasePrefix方法代码示例

本文整理汇总了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);
    }
}
开发者ID:hermixy,项目名称:szarp,代码行数:35,代码来源:remarksfetcher.cpp

示例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);

}
开发者ID:marta09,项目名称:szarp,代码行数:31,代码来源:wxgraphs.cpp

示例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());
}
开发者ID:cyclefusion,项目名称:szarp,代码行数:8,代码来源:seldraw.cpp

示例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);
}
开发者ID:marta09,项目名称:szarp,代码行数:11,代码来源:wxgraphs.cpp

示例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();
}
开发者ID:,项目名称:,代码行数:17,代码来源:

示例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);

}
开发者ID:cyclefusion,项目名称:szarp,代码行数:20,代码来源:seldraw.cpp

示例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);

}
开发者ID:hermixy,项目名称:szarp,代码行数:23,代码来源:remarksfetcher.cpp

示例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()));
	}

}
开发者ID:cyclefusion,项目名称:szarp,代码行数:24,代码来源:paredit.cpp


注:本文中的DrawInfo::GetBasePrefix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。