当前位置: 首页>>代码示例>>C++>>正文


C++ ComboBox_ResetContent函数代码示例

本文整理汇总了C++中ComboBox_ResetContent函数的典型用法代码示例。如果您正苦于以下问题:C++ ComboBox_ResetContent函数的具体用法?C++ ComboBox_ResetContent怎么用?C++ ComboBox_ResetContent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ComboBox_ResetContent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PopulateForm

static void PopulateForm(void)
{
    int32_t i,j;
    char buf[64];
    int32_t mode2d, mode3d;
    HWND hwnd2d, hwnd3d;

    hwnd2d = GetDlgItem(pages[TAB_CONFIG], IDC2DVMODE);
    hwnd3d = GetDlgItem(pages[TAB_CONFIG], IDC3DVMODE);

    mode2d = checkvideomode(&settings.xdim2d, &settings.ydim2d, 8, settings.fullscreen, 1);
    mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, settings.bpp3d, settings.fullscreen, 1);
    if (mode2d < 0) mode2d = 0;
    if (mode3d < 0)
    {
        int32_t cd[] = { 32, 24, 16, 15, 8, 0 };
        for (i=0; cd[i];) {
            if (cd[i] >= settings.bpp3d) i++;
            else break;
        }
        for (; cd[i]; i++)
        {
            mode3d = checkvideomode(&settings.xdim3d, &settings.ydim3d, cd[i], settings.fullscreen, 1);
            if (mode3d < 0) continue;
            settings.bpp3d = cd[i];
            break;
        }
    }

    Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCFULLSCREEN), (settings.fullscreen ? BST_CHECKED : BST_UNCHECKED));
    Button_SetCheck(GetDlgItem(pages[TAB_CONFIG], IDCALWAYSSHOW), (settings.forcesetup ? BST_CHECKED : BST_UNCHECKED));

    (void)ComboBox_ResetContent(hwnd2d);
    (void)ComboBox_ResetContent(hwnd3d);
    for (i=0; i<validmodecnt; i++)
    {
        if (validmode[i].fs != settings.fullscreen) continue;

        // all modes get added to the 3D mode list
        Bsprintf(buf, "%d x %d %dbpp", validmode[i].xdim, validmode[i].ydim, validmode[i].bpp);
        j = ComboBox_AddString(hwnd3d, buf);
        (void)ComboBox_SetItemData(hwnd3d, j, i);
        if (i == mode3d)(void)ComboBox_SetCurSel(hwnd3d, j);

        // only 8-bit modes get used for 2D
        if (validmode[i].bpp != 8 || validmode[i].xdim < 640 || validmode[i].ydim < 480) continue;
        Bsprintf(buf, "%d x %d", validmode[i].xdim, validmode[i].ydim);
        j = ComboBox_AddString(hwnd2d, buf);
        (void)ComboBox_SetItemData(hwnd2d, j, i);
        if (i == mode2d)(void)ComboBox_SetCurSel(hwnd2d, j);
    }
}
开发者ID:Daedolon,项目名称:erampage,代码行数:52,代码来源:startwin.editor.c

示例2: EnumDrives

void EnumDrives(HWND hW)
{
 HWND hWC;char szB[256];int i=0,k=0,iNum;
 char * p, * pBuf, * pN;

 hWC=GetDlgItem(hW,IDC_DRIVE);
 ComboBox_ResetContent(hWC);
 ComboBox_AddString(hWC,"NONE");                       // add always existing 'none'

 wsprintf(szB,"[%d:%d:%d",iCD_AD,iCD_TA,iCD_LU);       // make current user info text

 pN=pBuf=(char *)malloc(32768);
 memset(pBuf,0,32768);
 iNum=GetGenCDDrives(pBuf);                            // get the system cd drives list

 for(i=0;i<iNum;i++)                                   // loop drives
  {
   ComboBox_AddString(hWC,pN);                         // -> add drive name
   p=strchr(pN,']');
   if(p)
    {
     *p=0;
     if(strcmp(szB,pN)==0) k=i+1;                      // -> is it the current user drive? sel it
     *p=']';
    }
   pN+=strlen(pN)+1;                                   // next drive in buffer
  }

 free(pBuf);

 ComboBox_SetCurSel(hWC,k);                            // do the drive sel
}
开发者ID:ACanadianKernel,项目名称:pcsx2,代码行数:32,代码来源:Cfg.c

示例3: DSN_Set_Database

void DSN_Set_Database(SQLHANDLE Connection)
{
  MADB_Stmt *Stmt= NULL;
  SQLRETURN ret= SQL_ERROR;
  char Database[65];
  MADB_Dsn *Dsn= (MADB_Dsn *)GetWindowLongPtr(GetParent(hwndTab[0]), DWLP_USER);
  

  if (DBFilled)
    return;

  GetDialogFields();
  
  if (SQLAllocHandle(SQL_HANDLE_STMT, Connection, (SQLHANDLE *)&Stmt) != SQL_SUCCESS)
    goto end;

  if (SQLExecDirect((SQLHSTMT)Stmt, (SQLCHAR *)"SHOW DATABASES", SQL_NTS) != SQL_SUCCESS)
    goto end;

  SQLBindCol(Stmt, 1, SQL_C_CHAR, Database, 65, 0);
  ComboBox_ResetContent(GetDlgItem(hwndTab[1], cbDatabase));
  while (SQLFetch(Stmt) == SQL_SUCCESS)
    ComboBox_InsertString(GetDlgItem(hwndTab[1], cbDatabase), -1, Database);
  if (Dsn->Catalog)
  {
    int Idx= ComboBox_FindString(GetDlgItem(hwndTab[2], cbDatabase), 0, Dsn->Catalog);
    ComboBox_SetCurSel(GetDlgItem(hwndTab[2], cbDatabase), Idx);
  }
  ComboBox_SetMinVisible(GetDlgItem(hwndTab[1], cbDatabase),5);
  DBFilled= TRUE;

end:
  if (Stmt)
	  SQLFreeHandle(SQL_HANDLE_STMT, (SQLHANDLE)Stmt);
}
开发者ID:ezhangle,项目名称:mariadb-connector-odbc,代码行数:35,代码来源:odbc_dsn.c

示例4: combobox

/**
   Processing commands for dbname combobox (hwndCtl).
*/
void processDbCombobox(HWND hwnd, HWND hwndCtl, UINT codeNotify)
{
  switch(codeNotify)
  {
    /* Loading list and adjust its height if button clicked and on user input */
    case(CBN_DROPDOWN):
    {
      FillParameters(hwnd, pParams);
      LIST *dbs= mygetdatabases(hwnd, pParams);
      LIST *dbtmp= dbs;

      ComboBox_ResetContent(hwndCtl);

      adjustDropdownHeight(hwndCtl,list_length(dbs));

      for (; dbtmp; dbtmp= list_rest(dbtmp))
        ComboBox_AddString(hwndCtl, (SQLWCHAR *)dbtmp->data);

      list_free(dbs, 1);

      ComboBox_SetText(hwndCtl,pParams->database);

      break;
    }
  }
}
开发者ID:mysql,项目名称:mysql-connector-odbc,代码行数:29,代码来源:odbcdialogparams.cpp

示例5: ComboBox_ResetContent

void plNoteTrackDlg::ILoadAnims()
{
    if(fAnimID < 0 || !fhAnim)
        return;

    ComboBox_ResetContent(fhAnim);

    // Add the default option
    int def = ComboBox_AddString(fhAnim, ENTIRE_ANIMATION_NAME);
    ComboBox_SetItemData(fhAnim, def, kDefault);
    ComboBox_SetCurSel(fhAnim, def);

    if (!fSegMap)
        return;

    const char *savedAnim = fPB->GetStr(fAnimID);
    if (!savedAnim)
        savedAnim = "";

    // Add the names of the animations
    for (SegmentMap::iterator it = fSegMap->begin(); it != fSegMap->end(); it++)
    {
        SegmentSpec *spec = it->second;
        if (spec->fType == SegmentSpec::kAnim)
        {
            int idx = ComboBox_AddString(fhAnim, spec->fName.c_str());
            ComboBox_SetItemData(fhAnim, idx, kName);

            // If this is the saved animation name, select it
            if (!spec->fName.Compare(savedAnim))
                ComboBox_SetCurSel(fhAnim, idx);
        }
    }
}
开发者ID:Asteral,项目名称:Plasma,代码行数:34,代码来源:plNotetrackDlg.cpp

示例6: ShowWindow

void SymbolMap::FillSymbolComboBox(HWND listbox,SymbolType symmask)
{
    ShowWindow(listbox,SW_HIDE);
    ComboBox_ResetContent(listbox);

    //int style = GetWindowLong(listbox,GWL_STYLE);

    ComboBox_AddString(listbox,"(0x02000000)");
    ComboBox_SetItemData(listbox,0,0x02000000);

    //ListBox_AddString(listbox,"(0x80002000)");
    //ListBox_SetItemData(listbox,1,0x80002000);

    SendMessage(listbox, WM_SETREDRAW, FALSE, 0);
    SendMessage(listbox, CB_INITSTORAGE, (WPARAM)entries.size(), (LPARAM)entries.size() * 30);
    for (size_t i = 0; i < entries.size(); i++)
    {
        if (entries[i].type & symmask)
        {
            char temp[256];
            sprintf(temp,"%s (%d)",entries[i].name,entries[i].size);
            int index = ComboBox_AddString(listbox,temp);
            ComboBox_SetItemData(listbox,index,entries[i].vaddress);
        }
    }
    SendMessage(listbox, WM_SETREDRAW, TRUE, 0);
    RedrawWindow(listbox, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);

    ShowWindow(listbox,SW_SHOW);
}
开发者ID:jeid3,项目名称:ppsspp,代码行数:30,代码来源:SymbolMap.cpp

示例7: GetDlgItem

/// <summary>
/// Retrieve process threads
/// </summary>
/// <returns>Error code</returns>
DWORD MainDlg::FillThreads()
{
    HWND hCombo = GetDlgItem( _hMainDlg, IDC_THREADS );
    int idx = 0;

    ComboBox_ResetContent( hCombo );

    auto tMain = _proc.threads().getMain();
    if (!tMain)
        return ERROR_NOT_FOUND;

    // Fake 'New thread'
    idx = ComboBox_AddString( hCombo, L"New thread" );
    ComboBox_SetItemData( hCombo, idx, 0 );
    ComboBox_SetCurSel( hCombo, idx );

    for (auto& thd : _proc.threads().getAll( true ))
    {
        wchar_t text[255] = { 0 };

        if (thd == *tMain)
            swprintf_s( text, L"Thread %d (Main)", thd.id() );
        else
            swprintf_s( text, L"Thread %d", thd.id() );

        idx = ComboBox_AddString( hCombo, text );
        ComboBox_SetItemData( hCombo, idx, thd.id() );
    }


    return 0;
}
开发者ID:hezzrrah,项目名称:Xenos,代码行数:36,代码来源:Routines.cpp

示例8: sizeof

/// <summary>
/// Enumerate processes
/// </summary>
/// <returns>Error code</returns>
DWORD MainDlg::FillProcessList()
{
    PROCESSENTRY32W pe32 = { 0 };
    pe32.dwSize = sizeof(pe32);

    HWND hCombo = GetDlgItem( _hMainDlg, IDC_COMBO_PROC );

    ComboBox_ResetContent( hCombo );

    HANDLE hSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
    if (hSnap == NULL)
        return GetLastError();

    for (BOOL res = Process32FirstW( hSnap, &pe32 ); res; res = Process32NextW( hSnap, &pe32 ))
    {
        wchar_t text[255] = { 0 };
        swprintf_s( text, L"%ls (%d)", pe32.szExeFile, pe32.th32ProcessID );

        int idx = ComboBox_AddString( hCombo, text );
        ComboBox_SetItemData( hCombo, idx, pe32.th32ProcessID );
    }

    CloseHandle( hSnap );

    return 0;
}
开发者ID:hezzrrah,项目名称:Xenos,代码行数:30,代码来源:Routines.cpp

示例9: ComboBox_ResetContent

	void CComWnd::com_update_item_list()
	{
		list_callback_ud ud;
		ud.that = this;

		struct {
			list_callback_ud::e_type type;
			i_com_list* plist;
			HWND hwnd;
		} ups[] = {
			{list_callback_ud::e_type::cp, _comm.comports()->update_list() , _hCP},
			{list_callback_ud::e_type::br, _comm.baudrates()->update_list() , _hBR},
			{list_callback_ud::e_type::pa, _comm.parities()->update_list() , _hPA},
			{list_callback_ud::e_type::sb, _comm.stopbits()->update_list() , _hSB},
			{list_callback_ud::e_type::db, _comm.databits()->update_list() , _hDB},
		};

		for(int i=0; i<sizeof(ups)/sizeof(*ups); i++){
			ud.type = ups[i].type;
			ud.hwnd = ups[i].hwnd;
			ComboBox_ResetContent(ud.hwnd);
			ups[i].plist->callback(&CComWnd::com_udpate_list_callback, &ud);
			if (ComboBox_GetCount(ud.hwnd) > 0){
				ComboBox_SetCurSel(ud.hwnd, 0);
			}
		}

		int ii = ComboBox_InsertString(_hBR, -1, "<输入>");
		ComboBox_SetItemData(_hBR, ii, 1);	// 1 - 自定义
	}
开发者ID:faver2014,项目名称:common,代码行数:30,代码来源:msg.cpp

示例10: ShowWindow

void SymbolMap::FillSymbolComboBox(HWND listbox,SymbolType symmask)
{
    ShowWindow(listbox,SW_HIDE);
    ComboBox_ResetContent(listbox);

    //int style = GetWindowLong(listbox,GWL_STYLE);

    ComboBox_AddString(listbox,"(0x02000000)");
    ComboBox_SetItemData(listbox,0,0x02000000);

    //ListBox_AddString(listbox,"(0x80002000)");
    //ListBox_SetItemData(listbox,1,0x80002000);

    for (size_t i = 0; i < entries.size(); i++)
    {
        if (entries[i].type & symmask)
        {
            char temp[256];
            sprintf(temp,"%s (%d)",entries[i].name,entries[i].size);
            int index = ComboBox_AddString(listbox,temp);
            ComboBox_SetItemData(listbox,index,entries[i].vaddress);
        }
    }

    ShowWindow(listbox,SW_SHOW);
}
开发者ID:HomerSp,项目名称:ppsspp,代码行数:26,代码来源:SymbolMap.cpp

示例11: ComboBox_ResetContent

bool CWinCombo::ResetContent()
{
	if(m_Hwnd)
	{
		ComboBox_ResetContent(m_Hwnd);
		return true;
	}
	else return false;
}
开发者ID:segafan,项目名称:wme1_jankavan_tlc_edition-repo,代码行数:9,代码来源:WinCombo.cpp

示例12: getDlgItem

void CAtmoLiveSettings::LoadDisplayList() {
     CAtmoDisplays *pAtmoDisplays = this->m_pDynData->getAtmoDisplays();
     HWND hwndCtrl;
     hwndCtrl = getDlgItem(IDC_DISPLAYS);

     ComboBox_ResetContent(hwndCtrl);

     for(int i=0;i<pAtmoDisplays->getCount();i++) {
         TAtmoDisplayInfo nfo = pAtmoDisplays->getDisplayInfo(i);
         ComboBox_AddString(hwndCtrl, nfo.infoText);
     }
     ComboBox_SetCurSel(hwndCtrl, m_pDynData->getAtmoConfig()->getLiveView_DisplayNr());
}
开发者ID:Nevcairiel,项目名称:atmowin,代码行数:13,代码来源:AtmoLiveSettings.cpp

示例13: ILoadCombo

    void ILoadCombo(HWND hWnd, int ctrlID, int paramID, IParamBlock2* pb, plNotetrackAnim& anim)
    {
        const char* savedName = pb->GetStr(paramID);
        HWND hCombo = GetDlgItem(hWnd, ctrlID);
        ComboBox_ResetContent(hCombo);

        plString animName;
        while (!(animName = anim.GetNextAnimName()).IsNull())
        {
            int sel = ComboBox_AddString(hCombo, animName.c_str());
            if (animName.Compare(savedName) == 0)
                ComboBox_SetCurSel(hCombo, sel);
        }
    }
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:14,代码来源:plTypesComponents.cpp

示例14: GetDlgItem

void plResponderWaitProc::LoadWho(bool setDefault)
{
    HWND hWho = GetDlgItem(fhDlg, IDC_WAIT_WHO);
    int who = fWaitPB->GetInt(kWaitWho);

    ComboBox_ResetContent(hWho);

    int numFound = 0;

    // Copy all the commands before this one to the 'who' combo box
    for (int i = 0; i < fCurCmd; i++)
    {
        IParamBlock2 *pb = GetCmdParams(i);
        plResponderCmd *cmd = plResponderCmd::Find(pb);

        if (cmd->IsWaitable(pb))
        {
            int idx = ComboBox_AddString(hWho, cmd->GetInstanceName(pb));
            ComboBox_SetItemData(hWho, idx, i);

            // If the saved 'who' is valid, select it and check the wait checkbox
            if (who == i)
            {
                ComboBox_SetCurSel(hWho, idx);
                CheckDlgButton(fhDlg, IDC_CHECK_WAIT, BST_CHECKED);
                EnableWindow(hWho, TRUE);
            }

            numFound++;
        }
    }

    // Pick the last item in the who combo as the default
    if (setDefault && numFound > 0)
    {
        HWND hWho = GetDlgItem(fhDlg, IDC_WAIT_WHO);
        int idx = ComboBox_GetItemData(hWho, numFound-1);
        fWaitPB->SetValue(kWaitWho, 0, idx);

        ComboBox_SetCurSel(hWho, numFound-1);
        CheckDlgButton(fhDlg, IDC_CHECK_WAIT, BST_CHECKED);
        EnableWindow(hWho, TRUE);
    }

    // Disable the wait checkbox if there are no waitable commands behind this one
    EnableWindow(GetDlgItem(fhDlg, IDC_CHECK_WAIT), (numFound > 0));
}
开发者ID:Hoikas,项目名称:Plasma,代码行数:47,代码来源:plResponderWait.cpp

示例15: Dlg_PopulateModuleList

VOID Dlg_PopulateModuleList(HWND hwnd) {

   HWND hwndModuleHelp = GetDlgItem(hwnd, IDC_MODULEHELP);
   ListBox_ResetContent(hwndModuleHelp);

   CToolhelp thProcesses(TH32CS_SNAPPROCESS);
   PROCESSENTRY32 pe = { sizeof(pe) };
   BOOL fOk = thProcesses.ProcessFirst(&pe);
   for (; fOk; fOk = thProcesses.ProcessNext(&pe)) {

      CToolhelp thModules(TH32CS_SNAPMODULE, pe.th32ProcessID);
      MODULEENTRY32 me = { sizeof(me) };
      BOOL fOk = thModules.ModuleFirst(&me);
      for (; fOk; fOk = thModules.ModuleNext(&me)) {
        int n = ListBox_FindStringExact(hwndModuleHelp, -1, me.szExePath);
         if (n == LB_ERR) {
            // This module hasn't been added before
            ListBox_AddString(hwndModuleHelp, me.szExePath);
         }
      }
   }

   HWND hwndList = GetDlgItem(hwnd, IDC_PROCESSMODULELIST);
   SetWindowRedraw(hwndList, FALSE);
   ComboBox_ResetContent(hwndList);
   int nNumModules = ListBox_GetCount(hwndModuleHelp);
   for (int i = 0; i < nNumModules; i++) {
      TCHAR sz[1024];
      ListBox_GetText(hwndModuleHelp, i, sz);
      // Place module name (without its path) in the list
      int nIndex = ComboBox_AddString(hwndList, _tcsrchr(sz, TEXT('\\')) + 1);
      // Associate the index of the full path with the added item
      ComboBox_SetItemData(hwndList, nIndex, i);
   }

   ComboBox_SetCurSel(hwndList, 0);  // Select the first entry

   // Simulate the user selecting this first item so that the
   // results pane shows something interesting
   FORWARD_WM_COMMAND(hwnd, IDC_PROCESSMODULELIST, 
      hwndList, CBN_SELCHANGE, SendMessage);

   SetWindowRedraw(hwndList, TRUE);
   InvalidateRect(hwndList, NULL, FALSE);
}
开发者ID:melvinvarkey,项目名称:ANCI_C_Training,代码行数:45,代码来源:ProcessInfo.cpp


注:本文中的ComboBox_ResetContent函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。