本文整理汇总了C++中TabCtrl_SetCurSel函数的典型用法代码示例。如果您正苦于以下问题:C++ TabCtrl_SetCurSel函数的具体用法?C++ TabCtrl_SetCurSel怎么用?C++ TabCtrl_SetCurSel使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TabCtrl_SetCurSel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Server_DisplayTab
void Server_DisplayTab (HWND hDlg, CHILDTAB iTab)
{
HWND hTab = GetDlgItem (hDlg, IDC_TABS);
int idd = -1;
DLGPROC dlgproc = NULL;
switch (iTab)
{
case tabSERVICES:
idd = IDD_SERVICES;
dlgproc = (DLGPROC)Services_DlgProc;
break;
case tabAGGREGATES:
idd = IDD_AGGREGATES;
dlgproc = (DLGPROC)Aggregates_DlgProc;
break;
case tabFILESETS:
idd = IDD_FILESETS;
dlgproc = (DLGPROC)Filesets_DlgProc;
break;
}
if (idd != -1)
{
HWND hDialogOld = GetTabChild (hTab);
HWND hDialogNew = ModelessDialog (idd, hTab, dlgproc);
if (hDialogNew != NULL)
{
TabCtrl_SetCurSel (hTab, iTab);
ShowWindow (hDialogNew, SW_SHOW);
if (hDialogOld != NULL)
{
DestroyWindow (hDialogOld);
}
Server_ForceRedraw (hDlg);
}
}
}
示例2: Close
LRESULT CColorPicker::OnKeyDownList(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
bHandled = FALSE;
if (wParam == VK_ESCAPE)
{
Close();
}
else if (wParam == VK_RETURN)
{
int nSel = m_winList.SendMessage(LB_GETCURSEL);
if(nSel >= 0) m_clr = m_SystemColors[nSel].clr;
Close();
}
else if (wParam == VK_TAB)
{
BOOL b;
TabCtrl_SetCurSel(m_winTab, 0);
OnTabSelChange(0, 0, b);
}
return 0;
}
示例3: wxCHECK_MSG
int wxNotebook::SetSelection(size_t nPage)
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("notebook page out of range") );
if ( m_selection == wxNOT_FOUND || nPage != (size_t)m_selection )
{
if ( SendPageChangingEvent(nPage) )
{
// program allows the page change
const int selectionOld = m_selection;
UpdateSelection(nPage);
TabCtrl_SetCurSel(GetHwnd(), nPage);
SendPageChangedEvent(selectionOld, nPage);
}
}
return m_selection;
}
示例4: TabsOnLoadedDoc
// On load of a new document we insert a new tab item in the tab bar.
// Its text is the name of the opened file.
void TabsOnLoadedDoc(WindowInfo *win)
{
if (!win)
return;
TabData *td = new TabData();
SaveTabData(win, td);
TCITEM tcs;
tcs.mask = TCIF_TEXT | TCIF_PARAM;
tcs.pszText = (WCHAR *)path::GetBaseName(win->loadedFilePath);
tcs.lParam = (LPARAM)td;
int count = TabsGetCount(win);
if (-1 != TabCtrl_InsertItem(win->hwndTabBar, count, &tcs)) {
TabCtrl_SetCurSel(win->hwndTabBar, count);
UpdateTabWidth(win);
}
else
DeleteTabData(td, false);
UpdateCurrentTabBgColForWindow(win);
}
示例5: UpdateDockTabView
//
// Ensure the TabView reflects the dockwnds
//
void UpdateDockTabView(DOCKPANEL *dpp)
{
DOCKWND *dwp = 0;
int idx = 0;
int selidx = 0;
DOCKWND *seldwp = 0;
TabCtrl_DeleteAllItems(dpp->hwndTabView);
//TRACEA("Updating tab: %x %x\n", dpp->hwndPanel, dpp);
for(dwp = dpp->WndListHead->flink; dwp != dpp->WndListTail; dwp = dwp->flink)
{
if(dwp->fVisible)
{
TCITEM tci = { TCIF_PARAM|TCIF_TEXT };
tci.lParam = dwp->uWndId;
tci.pszText = dwp->szTitle;
if(dwp->uWndId == dpp->uCurrentTabId)
{
selidx = idx;
seldwp = dwp;
}
TabCtrl_InsertItem(dpp->hwndTabView, idx++, &tci);
}
}
TabCtrl_SetCurSel(dpp->hwndTabView, selidx);
if(seldwp)
{
SetWindowText(dpp->hwndPanel, seldwp->szTitle);
}
InvalidateRect(dpp->hwndPanel, 0, TRUE);
}
示例6: ActivateChild
static void ActivateChild(struct ParentWindowData *dat, HWND child) {
int i;
RECT rcChild;
GetChildWindowRect(dat, &rcChild);
SetWindowPos(child, HWND_TOP, rcChild.left, rcChild.top, rcChild.right-rcChild.left, rcChild.bottom - rcChild.top, SWP_NOSIZE);
if(child != dat->hwndActive) {
HWND prev = dat->hwndActive;
dat->hwndActive = child;
SendMessage(dat->hwndActive, DM_UPDATESTATUSBAR, 0, 0);
SendMessage(dat->hwndActive, DM_UPDATETITLE, 0, 0);
SendMessage(dat->hwnd, WM_SIZE, 0, 0);
ShowWindow(dat->hwndActive, SW_SHOWNOACTIVATE);
SendMessage(dat->hwndActive, DM_SCROLLLOGTOBOTTOM, 0, 0);
if (prev!=NULL) ShowWindow(prev, SW_HIDE);
} else {
SendMessage(dat->hwnd, WM_SIZE, 0, 0);
}
i = GetTabFromHWND(dat, child);
TabCtrl_SetCurSel(dat->hwndTabs, i);
SendMessage(dat->hwndActive, DM_ACTIVATE, WA_ACTIVE, 0);
}
示例7: TabsOnLoadedDoc
// On load of a new document we insert a new tab item in the tab bar.
void TabsOnLoadedDoc(WindowInfo *win)
{
if (!win)
return;
TabInfo *tab = win->tabs.Last();
VerifyTabInfo(win, tab);
TCITEM tcs;
tcs.mask = TCIF_TEXT;
tcs.pszText = (WCHAR *)tab->GetTabTitle();
int index = (int)win->tabs.Count() - 1;
if (-1 != TabCtrl_InsertItem(win->hwndTabBar, index, &tcs)) {
TabCtrl_SetCurSel(win->hwndTabBar, index);
UpdateTabWidth(win);
}
else {
// TODO: what now?
CrashIf(true);
}
}
示例8: DialogAbout
/*
** Opens the About dialog.
**
*/
void DialogAbout::Open(int tab)
{
if (!c_Dialog)
{
c_Dialog = new DialogAbout();
}
c_Dialog->ShowDialogWindow(
GetString(ID_STR_ABOUTRAINMETER),
0, 0, 400, 210,
DS_CENTER | WS_POPUP | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME,
WS_EX_APPWINDOW | WS_EX_CONTROLPARENT | ((*GetString(ID_STR_ISRTL) == L'1') ? WS_EX_LAYOUTRTL : 0),
GetRainmeter().GetWindow());
// Fake WM_NOTIFY to change tab
NMHDR nm;
nm.code = TCN_SELCHANGE;
nm.idFrom = Id_Tab;
nm.hwndFrom = c_Dialog->GetControl(Id_Tab);
TabCtrl_SetCurSel(nm.hwndFrom, tab);
c_Dialog->OnNotify(0, (LPARAM)&nm);
}
示例9: PBSettings_OnInitDialog
//WM_INITDIALOG
BOOL PBSettings_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
(void) hwndFocus; //To avoid the warning
//Associate the parameters to the window
SetWindowLongPtr(hwnd,GWLP_USERDATA,(__int3264)(LONG_PTR)lParam);
//Get the PBSDP
PenBrushSettingsDlgParam * pbsdp=(PenBrushSettingsDlgParam *)(LONG_PTR)GetWindowLongPtr(hwnd,GWLP_USERDATA);
//Create the tabs
TCITEM ti;
//Foreground tab
ti.pszText=const_cast<LPTSTR>(langFile->GetString(IDS_PB_TABS_FG).c_str());
ti.mask=TCIF_TEXT;
if((pbsdp->fgTabIndex=TabCtrl_InsertItem(GetDlgItem(hwnd,IDC_PB_TABS),0,&ti))==-1)
throw std::runtime_error(ERROR_STD_PROLOG "TabCtrl_InsertItem returned -1 creating the \"Foreground\" tab.");
//Background tab
ti.pszText=const_cast<LPTSTR>(langFile->GetString(IDS_PB_TABS_BG).c_str());
if((pbsdp->bgTabIndex=TabCtrl_InsertItem(GetDlgItem(hwnd,IDC_PB_TABS),1,&ti))==-1)
throw std::runtime_error(ERROR_STD_PROLOG "TabCtrl_InsertItem returned -1 creating the \"Background\" tab.");
//Select the right tab
TabCtrl_SetCurSel(GetDlgItem(hwnd,IDC_PB_TABS),pbsdp->GetActiveTabIndex());
//Send a fake notification
NMHDR nmh;
nmh.code=TCN_SELCHANGE;
nmh.hwndFrom=GetDlgItem(hwnd,IDC_PB_TABS);
nmh.idFrom=IDC_PB_TABS;
FORWARD_WM_NOTIFY(hwnd,IDC_PB_TABS,&nmh,SendMessage);
//Setup the updown control
//Set the range of the width updown control
SendDlgItemMessage(hwnd,IDC_PB_UD_WIDTH,UDM_SETRANGE,0,(LPARAM) MAKELONG((short) MAXPENWIDTH, (short) MINPENWIDTH));
//Init some other controls
ColorUtils2CommonControls(hwnd);
//Subclass the textbox
SetWindowLongPtr(GetDlgItem(hwnd,IDC_PB_P_TX_CUSTOM),GWLP_USERDATA,(__int3264)(LONG_PTR)SetWindowLongPtr(GetDlgItem(hwnd,IDC_PB_P_TX_CUSTOM),GWLP_WNDPROC,(__int3264)(LONG_PTR)SubclTxtProc));
//Load the captions of the child windows (and of itself)
langFile->InitializeDialogCaptions(hwnd, IDD_PENBRUSHSETTINGS);
return TRUE;
}
示例10: ShowFindDlg
//
// Show the find/replace/goto dialog
//
HWND ShowFindDlg(HWND hwndParent, UINT nPage)
{
HWND hwndTab;
NMHDR nmhdr;
//
// Create the dialog if it hasn't been already
//
if(g_hwndSearchDlg == 0)
{
g_hwndSearchDlg = CreateDialog(g_hResourceModule, MAKEINTRESOURCE(IDD_FIND), hwndParent, SearchDlgProc);
CenterWindow(g_hwndSearchDlg);
ShowWindow(g_hwndSearchDlg, SW_SHOW);
}
SetForegroundWindow(g_hwndSearchDlg);
//
// Simulate the user clicking one of the TABs in order to
// set the desired page
//
hwndTab = GetDlgItem(g_hwndSearchDlg, IDC_TAB1);
nmhdr.hwndFrom = hwndTab;
nmhdr.code = TCN_SELCHANGE;
nmhdr.idFrom = IDC_TAB1;
TabCtrl_SetCurSel(hwndTab, nPage);
SendMessage(g_hwndSearchDlg, WM_NOTIFY, IDC_TAB1, (LPARAM)&nmhdr);
// Set focus to 1st control in dialog
SetFocus(GetDlgItem(g_hwndFindPane[nPage], IDC_COMBO1));
PostMessage(g_hwndFindPane[nPage], WM_NEXTDLGCTL, IDC_COMBO1, TRUE);
return g_hwndSearchDlg;
}
示例11: config_dlgproc
INT_PTR CALLBACK config_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
LPNMHDR lpn = (LPNMHDR) lParam;
switch (uMsg) {
case WM_INITDIALOG:
logger.Info("config_dlgproc()", "WM_INITDIALOG");
TCITEM tie;
m_hwndDlg = hwndDlg;
m_hwndTab = GetDlgItem(hwndDlg, IDC_CONFIG_TABS);
tie.mask = TCIF_TEXT;
for (int i = 0; i < sizeof(tabs) / sizeof(pref_tab); i++) {
tie.pszText = tabs[i].title;
TabCtrl_InsertItem(m_hwndTab, i, &tie);
}
TabCtrl_SetCurSel(m_hwndTab, 0);
OnSelChanged(hwndDlg);
break;
case WM_NOTIFY:
if(lpn) if(lpn->code==TCN_SELCHANGE) OnSelChanged(hwndDlg);
break;
case WM_COMMAND:
logger.Message("config_dlgproc()", "WM_COMMAND");
switch (LOWORD(wParam)) {
case IDOK:
mlOrgConfig.SaveConfiguration(iniFile);
case IDCANCEL:
mlOrgConfig.LoadConfiguration(iniFile);
EndDialog(hwndDlg, 0);
break;
}
break;
}
return 0;
}
示例12: displayDocumentByIndex
/// Function name : displayDocumentByIndex
// Description : Changes the active tab and displays the appropriate document
//
// HWND hTabCtrl : [in] Document control handle
// CONST UINT iIndex : [in] Zero based index of the document to display
//
VOID displayDocumentByIndex(HWND hTabCtrl, CONST UINT iIndex)
{
DOCUMENTS_DATA* pWindowData; // Window data
DOCUMENT* pDocument; // Target Document
// Prepare
pWindowData = getDocumentsControlData(hTabCtrl);
// Lookup document and ensure its not already active
if (findDocumentByIndex(hTabCtrl, iIndex, pDocument) AND pDocument != getActiveDocument())
{
// [SUCCESS] Hide current active document (if any)
if (getActiveDocument())
ShowWindow(getActiveDocument()->hWnd, SW_HIDE);
/// Ensure correct tab is selected
TabCtrl_SetCurSel(pWindowData->hTabCtrl, iIndex); // Already active if user has changed tab manually
/// Display new document
setActiveDocument(pWindowData, pDocument);
}
}
示例13: _SetEdtValue
void CTerrainTool::ContentInit()
{
_SetEdtValue(IDC_EDIT_BRUSH_SIZE, 10);
_SetEdtValue(IDC_EDIT_CAMERA_MOVE, 1);
_SetRangeTrackBar(IDC_SLIDE_BRUSH_SIZE, 1, 100);
_SetRangeTrackBar(IDC_SLIDE_CAMERA_MOVE, 1, 20);
_SetPosTrackBar(IDC_SLIDE_BRUSH_SIZE, 10);
_SetPosTrackBar(IDC_SLIDE_CAMERA_MOVE, 1);
_SetCheckBox(IDC_CHECK_FOG, false);
_SetCheckBox(IDC_CHECK_LIGHT, false);
_SetCheckBox(IDC_CHECK_WIRE, false);
_SetCheckBox(IDC_CHECK_PICK, true);
m_pEditDlg->ContentInit();
int id = dynamic_cast<Scn_MapTool*>(AVDirector::GetDiector()->GetScene())->baseTexID();
int num = dynamic_cast<Scn_MapTool*>(AVDirector::GetDiector()->GetScene())->SizeSplatTextures();
m_pSplattingDlg->ContentInit(id, num);//임시
for(int i=0; i<num; i++)
m_pSplattingDlg->m_vID.push_back(i);
HWND hWnd = GetDlgItem(m_hWnd, IDC_TAB);
TabCtrl_SetCurSel(hWnd, 0);
}
示例14: TabsOnCloseDoc
// Called when we're closing a document
void TabsOnCloseDoc(WindowInfo *win)
{
int count = TabsGetCount(win);
if (count <= 0)
return;
if (win->AsFixed() && win->AsFixed()->userAnnots && win->AsFixed()->userAnnotsModified) {
// TODO: warn about unsaved changes
}
int current = TabCtrl_GetCurSel(win->hwndTabBar);
TabData *tdata = GetTabData(win, current);
win->tabSelectionHistory->Remove(tdata);
UpdateTabFileDisplayStateForWin(win, tdata);
DeleteTabData(tdata, false);
TabCtrl_DeleteItem(win->hwndTabBar, current);
UpdateTabWidth(win);
if (count > 1) {
tdata = win->tabSelectionHistory->Pop();
TabCtrl_SetCurSel(win->hwndTabBar, FindTabIndex(win, tdata));
LoadModelIntoTab(win, tdata);
UpdateCurrentTabBgColForWindow(win);
}
}
示例15: GetDlgItem
void ConEmuAbout::searchProc(HWND hDlg, HWND hSearch, bool bReentr)
{
HWND hEdit = GetDlgItem(hDlg, tAboutText);
wchar_t* pszPart = GetDlgItemTextPtr(hSearch, 0);
wchar_t* pszText = GetDlgItemTextPtr(hEdit, 0);
bool bRetry = false;
if (pszPart && *pszPart && pszText && *pszText)
{
LPCWSTR pszFrom = pszText;
DWORD nStart = 0, nEnd = 0;
SendMessage(hEdit, EM_GETSEL, (WPARAM)&nStart, (LPARAM)&nEnd);
size_t cchMax = wcslen(pszText);
size_t cchFrom = max(nStart,nEnd);
if (cchMax > cchFrom)
pszFrom += cchFrom;
LPCWSTR pszFind = StrStrI(pszFrom, pszPart);
if (!pszFind && bReentr && (pszFrom != pszText))
pszFind = StrStrI(pszText, pszPart);
if (pszFind)
{
const wchar_t szBrkChars[] = L"()[]<>{}:;,.-=\\/ \t\r\n";
LPCWSTR pszEnd = wcspbrk(pszFind, szBrkChars);
INT_PTR nPartLen = wcslen(pszPart);
if (!pszEnd || ((pszEnd - pszFind) > max(nPartLen,60)))
pszEnd = pszFind + nPartLen;
while ((pszFind > pszFrom) && !wcschr(szBrkChars, *(pszFind-1)))
pszFind--;
//SetFocus(hEdit);
nTextSelStart = (DWORD)(pszEnd-pszText);
nTextSelEnd = (DWORD)(pszFind-pszText);
SendMessage(hEdit, EM_SETSEL, nTextSelStart, nTextSelEnd);
SendMessage(hEdit, EM_SCROLLCARET, 0, 0);
}
else if (!bReentr)
{
HWND hTab = GetDlgItem(hDlg, tbAboutTabs);
int iPage = TabCtrl_GetCurSel(hTab);
int iFound = -1;
for (int s = 0; (iFound == -1) && (s <= 1); s++)
{
int iFrom = (s == 0) ? (iPage+1) : 0;
int iTo = (s == 0) ? (int)countof(Pages) : (iPage-1);
for (int i = iFrom; i < iTo; i++)
{
if (StrStrI(Pages[i].Title, pszPart)
|| StrStrI(Pages[i].Text, pszPart))
{
iFound = i; break;
}
}
}
if (iFound >= 0)
{
TabSelected(hDlg, iFound);
TabCtrl_SetCurSel(hTab, iFound);
//SetFocus(hEdit);
bRetry = true;
}
}
}
SafeFree(pszPart);
SafeFree(pszText);
if (bRetry)
{
searchProc(hDlg, hSearch, true);
}
}