本文整理汇总了C++中wxT函数的典型用法代码示例。如果您正苦于以下问题:C++ wxT函数的具体用法?C++ wxT怎么用?C++ wxT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wxT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToolBar
//Standard contructor
DeviceToolBar::DeviceToolBar()
: ToolBar(DeviceBarID, _("Device"), wxT("Device"), true)
{
mPlayBitmap = NULL;
mRecordBitmap = NULL;
}
示例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());
//.........这里部分代码省略.........
示例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
示例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);
//.........这里部分代码省略.........
示例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
}
}
示例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;
//.........这里部分代码省略.........
示例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) ;
}
示例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")) // style
wxEND_PROPERTIES_TABLE()
wxBEGIN_HANDLERS_TABLE(wxStaticText)
wxEND_HANDLERS_TABLE()
wxCONSTRUCTOR_6( wxStaticText , wxWindow* , Parent , wxWindowID , Id , wxString , Label , wxPoint , Position , wxSize , Size , long , WindowStyle )
#else
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
#endif
bool wxStaticText::Create(wxWindow *parent,
wxWindowID id,
const wxString& label,
const wxPoint& pos,
示例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);
//.........这里部分代码省略.........
示例10: GetInstallPrefix
wxString wxStandardPaths::GetDataDir() const
{
return GetInstallPrefix() + wxT("\\data");
}
示例11: AppendAppInfo
wxString wxStandardPaths::GetUserDataDir() const
{
return AppendAppInfo(wxFileName::GetHomeDir() + wxT("\\."));
}
示例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,
//.........这里部分代码省略.........
示例13: wxT
void PCB_EDIT_FRAME::OnUpdateShowMicrowaveToolbar( wxUpdateUIEvent& aEvent )
{
aEvent.Check( m_auimgr.GetPane( wxT( "m_microWaveToolBar" ) ).IsShown() );
}
示例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);
}
示例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);
}
}
}
}