本文整理汇总了C++中DrawInfo::GetParam方法的典型用法代码示例。如果您正苦于以下问题:C++ DrawInfo::GetParam方法的具体用法?C++ DrawInfo::GetParam怎么用?C++ DrawInfo::GetParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DrawInfo
的用法示例。
在下文中一共展示了DrawInfo::GetParam方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxMenu
void
SelectDrawValidator::OnMouseRightDown(wxMouseEvent &event) {
DrawInfo* di = m_draws_wdg->GetDrawInfo(m_index);
if (di == NULL)
return;
wxMenu menu;
DrawParam* dp = di->GetParam();
if (di->IsValid() && dp->GetIPKParam()->GetPSC())
menu.Append(seldrawID_PSC,_("Set parameter"));
menu.SetClientData(m_cb);
if (m_draws_wdg->GetDrawBlocked(m_index)) {
wxMenuItem* item = menu.AppendCheckItem(seldrawID_CTX_BLOCK_MENU, _("Draw blocked\tCtrl-B"));
item->Check();
} else {
int non_blocked_count = 0;
for (unsigned int i = 0; i < m_draws_wdg->GetDrawsCount(); ++i)
if (!m_draws_wdg->GetDrawBlocked(i))
non_blocked_count++;
//one draw shall be non-blocked
if (non_blocked_count > 1)
menu.AppendCheckItem(seldrawID_CTX_BLOCK_MENU, _("Draw blocked\tCtrl-B"));
}
menu.Append(seldrawID_CTX_DOC_MENU, _("Parameter documentation\tCtrl-H"));
menu.Append(seldrawID_CTX_COPY_PARAM_NAME_MENU, _("Copy parameter name\tCtrl+Shift+C"));
wxMenu* submenu = new wxMenu();
submenu->SetClientData(m_cb);
wxMenuItem* averageItem = submenu->AppendRadioItem(seldrawID_CTX_AVERAGE_VALUE, _("Average value for selected period"));
wxMenuItem* lastItem = submenu->AppendRadioItem(seldrawID_CTX_LAST_VALUE, _("Last value"));
wxMenuItem* diffItem = submenu->AppendRadioItem(seldrawID_CTX_DIFFERENCE_VALUE, _("Difference between last and first value"));
menu.AppendSubMenu(submenu, _("Type of average values shown"));
switch (di->GetAverageValueCalculationMethod()) {
case AVERAGE_VALUE_CALCULATION_AVERAGE:
averageItem->Check(true);
break;
case AVERAGE_VALUE_CALCULATION_LAST:
lastItem->Check(true);
break;
case AVERAGE_VALUE_CALCULATION_LAST_FIRST:
diffItem->Check(true);
break;
}
if (dynamic_cast<DefinedParam*>(dp) != NULL)
menu.Append(seldrawID_CTX_EDIT_PARAM, _("Edit parameter associated with graph\tCtrl-E"));
m_cb->PopupMenu(&menu);
}
示例2: OpenParameterDoc
void SelectDrawWidget::OpenParameterDoc(int i) {
DrawInfo* d;
if (i == -1)
d = m_draws_wdg->GetCurrentDrawInfo();
else
d = m_draws_wdg->GetDrawInfo(i);
if (d == NULL)
return;
if (DefinedParam* dp = dynamic_cast<DefinedParam*>(d->GetParam()))
ShowDefinedParamDoc(dp);
else
GoToWWWDocumentation(d);
#ifdef __WXMSW__
m_draws_wdg->SetFocus();
#endif
}
示例3: 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);
}
示例4: 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()));
}
}