本文整理汇总了C++中CTSTRING函数的典型用法代码示例。如果您正苦于以下问题:C++ CTSTRING函数的具体用法?C++ CTSTRING怎么用?C++ CTSTRING使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CTSTRING函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateEnablement
LRESULT AVIPreview::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
PropPage::translate(texts);
PropPage::read(items);
updateEnablement();
CRect rc;
ctrlCommands.Attach(GetDlgItem(IDC_MENU_ITEMS));
ctrlCommands.GetClientRect(rc);
ctrlCommands.InsertColumn(0, CTSTRING(SETTINGS_NAME), LVCFMT_LEFT, rc.Width()/5, 0);
ctrlCommands.InsertColumn(1, CTSTRING(SETTINGS_COMMAND), LVCFMT_LEFT, rc.Width()*2 / 5, 1);
ctrlCommands.InsertColumn(2, CTSTRING(SETTINGS_ARGUMENT), LVCFMT_LEFT, rc.Width() / 5, 2);
ctrlCommands.InsertColumn(3, CTSTRING(SETTINGS_EXTENSIONS), LVCFMT_LEFT, rc.Width() / 5, 3);
ctrlCommands.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
// Do specialized reading here
PreviewApplication::List lst = FavoriteManager::getInstance()->getPreviewApps();
for(PreviewApplication::Iter i = lst.begin(); i != lst.end(); ++i) {
PreviewApplication::Ptr pa = *i;
addEntry(pa, ctrlCommands.GetItemCount());
}
return 0;
}
示例2: getText
LRESULT AsGroupsDlg::onRemove(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
int32_t pos = ctrlGroups.GetSelectedIndex();
if (pos < 0)
return 0;
AutoSearchList removeLst;
{
tstring name = getText(0, pos);
WLock l(AutoSearchManager::getInstance()->getCS());
auto lst = AutoSearchManager::getInstance()->getSearchItems();
bool remove = MessageBox(CTSTRING(GROUP_REMOVE_ITEMS), CTSTRING(REMOVE_GROUP), MB_ICONQUESTION | MB_YESNO) == IDYES;
for (auto as : lst | map_values) {
if (as->getGroup() != Text::fromT(name))
continue;
if (remove)
removeLst.push_back(as);
else
as->setGroup(Util::emptyString);
}
ctrlGroups.DeleteItem(pos);
updateSelectedGroup(true);
}
for_each(removeLst, [&](AutoSearchPtr a) { AutoSearchManager::getInstance()->removeAutoSearch(a); });
return 0;
}
示例3: GetDlgItem
LRESULT QueuePage::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
PropPage::translate(texts);
PropPage::read(items);
PropPage::readCheckBoxList(optionItems, GetDlgItem(IDC_OTHER_QUEUE_OPTIONS));
CUpDownCtrl spin;
spin.Attach(GetDlgItem(IDC_SEG_NUMBER_SPIN));
spin.SetRange32(1, 200); //[!]PPA
spin.Detach();
spin.Attach(GetDlgItem(IDC_SEARCH_SPIN));
spin.SetRange32(2, 60);
spin.Detach();
spin.Attach(GetDlgItem(IDC_BEGIN_SPIN));
spin.SetRange32(2, 100000);
spin.Detach();
ctrlMultiSource.Attach(GetDlgItem(IDC_MULTISOURCE_COMBO));
ctrlMultiSource.AddString(CTSTRING(DISABLED));
ctrlMultiSource.AddString(CTSTRING(AUTOMATIC));
ctrlMultiSource.SetCurSel(SETTING(MULTI_CHUNK));
::EnableWindow(GetDlgItem(IDC_DONTBEGIN), FALSE); //[+]PPA
::EnableWindow(GetDlgItem(IDC_BEGIN_EDIT), FALSE); //[+]PPA
// Do specialized reading here
return TRUE;
}
示例4: SetDlgItemText
LRESULT
DCLSTGenDlg::onSaveAS(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// GetNew _mNameDCLST
tstring targetOld = Text::toT(_mNameDCLST);
tstring target = targetOld;
static const TCHAR defaultExt[] = L"dcls";
if (WinUtil::browseFile(target, *this, true, Util::emptyStringT, FILE_LIST_TYPE_T, defaultExt)) // TODO translate
{
try
{
File::renameFile(targetOld, target);
_mNameDCLST = Text::fromT(target);
const string l_TTH_str = _tth.get()->getRoot().toBase32();
_strMagnet = "magnet:?xt=urn:tree:tiger:" + l_TTH_str +
"&xl=" + Util::toString(_tth.get()->getFileSize()) + "&dn=" + Util::encodeURI(Util::getFileName(_mNameDCLST)) + "&dl=" + Util::toString(_totalSize);
SetDlgItemText(IDC_DCLSTGEN_MAGNET, Text::toT(_strMagnet).c_str());
SetDlgItemText(IDC_DCLSTGEN_NAME, target.c_str());
}
catch (const FileException& /*ex*/)
{
MessageBox(CTSTRING(DCLSTGEN_METAFILECANNOTMOVED), CTSTRING(DCLSTGEN_TITLE), MB_OK | MB_ICONERROR);
}
}
return 0;
}
示例5: getValues
LRESULT FulHighlightDialog::onOk(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/){
try{
getValues();
}catch(...) {
MessageBox(CTSTRING(BAD_REGEXP), _T(APPNAME) _T(" ") _T(VERSIONSTRING), MB_OK | MB_ICONEXCLAMATION);
return TRUE;
}
if(cs.getMatch().empty()){
MessageBox(CTSTRING(ADD_EMPTY), _T(APPNAME) _T(" ") _T(VERSIONSTRING), MB_OK | MB_ICONEXCLAMATION);
return TRUE;
}
if(cs.getMatch().find(_T("$Re:")) == 0) {
string str1 = "^$";
string str2 = (Text::fromT(cs.getMatch())).substr(4);
try {
boost::regex reg(str1);
if(boost::regex_search(str2.begin(), str2.end(), reg)){
//....
}
} catch(...) {
MessageBox(CTSTRING(BAD_REGEXP), _T(APPNAME) _T(" ") _T(VERSIONSTRING), MB_OK | MB_ICONEXCLAMATION);
return TRUE;
}
}
EndDialog(IDOK);
return 0;
}
示例6: CTSTRING
LRESULT WebServerPage::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
PropPage::translate((HWND)(*this), texts);
::SetWindowText(GetDlgItem(IDC_WEBSERVER_PORT), Util::toStringW(webMgr->getPlainServerConfig().getPort()).c_str());
::SetWindowText(GetDlgItem(IDC_WEBSERVER_TLSPORT), Util::toStringW(webMgr->getTlsServerConfig().getPort()).c_str());
ctrlTlsPort.Attach(GetDlgItem(IDC_WEBSERVER_TLSPORT));
ctrlPort.Attach(GetDlgItem(IDC_WEBSERVER_PORT));
ctrlWebUsers.Attach(GetDlgItem(IDC_WEBSERVER_USERS));
ctrlWebUsers.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
CRect rc;
ctrlWebUsers.GetClientRect(rc);
ctrlWebUsers.InsertColumn(0, CTSTRING(NAME), LVCFMT_LEFT, rc.Width() / 2, 0);
ctrlWebUsers.InsertColumn(1, CTSTRING(PASSWORD), LVCFMT_LEFT, rc.Width() / 2, 1);
ctrlRemove.Attach(GetDlgItem(IDC_WEBSERVER_REMOVE_USER));
ctrlAdd.Attach(GetDlgItem(IDC_WEBSERVER_ADD_USER));
ctrlChange.Attach(GetDlgItem(IDC_WEBSERVER_CHANGE));
ctrlStart.Attach(GetDlgItem(IDC_WEBSERVER_START));
ctrlStatus.Attach(GetDlgItem(IDC_WEBSERVER_STATUS));
currentState = webMgr->isRunning() ? STATE_STARTED : STATE_STOPPED;
updateStatus();
webUserList = webMgr->getUserManager().getUsers();
for (auto u : webUserList) {
addListItem(u->getUserName(), u->getPassword());
}
webMgr->addListener(this);
return TRUE;
}
示例7: CTSTRING
LRESULT UCPage::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
PropPage::translate((HWND)(*this), texts);
PropPage::read((HWND)*this, items);
CRect rc;
ctrlCommands.Attach(GetDlgItem(IDC_MENU_ITEMS));
ctrlCommands.GetClientRect(rc);
ctrlCommands.InsertColumn(0, CTSTRING(SETTINGS_NAME), LVCFMT_LEFT, rc.Width()/4, 0);
ctrlCommands.InsertColumn(1, CTSTRING(SETTINGS_COMMAND), LVCFMT_LEFT, rc.Width()*2 / 4, 1);
ctrlCommands.InsertColumn(2, CTSTRING(HUB), LVCFMT_LEFT, rc.Width() / 4, 2);
ctrlCommands.SetExtendedListViewStyle(LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
// Do specialized reading here
UserCommand::List lst = FavoriteManager::getInstance()->getUserCommands();
for(UserCommand::List::iterator i = lst.begin(); i != lst.end(); ++i) {
UserCommand& uc = *i;
if(!uc.isSet(UserCommand::FLAG_NOSAVE)) {
addEntry(uc, ctrlCommands.GetItemCount());
}
}
return TRUE;
}
示例8: CTSTRING
LRESULT AVIPreview::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
PropPage::translate((HWND)(*this), texts);
CRect rc;
ctrlCommands.Attach(GetDlgItem(IDC_MENU_ITEMS));
ctrlCommands.GetClientRect(rc);
ctrlCommands.InsertColumn(0, CTSTRING(SETTINGS_NAME), LVCFMT_LEFT, rc.Width() / 5, 0);
ctrlCommands.InsertColumn(1, CTSTRING(SETTINGS_COMMAND), LVCFMT_LEFT, rc.Width() * 2 / 5, 1);
ctrlCommands.InsertColumn(2, CTSTRING(SETTINGS_ARGUMENT), LVCFMT_LEFT, rc.Width() / 5, 2);
ctrlCommands.InsertColumn(3, CTSTRING(SETTINGS_EXTENSIONS), LVCFMT_LEFT, rc.Width() / 5, 3);
SET_EXTENDENT_LIST_VIEW_STYLE(ctrlCommands);
SET_LIST_COLOR_IN_SETTING(ctrlCommands);
// Do specialized reading here
const PreviewApplication::List lst = FavoriteManager::getInstance()->getPreviewApps();
auto cnt = ctrlCommands.GetItemCount();
for (auto i = lst.cbegin(); i != lst.cend(); ++i)
{
PreviewApplication::Ptr pa = *i;
addEntry(pa, cnt++);
}
return 0;
}
示例9: if
void AutoSearchFrame::addEntry(const AutoSearchPtr as, int pos) {
if(as == NULL)
return;
if(pos < 0)
pos = 0;
TStringList lst;
lst.push_back(Text::toT(as->getSearchString()));
lst.push_back(Text::toT(getType(as->getFileType())));
if(as->getAction() == 0){
lst.push_back(CTSTRING(DOWNLOAD));
}else if(as->getAction() == 1){
lst.push_back(CTSTRING(ADD_TO_QUEUE));
}else if(as->getAction() == 2){
lst.push_back(CTSTRING(AS_REPORT));
}
lst.push_back(Text::toT(as->getTarget()));
lst.push_back(Text::toT(as->getRemove()? "Yes" : "No"));
lst.push_back(Text::toT(as->getNickPattern()));
lst.push_back((as->getLastSearch() > 0 ? formatSearchDate(as->getLastSearch()).c_str() : _T("Unknown")));
bool b = as->getEnabled();
int i = ctrlAutoSearch.insert(pos, lst, 0, (LPARAM)as.get());
ctrlAutoSearch.SetCheckState(i, b);
}
示例10: _T
uint64_t UserInfoSimple::inputSlotTime()
{
static tstring deftext = _T("00:30");
LineDlg dlg;
dlg.description = TSTRING(EXTRA_SLOT_TIME_FORMAT);
dlg.title = TSTRING(EXTRA_SLOT_TIMEOUT);
dlg.line = deftext;
if (dlg.DoModal() == IDOK)
{
deftext = dlg.line;
unsigned int n = 0;
for (size_t i = 0; i < deftext.length(); i++) // TODO: cleanup.
{
if (deftext[i] == L':') n++;
}
unsigned int d, h, m;
switch (n)
{
case 1:
if (swscanf(deftext.c_str(), L"%u:%u", &h, &m) == 2)
return (h * 3600 + m * 60);
break;
case 2:
if (swscanf(deftext.c_str(), L"%u:%u:%u", &d, &h, &m) == 3)
return (d * 3600 * 24 + h * 3600 + m * 60);
break;
}
::MessageBox(GetForegroundWindow(), CTSTRING(INVALID_TIME_FORMAT), CTSTRING(ERRORS), MB_OK | MB_ICONERROR);
}
return 0;
}
示例11: CTSTRING
LRESULT CFulEditCtrl::onCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled){
searchMenu.CreatePopupMenu();
menu.CreatePopupMenu();
if( isSet(MENU_COPY) )
menu.AppendMenu(MF_STRING, IDC_COPY, CTSTRING(COPY));
if( isSet(MENU_PASTE) )
menu.AppendMenu(MF_STRING, IDC_PASTE, CTSTRING(PASTE));
if( isSet(MENU_SEARCH) )
menu.AppendMenu(MF_STRING, IDC_SEARCH, CTSTRING(SEARCH));
if( isSet(MENU_SEARCH_TTH) )
menu.AppendMenu(MF_STRING, IDC_SEARCH_BY_TTH, CTSTRING(SEARCH_BY_TTH));
if( isSet(MENU_SEARCH_MENU) )
menu.AppendMenu(MF_POPUP, (UINT_PTR)(HMENU)searchMenu, CTSTRING(SEARCH_SITES));
//Set the MNS_NOTIFYBYPOS flag to receive WM_MENUCOMMAND
MENUINFO inf;
inf.cbSize = sizeof(MENUINFO);
inf.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS;
inf.dwStyle = MNS_NOTIFYBYPOS;
menu.SetMenuInfo(&inf);
handCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND));
beamCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_IBEAM));
bHandled = FALSE;
return 1;
}
示例12: GET_X_LPARAM
LRESULT UsersFrame::onContextMenu(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {
if (reinterpret_cast<HWND>(wParam) == ctrlUsers && ctrlUsers.GetSelectedCount() > 0 ) {
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
if(pt.x == -1 && pt.y == -1) {
WinUtil::getContextMenuPos(ctrlUsers, pt);
}
OMenu usersMenu;
usersMenu.CreatePopupMenu();
usersMenu.AppendMenu(MF_STRING, IDC_OPEN_USER_LOG, CTSTRING(OPEN_USER_LOG));
usersMenu.AppendMenu(MF_SEPARATOR);
appendUserItems(usersMenu, Util::emptyString); // TODO: hubhint
usersMenu.AppendMenu(MF_SEPARATOR);
usersMenu.AppendMenu(MF_STRING, IDC_EDIT, CTSTRING(PROPERTIES));
usersMenu.AppendMenu(MF_STRING, IDC_REMOVE, CTSTRING(REMOVE));
tstring x;
if (ctrlUsers.GetSelectedCount() == 1) {
x = ctrlUsers.getItemData(WinUtil::getFirstSelectedIndex(ctrlUsers))->columns[COLUMN_NICK];
} else {
x = _T("");
}
if (!x.empty())
usersMenu.InsertSeparatorFirst(x);
usersMenu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, m_hWnd);
return TRUE;
}
bHandled = FALSE;
return FALSE;
}
示例13: SetDlgItemText
void ADLSProperties::setControlOverride() {
bool b = (::SendMessage(GetDlgItem(IDC_OVERRIDE_FAV), BM_GETCHECK, 0, 0L) != 0);
::ShowWindow(GetDlgItem(IDC_ADLS_KICK_STRING), !b);
::ShowWindow(GetDlgItem(IDC_ADLSEARCH_RAW_ACTION), b);
if (b)
SetDlgItemText(IDC_ADLSEARCH_ACTION, CTSTRING(ACTION));
else
SetDlgItemText(IDC_ADLSEARCH_ACTION, CTSTRING(RAW));
}
示例14: switch
tstring ADLSearch::SizeTypeToDisplayString(ADLSearch::SizeType t) {
switch(t) {
default:
case SizeBytes: return CTSTRING(B);
case SizeKiloBytes: return CTSTRING(KB);
case SizeMegaBytes: return CTSTRING(MB);
case SizeGigaBytes: return CTSTRING(GB);
}
}
示例15: GetDlgItem
LRESULT SharingOptionsPage::onInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
PropPage::translate((HWND)(*this), texts);
PropPage::read((HWND)*this, items, listItems, GetDlgItem(IDC_SHARINGLIST));
//refresh
setMinMax(IDC_REFRESH_SPIN, 0, 3000);
setMinMax(IDC_INCOMING_SPIN, 0, 1000);
setMinMax(IDC_MONITORING_SECONDS_SPIN, 1, 1000);
ctrlThreadedRefresh.Attach(GetDlgItem(IDC_MULTITHREADED_REFRESH));
ctrlThreadedRefresh.InsertString(0, CTSTRING(NEVER));
ctrlThreadedRefresh.InsertString(1, CTSTRING(MANUAL_REFRESHES));
ctrlThreadedRefresh.InsertString(2, CTSTRING(ALWAYS));
ctrlThreadedRefresh.SetCurSel(SETTING(REFRESH_THREADING));
ctrlDelayMode.Attach(GetDlgItem(IDC_DELAY_MODE));
ctrlDelayMode.InsertString(0, CTSTRING(MONITOR_DELAY_DIR));
ctrlDelayMode.InsertString(1, CTSTRING(MONITOR_DELAY_VOLUME));
ctrlDelayMode.InsertString(2, CTSTRING(MONITOR_DELAY_ANY));
ctrlDelayMode.SetCurSel(SETTING(DELAY_COUNT_MODE));
ctrlMonitoringMode.Attach(GetDlgItem(IDC_MONITORING_MODE));
ctrlMonitoringMode.InsertString(0, CTSTRING(DISABLED));
ctrlMonitoringMode.InsertString(1, CTSTRING(INCOMING_ONLY));
ctrlMonitoringMode.InsertString(2, CTSTRING(ALL_DIRS));
ctrlMonitoringMode.SetCurSel(SETTING(MONITORING_MODE));
// Do specialized reading here
return TRUE;
}