本文整理汇总了C++中Draw::GetEnable方法的典型用法代码示例。如果您正苦于以下问题:C++ Draw::GetEnable方法的具体用法?C++ Draw::GetEnable怎么用?C++ Draw::GetEnable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Draw
的用法示例。
在下文中一共展示了Draw::GetEnable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
std::set<std::set<int> > DrawsPrintout::ChooseDraws() {
int count;
if (wxConfig::Get()->Read(_T("MaxPrintedAxesNumber"), &count) == false)
count = 3;
if (count < 1)
count = 1;
Axis sr;
std::tr1::unordered_map<Axis, std::set<int>, AxisHasher> ranges;
for (int i = 0; i < m_draws_count; ++i) {
Draw* draw = m_draws[i];
if (!draw->GetEnable())
continue;
Axis r;
r.min = draw->GetDrawInfo()->GetMin();
r.max = draw->GetDrawInfo()->GetMax();
r.prec = draw->GetDrawInfo()->GetPrec();
r.unit = draw->GetDrawInfo()->GetUnit();
for (auto it = ranges.begin(); it!=ranges.end(); ++it) // for each axis in ranges
{
if (it->first.min == r.min && it->first.max == r.max && it->first.unit == r.unit) // check, if they differ only by precision. If so, change the axis
{
if (it->first.prec < r.prec) r.prec = it->first.prec;
else {
for (auto jt = ranges[it->first].begin(); jt != ranges[it->first].end(); ++jt)
ranges[r].insert(*jt);
if (sr == it->first)
sr = r;
}
}
}
if (m_draws[i]->GetSelected())
sr = r;
ranges[r].insert(i);
}
std::set<std::set<int> > ret;
std::tr1::unordered_map<Axis, std::set<int>, AxisHasher>::iterator it = ranges.begin();
for (int added = 0; added < count - 1 && it != ranges.end(); it++) {
if (it->first == sr)
continue;
added++;
ret.insert(it->second);
}
ret.insert(ranges[sr]);
return ret;
}
示例2: InsertSomeDraws
void SelectDrawWidget::InsertSomeDraws(size_t start, size_t count) {
wxSizer *sizer = GetSizer();
int width = GetCheckBoxWidth();
ConfigNameHash& cnm = const_cast<ConfigNameHash&>(m_cfg->GetConfigTitles());
for (size_t i = start; count; count--, i++) {
if (i >= m_cb_l.size()) {
i = m_cb_l.size();
m_cb_l.push_back(new wxCheckBox());
m_cb_l[i]->Create(this, drawID_SELDRAWCB,
wxString::Format(_T("%d."), i + 1),
wxDefaultPosition, wxSize(width, -1), 0,
SelectDrawValidator(m_draws_wdg, i, m_cb_l[i]));
m_cb_l[i]->Enable(FALSE);
m_cb_l[i]->SetToolTip(wxEmptyString);
m_cb_l[i]->SetBackgroundColour(DRAW3_BG_COLOR);
sizer->Add(m_cb_l[i], 0, wxTOP | wxLEFT | wxRIGHT, 1);
}
Draw* draw = m_dc->GetDraw(i);
DrawInfo* draw_info = draw->GetDrawInfo();
wxString label;
if (draw_info->IsValid()) {
m_cb_l[i]->Enable(TRUE);
m_cb_l[i]->SetValue(draw->GetEnable());
m_cb_l[i]->SetToolTip(cnm[draw_info->GetBasePrefix()] + _T(":") + draw_info->GetParamName());
label = wxString::Format(_T("%d."), draw->GetInitialDrawNo() + 1) + draw_info->GetName();
if (draw_info->GetParam()->GetIPKParam()->GetPSC())
label += _T("*");
if (draw->GetBlocked())
label.Replace(wxString::Format(_T("%d."), draw->GetInitialDrawNo() + 1), wxString::Format(_("%d.[B]"), i + 1), false);
} else {
label = _T("***");
}
m_cb_l[i]->SetLabel(label);
wxValidator* validator = m_cb_l[i]->GetValidator();
if (validator)
dynamic_cast<SelectDrawValidator*>(validator)->Set(m_draws_wdg, i, m_cb_l[i]);
else
m_cb_l[i]->SetValidator(SelectDrawValidator(m_draws_wdg, i, m_cb_l[i]));
m_cb_l[i]->SetBackgroundColour(draw_info->GetDrawColor());
#ifdef MINGW32
m_cb_l[i]->Refresh();
#endif
}
if (m_cb_l.size() > MIN_DRAWS_COUNT)
SetScrollRate(10, 10);
else
SetScrollRate(0, 0);
sizer->Layout();
}
示例3: OnPaint
void WxGraphs::OnPaint(wxPaintEvent & WXUNUSED(event))
{
wxBufferedPaintDC dc(this);
dc.SetMapMode(wxMM_TEXT);
dc.SetBackground(*wxBLACK);
dc.SetFont(GetFont());
int selected_draw = m_draws_wdg->GetSelectedDrawIndex();
if (selected_draw == -1) {
dc.Clear();
return;
}
wxRegion region = GetUpdateRegion();
wxRegionIterator i(region);
wxDC *pdc = m_bg_view->GetDC();
if (m_draws_wdg->GetNoData() == false) {
#ifndef NO_GSTREAMER
if (!m_dancing)
#endif
while (i) {
int x = i.GetX();
int y = i.GetY();
int w = i.GetW();
int h = i.GetH();
wxLogInfo(_T("Repainting - x:%d y:%d, w:%d h:%d"), x, y, w, h);
if (pdc->Ok())
dc.Blit(x, y, w, h, pdc, x, y, wxCOPY);
for (size_t j = 0; j <= m_draws.size(); ++j) {
size_t i;
if ((int)j == selected_draw)
continue;
if (j == m_draws.size())
i = selected_draw;
else
i = j;
Draw *d = m_draws[i];
if (d->GetEnable() == false)
continue;
wxDC *pdc = m_graphs.at(i)->GetDC();
if (pdc->Ok())
dc.Blit(x, y, w, h, pdc, x, y, wxCOPY, true);
}
++i;
}
#ifndef NO_GSTREAMER
else
DrawDance(&dc);
#endif
} else {
int w, h, tw, th;
GetClientSize(&w, &h);
if (pdc->Ok())
dc.Blit(0, 0, w, h, pdc, 0, 0, wxCOPY);
wxString no_data = _("No data");
dc.SetFont(GetFont());
dc.SetTextForeground(*wxWHITE);
dc.GetTextExtent(no_data, &tw, &th);
dc.DrawText(no_data, (w - tw) / 2, (h - th) / 2);
}
DrawWindowInfo(&dc, region);
if (m_draw_current_draw_name)
DrawCurrentParamName(&dc);
}
示例4: PrintDrawsInfo
//.........这里部分代码省略.........
dc->GetTextExtent(period, &tw, &th);
dc->DrawText(period, hw - tw / 2, maxy);
maxy += int(1.4 * th);
int point_size = f.GetPointSize();
bool painted = false;
do {
wxString time;
time += _("From: ");
time += FormatTime(fd->GetTimeOfIndex(0), pt);
time += _(" to: ");
time += FormatTime(fd->GetTimeOfIndex(fd->GetValuesTable().size() - 1), pt);
dc->GetTextExtent(time, &tw, &th);
if (tw > w && f.GetPointSize() >= 2) {
f.SetPointSize(f.GetPointSize() - 1);
dc->SetFont(f);
} else {
dc->DrawText(time, hw - tw / 2, maxy);
maxy += int(1.4 * th);
painted = true;
}
} while (!painted);
f.SetPointSize(point_size) ;
dc->SetFont(f);
painted = false;
bool painting = false;
int pmaxy = maxy;
do {
for (int i = 0; i < m_draws_count; ++i) {
Draw *d = m_draws[i];
if (!d->GetEnable())
continue;
DrawInfo* di = d->GetDrawInfo();
int cx = 0.02 * w;
wxString str = wxString::Format(_T("%s = %s "),
di->GetShortName().c_str(),
di->GetName().c_str());
dc->SetTextForeground(di->GetDrawColor());
dc->GetTextExtent(str, &tw, &th);
if (painting)
dc->DrawText(str, cx, maxy);
cx += tw;
const Draw::VT& vt = d->GetValuesTable();
if (vt.m_count) {
dc->SetTextForeground(*wxBLACK);
wxString unit = di->GetUnit();
str = wxString(_T(": "))
+ _("min.=") + d->GetDrawInfo()->GetValueStr(vt.m_min, _T("- -")) +
+ _T(" ; ") + _("avg.=") + wxString(d->GetDrawInfo()->GetValueStr(vt.m_sum / vt.m_count, _T("- -"))) +
+ _T(" ; ") + _("max.=") + wxString(d->GetDrawInfo()->GetValueStr(vt.m_max, _T("- -"))) +
+ _T(" ") + unit;
if (painting) {
dc->GetTextExtent(str, &tw, &th);
dc->DrawText(str, cx, maxy);