您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wxT函数代码示例

51自学网 2021-06-03 10:12:30
  C++
这篇教程C++ wxT函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wxT函数的典型用法代码示例。如果您正苦于以下问题:C++ wxT函数的具体用法?C++ wxT怎么用?C++ wxT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wxT函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ToolBar

//Standard contructorDeviceToolBar::DeviceToolBar(): ToolBar(DeviceBarID, _("Device"), wxT("Device"), true){   mPlayBitmap = NULL;   mRecordBitmap = NULL;}
开发者ID:PhilSee,项目名称:audacity,代码行数:7,


示例2: GetParentForModalDialog

bool wxGenericDirDialog::Create(wxWindow* parent,                                const wxString& title,                                const wxString& defaultPath, long style,                                const wxPoint& pos,                                const wxSize& sz,                                const wxString& name){    wxBusyCursor cursor;    parent = GetParentForModalDialog(parent, style);    if (!wxDirDialogBase::Create(parent, title, defaultPath, style, pos, sz, name))        return false;    m_path = defaultPath;    if (m_path == wxT("~"))        wxGetHomeDir(&m_path);    if (m_path == wxT("."))        m_path = wxGetCwd();    wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );    // smartphones does not support or do not waste space for wxButtons#if defined(__SMARTPHONE__)    wxMenu *dirMenu = new wxMenu;    dirMenu->Append(ID_GO_HOME, _("Home"));    if (!HasFlag(wxDD_DIR_MUST_EXIST))    {        dirMenu->Append(ID_NEW, _("New directory"));    }    dirMenu->AppendCheckItem(ID_SHOW_HIDDEN, _("Show hidden directories"));    dirMenu->AppendSeparator();    dirMenu->Append(wxID_CANCEL, _("Cancel"));#else    // 0) 'New' and 'Home' Buttons    wxSizer* buttonsizer = new wxBoxSizer( wxHORIZONTAL );    // VS: 'Home directory' concept is unknown to MS-DOS#if !defined(__DOS__)    wxBitmapButton* homeButton =        new wxBitmapButton(this, ID_GO_HOME,                           wxArtProvider::GetBitmap(wxART_GO_HOME, wxART_BUTTON));    buttonsizer->Add( homeButton, 0, wxLEFT|wxRIGHT, 10 );#endif    // I'm not convinced we need a New button, and we tend to get annoying    // accidental-editing with label editing enabled.    if (!HasFlag(wxDD_DIR_MUST_EXIST))    {        wxBitmapButton* newButton =            new wxBitmapButton(this, ID_NEW,                               wxArtProvider::GetBitmap(wxART_NEW_DIR, wxART_BUTTON));        buttonsizer->Add( newButton, 0, wxRIGHT, 10 );#if wxUSE_TOOLTIPS        newButton->SetToolTip(_("Create new directory"));#endif    }#if wxUSE_TOOLTIPS    homeButton->SetToolTip(_("Go to home directory"));#endif    topsizer->Add( buttonsizer, 0, wxTOP | wxALIGN_RIGHT, 10 );#endif // __SMARTPHONE__/!__SMARTPHONE__    // 1) dir ctrl    m_dirCtrl = NULL; // this is necessary, event handler called from    // wxGenericDirCtrl would crash otherwise!    long dirStyle = wxDIRCTRL_DIR_ONLY | wxDEFAULT_CONTROL_BORDER;#ifdef __WXMSW__    if (!HasFlag(wxDD_DIR_MUST_EXIST))    {        // Only under Windows do we need the wxTR_EDIT_LABEL tree control style        // before we can call EditLabel (required for "New directory")        dirStyle |= wxDIRCTRL_EDIT_LABELS;    }#endif    m_dirCtrl = new wxGenericDirCtrl(this, ID_DIRCTRL,                                     m_path, wxDefaultPosition,                                     wxSize(300, 200),                                     dirStyle);    wxSizerFlags flagsBorder2;    flagsBorder2.DoubleBorder(wxTOP | wxLEFT | wxRIGHT);    topsizer->Add(m_dirCtrl, wxSizerFlags(flagsBorder2).Proportion(1).Expand());#ifndef __SMARTPHONE__    // TODO: Make this an option depending on a flag?    wxCheckBox *    check = new wxCheckBox(this, ID_SHOW_HIDDEN, _("Show &hidden directories"));    topsizer->Add(check, wxSizerFlags(flagsBorder2).Right());//.........这里部分代码省略.........
开发者ID:BhaaLseN,项目名称:dolphin,代码行数:101,


示例3: wxT

#include "wx/valgen.h"#include "wx/valtext.h"#include "wx/valnum.h"#ifndef wxHAS_IMAGES_IN_RESOURCES    #include "../sample.xpm"#endif// ----------------------------------------------------------------------------// Global data// ----------------------------------------------------------------------------MyData g_data;wxString g_listbox_choices[] =    {wxT("one"),  wxT("two"),  wxT("three")};wxString g_combobox_choices[] =    {wxT("yes"), wxT("no (doesn't validate)"), wxT("maybe (doesn't validate)")};wxString g_radiobox_choices[] =    {wxT("green"), wxT("yellow"), wxT("red")};// ----------------------------------------------------------------------------// MyData// ----------------------------------------------------------------------------MyData::MyData(){    // This string will be passed to an alpha-only validator, which    // will complain because spaces aren't alpha. Note that validation
开发者ID:ruifig,项目名称:nutcracker,代码行数:31,


示例4: wxDialog

DlgPass::DlgPass()                : wxDialog(DlgPass::Parent, -1, wxT("Nau - Pass"),wxDefaultPosition,wxDefaultSize,wxRESIZE_BORDER|wxDEFAULT_DIALOG_STYLE),				m_Name("Pass Dialog"){	m_Parent = DlgPass::Parent;	wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);	/* ----------------------------------------------------------------	                             Toolbar	-----------------------------------------------------------------*/    // load the image wanted on the toolbar    //wxBitmap newImage(wxT("bitmaps/new.bmp"), wxBITMAP_TYPE_BMP);    //wxBitmap cutImage(wxT("bitmaps/cut.bmp"), wxBITMAP_TYPE_BMP);//	wxBitmap aboutImage = wxBITMAP(help) ;    // create the toolbar and add our 1 tool to it /*   m_toolbar = new wxToolBar(this,TOOLBAR_ID);	long tstyle = m_toolbar->GetWindowStyle();	tstyle |= wxTB_TEXT;	m_toolbar->SetWindowStyle(tstyle);    m_toolbar->AddTool(PIPELINE_NEW, _("New"), newImage, _("New Pipeline"));    m_toolbar->AddTool(PIPELINE_REMOVE, _("Remove"), cutImage, _("Remove Pipeline")); 	m_toolbar->AddSeparator();    m_toolbar->AddTool(PASS_NEW, _("New"), newImage, _("New Pass"));    m_toolbar->AddTool(PASS_REMOVE, _("Remove"), cutImage, _("Remove Pass"));	m_toolbar->EnableTool(PIPELINE_REMOVE, FALSE);	m_toolbar->Realize();	sizer->Add(m_toolbar,0,wxGROW |wxALL, 1);*/	/* ----------------------------------------------------------------	                             Pipelines and Passes	-----------------------------------------------------------------*/	m_PipelineList = new wxComboBox(this,DLG_MI_COMBO_PIPELINE,wxT(""),wxDefaultPosition,wxDefaultSize,0,NULL,wxCB_READONLY );	m_PassList = new wxComboBox(this,DLG_MI_COMBO_PASS,wxT(""),wxDefaultPosition,wxDefaultSize,0,NULL,wxCB_READONLY );	wxBoxSizer *sizer1 = new wxBoxSizer(wxHORIZONTAL);	wxStaticText *stg1 =  new wxStaticText(this,-1,wxT("Pipeline: "));	sizer1->Add(stg1,0,wxGROW |wxALL, 5);	sizer1->Add(m_PipelineList,0,wxGROW |wxALL,5);	wxStaticText *stg2 =  new wxStaticText(this,-1,wxT("Pass: "));	sizer1->Add(stg2,0,wxGROW |wxALL, 5);	sizer1->Add(m_PassList,0,wxGROW |wxALL,5);	sizer1->Add(5,5,0, wxGROW |wxALL,5);	sizer->Add(sizer1,0,wxGROW | wxALL,5);	/* ----------------------------------------------------------------	                             Properties	-----------------------------------------------------------------*/	wxStaticBox *sb;	sb = new wxStaticBox(this,-1,wxT("Pass Properties"));	wxSizer *sizerS = new wxStaticBoxSizer(sb,wxVERTICAL);		m_PG = new wxPropertyGridManager(this, DLG_MI_PG,				wxDefaultPosition, wxDefaultSize,				// These and other similar styles are automatically				// passed to the embedded wxPropertyGrid.				wxPG_BOLD_MODIFIED|wxPG_SPLITTER_AUTO_CENTER|				// Plus defaults.				wxPGMAN_DEFAULT_STYLE           );		// dummy prop		m_PG->AddPage(wxT("Properties"));		m_PG->Append(new wxPGProperty(wxT("Parameters"), wxPG_LABEL));		m_PG->Append(new wxFloatProperty(wxT("alpha"),wxPG_LABEL, 0.0f));	sizerS->Add(m_PG, 1, wxGROW | wxALL, 5);	/* ----------------------------------------------------------------								Activate button	-----------------------------------------------------------------*/	wxBoxSizer *sizH3 = new wxBoxSizer(wxHORIZONTAL);	m_BActivate = new wxButton(this, DLG_BUTTON_ACTIVATE, wxT("Activate Pipeline"));	m_ActivePipText = new wxStaticText(this, wxID_ANY, wxT("..."));	sizH3->Add(m_BActivate, 0, wxALL | wxGROW | wxHORIZONTAL , 5);	sizH3->Add(m_ActivePipText, 0, wxALL | wxGROW | wxHORIZONTAL , 5);	/* ----------------------------------------------------------------	                             End	-----------------------------------------------------------------*/	sizer->Add(sizerS,1,wxGROW | wxALL,5);	sizer->Add(sizH3, 0, wxALL | wxGROW | wxHORIZONTAL, 15);	//sizer->Add(5,5,0, wxGROW | wxALL,5);//.........这里部分代码省略.........
开发者ID:Nau3D,项目名称:nau,代码行数:101,


示例5: GetClientSize

void RadarCanvas::Render(wxPaintEvent &evt) {  int w, h;  if (!IsShown() || !m_pi->m_initialized) {    return;  }  GetClientSize(&w, &h);  wxPaintDC(this);  // only to be used in paint events. use wxClientDC to paint                    // outside the paint event  if (!m_pi->m_opengl_mode) {    LOG_DIALOG(wxT("BR24radar_pi: %s cannot render non-OpenGL mode"), m_ri->m_name.c_str());    return;  }  if (!m_pi->m_opencpn_gl_context && !m_pi->m_opencpn_gl_context_broken) {    LOG_DIALOG(wxT("BR24radar_pi: %s skip render as no context known yet"), m_ri->m_name.c_str());    return;  }  LOG_DIALOG(wxT("BR24radar_pi: %s render OpenGL canvas %d by %d "), m_ri->m_name.c_str(), w, h);  SetCurrent(*m_context);  glPushMatrix();  glPushAttrib(GL_ALL_ATTRIB_BITS);  wxFont font = GetOCPNGUIScaledFont_PlugIn(_T("StatusBar"));  m_FontNormal.Build(font);  wxFont bigFont = GetOCPNGUIScaledFont_PlugIn(_T("Dialog"));  bigFont.SetPointSize(bigFont.GetPointSize() + 2);  bigFont.SetWeight(wxFONTWEIGHT_BOLD);  m_FontBig.Build(bigFont);  bigFont.SetPointSize(bigFont.GetPointSize() + 2);  bigFont.SetWeight(wxFONTWEIGHT_NORMAL);  m_FontMenu.Build(bigFont);  bigFont.SetPointSize(bigFont.GetPointSize() + 10);  bigFont.SetWeight(wxFONTWEIGHT_BOLD);  m_FontMenuBold.Build(bigFont);  glClearColor(0.0f, 0.0f, 0.0f, 1.0f);                // Black Background  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);  // Clear the canvas  glEnable(GL_TEXTURE_2D);                             // Enable textures  glEnable(GL_COLOR_MATERIAL);  glEnable(GL_BLEND);  // glDisable(GL_DEPTH_TEST);  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);  glViewport(0, 0, w, h);  glMatrixMode(GL_PROJECTION);  // Next two operations on the project matrix stack  glLoadIdentity();             // Reset projection matrix stack  glOrtho(0, w, h, 0, -1, 1);  glMatrixMode(GL_MODELVIEW);  // Reset matrick stack target back to GL_MODELVIEW  RenderRangeRingsAndHeading(w, h);  Render_EBL_VRM(w, h);  glViewport(0, 0, w, h);  glMatrixMode(GL_PROJECTION);  // Next two operations on the project matrix stack  glLoadIdentity();             // Reset projection matrix stack  if (w >= h) {    glScaled(1.0, (float)-w / h, 1.0);  } else {    glScaled((float)h / w, -1.0, 1.0);  }  glMatrixMode(GL_MODELVIEW);  // Reset matrick stack target back to GL_MODELVIEW  m_ri->RenderRadarImage(wxPoint(0, 0), 1.0, 0.0, false);  glViewport(0, 0, w, h);  glMatrixMode(GL_PROJECTION);  // Next two operations on the project matrix stack  glLoadIdentity();             // Reset projection matrix stack  glOrtho(0, w, h, 0, -1, 1);  glMatrixMode(GL_MODELVIEW);  // Reset matrick stack target back to GL_MODELVIEW  glEnable(GL_TEXTURE_2D);  RenderTexts(w, h);  RenderCursor(w, h);#ifdef NEVER  glDisable(GL_TEXTURE_2D);  glMatrixMode(GL_PROJECTION);  // Next two operations on the project matrix stack  glLoadIdentity();             // Reset projection matrix stack  glMatrixMode(GL_MODELVIEW);   // Reset matrick stack target back to GL_MODELVIEW#endif  glPopAttrib();  glPopMatrix();  glFlush();  glFinish();  SwapBuffers();  if (m_pi->m_opencpn_gl_context) {    SetCurrent(*m_pi->m_opencpn_gl_context);  } else {    SetCurrent(*m_zero_context);  // Make sure OpenCPN -at least- doesn't overwrite our context info  }}
开发者ID:CarCode,项目名称:Cocoa-OCPN,代码行数:99,


示例6: wxT

wxString GroupCell::ToTeX(bool all, wxString imgDir, wxString filename, int *imgCounter){  wxString str;  // pagebreak  if (m_groupType == GC_TYPE_PAGEBREAK) {    str = wxT("//pagebreak/n");  }  // IMAGE CELLS  else if (m_groupType == GC_TYPE_IMAGE && imgDir != wxEmptyString) {    MathCell *copy = m_output->Copy(false);    (*imgCounter)++;    wxString image = filename + wxString::Format(wxT("_%d.png"), *imgCounter);    wxString file = imgDir + wxT("/") + image;    Bitmap bmp;    bmp.SetData(copy);    if (!wxDirExists(imgDir))      wxMkdir(imgDir);    if (bmp.ToFile(file))    {      str << wxT("//begin{figure}[htb]/n")          << wxT("  //begin{center}/n")          << wxT("    //includegraphics{")          << filename << wxT("_img/") << image << wxT("}/n")          << wxT("  //caption{") << PrepareForTeX(m_input->m_next->GetValue()) << wxT("}/n")          << wxT("  //end{center}/n")          << wxT("//end{figure}");    }  }  else if (m_groupType == GC_TYPE_IMAGE)    str << wxT("/n//vert|<<GRAPHICS>>|/n");  // CODE CELLS  else if (m_groupType == GC_TYPE_CODE) {    // Input cells    str = wxT("/n//noindent/n%%%%%%%%%%%%%%%/n")          wxT("%%% INPUT:/n")          wxT("//begin{minipage}[t]{8ex}{//color{red}//bf/n")          wxT("//begin{verbatim}/n") +          m_input->ToString(false) +          wxT("/n//end{verbatim}}/n//end{minipage}");    if (m_input->m_next!=NULL)    {      str += wxT("/n//begin{minipage}[t]{//textwidth}{//color{blue}/n//begin{verbatim}/n") +             m_input->m_next->ToString(true) +             wxT("/n//end{verbatim}}/n//end{minipage}");    }    str += wxT("/n");    if (m_output != NULL) {      str += wxT("%%% OUTPUT:/n");      // Need to define labelcolor if this is Copy as LaTeX!      if (imgCounter == NULL)        str += wxT("//definecolor{labelcolor}{RGB}{100,0,0}/n");      str += wxT("//begin{math}//displaystyle/n");      MathCell *tmp = m_output;      while (tmp != NULL) {        if (tmp->GetType() == MC_TYPE_IMAGE || tmp->GetType() == MC_TYPE_SLIDE)        {          if (imgDir != wxEmptyString)          {            MathCell *copy = tmp->Copy(false);            (*imgCounter)++;            wxString image = filename + wxString::Format(wxT("_%d.png"), *imgCounter);            wxString file = imgDir + wxT("/") + image;            Bitmap bmp;            bmp.SetData(copy);            if (!wxDirExists(imgDir))              if (!wxMkdir(imgDir))                continue;            if (bmp.ToFile(file))              str += wxT("//includegraphics[width=9cm]{") +                  filename + wxT("_img/") + image + wxT("}");          }          else            str << wxT("/n//verb|<<GRAPHICS>>|/n");        }        else if (tmp->GetStyle() == TS_LABEL)        {          if (str.Right(13) != wxT("displaystyle/n"))            str += wxT("/n//end{math}/n/n//begin{math}//displaystyle/n");          str += wxT("//parbox{8ex}{//color{labelcolor}") + tmp->ToTeX(false) + wxT("}/n");        }        else          str += tmp->ToTeX(false);        tmp = tmp->m_nextToDraw;//.........这里部分代码省略.........
开发者ID:BlackEdder,项目名称:wxmaxima,代码行数:101,


示例7: wxString

void DlgPass::updatePipelines() {	std::vector<std::string> pips;	RENDERMANAGER->getPipelineNames(&pips);	std::vector<std::string>::iterator iter;	//wxString sel = m_PipelineList->GetStringSelection();	wxString sel = wxString(RENDERMANAGER->getActivePipelineName());	m_PipelineList->Clear();	for (iter = pips.begin(); iter != pips.end(); ++iter)		m_PipelineList->Append(wxString(iter->c_str()));	if (! m_PipelineList->SetStringSelection(sel)) 		m_PipelineList->SetSelection(0);	sel = m_PipelineList->GetStringSelection();	m_ActivePipText->SetLabelText(sel);	std::string pipName = std::string(sel.mb_str());	std::shared_ptr<Pipeline> &pip = RENDERMANAGER->getPipeline(pipName);	std::vector<std::string> passes;	pip->getPassNames(&passes);	sel = m_PassList->GetStringSelection();	m_PassList->Clear();	for (auto &name:passes)		m_PassList->Append(wxString(name.c_str()));	if (! m_PassList->SetStringSelection(sel))		m_PassList->SetSelection(0);			Pass *p = getPass();	m_PG->ClearPage(0);		m_PG->Append(new wxStringProperty(wxT("Class"), wxPG_LABEL, wxT("")));		m_PG->DisableProperty(wxT("Class"));		m_pgCamList.Add(wxT("dummy"));		m_pgPropCam = new wxEnumProperty(wxT("Camera"),wxPG_LABEL,m_pgCamList);		m_PG->Append(m_pgPropCam);				m_pgViewportList.Add(wxT("From Camera"));		m_pgPropViewport = new wxEnumProperty(wxT("Viewport"),wxPG_LABEL,m_pgViewportList);		m_PG->Append(m_pgPropViewport);		m_PG->Append(new wxBoolProperty(wxT("Use Render Target"), wxPG_LABEL, true));		m_PG->SetPropertyAttribute( wxT("Use Render Target"),                              wxPG_BOOL_USE_CHECKBOX,                              true );		m_pgRenderTargetList.Add(wxT("None"));		m_pgPropRenderTarget = new wxEnumProperty(wxT("Render Target"),wxPG_LABEL,m_pgRenderTargetList);		m_PG->Append(m_pgPropRenderTarget);	updateLists(p);	setupGrid();	updateProperties(p) ;}
开发者ID:Nau3D,项目名称:nau,代码行数:63,


示例8: wxFLAGS_MEMBER

    wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE)    wxFLAGS_MEMBER(wxALWAYS_SHOW_SB )    wxFLAGS_MEMBER(wxVSCROLL)    wxFLAGS_MEMBER(wxHSCROLL)    wxFLAGS_MEMBER(wxST_NO_AUTORESIZE)    wxFLAGS_MEMBER(wxALIGN_LEFT)    wxFLAGS_MEMBER(wxALIGN_RIGHT)    wxFLAGS_MEMBER(wxALIGN_CENTRE)wxEND_FLAGS( wxStaticTextStyle )IMPLEMENT_DYNAMIC_CLASS_XTI(wxStaticText, wxControl,"wx/stattext.h")wxBEGIN_PROPERTIES_TABLE(wxStaticText)    wxPROPERTY( Label,wxString, SetLabel, GetLabel, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))    wxPROPERTY_FLAGS( WindowStyle , wxStaticTextStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // stylewxEND_PROPERTIES_TABLE()wxBEGIN_HANDLERS_TABLE(wxStaticText)wxEND_HANDLERS_TABLE()wxCONSTRUCTOR_6( wxStaticText , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )#elseIMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)#endifbool wxStaticText::Create(wxWindow *parent,                          wxWindowID id,                          const wxString& label,                          const wxPoint& pos,
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:31,


示例9: wxFileName

wxIcon* IconGetter::GetDocumentIcon(const wxString& filePath, int iconSize) {  #ifdef __WINDOWS__  // Get the file type from the file extension  wxFileType* fileType = NULL;  wxFileName filename = wxFileName(filePath);  wxString fileExtension = filename.GetExt();  if (fileExtension != wxEmptyString) {    fileType = wxTheMimeTypesManager->GetFileTypeFromExtension(fileExtension);  }  if (!fileType) {    // The file type is not registered on the system, so try to get the default    // icon from shell32.dll (works on Windows XP - not sure on Vista)    // LPTSTR is wchar_t if UNICODE is enabled, or a char otherwise    LPTSTR buffer = new TCHAR[MAX_PATH];    int success = GetSystemDirectory(buffer, MAX_PATH);        // Convert the LPTSTR to a char*    char cString[MAX_PATH];    wcstombs(cString, buffer, MAX_PATH);    wxDELETE(buffer);    wxString shell32Path;    if (success) {      shell32Path = wxString::FromAscii(cString);      shell32Path += wxT("//SHELL32.DLL");    } else {      // If we couldn't get the system directory, try to guess it.      // If the file doesn't exist, GetExecutableIcon() will return wxNullIcon      shell32Path = wxT("C://WINDOWS//SYSTEM32//SHELL32.DLL");    }    return GetExecutableIcon(shell32Path, iconSize);  }  // Try to get the icon location from the file type  wxIconLocation iconLocation;  bool success = fileType->GetIcon(&iconLocation);  // Fixes a bug in wxWidgets: Sometime the icon is negative, in which case the wxIconLocation will be invalid  if (iconLocation.GetIndex() < 0) iconLocation.SetIndex(0);  // Fixes a bug in wxWidgets: The filename is sometime surrounded by quotes, and so the wxIconLocation will  // again be invalid. We remove the quotes below:  wxString iconLocFile = iconLocation.GetFileName();  while (iconLocFile[0] == _T('"')) iconLocFile = iconLocFile.Mid(1, iconLocFile.Len());  while (iconLocFile[iconLocFile.Len() - 1] == _T('"')) iconLocFile = iconLocFile.Mid(0, iconLocFile.Len() - 1);  iconLocation.SetFileName(iconLocFile);  wxDELETE(fileType);  if (success) {    wxIcon* icon = new wxIcon(iconLocation);    icon->SetSize(iconSize, iconSize);    return icon;  } else {    // If we couldn't find the icon at this stage, look for it in the registry. The icon file path    // may be stored in many different places. We need to look in:    //    // HKEY_CLASSES_ROOT/.<extension>/DefaultIcon/<defaultValue>    // HKEY_CLASSES_ROOT/<documentType>/DefaultIcon/<defaultValue>    // HKEY_CLASSES_ROOT/CLSID/<classId>/DefaultIcon/<defaultValue>    //    // The document type can be read at HKEY_CLASSES_ROOT/.<extension>/<defaultValue>    // The class ID is (sometime) at HKEY_CLASSES_ROOT/<documentType>/CLSID/<defaultValue>    //     // Note: all the DefaultIcon values already seem to be handled by wxWidgets so we    // only care about the CLSID case below.    //     // If there is no class ID, we could also look in:    // HKEY_CLASSES_ROOT/<documentType>/shell/open/command    // then get the associated executable from there and, finally, get the icon.    // This is currently not implemented.    //    // Finally, some icons are displayed using an icon handler that can be found at:    // HKEY_CLASSES_ROOT/<documentType>/ShellEx/IconHandler/<defaultValue>    // This is a special module which displays the icon depending on the file content. It    // may actually display two different icons for the same file extension. For example,    // a C# .sln file is going to be displayed differently than a C++ .sln file. These cases    // are hopefully rare enough to ignore them.    wxRegKey* regKey = new wxRegKey(_T("HKEY_CLASSES_ROOT//.") + fileExtension);    wxString iconPath;    if (regKey->Exists()) {      wxString extensionLink = regKey->QueryDefaultValue();          if (extensionLink != wxEmptyString) {        wxDELETE(regKey);        regKey = new wxRegKey(_T("HKEY_CLASSES_ROOT//") + extensionLink + _T("//CLSID"));        if (regKey->Exists()) {          wxString classIdLink = regKey->QueryDefaultValue();          if (classIdLink != wxEmptyString) {            wxDELETE(regKey);//.........这里部分代码省略.........
开发者ID:DocWhoChat,项目名称:appetizer,代码行数:101,


示例10: GetInstallPrefix

wxString wxStandardPaths::GetDataDir() const{    return GetInstallPrefix() + wxT("//data");}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:4,


示例11: AppendAppInfo

wxString wxStandardPaths::GetUserDataDir() const{    return AppendAppInfo(wxFileName::GetHomeDir() + wxT("//."));}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:4,


示例12: getActiveLayer

/* Read a gerber file, RS274D or RS274X format. */bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName,                                           const wxString& D_Code_FullFileName ){    int      G_command = 0;        // command number for G commands like G04    int      D_commande = 0;       // command number for D commands like D02    char     line[GERBER_BUFZ];    wxString msg;    char*    text;    int layer;         // current layer used in GerbView    layer = getActiveLayer();    if( g_GERBER_List[layer] == NULL )    {        g_GERBER_List[layer] = new GERBER_IMAGE( this, layer );    }    GERBER_IMAGE* gerber = g_GERBER_List[layer];    ClearMessageList( );    /* Set the gerber scale: */    gerber->ResetDefaultValues();    /* Read the gerber file */    gerber->m_Current_File = wxFopen( GERBER_FullFileName, wxT( "rt" ) );    if( gerber->m_Current_File == 0 )    {        msg.Printf( _( "File <%s> not found" ), GetChars( GERBER_FullFileName ) );        DisplayError( this, msg, 10 );        return false;    }    gerber->m_FileName = GERBER_FullFileName;    wxString path = wxPathOnly( GERBER_FullFileName );    if( path != wxEmptyString )        wxSetWorkingDirectory( path );    SetLocaleTo_C_standard();    while( true )    {        if( fgets( line, sizeof(line), gerber->m_Current_File ) == NULL )        {            if( gerber->m_FilesPtr == 0 )                break;            fclose( gerber->m_Current_File );            gerber->m_FilesPtr--;            gerber->m_Current_File =                gerber->m_FilesList[gerber->m_FilesPtr];            continue;        }        text = StrPurge( line );        while( text && *text )        {            switch( *text )            {            case ' ':            case '/r':            case '/n':                text++;                break;            case '*':       // End command                gerber->m_CommandState = END_BLOCK;                text++;                break;            case 'M':       // End file                gerber->m_CommandState = CMD_IDLE;                while( *text )                    text++;                break;            case 'G':    /* Line type Gxx : command */                G_command = gerber->GCodeNumber( text );                gerber->Execute_G_Command( text, G_command );                break;            case 'D':       /* Line type Dxx : Tool selection (xx > 0) or                             * command if xx = 0..9 */                D_commande = gerber->DCodeNumber( text );                gerber->Execute_DCODE_Command( text, D_commande );                break;            case 'X':            case 'Y':                   /* Move or draw command */                gerber->m_CurrentPos = gerber->ReadXYCoord( text );                if( *text == '*' )      // command like X12550Y19250*                {                    gerber->Execute_DCODE_Command( text,//.........这里部分代码省略.........
开发者ID:LDavis4559,项目名称:kicad-source-mirror,代码行数:101,


示例13: wxT

void PCB_EDIT_FRAME::OnUpdateShowMicrowaveToolbar( wxUpdateUIEvent& aEvent ){    aEvent.Check( m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).IsShown() );}
开发者ID:corecode,项目名称:kicad-source-mirror,代码行数:4,


示例14: MathCell

GroupCell::GroupCell(int groupType, wxString initString) : MathCell(){  m_input = NULL;  m_output = NULL;  m_hiddenTree = NULL;  m_outputRect.x = -1;  m_outputRect.y = -1;  m_outputRect.width = 0;  m_outputRect.height = 0;  m_group = this;  m_forceBreakLine = true;  m_breakLine = true;  m_type = MC_TYPE_GROUP;  m_indent = MC_GROUP_LEFT_INDENT;  m_hide = false;  m_working = false;  m_groupType = groupType;  m_lastInOutput = NULL;  m_appendedCells = NULL;  // set up cell depending on groupType, so we have a working cell  if (groupType != GC_TYPE_PAGEBREAK) {    if (groupType == GC_TYPE_CODE)      m_input = new TextCell(EMPTY_INPUT_LABEL);    else      m_input = new TextCell(wxT(" "));    m_input->SetType(MC_TYPE_MAIN_PROMPT);  }  bool match = true;  wxConfig::Get()->Read(wxT("matchParens"), &match);  EditorCell *editor = new EditorCell();  editor->SetMatchParens(match);  switch (groupType) {    case GC_TYPE_CODE:      editor->SetType(MC_TYPE_INPUT);      AppendInput(editor);      break;    case GC_TYPE_TEXT:      m_input->SetType(MC_TYPE_TEXT);      editor->SetType(MC_TYPE_TEXT);      AppendInput(editor);      break;    case GC_TYPE_TITLE:      m_input->SetType(MC_TYPE_TITLE);      editor->SetType(MC_TYPE_TITLE);      AppendInput(editor);      break;    case GC_TYPE_SECTION:      m_input->SetType(MC_TYPE_SECTION);      editor->SetType(MC_TYPE_SECTION);      AppendInput(editor);      break;    case GC_TYPE_SUBSECTION:      m_input->SetType(MC_TYPE_SUBSECTION);      editor->SetType(MC_TYPE_SUBSECTION);      AppendInput(editor);      break;    case GC_TYPE_IMAGE:      m_input->SetType(MC_TYPE_TEXT);      editor->SetType(MC_TYPE_TEXT);      editor->SetValue(wxEmptyString);      AppendInput(editor);      break;    default:      delete editor;      editor = NULL;      break;  }  if (editor != NULL)    editor->SetValue(initString);  // when creating an image cell, if a string is provided  // it loads an image (without deleting it)  if ((groupType == GC_TYPE_IMAGE) && (initString.Length() > 0)) {    ImgCell *ic = new ImgCell(initString, false);    AppendOutput(ic);  }  SetParent(this, false);}
开发者ID:BlackEdder,项目名称:wxmaxima,代码行数:84,


示例15: CFDictionaryGetValue

void wxHIDJoystick::MakeCookies(CFArrayRef Array){    int i, nUsage, nPage;    for (i = 0; i < CFArrayGetCount(Array); ++i)    {        const void* ref = CFDictionaryGetValue(                (CFDictionaryRef)CFArrayGetValueAtIndex(Array, i),                CFSTR(kIOHIDElementKey)                                              );        if (ref != NULL)        {            MakeCookies((CFArrayRef) ref);    }        else        {            CFNumberGetValue(                (CFNumberRef)                    CFDictionaryGetValue(                        (CFDictionaryRef) CFArrayGetValueAtIndex(Array, i),                        CFSTR(kIOHIDElementUsageKey)                                        ),                kCFNumberIntType,                &nUsage    );            CFNumberGetValue(                (CFNumberRef)                    CFDictionaryGetValue(                        (CFDictionaryRef) CFArrayGetValueAtIndex(Array, i),                        CFSTR(kIOHIDElementUsagePageKey)                                        ),                kCFNumberIntType,                &nPage     );#if 0            wxLogSysError(wxT("[%i][%i]"), nUsage, nPage);#endif            if (nPage == kHIDPage_Button && nUsage <= 40)                AddCookieInQueue(CFArrayGetValueAtIndex(Array, i), nUsage-1 );            else if (nPage == kHIDPage_GenericDesktop)            {                //axis...                switch(nUsage)                {                    case kHIDUsage_GD_X:                        AddCookieInQueue(CFArrayGetValueAtIndex(Array, i), wxJS_AXIS_X);                        wxGetIntFromCFDictionary(CFArrayGetValueAtIndex(Array, i),                                                 CFSTR(kIOHIDElementMaxKey),                                                 &m_nXMax);                        wxGetIntFromCFDictionary(CFArrayGetValueAtIndex(Array, i),                                                 CFSTR(kIOHIDElementMinKey),                                                 &m_nXMin);                        break;                    case kHIDUsage_GD_Y:                        AddCookieInQueue(CFArrayGetValueAtIndex(Array, i), wxJS_AXIS_Y);                        wxGetIntFromCFDictionary(CFArrayGetValueAtIndex(Array, i),                                                 CFSTR(kIOHIDElementMaxKey),                                                 &m_nYMax);                        wxGetIntFromCFDictionary(CFArrayGetValueAtIndex(Array, i),                                                 CFSTR(kIOHIDElementMinKey),                                                 &m_nYMin);                        break;                    case kHIDUsage_GD_Z:                        AddCookieInQueue(CFArrayGetValueAtIndex(Array, i), wxJS_AXIS_Z);                        wxGetIntFromCFDictionary(CFArrayGetValueAtIndex(Array, i),                                                 CFSTR(kIOHIDElementMaxKey),                                                 &m_nZMax);                        wxGetIntFromCFDictionary(CFArrayGetValueAtIndex(Array, i),                                                 CFSTR(kIOHIDElementMinKey),                                                 &m_nZMin);                        break;                    default:                        break;                }            }            else if (nPage == kHIDPage_Simulation && nUsage == kHIDUsage_Sim_Rudder)            {                //rudder...                AddCookieInQueue(CFArrayGetValueAtIndex(Array, i), wxJS_AXIS_RUDDER );                wxGetIntFromCFDictionary(CFArrayGetValueAtIndex(Array, i),                                         CFSTR(kIOHIDElementMaxKey),                                         &m_nRudderMax);                wxGetIntFromCFDictionary(CFArrayGetValueAtIndex(Array, i),                                         CFSTR(kIOHIDElementMinKey),                                         &m_nRudderMin);            }        }    }}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:90,


示例16: str1

wxString GroupCell::PrepareForTeX(wxString str){#if !wxUSE_UNICODE  wxString str1(str.wc_str(wxConvLocal), wxConvUTF8);#else  wxString str1(str);#endif  str1.Replace(wxT("//"), wxT("//verb|//|"));  str1.Replace(wxT("_"), wxT("//_"));  str1.Replace(wxT("%"), wxT("//%"));  str1.Replace(wxT("{"), wxT("//{"));  str1.Replace(wxT("}"), wxT("//}"));  str1.Replace(wxT("^"), wxT("//verb|^|"));  str1.Replace(wxT(">"), wxT("//verb|>|"));  str1.Replace(wxT("<"), wxT("//verb|<|"));#if !wxUSE_UNICODE  wxString str2(str1.wc_str(wxConvUTF8), wxConvLocal);#else  wxString str2(str1);#endif  return str2;}
开发者ID:BlackEdder,项目名称:wxmaxima,代码行数:25,


示例17: wxLogSysError

//---------------------------------------------------------------------------// wxJoystickThread::Entry//// Thread procedure//// Runs a CFRunLoop for polling. Basically, it sets the HID queue to// call wxJoystickThread::HIDCallback in the context of this thread// when something changes on the device. It polls as long as the user// wants, or a certain amount if the user wants to "block". Note that// we don't actually block here since this is in a secondary thread.//---------------------------------------------------------------------------void* wxJoystickThread::Entry(){    CFRunLoopSourceRef pRLSource = NULL;    if ((*m_hid->GetQueue())->createAsyncEventSource(                    m_hid->GetQueue(), &pRLSource) != kIOReturnSuccess )    {        wxLogSysError(wxT("Couldn't create async event source"));        return NULL;    }    wxASSERT(pRLSource != NULL);    //attach runloop source to main run loop in thread    CFRunLoopRef pRL = CFRunLoopGetCurrent();    CFRunLoopAddSource(pRL, pRLSource, kCFRunLoopDefaultMode);    wxASSERT( CFRunLoopContainsSource(pRL, pRLSource, kCFRunLoopDefaultMode) );    if( (*m_hid->GetQueue())->setEventCallout(m_hid->GetQueue(),          wxJoystickThread::HIDCallback, this, this) != kIOReturnSuccess )    {        wxLogSysError(wxT("Could not set event callout for queue"));        return NULL;    }    if( (*m_hid->GetQueue())->start(m_hid->GetQueue()) != kIOReturnSuccess )    {        wxLogSysError(wxT("Could not start queue"));        return NULL;    }    double dTime;    while(true)    {        if (TestDestroy())            break;        if (m_polling)            dTime = 0.0001 * m_polling;        else            dTime = 0.0001 * 10;  // check at least every 10 msec in "blocking" case        //true just "handles and returns" - false forces it to stay the time        //amount#if 1        CFRunLoopRunInMode(kCFRunLoopDefaultMode, dTime, true);#else        IOReturn ret = NULL;        HIDCallback(this, ret, this, this);        Sleep(3000);#endif    }    wxASSERT( CFRunLoopContainsSource(pRL, pRLSource, kCFRunLoopDefaultMode) );    CFRunLoopRemoveSource(pRL, pRLSource, kCFRunLoopDefaultMode);    CFRelease(pRLSource);    return NULL;}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:73,


示例18: WXUNUSED

//---------------------------------------------------------------------------// wxJoystickThread::HIDCallback (static)//// Callback for the native HID device when it recieves input.//// This is where the REAL dirty work gets done.//// 1) Loops through each event the queue has recieved// 2) First, checks if the thread that is running the loop for//    the polling has ended - if so it breaks out// 3) Next, it checks if there was an error getting this event from//    the HID queue, if there was, it logs an error and returns// 4) Now it does the real dirty work by getting the button states//    from cookies 0-40 and axes positions/states from cookies 40-50//    in the native HID device by quering cookie values.// 5) Sends the event to the polling window (if any)// 6) Gets the next event and goes back to (1)//---------------------------------------------------------------------------/*static*/ void wxJoystickThread::HIDCallback(void* WXUNUSED(target),                                              IOReturn WXUNUSED(res),                                              void* context,                                              void* WXUNUSED(sender)){    IOHIDEventStruct hidevent;    AbsoluteTime bogustime = {0,0};    IOReturn ret;    wxJoystickThread* pThis = (wxJoystickThread*) context;    wxHIDJoystick* m_hid = pThis->m_hid;    //Get the "first" event from the queue    //bogustime tells it we don't care at what time to start    //where it gets the next from    ret = (*m_hid->GetQueue())->getNextEvent(m_hid->GetQueue(),                    &hidevent, bogustime, 0);    while (ret != kIOReturnUnderrun)    {        if (pThis->TestDestroy())            break;        if(ret != kIOReturnSuccess)        {            wxLogSysError(wxString::Format(wxT("wxJoystick Error:[%i]"), ret));            return;        }        wxJoystickEvent wxevent;        //Find the cookie that changed        int nIndex = 0;        IOHIDElementCookie* pCookies = m_hid->GetCookies();        while(nIndex < 50)        {            if(hidevent.elementCookie == pCookies[nIndex])                break;            ++nIndex;        }        //debugging stuff#if 0        if(nIndex == 50)        {            wxLogSysError(wxString::Format(wxT("wxJoystick Out Of Bounds Error")));            break;        }#endif        //is the cookie a button?        if (nIndex < 40)        {            if (hidevent.value)            {                pThis->m_buttons |= (1 << nIndex);                wxevent.SetEventType(wxEVT_JOY_BUTTON_DOWN);            }            else            {                pThis->m_buttons &= ~(1 << nIndex);                wxevent.SetEventType(wxEVT_JOY_BUTTON_UP);            }            wxevent.SetButtonChange(nIndex+1);        }        else if (nIndex == wxJS_AXIS_X)        {            pThis->m_lastposition.x = hidevent.value;            wxevent.SetEventType(wxEVT_JOY_MOVE);            pThis->m_axe[0] = hidevent.value;        }        else if (nIndex == wxJS_AXIS_Y)        {            pThis->m_lastposition.y = hidevent.value;            wxevent.SetEventType(wxEVT_JOY_MOVE);            pThis->m_axe[1] = hidevent.value;        }        else if (nIndex == wxJS_AXIS_Z)        {            wxevent.SetEventType(wxEVT_JOY_ZMOVE);            pThis->m_axe[2] = hidevent.value;//.........这里部分代码省略.........
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:101,


示例19: switch

/* Must be called on a click on the left toolbar (options toolbar * Update variables according to tools states */void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ){    int id = event.GetId();    bool state = event.IsChecked();    DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*)GetDisplayOptions();    switch( id )    {    case ID_TB_OPTIONS_DRC_OFF:        g_Drc_On = !state;        if( GetToolId() == ID_TRACK_BUTT )        {            if( g_Drc_On )                m_canvas->SetCursor( wxCURSOR_PENCIL );            else                m_canvas->SetCursor( wxCURSOR_QUESTION_ARROW );        }        break;    case ID_TB_OPTIONS_SHOW_RATSNEST:        SetElementVisibility( RATSNEST_VISIBLE, state );        if( state && (GetBoard()->m_Status_Pcb & LISTE_RATSNEST_ITEM_OK) == 0 )            Compile_Ratsnest( NULL, true );        m_canvas->Refresh();        break;    case ID_TB_OPTIONS_SHOW_MODULE_RATSNEST:        displ_opts->m_Show_Module_Ratsnest = state; // TODO: see if we can use the visibility list        break;    case ID_TB_OPTIONS_AUTO_DEL_TRACK:        g_AutoDeleteOldTrack = state;        break;    case ID_TB_OPTIONS_SHOW_ZONES:        displ_opts->m_DisplayZonesMode = 0;        m_canvas->Refresh();        break;    case ID_TB_OPTIONS_SHOW_ZONES_DISABLE:        displ_opts->m_DisplayZonesMode = 1;        m_canvas->Refresh();        break;    case ID_TB_OPTIONS_SHOW_ZONES_OUTLINES_ONLY:        displ_opts->m_DisplayZonesMode = 2;        m_canvas->Refresh();        break;    case ID_TB_OPTIONS_SHOW_VIAS_SKETCH:        displ_opts->m_DisplayViaFill = !state;        m_canvas->Refresh();        break;    case ID_TB_OPTIONS_SHOW_TRACKS_SKETCH:        displ_opts->m_DisplayPcbTrackFill = !state;        m_canvas->Refresh();        break;    case ID_TB_OPTIONS_SHOW_HIGH_CONTRAST_MODE:    {        displ_opts->m_ContrastModeDisplay = state;        m_canvas->Refresh();        break;    }    case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR_MICROWAVE:        m_show_microwave_tools = state;        m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).Show( m_show_microwave_tools );        m_auimgr.Update();        GetMenuBar()->SetLabel( ID_MENU_PCB_SHOW_HIDE_MUWAVE_TOOLBAR,                        m_show_microwave_tools ?                        _( "Hide Microwave Toolbar" ): _( "Show Microwave Toolbar" ));        break;    case ID_TB_OPTIONS_SHOW_MANAGE_LAYERS_VERTICAL_TOOLBAR:        // show auxiliary Vertical layers and visibility manager toolbar        m_show_layer_manager_tools = state;        m_auimgr.GetPane( wxT( "m_LayersManagerToolBar" ) ).Show( m_show_layer_manager_tools );        m_auimgr.Update();        GetMenuBar()->SetLabel( ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG,                                m_show_layer_manager_tools ?                                _( "Hide &Layers Manager" ) : _( "Show &Layers Manager" ) );        break;    default:        DisplayError( this,                      wxT( "PCB_EDIT_FRAME::OnSelectOptionToolbar error /n (event not handled!)" ) );        break;    }}
开发者ID:BTR1,项目名称:kicad-source-mirror,代码行数:99,


示例20: getPass

void DlgPass::OnProcessPGChange( wxPropertyGridEvent& e){	Pass *p = getPass();	wxString name,subname,value;	std::string mat,lib;	name = e.GetPropertyName();	int index;	index = e.GetPropertyValue().GetInteger();	if (name == wxT("Camera")) {		value = m_pgCamList.GetLabel(index);		p->setCamera(std::string(value.mb_str()));		}	else if (name == wxT("Viewport")) {		if (index == 0)			p->setViewport(RENDERMANAGER->getCamera(p->getCameraName())->getViewport());		else {			value = m_pgViewportList.GetLabel(index-1);			p->setViewport(RENDERMANAGER->getViewport(std::string(value.mb_str())));		}	}	else if (name == wxT("Use Render Target")) {		p->enableRenderTarget(0 != e.GetPropertyValue().GetBool());	}	else if (name == wxT("Render Target")) {		value = e.GetPropertyValue().GetString();		if (value == wxT("None")) {			p->setRenderTarget(NULL);			m_PG->SetPropertyValue(wxT("Viewport"),wxT("From Camera"));			m_PG->EnableProperty(wxT("Viewport"));		}		else {			m_PG->SetPropertyValue(wxT("Viewport"), wxT("From Render Target"));			m_PG->DisableProperty(wxT("Viewport"));			p->setRenderTarget(RESOURCEMANAGER->getRenderTarget(std::string(value.mb_str())));		}	}	//else if (name == wxT("Clear Color")) 	//	p->setPropb(Pass::COLOR_CLEAR, (0 != e.GetPropertyValue().GetBool()));	//else if (name == wxT("Clear Depth"))	//	p->setPropb(Pass::DEPTH_CLEAR, (0 != e.GetPropertyValue().GetBool()));		else if (name.substr(0,6) == wxT("Lights")) {		subname = name.substr(7,std::string::npos);		bool b = 0 != e.GetPropertyValue().GetBool();		if (b)			p->addLight(std::string(subname.mb_str()));		else			p->removeLight(std::string(subname.mb_str()));	}	else if (name.substr(0,6) == wxT("Scenes")) {		subname = name.substr(7,std::string::npos);		bool b = 0 != e.GetPropertyValue().GetBool();		if (b)			p->addScene(std::string(subname.mb_str()));		else			p->removeScene(std::string(subname.mb_str()));	}	else if (name.substr(0,13) == wxT("Material Maps")) { // Material Maps		subname = name.substr(14, std::string::npos);		if (subname == wxT("*"))			value = m_pgMaterialListPlus.GetLabel(e.GetPropertyValue().GetInteger());		else			value = m_pgMaterialList.GetLabel(e.GetPropertyValue().GetInteger());		mat = std::string(value.AfterLast(':').mb_str());		lib = std::string(value.BeforeFirst(':').mb_str());		if (subname == wxT("*")) {			if (mat == "*") {				p->remapAll(lib);				updateMats(p);			}			else if (value != wxT("None")) {				p->remapAll(lib,mat);				updateMats(p);			}		}		else			p->remapMaterial(std::string(subname.c_str()),lib,mat);	}	else		PropertyManager::updateProp(m_PG, name.ToStdString(), Pass::GetAttribs(), (AttributeValues *)p);	//else if (name.substr(0,10) == wxT("Parameters")) {	//	subname = name.substr(11, std::string::npos);	//	p->setParam(std::string(subname.mb_str()), (float)(e.GetPropertyValue().GetDouble()));	//	//} }
开发者ID:Nau3D,项目名称:nau,代码行数:95,


示例21: GetProcesses

// Get PID and name of each process that has our DLL loaded.static bool GetProcesses(std::vector<ProcessInfo>& processes){   // PSAPI function pointers.   BOOL (WINAPI* lpfEnumProcesses)(DWORD*, DWORD, DWORD*);   BOOL (WINAPI* lpfEnumProcessModules)(HANDLE, HMODULE*, DWORD, LPDWORD );   DWORD (WINAPI* lpfGetModuleBaseName)(HANDLE, HMODULE, LPCTSTR, DWORD);      bool found = false;            // Load library and get function pointers.   HINSTANCE hInstLib = LoadLibraryA("PSAPI.DLL");   if (!hInstLib)   {       DBG("Failed to load PSAPI.DLL");       return false;   }      // Get procedure addresses.   lpfEnumProcesses = (BOOL (WINAPI*)(DWORD*,DWORD,DWORD*)) GetProcAddress(hInstLib, "EnumProcesses");   lpfEnumProcessModules = (BOOL (WINAPI*)(HANDLE, HMODULE*, DWORD, LPDWORD)) GetProcAddress( hInstLib, "EnumProcessModules" );   lpfGetModuleBaseName =(DWORD (WINAPI*)(HANDLE, HMODULE, LPCTSTR, DWORD )) GetProcAddress( hInstLib, "GetModuleBaseNameW" );   if (!lpfEnumProcesses ||       !lpfEnumProcessModules ||       !lpfGetModuleBaseName)   {       DBG("GetProcAddress failed");       FreeLibrary(hInstLib);       return false;   }   DWORD pidList[1000];   DWORD iCbneeded;   if (!lpfEnumProcesses(pidList, sizeof(pidList), &iCbneeded))   {       DBG("EnumProcesses failed");       FreeLibrary(hInstLib);       return false;   }   // How many processes are there?   int iNumProc = iCbneeded/sizeof(DWORD);   // Get and match the name of each process   for (int i = 0; i < iNumProc; ++i)   {       // First, get a handle to the process       HANDLE processHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pidList[i]);       if (processHandle)       {           // Get modules loaded by process           int maxModules = 1000;           HMODULE* hMod = 0;           while (1)           {               hMod = new HMODULE[maxModules];               // Determine number of modules               if (!lpfEnumProcessModules(processHandle, hMod, maxModules*sizeof(HMODULE), &iCbneeded))               {                   DWORD err = GetLastError();                   if (err = ERROR_PARTIAL_COPY)                   {                       // This means that we are looking at the SYSTEM process. Skip it.                       delete[] hMod;                       hMod = 0;                       break;                   }               }               else if (iCbneeded <= maxModules*sizeof(HMODULE))                   break;               delete[] hMod;               if (maxModules > 50000)               {                   DBG("maxModules: " << maxModules);                   return false; // This is getting ridiculous...               }           }           if (!hMod)               continue;           // Explorer?           TCHAR executableName[MAX_PATH];           if (!lpfGetModuleBaseName(processHandle, hMod[0], executableName, MAX_PATH))           {               DBG("GetModuleBaseName failed for process " << pidList[i]);               return false;           }           //DBG("PROCESS " << wxAscii(executableName));           if (!_tcsicmp(executableName, wxT("explorer.exe")))           {               // Explorer must always be killed               processes.push_back(ProcessInfo(pidList[i], executableName, wxT("")));               continue;           }           // Check if any of the modules are our DLL           int numModules = iCbneeded/sizeof(HMODULE);           for (int j = 1; j < numModules; ++j)           {               TCHAR name[MAX_PATH];               if (!lpfGetModuleBaseName(processHandle, hMod[j], name, MAX_PATH))//.........这里部分代码省略.........
开发者ID:pampersrocker,项目名称:G-CVSNT,代码行数:101,


示例22: LOG_DIALOG

void RadarCanvas::OnMove(wxMoveEvent &evt) {  wxPoint pos = m_parent->GetPosition();  LOG_DIALOG(wxT("BR24radar_pi: %s move OpenGL canvas to %d, %d"), m_ri->m_name.c_str(), pos.x, pos.y);}
开发者ID:CarCode,项目名称:Cocoa-OCPN,代码行数:4,


示例23: DBG

int SetupHelperApp::OnRun(){#ifdef _WIN64    DBG("--- x64 SetupHelper");#else    DBG("--- x86 SetupHelper");#endif        if (__argc < 3)        return -1;    std::vector<ProcessInfo> processes;    DBG("Get processes (1)");     if (!GetProcesses(processes))        return -1;    DBG("Got processes (1):");    for (size_t i = 0; i < processes.size(); ++i)    {        DBG(i << ": " << processes[i].pid);    }    // Kill all Explorer and cvslock processes        for (size_t i = 0; i < processes.size(); ++i)    {        if (!_tcsicmp(processes[i].image.c_str(), wxT("explorer.exe")))        {            DBG("Killing Explorer");            // Show dialog            wxProgressDialog* dlg = new wxProgressDialog(wxT("TortoiseCVS Setup"), wxText(__argv[1]));            dlg->Show();            // Kill Explorer            TerminateProcess(processes[i]);            int i = 0;            while (IsProcessRunning(processes[i].pid) && (i < 50))            {                dlg->Update((i+1)*100/50);                Sleep(50);            }                        // Avoid the Active Desktop error message            HKEY hKey;            if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software//Microsoft//Windows//CurrentVersion//Explorer",                              0, KEY_WRITE, &hKey))            {                DWORD data = 0;                RegSetValueExA(hKey, "FaultKey", 0, REG_DWORD, reinterpret_cast<BYTE*>(&data), sizeof(DWORD));            }            dlg->Destroy();        }        else if (!_tcsicmp(processes[i].image.c_str(), wxT("cvslock.exe")))        {            // Kill CVSNT lock service            TerminateProcess(processes[i]);        }    }    // Show dialog    wxProgressDialog* dlg = new wxProgressDialog(wxT("TortoiseCVS Setup"), wxText(__argv[1]));    dlg->Show();    // Wait for Explorer restart    for (int i = 0; i < 50; ++i)    {       if (IsExplorerRunning())          break;       dlg->Update((i+1)*100/50);       Sleep(50);    }    if (!IsExplorerRunning())    {       dlg->Update(0);       STARTUPINFOA startupinfo;       startupinfo.cb = sizeof(STARTUPINFOA);       startupinfo.lpReserved = 0;       startupinfo.lpDesktop = 0;       startupinfo.lpTitle = 0;       startupinfo.dwFlags = 0;       startupinfo.cbReserved2 = 0;       startupinfo.lpReserved2 = 0;       PROCESS_INFORMATION processinfo;       CreateProcessA(0, "explorer.exe", 0, 0, FALSE, 0, 0, 0, &startupinfo, &processinfo);       CloseHandle(processinfo.hProcess);       CloseHandle(processinfo.hThread);       for (int i = 0; i < 10; ++i)       {          Sleep(50);          dlg->Update((i+1)*100/10);       }    }    dlg->Destroy();        DBG("Check remaining processes");    bool anyLeft = true;    while (anyLeft)    {        processes.clear();        DBG("Get processes (2)");        if (!GetProcesses(processes))//.........这里部分代码省略.........
开发者ID:pampersrocker,项目名称:G-CVSNT,代码行数:101,


示例24: wxLogMessage

void ItemContainerWidgetsPage::StartTest(const wxString& label){    m_container->Clear();    wxLogMessage(wxT("Test - %s:"), label.c_str());}
开发者ID:ruifig,项目名称:nutcracker,代码行数:5,


示例25: wxT

#ifdef __BORLANDC__    #pragma hdrstop#endif// for all others, include the necessary headers#ifndef WX_PRECOMP    #include "wx/wx.h"#endif#include "wx/wfstream.h"#include "bstream.h"#define DATABUFFER_SIZE     1024static const wxString FILENAME_FFILEINSTREAM = wxT("ffileinstream.test");static const wxString FILENAME_FFILEOUTSTREAM = wxT("ffileoutstream.test");///////////////////////////////////////////////////////////////////////////////// The test case//// Try to fully test wxFFileInputStream and wxFFileOutputStreamclass ffileStream : public BaseStreamTestCase<wxFFileInputStream, wxFFileOutputStream>{public:    ffileStream();    virtual ~ffileStream();    CPPUNIT_TEST_SUITE(ffileStream);        // Base class stream tests the ffileStream supports.
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:31,


示例26: WXUNUSED

MyDialog::MyDialog( wxWindow *parent, const wxString& title,                    const wxPoint& pos, const wxSize& size, const long WXUNUSED(style) ) :    wxDialog(parent, VALIDATE_DIALOG_ID, title, pos, size, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER){    // setup the flex grid sizer    // -------------------------    wxFlexGridSizer *flexgridsizer = new wxFlexGridSizer(3, 2, 5, 5);    // Create and add controls to sizers. Note that a member variable    // of g_data is bound to each control upon construction. There is    // currently no easy way to substitute a different validator or a    // different transfer variable after a control has been constructed.    // Pointers to some of these controls are saved in member variables    // so that we can use them elsewhere, like this one.    m_text = new wxTextCtrl(this, VALIDATE_TEXT, wxEmptyString,                            wxDefaultPosition, wxDefaultSize, 0,                            wxTextValidator(wxFILTER_ALPHA, &g_data.m_string));    m_text->SetToolTip("uses wxTextValidator with wxFILTER_ALPHA");    flexgridsizer->Add(m_text, 1, wxGROW);    // Now set a wxTextValidator with an explicit list of characters NOT allowed:    wxTextValidator textVal(wxFILTER_EMPTY|wxFILTER_EXCLUDE_LIST, &g_data.m_string2);    textVal.SetCharExcludes("bcwyz");    wxTextCtrl* txt2 =             new wxTextCtrl(this, VALIDATE_TEXT2, wxEmptyString,                            wxDefaultPosition, wxDefaultSize, 0, textVal);    txt2->SetToolTip("uses wxTextValidator with wxFILTER_EMPTY|wxFILTER_EXCLUDE_LIST (to exclude 'bcwyz')");    flexgridsizer->Add(txt2, 1, wxGROW);    flexgridsizer->Add(new wxListBox((wxWindow*)this, VALIDATE_LIST,                        wxDefaultPosition, wxDefaultSize,                        3, g_listbox_choices, wxLB_MULTIPLE,                        wxGenericValidator(&g_data.m_listbox_choices)),                       1, wxGROW);    m_combobox = new wxComboBox(this, VALIDATE_COMBO, wxEmptyString,                                wxDefaultPosition, wxDefaultSize,                                3, g_combobox_choices, 0L,                                MyComboBoxValidator(&g_data.m_combobox_choice));    m_combobox->SetToolTip("uses a custom validator (MyComboBoxValidator)");    flexgridsizer->Add(m_combobox, 1, wxALIGN_CENTER);    // This wxCheckBox* doesn't need to be assigned to any pointer    // because we don't use it elsewhere--it can be anonymous.    // We don't need any such pointer to query its state, which    // can be gotten directly from g_data.    flexgridsizer->Add(new wxCheckBox(this, VALIDATE_CHECK, wxT("Sample checkbox"),                        wxDefaultPosition, wxDefaultSize, 0,                        wxGenericValidator(&g_data.m_checkbox_state)),                       1, wxALIGN_CENTER|wxALL, 15);    flexgridsizer->AddGrowableCol(0);    flexgridsizer->AddGrowableCol(1);    flexgridsizer->AddGrowableRow(1);    // setup the button sizer    // ----------------------    wxStdDialogButtonSizer *btn = new wxStdDialogButtonSizer();    btn->AddButton(new wxButton(this, wxID_OK));    btn->AddButton(new wxButton(this, wxID_CANCEL));    btn->Realize();    // setup a sizer with the controls for numeric validators    // ------------------------------------------------------    wxIntegerValidator<int> valInt(&g_data.m_intValue,                                   wxNUM_VAL_THOUSANDS_SEPARATOR |                                   wxNUM_VAL_ZERO_AS_BLANK);    valInt.SetMin(0); // Only allow positive numbers    m_numericTextInt = new wxTextCtrl                           (                                this,                                wxID_ANY,                                "",                                wxDefaultPosition,                                wxDefaultSize,                                wxTE_RIGHT,                                valInt                            );    m_numericTextInt->SetToolTip("uses wxIntegerValidator to accept positive "                                 "integers only");    m_numericTextDouble = new wxTextCtrl                              (                                this,                                wxID_ANY,                                "",                                wxDefaultPosition,                                wxDefaultSize,                                wxTE_RIGHT,                                wxMakeFloatingPointValidator                                (                                    3,                                    &g_data.m_doubleValue,//.........这里部分代码省略.........
开发者ID:ruifig,项目名称:nutcracker,代码行数:101,


示例27: wxT

void DeviceToolBar::FillHostDevices(){   const std::vector<DeviceSourceMap> &inMaps  = DeviceManager::Instance()->GetInputDeviceMaps();   const std::vector<DeviceSourceMap> &outMaps = DeviceManager::Instance()->GetOutputDeviceMaps();   //read what is in the prefs   wxString host = gPrefs->Read(wxT("/AudioIO/Host"), wxT(""));   size_t i;   int foundHostIndex = -1;   // if the host is not in the hosts combo then we rescanned.   // set it to blank so we search for another host.   if (mHost->FindString(host) == wxNOT_FOUND)      host = wxT("");   for (i = 0; i < outMaps.size(); i++) {      if (outMaps[i].hostString == host) {         foundHostIndex = outMaps[i].hostIndex;         break;      }   }   if (foundHostIndex == -1) {      for (i = 0; i < inMaps.size(); i++) {         if (inMaps[i].hostString == host) {            foundHostIndex = inMaps[i].hostIndex;            break;         }      }   }   // If no host was found based on the prefs device host, load the first available one   if (foundHostIndex == -1) {      if (outMaps.size())         foundHostIndex = outMaps[0].hostIndex;      else if (inMaps.size())         foundHostIndex = inMaps[0].hostIndex;   }   // Make sure in/out are clear in case no host was found   mInput->Clear();   mOutput->Clear();   // If we still have no host it means no devices, in which case do nothing.   if (foundHostIndex == -1)      return;   // Repopulate the Input/Output device list available to the user   for (i = 0; i < inMaps.size(); i++) {      if (foundHostIndex == inMaps[i].hostIndex) {         mInput->Append(MakeDeviceSourceString(&inMaps[i]));         if (host == wxT("")) {            host = inMaps[i].hostString;            gPrefs->Write(wxT("/AudioIO/Host"), host);            mHost->SetStringSelection(host);         }      }   }   mInput->Enable(mInput->GetCount() ? true : false);   mInput->InvalidateBestSize();   mInput->SetMaxSize(mInput->GetBestSize());   for (i = 0; i < outMaps.size(); i++) {      if (foundHostIndex == outMaps[i].hostIndex) {         mOutput->Append(MakeDeviceSourceString(&outMaps[i]));         if (host == wxT("")) {            host = outMaps[i].hostString;            gPrefs->Write(wxT("/AudioIO/Host"), host);            gPrefs->Flush();            mHost->SetStringSelection(host);         }      }   }   mOutput->Enable(mOutput->GetCount() ? true : false);   mOutput->InvalidateBestSize();   mOutput->SetMaxSize(mOutput->GetBestSize());   // The setting of the Device is left up to OnChoice}
开发者ID:PhilSee,项目名称:audacity,代码行数:81,



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


C++ wxTimeSpan函数代码示例
C++ wxStrlen函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。