这篇教程C++ to_wx函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中to_wx函数的典型用法代码示例。如果您正苦于以下问题:C++ to_wx函数的具体用法?C++ to_wx怎么用?C++ to_wx使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了to_wx函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wxDialogDialogVideoDetails::DialogVideoDetails(agi::Context *c): wxDialog(c->parent , -1, _("Video Details")){ auto width = c->videoController->GetWidth(); auto height = c->videoController->GetHeight(); auto framecount = c->videoController->GetLength(); auto fps = c->videoController->FPS(); boost::rational<int> ar(width, height); auto fg = new wxFlexGridSizer(2, 5, 10); auto make_field = [&](wxString const& name, wxString const& value) { fg->Add(new wxStaticText(this, -1, name), 0, wxALIGN_CENTRE_VERTICAL); fg->Add(new wxTextCtrl(this, -1, value, wxDefaultPosition, wxSize(300,-1), wxTE_READONLY), 0, wxALIGN_CENTRE_VERTICAL | wxEXPAND); }; make_field(_("File name:"), c->videoController->GetVideoName().wstring()); make_field(_("FPS:"), wxString::Format("%.3f", fps.FPS())); make_field(_("Resolution:"), wxString::Format("%dx%d (%d:%d)", width, height, ar.numerator(), ar.denominator())); make_field(_("Length:"), wxString::Format(_("%d frames (%s)"), framecount, to_wx(AssTime(fps.TimeAtFrame(framecount - 1)).GetAssFormated(true)))); make_field(_("Decoder:"), to_wx(c->videoController->GetProvider()->GetDecoderName())); wxStaticBoxSizer *video_sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Video")); video_sizer->Add(fg); auto main_sizer = new wxBoxSizer(wxVERTICAL); main_sizer->Add(video_sizer, 1, wxALL|wxEXPAND, 5); main_sizer->Add(CreateSeparatedButtonSizer(wxOK), 0, wxALL|wxEXPAND, 5); SetSizerAndFit(main_sizer); CenterOnParent();}
开发者ID:KagamiChan,项目名称:Aegisub,代码行数:30,
示例2: log void log(agi::log::SinkMessage *sm) override {#ifndef _WIN32 tm tmtime; localtime_r(&sm->tv.tv_sec, &tmtime); auto log = wxString::Format("%c %02d:%02d:%02d %-6ld <%-25s> [%s:%s:%d] %s/n", agi::log::Severity_ID[sm->severity], (int)tmtime.tm_hour, (int)tmtime.tm_min, (int)tmtime.tm_sec, (long)sm->tv.tv_usec, sm->section, sm->file, sm->func, sm->line, to_wx(sm->message));#else auto log = wxString::Format("%c %-6ld <%-25s> [%s:%s:%d] %s/n", agi::log::Severity_ID[sm->severity], sm->tv.tv_usec, sm->section, sm->file, sm->func, sm->line, to_wx(sm->message));#endif if (wxIsMainThread()) text_ctrl->AppendText(log); else agi::dispatch::Main().Async([=]{ text_ctrl->AppendText(log); }); }
开发者ID:KagamiChan,项目名称:Aegisub,代码行数:31,
示例3: AssTimevoid VideoBox::UpdateTimeBoxes() { if (!context->videoController->IsLoaded()) return; int frame = context->videoController->GetFrameN(); int time = context->videoController->TimeAtFrame(frame, agi::vfr::EXACT); // Set the text box for frame number and time VideoPosition->SetValue(wxString::Format("%s - %d", AssTime(time).GetAssFormated(true), frame)); if (boost::binary_search(context->videoController->GetKeyFrames(), frame)) { // Set the background color to indicate this is a keyframe VideoPosition->SetBackgroundColour(to_wx(OPT_GET("Colour/Subtitle Grid/Background/Selection")->GetColor())); VideoPosition->SetForegroundColour(to_wx(OPT_GET("Colour/Subtitle Grid/Selection")->GetColor())); } else { VideoPosition->SetBackgroundColour(wxNullColour); VideoPosition->SetForegroundColour(wxNullColour); } AssDialogue *active_line = context->selectionController->GetActiveLine(); if (!active_line) VideoSubsPos->SetValue(""); else { VideoSubsPos->SetValue(wxString::Format( "%+dms; %+dms", time - active_line->Start, time - active_line->End)); }}
开发者ID:KagamiChan,项目名称:Aegisub,代码行数:28,
示例4: executebool execute( const std::vector<std::string>& args, execution_info& info){ bp::pipe out_pipe(bp::create_pipe()), err_pipe(bp::create_pipe()); { bio::file_descriptor_sink out_sink(out_pipe.sink, bio::close_handle), err_sink(err_pipe.sink, bio::close_handle); bp::child c = bp::execute( bpi::set_args(args), bpi::bind_stdout(out_sink), bpi::bind_stderr(err_sink), bpi::close_stdin() ); info.exitcode = bp::wait_for_exit(c); } bio::file_descriptor_source out_source(out_pipe.source, bio::close_handle), err_source(err_pipe.source, bio::close_handle); string_sink out, err; bio::copy(out_source, out); bio::copy(err_source, err); info.cmd = to_wx(args[0]); info.out = to_wx(out.get()); info.err = to_wx(err.get()); return info.exitcode == 0;}
开发者ID:coldfix,项目名称:latex-preview,代码行数:30,
示例5: deserialize_sizestatic Optional<Size> deserialize_size(const utf8_string& str){ wxString wxStr(to_wx(str)); wxArrayString strs = wxSplit(to_wx(str), ',', '/0'); if (strs.GetCount() != 2){ return {}; } long width; if (!strs[0].ToLong(&width)){ return {}; } if (width <= 0){ return {}; } long height; if (!strs[1].ToLong(&height)){ return {}; } if (height <= 0){ return {}; } return {Size(static_cast<coord>(width), static_cast<coord>(height))};}
开发者ID:lukas-ke,项目名称:faint-graphics-editor,代码行数:25,
示例6: GetEncodingwxString GetEncoding(wxString const& filename) { agi::charset::CharsetListDetected list; try { list = agi::charset::DetectAll(from_wx(filename)); } catch (const agi::charset::UnknownCharset&) { /// @todo If the charset is unknown we need to display a complete list of character sets. } if (list.size() == 1) { auto charset = list.begin(); LOG_I("charset/file") << filename << " (" << charset->second << ")"; return to_wx(charset->second); } wxArrayString choices; std::string log_choice; for (auto const& charset : list) { choices.push_back(to_wx(charset.second)); log_choice.append(" " + charset.second); } LOG_I("charset/file") << filename << " (" << log_choice << ")"; int choice = wxGetSingleChoiceIndex(_("Aegisub could not narrow down the character set to a single one./nPlease pick one below:"),_("Choose character set"),choices); if (choice == -1) throw "Canceled"; return choices[choice];}
开发者ID:jmglogow,项目名称:Aegisub,代码行数:29,
示例7: aboutvoid LatexPreviewWindow::OnAboutClick( wxCommandEvent& event ){ wxtk::AboutBox about(this); about.SetDescription( to_wx("Clever text describing the application. Not.") ); about.SetBigIcon( GetIconResource(wxT("icon1.xpm")) ); about.SetAppname( to_wx("wxLatexPreview/nVersion 1.2") ); about.SetTitle( to_wx("About wxLatexPreview") ); about.SetCopyright( to_wx("(C) 2010-2012 Thomas Gl C++ to_xenbus_driver函数代码示例 C++ to_wide_string函数代码示例
|