void AppNodeStar::TemplatePage(Wt::WContainerWidget* pcw, FTemplate f) { std::string sTitle( "NodeStar: Network Infrastructure Data Management" ); setTitle( sTitle ); auto pTitle( new Wt::WText( "NodeStar: Network Infrastructure Data Management" ) ); pTitle->setStyleClass( "MainTitle" ); pcw->addWidget( pTitle ); // should show up to the right of the title if ( this->internalPathMatches( "/auth/signin" ) ) { // don't show sign in status } else { if ( m_pAuth->LoggedIn() ) { //pcw->addWidget( m_pAuth->NewAuthWidget() ); AddLink( pcw, "member", "/auth/signout", "Sign Out" ); AddLink( pcw, "member", "/member/home", "Home" ); } else { AddLink( pcw, "admin", "/auth/signin", "Sign In" ); AddLink( pcw, "default", "/home", "Home" ); } } f( pcw ); }
CDialogAcceptAllele::CDialogAcceptAllele( COARlocus *pLocus, const COARmessages *pMessages, wxWindow *parent, wxWindowID id, bool bAllowUserOverride, const wxString &sSampleName, const wxSize &sz) : wxDialog(parent, id, wxEmptyString, wxDefaultPosition, sz, mainApp::DIALOG_STYLE), m_pRev(new CAppendAcceptanceLocus(pLocus)) { const int USER_FLAG = UID_BTN_ACCEPT | UID_BTN_CANCEL | UID_BTN_EDIT | UID_SPACER_BTN_CENTER | UID_SEND_BTN_EVENTS; m_pSplitter = new wxSplitterWindow(this,wxID_ANY, wxDefaultPosition, wxDefaultSize,ID_SPLITTER_STYLE); m_pPeaks = new CGridLocusPeaks( pLocus->GetSample(), pLocus->GetChannelNr(), pLocus->GetName(), m_pSplitter, wxID_ANY, true); m_MsgEdit.CopyOnly(*pMessages,pLocus->GetAlerts()); m_pGridAlerts = new CGridAlerts( &m_MsgEdit,m_pSplitter,wxID_ANY,0,true); CPanelUserID *pPanelUser = new CPanelUserID( this,wxID_ANY,wxID_ANY,m_pRev,USER_FLAG,!bAllowUserOverride); wxString sTitle(_T("Accept Alleles for ")); sTitle.Append(pLocus->GetName()); if(!sSampleName.IsEmpty()) { sTitle.Append(_T(" on ")); sTitle.Append(sSampleName); } SetTitle(sTitle); wxBoxSizer *pSizer = new wxBoxSizer(wxVERTICAL); pSizer->Add(m_pSplitter,1,wxEXPAND); pSizer->Add(pPanelUser,0,wxEXPAND | wxALL, ID_BORDER); SetSizer(pSizer); pSizer->Layout(); m_pSplitter->SplitHorizontally(m_pPeaks,m_pGridAlerts,0); m_pSplitter->SetMinimumPaneSize(1); CentreOnParent(); }
void CDebugger::UpdateTitle() { std::tstring sTitle(_T("Play! - Debugger")); if(GetCurrentView() != NULL) { sTitle += _T(" - [ ") + string_cast<std::tstring>(GetCurrentView()->GetName()) + _T(" ]"); } SetText(sTitle.c_str()); }
bool CMainWindow::AskForFile(HWND owner, TCHAR * path) { OPENFILENAME ofn = {0}; // common dialog box structure // Initialize OPENFILENAME ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = owner; ofn.lpstrFile = path; ofn.nMaxFile = MAX_PATH; ResString sTitle(::hResource, IDS_OPENIMAGEFILE); ofn.lpstrTitle = sTitle; ofn.Flags = OFN_DONTADDTORECENT | OFN_FILEMUSTEXIST | OFN_EXPLORER; ofn.hInstance = ::hResource; TCHAR filters[] = _T("Images\0*.wmf;*.jpg;*jpeg;*.bmp;*.gif;*.png;*.ico;*.dib;*.emf\0All (*.*)\0*.*\0\0"); ofn.lpstrFilter = filters; ofn.nFilterIndex = 1; // Display the Open dialog box. if (GetOpenFileName(&ofn)==FALSE) { return false; } return true; }
void UserListModule_Impl::_departmentResponse(CImPdu* pdu) { CImPduClientDepartmentResponse* pResp = (CImPduClientDepartmentResponse*)pdu; client_department_info_t* pList = pResp->GetDepartmentList(); m_vecDepartment.reserve(pResp->GetDepartCnt()); for (UInt32 i = 0; i < pResp->GetDepartCnt(); i++) { module::DepartmentEntity depart; depart.dId = std::string(pList[i].depart_id_url, pList[i].depart_id_url_len); depart.dId = _makeDepartmentId(depart.dId); depart.parentDepartId = std::string(pList[i].parent_depart_id_url, pList[i].parent_depart_id_url_len); std::string sTitle(pList[i].title, pList[i].title_len); depart.title = util::stringToCString(sTitle); std::string sDescription(pList[i].description, pList[i].description_len); depart.description = util::stringToCString(sDescription); depart.status = pList[i].status; { util::TTAutoLock lock(&m_lock); m_vecDepartment.push_back(depart); } } }
void CDialogEditAllele::_InitCommon( const wxString &sLocusName, const wxString &sSampleName) { wxString sTitle("Edit Alleles for "); wxBoxSizer *pSizer; sTitle.Append(sLocusName); if(!sSampleName.IsEmpty()) { sTitle.Append(" on "); sTitle.Append(sSampleName); } SetTitle(sTitle); pSizer = new wxBoxSizer(wxVERTICAL); pSizer->Add(m_pPanel,1, wxEXPAND); if(m_pSample == NULL) { m_pButtonBar = new CPanelApplyCancel(this); m_pButtonUser = NULL; pSizer->Add(m_pButtonBar,0,wxALIGN_CENTRE); } else { m_pButtonBar = NULL; m_pButtonUser = new CPanelUserID( this,wxID_ANY,IDeditUser, NULL, UID_BTN_OK | UID_BTN_CANCEL | UID_SPACER_BTN_CENTER | UID_SEND_BTN_EVENTS, !m_bAllowUserNameOverride); m_pPanel->SetPanelUserID(m_pButtonUser); pSizer->Add(m_pButtonUser,0,wxALL | wxEXPAND, ID_BORDER); } SetSizer(pSizer); pSizer->Layout(); CentreOnParent(); m_pPanel->TransferDataToWindow(); }
bool CWebSock::AddModLoop(const CString& sLoopName, CModule& Module) { CString sTitle(Module.GetWebMenuTitle()); if (!sTitle.empty() && (IsLoggedIn() || (!Module.WebRequiresLogin() && !Module.WebRequiresAdmin())) && (GetSession()->IsAdmin() || !Module.WebRequiresAdmin())) { CTemplate& Row = m_Template.AddRow(sLoopName); Row["ModName"] = Module.GetModName(); Row["Title"] = sTitle; if (m_sModName == Module.GetModName()) { Row["Active"] = "true"; } if (Module.GetUser()) { Row["Username"] = Module.GetUser()->GetUserName(); } VWebSubPages& vSubPages = Module.GetSubPages(); for (unsigned int a = 0; a < vSubPages.size(); a++) { TWebSubPage& SubPage = vSubPages[a]; // bActive is whether or not the current url matches this subpage (params will be checked below) bool bActive = (m_sModName == Module.GetModName() && m_sPage == SubPage->GetName()); if (SubPage->RequiresAdmin() && !GetSession()->IsAdmin()) { continue; // Don't add admin-only subpages to requests from non-admin users } CTemplate& SubRow = Row.AddRow("SubPageLoop"); SubRow["ModName"] = Module.GetModName(); SubRow["PageName"] = SubPage->GetName(); SubRow["Title"] = SubPage->GetTitle().empty() ? SubPage->GetName() : SubPage->GetTitle(); CString& sParams = SubRow["Params"]; const VPair& vParams = SubPage->GetParams(); for (size_t b = 0; b < vParams.size(); b++) { pair<CString, CString> ssNV = vParams[b]; if (!sParams.empty()) { sParams += "&"; } if (!ssNV.first.empty()) { if (!ssNV.second.empty()) { sParams += ssNV.first.Escape_n(CString::EURL); sParams += "="; sParams += ssNV.second.Escape_n(CString::EURL); } if (bActive && GetParam(ssNV.first, false) != ssNV.second) { bActive = false; } } } if (bActive) { SubRow["Active"] = "true"; } } return true; } return false; }