本文整理汇总了C++中DrawInfo::GetSetName方法的典型用法代码示例。如果您正苦于以下问题:C++ DrawInfo::GetSetName方法的具体用法?C++ DrawInfo::GetSetName怎么用?C++ DrawInfo::GetSetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DrawInfo
的用法示例。
在下文中一共展示了DrawInfo::GetSetName方法的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: GetUrl
wxString DrawsWidget::GetUrl(bool with_infinity) {
Draw* d = m_draws_controller->GetSelectedDraw();
if (d == NULL)
return wxEmptyString;
time_t t;
if (with_infinity && m_draws_controller->AtTheNewestValue()) {
t = std::numeric_limits<time_t>::max();
} else {
t = GetCurrentTime().GetTicks();
}
wxString prefix = m_draws_controller->GetSet()->GetDrawsSets()->GetPrefix();
DrawInfo* di = d->GetDrawInfo();
SetInfoDataObject* wido =
new SetInfoDataObject(prefix, di->GetSetName(), d->GetPeriod(), t , d->GetDrawNo());
wxString tmp = wido->GetUrl();
delete wido;
return tmp;
}
示例3: 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);
}
示例4: DrawWindowInfo
void WxGraphs::DrawWindowInfo(wxDC * dc, const wxRegion & repainted_region)
{
if (repainted_region.IsEmpty())
return;
int info_left_marg = m_screen_margins.leftmargin + 8;
int param_name_shift = 5;
if (m_draws.size() < 1)
return;
int w, h;
dc->GetSize(&w, &h);
DrawInfo *info = m_draws[0]->GetDrawInfo();
wxString name = info->GetSetName().c_str();
int namew, nameh;
dc->GetTextExtent(name, &namew, &nameh);
if (repainted_region.Contains(info_left_marg, m_screen_margins.infotopmargin, w - m_screen_margins.infotopmargin, nameh) == wxOutRegion)
return;
dc->SetTextForeground(*wxWHITE);
dc->DrawText(name, info_left_marg, m_screen_margins.infotopmargin);
wxColor color = dc->GetTextForeground();
int xpos = info_left_marg + namew + param_name_shift;
for (int i = 0; i < (int)m_draws.size(); ++i) {
if (!m_draws[i]->GetEnable())
continue;
DrawInfo *info = m_draws[i]->GetDrawInfo();
dc->SetTextForeground(info->GetDrawColor());
name = info->GetShortName().c_str();
dc->GetTextExtent(name, &namew, &nameh);
dc->DrawText(name, xpos, m_screen_margins.infotopmargin);
xpos += namew + param_name_shift;
}
dc->SetTextForeground(color);
}
示例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: DrawWindowInfo
void GCDCGraphs::DrawWindowInfo(wxGraphicsContext &dc) {
double info_left_marg = m_screen_margins.leftmargin + 8;
double param_name_shift = 5;
if (m_draws.size() < 1)
return;
int w, h;
GetClientSize(&w, &h);
DrawInfo *info = m_draws[0]->GetDrawInfo();
wxString name = info->GetSetName().c_str();
double namew, nameh, th, tsel;
dc.GetTextExtent(name, &namew, &nameh, &th, &tsel);
dc.DrawText(name, info_left_marg, m_screen_margins.infotopmargin);
int xpos = info_left_marg + namew + param_name_shift;
for (int i = 0; i < (int)m_draws.size(); ++i) {
if (!m_draws[i]->GetEnable())
continue;
DrawInfo *info = m_draws[i]->GetDrawInfo();
dc.SetFont(GetFont(), info->GetDrawColor());
name = info->GetShortName().c_str();
if (!name.IsEmpty()) {
dc.GetTextExtent(name, &namew, &nameh, &th, &tsel);
dc.DrawText(name, xpos, m_screen_margins.infotopmargin);
xpos += namew + param_name_shift;
} else {
xpos += param_name_shift;
}
}
}
示例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: PrintDrawsInfo
void DrawsPrintout::PrintDrawsInfo(wxDC *dc, int leftmargin, int topmargin, int rightmargin, int bottommargin) {
int w, h;
int tw, th;
int maxy = 5;
int info_print_start;
dc->GetSize(&w, &h);
//GetPageSizePixels(&w, &h);
w -= leftmargin + rightmargin;
int hw = w / 2;
info_print_start = h * 2 / 3 + topmargin;
dc->SetDeviceOrigin(leftmargin, info_print_start);
Draw* fd = m_draws[0];
DrawInfo* fdi = m_draws[0]->GetDrawInfo();
wxFont font = dc->GetFont();
wxFont f = font;
//wxFont f(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, _T("Helvetica"), wxFONTENCODING_ISO8859_2);
#ifdef __WXMSW__
f.SetPointSize(100);
#else
f.SetPointSize(16);
#endif
dc->SetTextForeground(*wxBLACK);
dc->SetFont(f);
wxString cn = GetPrintoutConfigTitle();
dc->GetTextExtent(cn, &tw, &th);
dc->DrawText(cn, hw - tw / 2, maxy);
maxy += int(1.4 * th);
#ifdef __WXMSW__
f.SetPointSize(65);
#else
f.SetPointSize(8);
#endif
dc->SetFont(f);
wxString wt = fdi->GetSetName();
dc->GetTextExtent(wt, &tw, &th);
dc->DrawText(wt, hw - tw / 2, maxy);
maxy += int(1.4 * th);
PeriodType pt = fd->GetPeriod();
wxString period = _("For period: ");
switch (pt) {
case PERIOD_T_DECADE:
period += _("DECADE ");
break;
case PERIOD_T_YEAR:
period += _("YEAR ");
break;
case PERIOD_T_MONTH:
period += _("MONTH ");
break;
case PERIOD_T_WEEK:
period += _("WEEK ");
break;
case PERIOD_T_DAY:
period += _("DAY ");
break;
case PERIOD_T_30MINUTE:
period += _("HOUR ");
break;
case PERIOD_T_5MINUTE:
period += _("5MINUTE ");
break;
case PERIOD_T_MINUTE:
period += _("MINUTE ");
break;
case PERIOD_T_30SEC:
period += _("30SEC ");
break;
case PERIOD_T_SEASON:
period += _("SEASON ");
break;
default:
assert(false);
}
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);
//.........这里部分代码省略.........