void wxDynamicToolBar::AddTool( int toolIndex, const wxString& imageFileName, wxBitmapType imageFileType, const wxString& labelText, bool alignTextRight, bool isFlat ) { wxNewBitmapButton* pBtn = new wxNewBitmapButton( imageFileName, imageFileType, labelText, ( alignTextRight ) ? NB_ALIGN_TEXT_RIGHT : NB_ALIGN_TEXT_BOTTOM, isFlat ); pBtn->Create( this, toolIndex ); pBtn->Reshape(); AddTool( toolIndex, pBtn ); }
wxToolBarToolBase* wxDynamicToolBar::AddTool(const int toolIndex, const wxBitmap& bitmap, const wxBitmap& WXUNUSED(pushedBitmap), const bool WXUNUSED(toggle), const long WXUNUSED(xPos), const long WXUNUSED(yPos), wxObject *WXUNUSED(clientData), const wxString& helpString1, const wxString& WXUNUSED(helpString2)) { wxNewBitmapButton* pBmpBtn = new wxNewBitmapButton( bitmap ); pBmpBtn->Create( this, toolIndex ); pBmpBtn->Reshape(); #if wxUSE_TOOLTIPS pBmpBtn->SetToolTip( helpString1 ); #else wxUnusedVar( helpString1 ); #endif // wxUSE_TOOLTIPS AddTool( toolIndex, pBmpBtn ); return NULL; }
void PWSDragBar::RefreshButtons() { const bool newButtons = PWSprefs::GetInstance()->GetPref(PWSprefs::UseNewToolbar); #define BTN newButtons? wxBitmap(DragbarElements[idx].bitmap) : wxBitmap(DragbarElements[idx].classic_bitmap) #define BTN_DISABLED newButtons? wxBitmap(DragbarElements[idx].bitmap_disabled): wxBitmap(DragbarElements[idx].classic_bitmap_disabled) if (GetToolsCount() == 0) { //being created? for (int idx = 0; size_t(idx) < NumberOf(DragbarElements); ++idx) { AddTool(idx + DRAGBAR_TOOLID_BASE, BTN, wxString(_("Drag this image onto another window to paste the '")) << DragbarElements[idx].name << _("' field."), BTN_DISABLED ); } } else { for (int idx = 0; size_t(idx) < NumberOf(DragbarElements); ++idx) { SetToolBitmaps(idx + DRAGBAR_TOOLID_BASE, BTN, BTN_DISABLED); } } #undef BTN #undef BTN_DISABLED }
void CompilerLocatorCygwin::AddTools(const wxString& binFolder, const wxString& name, const wxString& suffix) { wxFileName masterPath(binFolder, ""); masterPath.RemoveLastDir(); // Create an empty compiler CompilerPtr compiler( new Compiler(NULL) ); compiler->SetCompilerFamily(COMPILER_FAMILY_CYGWIN); compiler->SetGenerateDependeciesFile(true); compiler->SetName( name ); compiler->SetInstallationPath( masterPath.GetPath() ); m_compilers.push_back( compiler ); CL_DEBUG("Found Cygwin compiler under: %s. \"%s\"", masterPath.GetPath(), compiler->GetName()); wxFileName toolFile(binFolder, ""); toolFile.SetFullName( "g++-" + suffix + ".exe" ); AddTool(compiler, "CXX", toolFile.GetFullPath()); AddTool(compiler, "LinkerName", toolFile.GetFullPath()); AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), "-shared -fPIC"); toolFile.SetFullName( "gcc-" + suffix + ".exe" ); AddTool(compiler, "CC", toolFile.GetFullPath()); toolFile.SetFullName("ar.exe"); AddTool(compiler, "AR", toolFile.GetFullPath(), "rcu"); toolFile.SetFullName("windres.exe"); AddTool(compiler, "ResourceCompiler", toolFile.GetFullPath()); toolFile.SetFullName("as.exe"); AddTool(compiler, "AS", toolFile.GetFullPath()); toolFile.SetFullName("make.exe"); wxString makeExtraArgs; if ( wxThread::GetCPUCount() > 1 ) { makeExtraArgs << "-j" << wxThread::GetCPUCount(); } if ( toolFile.FileExists() ) { AddTool(compiler, "MAKE", toolFile.GetFullPath(), makeExtraArgs); } else { toolFile.SetFullName("mingw32-make.exe"); if ( toolFile.FileExists() ) { AddTool(compiler, "MAKE", toolFile.GetFullPath(), makeExtraArgs); } } AddTool(compiler, "MakeDirCommand", "mkdir", "-p"); toolFile.SetFullName("gdb.exe"); if ( toolFile.FileExists() ) { AddTool(compiler, "Debugger", toolFile.GetFullPath()); } }
void mtsMedtronicStealthlink::Configure(const std::string &filename) { //TODO: Update to support myDataMap and myStateTableMap CMN_LOG_CLASS_INIT_VERBOSE << "Configure: using " << filename << std::endl; cmnXMLPath config; config.SetInputSource(filename); // initialize serial port std::string ipAddress; if (!config.GetXMLValue("/tracker/controller", "@ip", ipAddress, "192.168.0.1")) { CMN_LOG_CLASS_INIT_WARNING << "Configure: IP address not found, using default: " << ipAddress << std::endl; } #ifndef sawMedtronicStealthlink_IS_SIMULATOR // Configure MedtronicStealthlink interface // Set StealthLink server IP address CMN_LOG_CLASS_INIT_VERBOSE << "Configure: setting Stealthink IP address = " << ipAddress << std::endl; this->StealthServerProxy = new MNavStealthLink::StealthServer(const_cast<char *>(ipAddress.c_str())); #endif int toolCount = 0; config.Query("count(/tracker/tools/*)",toolCount); // add pre-defined tools (up to 100) unsigned int maxToolCount = static_cast<unsigned int>(std::min(toolCount,100)); for (unsigned int i = 0; i < maxToolCount; i++) { std::stringstream context; std::string stealthName, name; context << "/tracker/tools/tool[" << i+1 << "]"; config.GetXMLValue(context.str().c_str(), "@stealthName", stealthName, ""); config.GetXMLValue(context.str().c_str(), "@name", name, ""); if (stealthName.empty() && name.empty()) { break; } if (stealthName.empty()) { AddTool(name, name); } else if (name.empty()) { AddTool(stealthName, stealthName); } else { AddTool(stealthName, name); } } #ifdef sawMedtronicStealthlink_IS_SIMULATOR CMN_LOG_CLASS_INIT_VERBOSE << "Configure: using simulated Stealthstation" << std::endl; StealthlinkPresent = true; #else CMN_LOG_CLASS_INIT_VERBOSE << "Configure: initializing Stealthlink" << std::endl; // MNavStealthLink::Error StealthlinkError; // Connect to the server StealthlinkPresent = this->StealthServerProxy->connect(StealthlinkError) ? true : false; if (!StealthlinkPresent) { CMN_LOG_CLASS_INIT_ERROR << "Failed to connect to Stealth server application on host " << this->StealthServerProxy->getHost() << ", port " << this->StealthServerProxy->getPort() << ": " << StealthlinkError.reason() << std::endl; CMN_LOG_CLASS_INIT_ERROR << "Configure: could not Initialize StealthLink" << std::endl; }else{ //attach all of the callbacks instrumentSubscription = new MNavStealthLink::Subscription<MNavStealthLink::Instrument>(*(this->StealthServerProxy)); frameSubscription = new MNavStealthLink::Subscription<MNavStealthLink::Frame>(*(this->StealthServerProxy)); //registrationSubscription = new MNavStealthLink::Subscription<MNavStealthLink::Registration>(*(this->StealthServerProxy)); surgicalPlanSubscription = new MNavStealthLink::Subscription<MNavStealthLink::SurgicalPlan>(*(this->StealthServerProxy)); //Start all of the callbacks instrumentSubscription->start(this->myCallbackMember); frameSubscription->start(this->myCallbackMember); //registrationSubscription->start(this->myCallbackMember); surgicalPlanSubscription->start(this->myCallbackMember); } #endif }
BOOL COptionsBackup::OnInitDialog() { COptions_PropertyPage::OnInitDialog(); m_chkbox.SetTextColour(CR_DATABASE_OPTIONS); m_chkbox.ResetBkgColour(); //Use current window's background if (GetMainDlg()->IsDBOpen() && !GetMainDlg()->IsDBReadOnly()) { GetDlgItem(IDC_STATIC_DB_PREFS_RO_WARNING)->ShowWindow(SW_HIDE); } // Database preferences - can't change in R/O mode of if no DB is open if (!GetMainDlg()->IsDBOpen() || GetMainDlg()->IsDBReadOnly()) { CString cs_Preference_Warning; CString cs_temp(MAKEINTRESOURCE(GetMainDlg()->IsDBOpen() ? IDS_DB_READ_ONLY : IDS_NO_DB)); cs_Preference_Warning.Format(IDS_STATIC_DB_PREFS_RO_WARNING, static_cast<LPCWSTR>(cs_temp)); GetDlgItem(IDC_STATIC_DB_PREFS_RO_WARNING)->SetWindowText(cs_Preference_Warning); GetDlgItem(IDC_SAVEIMMEDIATELY)->EnableWindow(FALSE); } if (m_backupsuffix_cbox.GetCount() == 0) { // add the strings in alphabetical order CString cs_text(MAKEINTRESOURCE(IDS_NONE)); int nIndex; nIndex = m_backupsuffix_cbox.AddString(cs_text); m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_None); m_BKSFX_to_Index[PWSprefs::BKSFX_None] = nIndex; cs_text.LoadString(IDS_DATETIMESTRING); nIndex = m_backupsuffix_cbox.AddString(cs_text); m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_DateTime); m_BKSFX_to_Index[PWSprefs::BKSFX_DateTime] = nIndex; cs_text.LoadString(IDS_INCREMENTNUM); nIndex = m_backupsuffix_cbox.AddString(cs_text); m_backupsuffix_cbox.SetItemData(nIndex, PWSprefs::BKSFX_IncNumber); m_BKSFX_to_Index[PWSprefs::BKSFX_IncNumber] = nIndex; } m_backupsuffix_cbox.SetCurSel(m_BKSFX_to_Index[m_BackupSuffix]); GetDlgItem(IDC_BACKUPEXAMPLE)->SetWindowText(L""); CSpinButtonCtrl* pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_BKPMAXINCSPIN); pspin->SetBuddy(GetDlgItem(IDC_BACKUPMAXINC)); pspin->SetRange(1, 999); pspin->SetBase(10); pspin->SetPos(m_MaxNumIncBackups); OnComboChanged(); OnBackupBeforeSave(); if (m_BackupLocation == 1) { ExpandBackupPath(); } if (InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 0)) { m_Help1.Init(IDB_QUESTIONMARK); m_Help2.Init(IDB_QUESTIONMARK); m_Help3.Init(IDB_QUESTIONMARK); m_Help4.Init(IDB_QUESTIONMARK); // Note naming convention: string IDS_xxx corresponds to control IDC_xxx_HELP AddTool(IDC_BACKUPBEFORESAVEHELP, IDS_BACKUPBEFORESAVE); AddTool(IDC_USERBACKUPOTHERLOCATIONHELP, IDS_USERBACKUPOTHERLOCATION); AddTool(IDC_USERBACKUPOTHERLOCATIONHELP2, IDS_USERBACKUPOTHERLOCATION2); AddTool(IDC_SAVEIMMEDIATELYHELP, IDS_SAVEIMMEDIATELY); ActivateToolTip(); } else { m_Help1.EnableWindow(FALSE); m_Help1.ShowWindow(SW_HIDE); m_Help2.EnableWindow(FALSE); m_Help2.ShowWindow(SW_HIDE); m_Help3.EnableWindow(FALSE); m_Help3.ShowWindow(SW_HIDE); m_Help4.EnableWindow(FALSE); m_Help4.ShowWindow(SW_HIDE); } return TRUE; }
//----------------------------------------------------------------------------- // Purpose: Prepares the tool manager for use. // Output : Returns true on success, false on failure. //----------------------------------------------------------------------------- bool CToolManager::Init( CMapDoc *pDocument ) { // add default tools // // Create the tools that are held by the tool manager and add them // to the internal tools list. // RemoveAllTools(); m_pDocument = pDocument; AddTool( new CToolDisplace ); AddTool( new CToolMagnify ); AddTool( new CToolDecal ); AddTool( new CToolMaterial ); AddTool( new CToolAxisHandle ); AddTool( new CToolPointHandle ); AddTool( new CToolSphere ); AddTool( new CToolPickAngles ); AddTool( new CToolPickEntity ); AddTool( new CToolPickFace ); AddTool( new CToolSweptPlayerHull ); AddTool( new Selection3D ); AddTool( new CToolBlock ); AddTool( new CToolEntity ); AddTool( new Camera3D ); AddTool( new Morph3D ); AddTool( new Clipper3D ); AddTool( new Cordon3D ); AddTool( new CToolOverlay ); return true; }
static HRESULT ParseToolsList(IXMLDOMDocument* pXMLDom, BOOL bIsStandard) { static const _bstr_t XMLFileTag(L"MSCONFIGTOOLFILE"); static const _bstr_t XMLToolsTag(L"MSCONFIGTOOLS"); HRESULT hr = S_OK; IXMLDOMNode *pIterator = NULL, *pTmp = NULL; IXMLDOMElement* pEl = NULL; DOMNodeType type; _bstr_t tagName; if (!pXMLDom) return E_POINTER; // E_INVALIDARG pXMLDom->get_documentElement(&pEl); pEl->get_tagName(&tagName.GetBSTR()); _wcsupr(tagName); if (tagName == XMLFileTag) { pEl->get_firstChild(&pIterator); SAFE_RELEASE(pEl); while (pIterator) { pIterator->get_nodeType(&type); if (type == NODE_ELEMENT) { pIterator->QueryInterface(IID_PPV_ARG(IXMLDOMElement, &pEl) /* IID_PPV_ARGS(&pEl) */); pEl->get_tagName(&tagName.GetBSTR()); _wcsupr(tagName); if (tagName == XMLToolsTag) { pEl->get_firstChild(&pIterator); SAFE_RELEASE(pEl); while (pIterator) { pIterator->QueryInterface(IID_PPV_ARG(IXMLDOMElement, &pEl) /* IID_PPV_ARGS(&pEl) */); AddTool(pEl, bIsStandard); SAFE_RELEASE(pEl); pIterator->get_nextSibling(&pTmp); SAFE_RELEASE(pIterator); pIterator = pTmp; } // SAFE_RELEASE(pIterator); break; } SAFE_RELEASE(pEl); } pIterator->get_nextSibling(&pTmp); SAFE_RELEASE(pIterator); pIterator = pTmp; } // SAFE_RELEASE(pIterator); } else if (tagName == XMLToolsTag) { pEl->get_firstChild(&pIterator); SAFE_RELEASE(pEl); while (pIterator) { pIterator->QueryInterface(IID_PPV_ARG(IXMLDOMElement, &pEl) /* IID_PPV_ARGS(&pEl) */); AddTool(pEl, bIsStandard); SAFE_RELEASE(pEl); pIterator->get_nextSibling(&pTmp); SAFE_RELEASE(pIterator); pIterator = pTmp; } // SAFE_RELEASE(pIterator); } SAFE_RELEASE(pEl); return hr; }
void EnviroFrame::RefreshToolbar() { if (!m_pToolbar) // safety check return; // remove any existing buttons int count = m_pToolbar->GetToolsCount(); #ifdef __WXMAC__ // Nino says: I spent a long time with this one, the issue was definitely // deep in wxMac, but I don't remember, nor want to repeat it :). Can we // #ifdef __WXMAC__ for the time being to revisit it after Xcode is working? while (count >= 1) { m_pToolbar->DeleteToolByPos(count-1); count = m_pToolbar->GetToolsCount(); } m_pToolbar->Realize(); AddTool(ID_TOOLS_SELECT, wxBITMAP(select), _("Select"), true); #else if (!count) { AddTool(ID_TOOLS_SELECT, wxBITMAP(select), _("Select"), true); count = 1; } while (count > 1) { m_pToolbar->DeleteToolByPos(count-1); count = m_pToolbar->GetToolsCount(); } #endif bool bEarth = (g_App.m_state == AS_Orbit); bool bTerr = (g_App.m_state == AS_Terrain); if (bTerr) { AddTool(ID_TOOLS_SELECT_BOX, wxBITMAP(select_box), _("Select Box"), true); if (g_Options.m_bShowToolsCulture) { AddTool(ID_TOOLS_SELECT_MOVE, wxBITMAP(select_move), _("Select and Move"), true); AddTool(ID_TOOLS_MOVE, wxBITMAP(move), _("Move Objects"), true); AddTool(ID_TOOLS_FENCES, wxBITMAP(fence), _("Create Fences"), true); AddTool(ID_TOOLS_BUILDINGS, wxBITMAP(building), _("Create Buildings"), true); AddTool(ID_TOOLS_POWER, wxBITMAP(route), _("Create Powerlines"), true); AddTool(ID_TOOLS_PLANTS, wxBITMAP(tree), _("Create Plants"), true); } AddTool(ID_TOOLS_POINTS, wxBITMAP(placemark), _("Create Points"), true); if (g_Options.m_bShowToolsCulture) { AddTool(ID_TOOLS_INSTANCES, wxBITMAP(instances), _("Create Instances"), true); AddTool(ID_TOOLS_VEHICLES, wxBITMAP(vehicles), _("Create Vehicles"), true); } AddTool(ID_TOOLS_NAVIGATE, wxBITMAP(nav), _("Navigate"), true); } if (bTerr || bEarth) { AddTool(ID_TOOLS_MEASURE, wxBITMAP(distance), _("Measure Distance"), true); } if (bTerr) { m_pToolbar->AddSeparator(); AddTool(ID_VIEW_PROFILE, wxBITMAP(view_profile), _("Elevation Profile"), true); AddTool(ID_TOOLS_CONSTRAIN, wxBITMAP(bld_corner), _("Constrain Angles"), true); } if (g_Options.m_bShowToolsSnapshot) { m_pToolbar->AddSeparator(); AddTool(ID_VIEW_SNAPSHOT, wxBITMAP(snap), _("Snapshot"), false); AddTool(ID_VIEW_SNAP_AGAIN, wxBITMAP(snap_num), _("Numbered Snapshot"), false); } if (bTerr || bEarth) { m_pToolbar->AddSeparator(); AddTool(ID_FILE_LAYERS, wxBITMAP(layers), _("Show Layer Dialog"), false); } if (bTerr) { m_pToolbar->AddSeparator(); AddTool(ID_VIEW_MAINTAIN, wxBITMAP(maintain), _("Maintain Height"), true); AddTool(ID_VIEW_FASTER, wxBITMAP(nav_fast), _("Fly Faster"), false); AddTool(ID_VIEW_SLOWER, wxBITMAP(nav_slow), _("Fly Slower"), false); AddTool(ID_VIEW_SETTINGS, wxBITMAP(nav_set), _("Camera Dialog"), false); AddTool(ID_VIEW_LOCATIONS, wxBITMAP(loc), _("Locations"), false); } if (m_bEnableEarth) { m_pToolbar->AddSeparator(); if (bTerr) { AddTool(ID_SCENE_EPHEMERIS, wxBITMAP(ephemeris), _("Ephemeris"), false); AddTool(ID_SCENE_SPACE, wxBITMAP(space), _("Go to Space"), false); } AddTool(ID_SCENE_TERRAIN, wxBITMAP(terrain), _("Go to Terrain"), false); if (bEarth) { m_pToolbar->AddSeparator(); AddTool(ID_EARTH_SHOWSHADING, wxBITMAP(sun), _("Show Sunlight"), true); AddTool(ID_EARTH_SHOWAXES, wxBITMAP(axes), _("Axes"), true); AddTool(ID_EARTH_TILT, wxBITMAP(tilt), _("Tilt"), true); AddTool(ID_EARTH_UNFOLD, wxBITMAP(unfold), _("Unfold"), true); } } if (g_Options.m_bShowToolsTime) { m_pToolbar->AddSeparator(); AddTool(ID_TIME_DIALOG, wxBITMAP(time), _("Time"), false); AddTool(ID_TIME_FASTER, wxBITMAP(faster), _("Time Faster"), false); AddTool(ID_TIME_STOP, wxBITMAP(stop), _("Time Stop"), false); } m_pToolbar->AddSeparator(); AddTool(ID_SCENE_SCENEGRAPH, wxBITMAP(sgraph), _("Scene Graph"), false); VTLOG1("Realize toolbar.\n"); m_pToolbar->Realize(); // "commit" all changes made to wxAuiManager wxAuiPaneInfo &api = m_mgr.GetPane(wxT("toolbar")); if (api.IsOk()) { wxSize best = m_pToolbar->GetBestSize(); api.MinSize(best); m_mgr.Update(); } }
DrawToolBar::DrawToolBar(wxWindow *parent) : wxToolBar(parent,-1) { SetHelpText(_T("draw3-toolbar-items")); AddTool(drawTB_ABOUT, _T(""),help_xpm,_("About")); AddTool(drawTB_FIND, _T(""),find_xpm, _("Find")); AddTool(drawTB_SUMWIN, _T(""),plus_xpm, _("Summary Window")); AddTool(drawTB_SPLTCRS, _T(""),split_xpm, _("Split cursor"), wxITEM_CHECK); AddTool(drawTB_FILTER, _T(""),filter0_xpm, _("Filter")); AddTool(drawTB_REFRESH, _T(""),refresh_xpm, _("Refresh")); AddTool(drawTB_DRAWTREE, _T(""),draw_tree_xpm, _("Tree Set")); /** disable florence keyboard in windows builds */ #ifndef MINGW32 AddTool(drawTB_FLORENCE, _T(""), florence_xpm, _("Show screen keyboard")); #endif AddTool(drawTB_GOTOLATESTDATE, _T(""), flag_checkered_xpm, _("Go to latest date")); AddTool(drawTB_REMARK, _T(""), remark_xpm, _("Remarks")); AddTool(drawTB_EXIT, _T(""),exit_xpm, _("Quit")); if (VersionChecker::IsNewVersion()) NewDrawVersionAvailable(); else Realize(); #ifndef MINGW32 /* disable florence button if program is not present */ std::string path = exec_cmd("which florence"); path = path.substr(0, path.size()-1); if (access(path.c_str(), X_OK)) EnableTool(drawTB_FLORENCE, false); #endif VersionChecker::AddToolbar(this); }
BOOL COptionsSystem::OnInitDialog() { COptions_PropertyPage::OnInitDialog(); PWSprefs *prefs = PWSprefs::GetInstance(); PWSprefs::ConfigOption configoption; StringX sx_CF = prefs->GetConfigFile(configoption).c_str(); std::wstring wsCO(L""); switch (configoption) { case PWSprefs::CF_NONE: LoadAString(sx_CF, IDS_NONE); break; case PWSprefs::CF_REGISTRY: LoadAString(sx_CF, IDS_REGISTRY); break; case PWSprefs::CF_FILE_RO: LoadAString(wsCO, IDS_READ_ONLY); break; case PWSprefs::CF_FILE_RW: case PWSprefs::CF_FILE_RW_NEW: LoadAString(wsCO, IDS_READ_WRITE); break; default: ASSERT(0); } CString cs_text; // R/W status GetDlgItem(IDC_STATIC_RWSTATUS)->SetWindowText(wsCO.c_str()); // Config file name & location cs_text = PWSUtil::NormalizeTTT(sx_CF, 60).c_str(); GetDlgItem(IDC_CONFIGFILE)->SetWindowText(cs_text); // Effective host & user used in config file if (configoption == PWSprefs::CF_FILE_RO || configoption == PWSprefs::CF_FILE_RW || configoption == PWSprefs::CF_FILE_RW_NEW) { stringT hn = SysInfo::GetInstance()->GetEffectiveHost(); PWSprefs::XMLify(charT('H'), hn); stringT un = SysInfo::GetInstance()->GetEffectiveUser(); PWSprefs::XMLify(charT('u'), un); cs_text.Format(IDS_HOSTUSER, static_cast<LPCWSTR>(hn.c_str()), static_cast<LPCWSTR>(un.c_str())); GetDlgItem(IDC_STATIC_HOSTUSER)->SetWindowText(cs_text); } bool bofferdeleteregistry = prefs->OfferDeleteRegistry(); bool boffermigrate2appdata = OfferConfigMigration(); if (!bofferdeleteregistry) { GetDlgItem(IDC_REGDEL)->ShowWindow(SW_HIDE); GetDlgItem(IDC_REGDEL)->EnableWindow(FALSE); } if (!boffermigrate2appdata) { GetDlgItem(IDC_MIGRATETOAPPDATA)->ShowWindow(SW_HIDE); GetDlgItem(IDC_MIGRATETOAPPDATA)->EnableWindow(FALSE); } if (!bofferdeleteregistry && !boffermigrate2appdata) { GetDlgItem(IDC_CONFIG_GRP)->ShowWindow(SW_HIDE); GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_HIDE); } else { GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_SHOW); } GetDlgItem(IDC_APPLYCONFIGCHANGES)->EnableWindow(FALSE); CSpinButtonCtrl *pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_RESPIN); pspin->SetBuddy(GetDlgItem(IDC_MAXREITEMS)); pspin->SetRange(M_prefminREItems(), M_prefmaxREItems()); pspin->SetBase(10); pspin->SetPos(m_MaxREItems); pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_MRUSPIN); pspin->SetBuddy(GetDlgItem(IDC_MAXMRUITEMS)); pspin->SetRange(M_prefminMRU(), M_prefmaxMRU()); pspin->SetBase(10); pspin->SetPos(m_MaxMRUItems); OnUseSystemTray(); if (InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 0)) { m_Help1.Init(IDB_QUESTIONMARK); m_Help2.Init(IDB_QUESTIONMARK); // Note naming convention: string IDS_xxx corresponds to control IDC_xxx_HELP AddTool(IDC_REGDELHELP, IDS_REGDEL); AddTool(IDC_MIGRATETOAPPDATAHELP, IDS_MIGRATETOAPPDATA); ActivateToolTip(); } else { m_Help1.EnableWindow(FALSE); m_Help1.ShowWindow(SW_HIDE); m_Help2.EnableWindow(FALSE); m_Help2.ShowWindow(SW_HIDE); } if (!bofferdeleteregistry) { m_Help1.EnableWindow(FALSE); m_Help1.ShowWindow(SW_HIDE); } if (!boffermigrate2appdata) { m_Help2.EnableWindow(FALSE); m_Help2.ShowWindow(SW_HIDE); } return TRUE; // return TRUE unless you set the focus to a control }
void MainToolBar::set_properties() { #ifdef __WXMAC__ SetToolBitmapSize(wxSize(96, 24)); AddTool(IDM_MENU, wxT("Menu"), wxBitmap(menu_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddSeparator(); AddTool(IDM_SHOW_DESK, wxT("Desk"), wxBitmap(desk_xpm), wxNullBitmap, wxITEM_RADIO, wxT(""), wxT("")); AddTool(IDM_SHOW_DESK_SETUP, wxT("Desk Setup"), wxBitmap(desk_setup_xpm), wxNullBitmap, wxITEM_RADIO, wxT(""), wxT("")); AddTool(IDM_SHOW_FUNCTION_SETUP, wxT("Function Setup"), wxBitmap(function_setup_xpm), wxNullBitmap, wxITEM_RADIO, wxT(""), wxT("")); AddSeparator(); AddTool(IDM_IO_SETUP, wxT("IO Setup"), wxBitmap(io_setup_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddTool(IDM_GROUP_SETUP, wxT("Group Setup"), wxBitmap(group_setup_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddTool(IDM_CHANNEL_SETUP, wxT("Channel Setup"), wxBitmap(channel_setup_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddTool(IDM_LIBRARY, wxT("Library"), wxBitmap(library_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddTool(IDM_DMX_PATCH, wxT("DMX Patch"), wxBitmap(dmx_patch_xpm), wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddSeparator(); AddTool(IDM_SETUP_OUTPUT, wxT("Setup Output"), wxBitmap(setup_output_xpm), wxNullBitmap, wxITEM_CHECK, wxT(""), wxT("")); #else SetToolBitmapSize(wxSize(0, 0)); AddTool(IDM_MENU, wxT("Menu"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddSeparator(); AddTool(IDM_SHOW_DESK, wxT("Desk"), wxNullBitmap, wxNullBitmap, wxITEM_RADIO, wxT(""), wxT("")); AddTool(IDM_SHOW_DESK_SETUP, wxT("Desk Setup"), wxNullBitmap, wxNullBitmap, wxITEM_RADIO, wxT(""), wxT("")); AddTool(IDM_SHOW_FUNCTION_SETUP, wxT("Function Setup"), wxNullBitmap, wxNullBitmap, wxITEM_RADIO, wxT(""), wxT("")); AddSeparator(); AddTool(IDM_IO_SETUP, wxT("IO Setup"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddTool(IDM_GROUP_SETUP, wxT("Group Setup"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddTool(IDM_CHANNEL_SETUP, wxT("Channel Setup"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddTool(IDM_LIBRARY, wxT("Library"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddTool(IDM_DMX_PATCH, wxT("DMX Patch"), wxNullBitmap, wxNullBitmap, wxITEM_NORMAL, wxT(""), wxT("")); AddSeparator(); AddTool(IDM_SETUP_OUTPUT, wxT("Setup Output"), wxNullBitmap, wxNullBitmap, wxITEM_CHECK, wxT(""), wxT("")); #endif Realize(); }
BOOL COptionsMisc::OnInitDialog() { COptions_PropertyPage::OnInitDialog(); for (int i = 0; i < 2; i++) { m_chkbox[i].SetTextColour(CR_DATABASE_OPTIONS); m_chkbox[i].ResetBkgColour(); // Use current window's background } // Database preferences - can't change in R/O mode of if no DB is open if (!GetMainDlg()->IsDBOpen() || GetMainDlg()->IsDBReadOnly()) { GetDlgItem(IDC_DEFUSERNAME)->EnableWindow(FALSE); GetDlgItem(IDC_STATIC_USERNAME)->EnableWindow(FALSE); GetDlgItem(IDC_STATIC_DEFAUTOTYPE)->EnableWindow(FALSE); GetDlgItem(IDC_DB_DEF_AUTOTYPE_TEXT)->EnableWindow(FALSE); GetDlgItem(IDC_MAINTAINDATETIMESTAMPS)->EnableWindow(FALSE); GetDlgItem(IDC_USEDEFUSER)->EnableWindow(FALSE); } OnUseDefUser(); // For some reason, MFC calls us twice when initializing. // Populate the combo box only once. if (m_dblclk_cbox.GetCount() == 0) { SetupCombo(&m_dblclk_cbox); } if (m_shiftdblclk_cbox.GetCount() == 0) { SetupCombo(&m_shiftdblclk_cbox); } m_dblclk_cbox.SetCurSel(m_DCA_to_Index[m_DoubleClickAction]); m_shiftdblclk_cbox.SetCurSel(m_DCA_to_Index[m_ShiftDoubleClickAction]); GetDlgItem(IDC_OTHERBROWSERLOCATION)->SetWindowText(m_OtherBrowserLocation); GetDlgItem(IDC_OTHEREDITORLOCATION)->SetWindowText(m_OtherEditorLocation); CSpinButtonCtrl *pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_DADSPIN); pspin->SetBuddy(GetDlgItem(IDC_DB_DEF_AUTOTYPE_DELAY)); pspin->SetRange32(M_prefminAutotypeDelay(), M_prefmaxAutotypeDelay()); pspin->SetBase(10); pspin->SetPos(m_AutotypeDelay); if (InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 0)) { m_Help1.Init(IDB_QUESTIONMARK); m_Help2.Init(IDB_QUESTIONMARK); m_Help3.Init(IDB_QUESTIONMARK); // Note naming convention: string IDS_xxx corresponds to control IDC_xxx_HELP AddTool(IDC_MAINTAINDATETIMESTAMPSHELP, IDS_MAINTAINDATETIMESTAMPS); AddTool(IDC_OTHERBROWSERLOCATIONHELP, IDS_OTHERBROWSERLOCATION); AddTool(IDC_OTHEREDITORLOCATIONHELP, IDS_OTHEREDITORLOCATION); ActivateToolTip(); } else { m_Help1.EnableWindow(FALSE); m_Help1.ShowWindow(SW_HIDE); m_Help2.EnableWindow(FALSE); m_Help2.ShowWindow(SW_HIDE); m_Help3.EnableWindow(FALSE); m_Help3.ShowWindow(SW_HIDE); } return TRUE; // return TRUE unless you set the focus to a control }
BOOL CPasswordPolicyDlg::OnInitDialog() { CPWDialog::OnInitDialog(); // If started with Tall and won't fit - return to be called again with Wide if (m_bLongPPs && !GetMainDlg()->LongPPs(this)) { EndDialog(-1); return FALSE; } if (m_bReadOnly && m_uicaller != IDS_GENERATEPASSWORD) { // Change OK button test CString cs_close(MAKEINTRESOURCE(IDS_CLOSE)); GetDlgItem(IDOK)->SetWindowText(cs_close); // Hide the Cancel button GetDlgItem(IDCANCEL)->EnableWindow(FALSE); GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE); } CString cs_title; switch (m_uicaller) { case IDS_OPTIONS: // Set correct window title cs_title.LoadString(IDS_EDIT_DEFAULT_POLICY); SetWindowText(cs_title); // These are only used in Manage -> Generate Password or Add/Edit Policy names GetDlgItem(IDC_GENERATEPASSWORD)->EnableWindow(FALSE); GetDlgItem(IDC_GENERATEPASSWORD)->ShowWindow(SW_HIDE); GetDlgItem(IDC_COPYPASSWORD)->EnableWindow(FALSE); GetDlgItem(IDC_COPYPASSWORD)->ShowWindow(SW_HIDE); GetDlgItem(IDC_PASSWORD)->EnableWindow(FALSE); GetDlgItem(IDC_PASSWORD)->ShowWindow(SW_HIDE); GetDlgItem(IDC_POLICYNAME)->EnableWindow(FALSE); GetDlgItem(IDC_POLICYNAME)->ShowWindow(SW_HIDE); GetDlgItem(IDC_POLICYLIST)->EnableWindow(FALSE); GetDlgItem(IDC_POLICYLIST)->ShowWindow(SW_HIDE); GetDlgItem(IDC_USENAMED_POLICY)->EnableWindow(FALSE); GetDlgItem(IDC_USENAMED_POLICY)->ShowWindow(SW_HIDE); GetDlgItem(IDC_STATIC_NAMEDPOLICY)->ShowWindow(SW_HIDE); break; case IDS_GENERATEPASSWORD: { // Set correct window title cs_title.LoadString(IDS_GENERATEPASSWORD); SetWindowText(cs_title); // These are only used in Manage -> Add/Edit Policy names GetDlgItem(IDC_POLICYNAME)->EnableWindow(FALSE); GetDlgItem(IDC_POLICYNAME)->ShowWindow(SW_HIDE); // Used to generate passwords GetDlgItem(IDC_POLICYLIST)->ShowWindow(SW_SHOW); GetDlgItem(IDC_USENAMED_POLICY)->EnableWindow(TRUE); GetDlgItem(IDC_USENAMED_POLICY)->ShowWindow(SW_SHOW); GetDlgItem(IDC_STATIC_NAMEDPOLICY)->ShowWindow(SW_HIDE); // Populate the combo box m_cbxPolicyNames.ResetContent(); // Get all password policy names std::vector<std::wstring> vNames; GetMainDlg()->GetPolicyNames(vNames); // Add Default const CString cs_default(MAKEINTRESOURCE(IDSC_DEFAULT_POLICY)); m_cbxPolicyNames.AddString(cs_default); for (std::vector<std::wstring>::iterator iter = vNames.begin(); iter != vNames.end(); ++iter) { m_cbxPolicyNames.AddString(iter->c_str()); } // Select Default m_cbxPolicyNames.SelectString(-1, cs_default); // and check the box ((CButton *)GetDlgItem(IDC_USENAMED_POLICY))->SetCheck(BST_CHECKED); // Centre the OK button & change its text RECT rc, rcOK; CWnd *pOK = GetDlgItem(IDOK); GetClientRect(&rc); pOK->GetWindowRect(&rcOK); ScreenToClient(&rcOK); int top = rcOK.top; pOK->GetClientRect(&rcOK); int left = (rc.right - rcOK.right) / 2; pOK->MoveWindow(left, top, rcOK.right, rcOK.bottom); CString cs_close(MAKEINTRESOURCE(IDS_CLOSE)); pOK->SetWindowText(cs_close); // Hide the Cancel & Help buttons GetDlgItem(IDCANCEL)->EnableWindow(FALSE); GetDlgItem(IDCANCEL)->ShowWindow(SW_HIDE); GetDlgItem(ID_HELP)->EnableWindow(FALSE); GetDlgItem(ID_HELP)->ShowWindow(SW_HIDE); Fonts::GetInstance()->ApplyPasswordFont(GetDlgItem(IDC_PASSWORD)); m_ex_password.SetSecure(false); // Remove password character so that the password is displayed m_ex_password.SetPasswordChar(0); // Load bitmap UINT nImageID = PWSprefs::GetInstance()->GetPref(PWSprefs::UseNewToolbar) ? IDB_COPYPASSWORD_NEW : IDB_COPYPASSWORD_CLASSIC; BOOL brc = m_CopyPswdBitmap.Attach(::LoadImage( ::AfxFindResourceHandle(MAKEINTRESOURCE(nImageID), RT_BITMAP), MAKEINTRESOURCE(nImageID), IMAGE_BITMAP, 0, 0, (LR_DEFAULTSIZE | LR_CREATEDIBSECTION | LR_SHARED))); ASSERT(brc); FixBitmapBackground(m_CopyPswdBitmap); CButton *pBtn = (CButton *)GetDlgItem(IDC_COPYPASSWORD); pBtn->SetBitmap(m_CopyPswdBitmap); break; } case IDS_PSWDPOLICY: // Set correct window title cs_title.LoadString(m_policyname.IsEmpty() ? IDS_ADD_NAMED_POLICY : IDS_EDIT_NAMED_POLICY); SetWindowText(cs_title); // These are only used in Manage -> Password Policy GetDlgItem(IDC_GENERATEPASSWORD)->EnableWindow(FALSE); GetDlgItem(IDC_GENERATEPASSWORD)->ShowWindow(SW_HIDE); GetDlgItem(IDC_COPYPASSWORD)->EnableWindow(FALSE); GetDlgItem(IDC_COPYPASSWORD)->ShowWindow(SW_HIDE); GetDlgItem(IDC_PASSWORD)->EnableWindow(FALSE); GetDlgItem(IDC_PASSWORD)->ShowWindow(SW_HIDE); GetDlgItem(IDC_POLICYLIST)->EnableWindow(FALSE); GetDlgItem(IDC_POLICYLIST)->ShowWindow(SW_HIDE); GetDlgItem(IDC_USENAMED_POLICY)->EnableWindow(FALSE); GetDlgItem(IDC_USENAMED_POLICY)->ShowWindow(SW_HIDE); GetDlgItem(IDC_STATIC_NAMEDPOLICY)->ShowWindow(SW_SHOW); if (!m_policyname.IsEmpty() && m_iter->second.usecount > 0) { // Cannot edit the policy 'Name' if it is present and use count > 0 m_PolicyNameEdit.SetReadOnly(TRUE); m_PolicyNameEdit.EnableWindow(FALSE); } m_PolicyNameEdit.SetWindowText(m_policyname); // Max. length of policy name is 255 - only one byte used for length // in database header m_PolicyNameEdit.SetLimitText(255); break; } setupBuddy(this, IDC_PWLENSPIN, IDC_DEFPWLENGTH, m_PWDefaultLength, 4); setupBuddy(this, IDC_SPINDIGITS, IDC_MINDIGITLENGTH, m_PWDigitMinLength); setupBuddy(this, IDC_SPINLOWERCASE, IDC_MINLOWERLENGTH, m_PWLowerMinLength); setupBuddy(this, IDC_SPINUPPERCASE, IDC_MINUPPERLENGTH, m_PWUpperMinLength); setupBuddy(this, IDC_SPINSYMBOLS, IDC_MINSYMBOLLENGTH, m_PWSymbolMinLength); m_save[SAVE_LOWERCASE] = m_PWUseLowercase; m_save[SAVE_UPPERCASE] = m_PWUseUppercase; m_save[SAVE_DIGITS] = m_PWUseDigits; m_save[SAVE_SYMBOLS] = m_PWUseSymbols; m_save[SAVE_EASYVISION] = m_PWEasyVision; m_save[SAVE_PRONOUNCEABLE] = m_PWMakePronounceable; m_savelen[SAVE_LOWERCASE] = m_PWLowerMinLength; m_savelen[SAVE_UPPERCASE] = m_PWUpperMinLength; m_savelen[SAVE_DIGITS] = m_PWDigitMinLength; m_savelen[SAVE_SYMBOLS] = m_PWSymbolMinLength; // Set up the correct controls (enabled/disabled) do_hex(m_PWUseHexdigits == TRUE); int iSet = EVPR_NONE; if (m_PWEasyVision == TRUE) iSet = EVPR_EV; else if (m_PWMakePronounceable == TRUE) iSet = EVPR_PR; do_easyorpronounceable(iSet); GetDlgItem(IDC_OWNSYMBOLS)->EnableWindow(m_PWUseSymbols); GetDlgItem(IDC_RESET_SYMBOLS)->EnableWindow(m_PWUseSymbols); m_SymbolsEdit.SetWindowText(m_Symbols); if (m_uicaller == IDS_GENERATEPASSWORD) { // Disable Specific policy controls as default is to use a named policy (database default) SetSpecificPolicyControls(FALSE); m_pToolTipCtrl = new CToolTipCtrl; if (!m_pToolTipCtrl->Create(this, TTS_ALWAYSTIP | TTS_BALLOON | TTS_NOPREFIX)) { pws_os::Trace(L"Unable To create Advanced Dialog ToolTip\n"); delete m_pToolTipCtrl; m_pToolTipCtrl = NULL; return TRUE; } // Tooltips EnableToolTips(); // Activate the tooltip control. m_pToolTipCtrl->Activate(TRUE); m_pToolTipCtrl->SetMaxTipWidth(300); // Quadruple the time to allow reading by user int iTime = m_pToolTipCtrl->GetDelayTime(TTDT_AUTOPOP); m_pToolTipCtrl->SetDelayTime(TTDT_AUTOPOP, 4 * iTime); AddTool(IDC_COPYPASSWORD, IDS_CLICKTOCOPY); } // Set appropriate focus GetDlgItem(m_uicaller == IDS_GENERATEPASSWORD ? IDC_GENERATEPASSWORD : IDCANCEL)->SetFocus(); return FALSE; }
DrawToolBar::DrawToolBar(wxWindow *parent) : wxToolBar(parent,-1) { SetHelpText(_T("draw3-toolbar-items")); AddTool(drawTB_ABOUT, _T(""),help_xpm,_("About")); AddTool(drawTB_FIND, _T(""),find_xpm, _("Find")); AddTool(drawTB_SUMWIN, _T(""),plus_xpm, _("Summary Window")); AddTool(drawTB_SPLTCRS, _T(""),split_xpm, _("Split cursor"), wxITEM_CHECK); AddTool(drawTB_FILTER, _T(""),filter0_xpm, _("Filter")); AddTool(drawTB_REFRESH, _T(""),refresh_xpm, _("Refresh")); AddTool(drawTB_DRAWTREE, _T(""),draw_tree_xpm, _("Tree Set")); /** disable florence keyboard in windows builds */ #ifndef MINGW32 AddTool(drawTB_FLORENCE, _T(""), florence_xpm, _("Show screen keyboard")); #endif AddTool(drawTB_GOTOLATESTDATE, _T(""), flag_checkered_xpm, _("Go to latest date")); AddTool(drawTB_REMARK, _T(""), remark_xpm, _("Remarks")); AddTool(drawTB_EXIT, _T(""),exit_xpm, _("Quit")); if (VersionChecker::IsNewVersion()) NewDrawVersionAvailable(); else Realize(); VersionChecker::AddToolbar(this); }
BOOL COptionsSystem::OnInitDialog() { COptions_PropertyPage::OnInitDialog(); PWSprefs *prefs = PWSprefs::GetInstance(); if (!m_bShowConfigFile) { GetDlgItem(IDC_STATIC_CONFIGFILE)->ShowWindow(SW_HIDE); GetDlgItem(IDC_STATIC_RWSTATUS)->ShowWindow(SW_HIDE); GetDlgItem(IDC_CONFIGFILE)->ShowWindow(SW_HIDE); } else { PWSprefs::ConfigOption configoption; std::wstring wsCF = prefs->GetConfigFile(configoption); std::wstring wsCO(L""); switch (configoption) { case PWSprefs::CF_NONE: LoadAString(wsCF, IDS_NONE); break; case PWSprefs::CF_REGISTRY: LoadAString(wsCF, IDS_REGISTRY); break; case PWSprefs::CF_FILE_RO: LoadAString(wsCO, IDS_READ_ONLY); break; case PWSprefs::CF_FILE_RW: case PWSprefs::CF_FILE_RW_NEW: LoadAString(wsCO, IDS_READ_WRITE); break; default: ASSERT(0); } GetDlgItem(IDC_CONFIGFILE)->SetWindowText(wsCF.c_str()); GetDlgItem(IDC_STATIC_RWSTATUS)->SetWindowText(wsCO.c_str()); } bool bofferdeleteregistry = prefs->OfferDeleteRegistry(); bool boffermigrate2appdata = OfferConfigMigration(); if (!bofferdeleteregistry) { GetDlgItem(IDC_REGDEL)->ShowWindow(SW_HIDE); GetDlgItem(IDC_REGDEL)->EnableWindow(FALSE); } if (!boffermigrate2appdata) { GetDlgItem(IDC_MIGRATETOAPPDATA)->ShowWindow(SW_HIDE); GetDlgItem(IDC_MIGRATETOAPPDATA)->EnableWindow(FALSE); } if (!bofferdeleteregistry && !boffermigrate2appdata) { GetDlgItem(IDC_CONFIG_GRP)->ShowWindow(SW_HIDE); GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_HIDE); } else { GetDlgItem(IDC_APPLYCONFIGCHANGES)->ShowWindow(SW_SHOW); } GetDlgItem(IDC_APPLYCONFIGCHANGES)->EnableWindow(FALSE); CSpinButtonCtrl *pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_RESPIN); pspin->SetBuddy(GetDlgItem(IDC_MAXREITEMS)); pspin->SetRange(0, ID_TRAYRECENT_ENTRYMAX - ID_TRAYRECENT_ENTRY1 + 1); pspin->SetBase(10); pspin->SetPos(m_MaxREItems); pspin = (CSpinButtonCtrl *)GetDlgItem(IDC_MRUSPIN); pspin->SetBuddy(GetDlgItem(IDC_MAXMRUITEMS)); pspin->SetRange(0, ID_FILE_MRU_ENTRYMAX - ID_FILE_MRU_ENTRY1 + 1); pspin->SetBase(10); pspin->SetPos(m_MaxMRUItems); OnUseSystemTray(); InitToolTip(TTS_BALLOON | TTS_NOPREFIX, 2); AddTool(IDC_REGDEL, IDS_REGDEL); AddTool(IDC_MIGRATETOAPPDATA, IDS_MIGRATETOAPPDATA); ActivateToolTip(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CompilerLocatorMinGW::AddTools(const wxString& binFolder, const wxString& name) { wxFileName masterPath(binFolder, ""); masterPath.RemoveLastDir(); if ( m_locatedFolders.count(masterPath.GetPath()) ) { return; } // Create an empty compiler CompilerPtr compiler( new Compiler(NULL) ); compiler->SetCompilerFamily(COMPILER_FAMILY_MINGW); compiler->SetGenerateDependeciesFile(true); m_compilers.push_back( compiler ); m_locatedFolders.insert( masterPath.GetPath() ); if ( name.IsEmpty() ) { compiler->SetName("MinGW ( " + masterPath.GetDirs().Last() + " )"); } else { compiler->SetName("MinGW ( " + name + " )"); } compiler->SetInstallationPath( masterPath.GetPath() ); CL_DEBUG("Found MinGW compiler under: %s. \"%s\"", masterPath.GetPath(), compiler->GetName()); wxFileName toolFile(binFolder, ""); toolFile.SetFullName("g++.exe"); AddTool(compiler, "CXX", toolFile.GetFullPath()); AddTool(compiler, "LinkerName", toolFile.GetFullPath()); AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), "-shared -fPIC"); toolFile.SetFullName("gcc.exe"); AddTool(compiler, "CC", toolFile.GetFullPath()); toolFile.SetFullName("ar.exe"); AddTool(compiler, "AR", toolFile.GetFullPath(), "rcu"); toolFile.SetFullName("windres.exe"); AddTool(compiler, "ResourceCompiler", toolFile.GetFullPath()); toolFile.SetFullName("as.exe"); AddTool(compiler, "AS", toolFile.GetFullPath()); toolFile.SetFullName("make.exe"); wxString makeExtraArgs; if ( wxThread::GetCPUCount() > 1 ) { makeExtraArgs << "-j" << wxThread::GetCPUCount(); } // This is needed under MinGW makeExtraArgs << " SHELL=cmd.exe "; if ( toolFile.FileExists() ) { AddTool(compiler, "MAKE", toolFile.GetFullPath(), makeExtraArgs); } else { toolFile.SetFullName("mingw32-make.exe"); if ( toolFile.FileExists() ) { AddTool(compiler, "MAKE", toolFile.GetFullPath(), makeExtraArgs); } } toolFile.SetFullName("gdb.exe"); if(toolFile.Exists()) { AddTool(compiler, "Debugger", toolFile.GetFullPath()); } }
wxExFindToolBar::wxExFindToolBar( wxExManagedFrame* frame, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : wxExToolBar(frame, id, pos, size, style) { const wxWindowID ID_MATCH_WHOLE_WORD = NewControlId(); const wxWindowID ID_MATCH_CASE = NewControlId(); const wxWindowID ID_REGULAR_EXPRESSION = NewControlId(); wxExFindTextCtrl* findCtrl = new wxExFindTextCtrl(this, GetFrame()); wxCheckBox* matchCase = new wxCheckBox(this, ID_MATCH_CASE, wxExFindReplaceData::Get()->GetTextMatchCase()); wxCheckBox* matchWholeWord = new wxCheckBox(this, ID_MATCH_WHOLE_WORD, wxExFindReplaceData::Get()->GetTextMatchWholeWord()); wxCheckBox* isRegularExpression = new wxCheckBox(this, ID_REGULAR_EXPRESSION, wxExFindReplaceData::Get()->GetTextRegEx()); #if wxUSE_TOOLTIPS matchCase->SetToolTip(_("Search case sensitive")); matchWholeWord->SetToolTip(_("Search matching words")); isRegularExpression->SetToolTip(_("Search using regular expressions")); #endif matchCase->SetValue(wxExFindReplaceData::Get()->MatchCase()); matchWholeWord->SetValue(wxExFindReplaceData::Get()->MatchWord()); isRegularExpression->SetValue(wxExFindReplaceData::Get()->UseRegEx()); // And place the controls on the toolbar. AddControl(findCtrl); AddTool( wxID_DOWN, wxEmptyString, wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_TOOLBAR), _("Find next")); AddTool( wxID_UP, wxEmptyString, wxArtProvider::GetBitmap(wxART_GO_UP, wxART_TOOLBAR), _("Find previous")); AddControl(matchWholeWord); AddControl(matchCase); AddControl(isRegularExpression); Realize(); Bind(wxEVT_CHECKBOX, [=](wxCommandEvent& event) { wxExFindReplaceData::Get()->SetMatchWord( matchWholeWord->GetValue());}, ID_MATCH_WHOLE_WORD); Bind(wxEVT_CHECKBOX, [=](wxCommandEvent& event) { wxExFindReplaceData::Get()->SetMatchCase( matchCase->GetValue());}, ID_MATCH_CASE); Bind(wxEVT_CHECKBOX, [=](wxCommandEvent& event) { wxExFindReplaceData::Get()->SetUseRegEx( isRegularExpression->GetValue());}, ID_REGULAR_EXPRESSION); Bind(wxEVT_MENU, [=](wxCommandEvent& event) { findCtrl->Find(true);}, wxID_DOWN); Bind(wxEVT_MENU, [=](wxCommandEvent& event) { findCtrl->Find(false);}, wxID_UP); Bind(wxEVT_UPDATE_UI, [=](wxUpdateUIEvent& event) { event.Enable(!findCtrl->GetValue().empty());}, wxID_DOWN); Bind(wxEVT_UPDATE_UI, [=](wxUpdateUIEvent& event) { event.Enable(!findCtrl->GetValue().empty());}, wxID_UP); }
void CToolTips::AddTool(int nIdWnd, CString sBalloonTipText, LPCRECT lpRectTool /* = NULL */, UINT_PTR nIDTool /* = 0 */) { AddTool(((CDialog*)m_pParentWnd)->GetDlgItem(nIdWnd), sBalloonTipText, lpRectTool, nIDTool); }
void CompilerLocatorCLANG::AddTools(CompilerPtr compiler, const wxString &installFolder) { compiler->SetInstallationPath( installFolder ); wxFileName toolFile(installFolder, ""); toolFile.AppendDir("bin"); #ifdef __WXMSW__ toolFile.SetExt("exe"); #endif toolFile.SetName("clang++"); AddTool(compiler, "CXX", toolFile.GetFullPath()); AddTool(compiler, "LinkerName", toolFile.GetFullPath()); #ifdef __WXMAC__ AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), "-dynamiclib -fPIC"); #else AddTool(compiler, "SharedObjectLinkerName", toolFile.GetFullPath(), "-shared -fPIC"); #endif toolFile.SetName("clang"); AddTool(compiler, "CC", toolFile.GetFullPath()); // Add the archive tool toolFile.SetName("llvm-ar"); if ( toolFile.FileExists() ) { AddTool(compiler, "AR", toolFile.GetFullPath(), "rcu"); } else { toolFile.SetName("ar"); AddTool(compiler, "AR", toolFile.GetFullPath(), "rcu"); } #ifdef __WXMSW__ AddTool(compiler, "ResourceCompiler", "windres.exe"); #else AddTool(compiler, "ResourceCompiler", ""); #endif // Add the assembler tool toolFile.SetName("llvm-as"); if ( toolFile.FileExists() ) { AddTool(compiler, "AS", toolFile.GetFullPath()); } else { toolFile.SetName("as"); AddTool(compiler, "AS", toolFile.GetFullPath()); } wxString makeExtraArgs; if ( wxThread::GetCPUCount() > 1 ) { makeExtraArgs << "-j" << wxThread::GetCPUCount(); } #ifdef __WXMSW__ AddTool(compiler, "MAKE", "mingw32-make.exe", makeExtraArgs); #else AddTool(compiler, "MAKE", "make", makeExtraArgs); #endif }