示例#1
0
/*
 *	このプログラムの初期化処理
 *	主に、設定ファイルからの読み込みと反映
 */
BOOL InitApplication(HWND hDlg)
{
	HWND hCombo;
	char buffer[256]="";

	/*設定ファイルの保存場所の設定*/
	InitIniFilePath(ini_filepath);

	/*基本的な設定の読み込み、設定*/
	LoadConfig(GetDlgItem(hDlg,IDC_MAILFROM),"MAIL","MAIL FROM",ini_filepath);
	LoadConfig(GetDlgItem(hDlg,IDC_MAILTO),"MAIL","MAIL TO",ini_filepath);
	LoadConfig(GetDlgItem(hDlg,IDC_SENDER),"MAIL","FROM",ini_filepath);
	LoadConfig(GetDlgItem(hDlg,IDC_DNSSERVER),"OPTION","DNS SERVER",ini_filepath);
	LoadConfig(GetDlgItem(hDlg,IDC_PCNAME),"OPTION","PC NAME",ini_filepath);

	/*メールの優先度の初期化*/
	hCombo = GetDlgItem(hDlg,IDC_MAILPRIORITY);
	ComboBox_AddString(hCombo,"1 (Highest)");
	ComboBox_AddString(hCombo,"2 (High)");
	ComboBox_AddString(hCombo,"3 (Normal)");
	ComboBox_AddString(hCombo,"4 (Low)");
	ComboBox_AddString(hCombo,"5 (Lowest)");
	
	/*優先度の3,Normalを初期で選択する*/
	ComboBox_SetCurSel(hCombo,2);

	/*結果を表示するスタティックテキストの初期化*/
	StringTableSetWindowText(GetDlgItem(hDlg,IDC_RESULT),IDS_READY);

	return TRUE;
}
示例#2
0
void ComboBoxArray_AddSoundFiles(HWND boxes[], int num)
{
	int i;
	char search[MAX_PATH];
	HANDLE hFind;
	WIN32_FIND_DATA FindFileData;
	memcpy(search, api.root, api.root_len);
	memcpy(search+api.root_len, "/waves/*", 9);
	for(i=0; i<num; ++i)
		ComboBox_AddString(boxes[i],"<  no sound  >");
	if((hFind=FindFirstFile(search, &FindFileData)) != INVALID_HANDLE_VALUE) {
		do{
			if(!(FindFileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) { // only files (also ignores . and ..)
				for(i=0; i<num; ++i)
					ComboBox_AddString(boxes[i], FindFileData.cFileName);
			}
		}while(FindNextFile(hFind, &FindFileData));
		FindClose(hFind);
	}
	for(i=0; i<num; ++i){
		if(ComboBox_GetTextLength(boxes[i])){
			ComboBox_GetText(boxes[i], search, sizeof(search));
			ComboBox_AddStringOnce(boxes[i], search, 1);
		}else
			ComboBox_SetCurSel(boxes[i], 0);
	}
}
示例#3
0
ATMO_BOOL CDmxConfigDialog::InitDialog(WPARAM wParam) {

        m_hCbxComports = getDlgItem(IDC_COMPORT);
        InitDialog_ComPorts( m_hCbxComports );

        int com = m_pConfig->getComport() - 1;
        if(com < 0) com = 0;
        ComboBox_SetCurSel(m_hCbxComports, com);

        m_hCbxBaudrate = getDlgItem(IDC_BAUDRATE);
        ComboBox_AddString(m_hCbxBaudrate, "115200");
        ComboBox_AddString(m_hCbxBaudrate, "250000");
        ComboBox_SetCurSel(m_hCbxBaudrate, m_pConfig->getDMX_BaudrateIndex());


        char buf[10];

        HWND control;

        control = getDlgItem(IDC_EDT_DMX_BASE);
        Edit_LimitText( control , 256);
        Edit_SetText(control, m_pConfig->getDMX_BaseChannels() );

        control = getDlgItem(IDC_EDT_DMX_RGB);
        Edit_LimitText(control, 2);
        sprintf(buf,"%d",m_pConfig->getDMX_RGB_Channels());
        Edit_SetText(control, buf);

        return ATMO_FALSE;
}
示例#4
0
/*------------------------------------------------------------------------------------------------------------------
--      FUNCTION: Init_Settings
--
--      DATE: Febuary 3, 2014
--      REVISIONS: none
--
--      DESIGNER: Ramzi Chennafi
--      PROGRAMMER: Ramzi Chennafi
--
--      INTERFACE: void Init_Settings(HWND hwnd)

--      RETURNS: void
--
--      NOTES:
--      Draws the default connection settings to the Settings dialog box. Takes the parent HWND as an argument in order
--		to retrieve the current settings.
----------------------------------------------------------------------------------------------------------------------*/
void Init_Settings(HWND hwnd){
	HWND hDlgPTCL	= GetDlgItem(hwnd, IDC_PROTSLT);
	HWND hDlgPORT	= GetDlgItem(hwnd, IDC_PORT);
	HWND hDlgIP		= GetDlgItem(hwnd, IDC_IP);
	HWND hDlgSAVE	= GetDlgItem(hwnd, IDC_SDISPLAY);
	HWND hDlgSPORT	= GetDlgItem(hwnd, IDC_SPORT);
	HWND hDlgSPRTCL	= GetDlgItem(hwnd, IDC_SPRTCL);
	HWND hDlgPCKT   = GetDlgItem(hwnd, IDC_PACKETSIZE);
	HWND hDlgTTS	= GetDlgItem(hwnd, IDC_TTS);
	SETTINGS * st = (SETTINGS*) GetClassLongPtr(GetParent(hwnd), 0);
	
	char * packetsizes[] = { "1024", "4096", "20000", "60000"};
	for (int i = 0; i < 4; i++){
		ComboBox_AddString(hDlgPCKT, packetsizes[i]);
	}
	ComboBox_SetCurSel(hDlgPCKT, st->packet_size);
	
	ComboBox_AddString(hDlgSPRTCL, "TCP");
	ComboBox_AddString(hDlgSPRTCL, "UDP");
	ComboBox_SetCurSel(hDlgSPRTCL, st->protocol);
	
	Edit_SetText(hDlgTTS, st->times_to_send);
	Edit_SetText(hDlgSPORT, st->server_port);
	Edit_SetText(hDlgPORT, st->client_port);
	Edit_SetText(hDlgIP, st->client_send_ip);
}
示例#5
0
文件: Win32.cpp 项目: Aced14/pcsx2
void OnInitDialog(HWND hW) {
	char *dev;
	//int i;

	LoadConf();

	ComboBox_AddString(GetDlgItem(hW, IDC_BAYTYPE), "Expansion");
	ComboBox_AddString(GetDlgItem(hW, IDC_BAYTYPE), "PC Card");
	for (int j=0;j<2;j++)
	{
	for (int i=0; i<pcap_io_get_dev_num(); i++) {
		dev = pcap_io_get_dev_desc(i,j);
		int itm=ComboBox_AddString(GetDlgItem(hW, IDC_ETHDEV), dev);
		ComboBox_SetItemData(GetDlgItem(hW, IDC_ETHDEV),itm,strdup(pcap_io_get_dev_name(i,j)));
		if (strcmp(pcap_io_get_dev_name(i,j), config.Eth) == 0) {
			ComboBox_SetCurSel(GetDlgItem(hW, IDC_ETHDEV), itm);
		}
	}
	}
	vector<tap_adapter> * al=GetTapAdapters();
	for (size_t i=0; i<al->size(); i++) {
		
		int itm=ComboBox_AddString(GetDlgItem(hW, IDC_ETHDEV), al[0][i].name.c_str());
		ComboBox_SetItemData(GetDlgItem(hW, IDC_ETHDEV),itm,strdup( al[0][i].guid.c_str()));
		if (strcmp(al[0][i].guid.c_str(), config.Eth) == 0) {
			ComboBox_SetCurSel(GetDlgItem(hW, IDC_ETHDEV), itm);
		}
	}

	Edit_SetText(GetDlgItem(hW, IDC_HDDFILE), config.Hdd);

	Button_SetCheck(GetDlgItem(hW, IDC_ETHENABLED), config.ethEnable);
	Button_SetCheck(GetDlgItem(hW, IDC_HDDENABLED), config.hddEnable);
}
示例#6
0
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);
}
示例#7
0
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);
        }
    }
}
示例#8
0
/*------------------------------------------------
--------------------------------------------------*/
int CALLBACK EnumSizeProcEx(const LOGFONT* lpelfe, const TEXTMETRIC* lpntme, DWORD FontType, LPARAM lParam)
{
	HWND hwndSize = (HWND)lParam;
	const unsigned char nFontSizes[] = {4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,32,36,48,72};
	wchar_t str[8];
	int i, size, count;
	(void)lpelfe;
	
	// is modern font which supports any size?
	if((FontType&TRUETYPE_FONTTYPE) || !(FontType&RASTER_FONTTYPE)) {
		for(i=0; i<_countof(nFontSizes); ++i) {
			wsprintf(str, FMT("%hu"), nFontSizes[i]);
			ComboBox_AddString(hwndSize, str);
		}
		return 0;
	}
	
	// only add supported sizes for raster type fonts
	size = (lpntme->tmHeight - lpntme->tmInternalLeading) * 72 / m_logpixelsy;
	count = ComboBox_GetCount(hwndSize);
	for(i=0; i<count; ++i) { // dupes check + sorting
		ComboBox_GetLBText(hwndSize, i, str);
		if(size == _wtoi(str))
			return 1;
		else if(size < _wtoi(str)) {
			wsprintf(str, FMT("%d"), size);
			ComboBox_InsertString(hwndSize, i, str);
			return 1;
		}
	}
	wsprintf(str, FMT("%d"), size);
	ComboBox_AddString(hwndSize, str);
	return 1;
}
示例#9
0
/// <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;
}
示例#10
0
void plMtlAnimProc::ILoadAnimCombo(HWND hWnd, IParamBlock2* pb)
{
    HWND hAnim = GetDlgItem(hWnd, fAnimComboID);

    ComboBox_ResetContent(hAnim);
    int sel = ComboBox_AddString(hAnim, ENTIRE_ANIMATION_NAME);
    ComboBox_SetCurSel(hAnim, sel);
    
    const char* savedName = pb->GetStr(fAnimParamID);
    if (!savedName)
        savedName = "";

    Mtl* mtl = IGetMtl(pb);
    if (mtl)
    {
        plNotetrackAnim anim(mtl, nil);
        plString animName;
        while (!(animName = anim.GetNextAnimName()).IsNull())
        {
            int idx = ComboBox_AddString(hAnim, animName.c_str());
            ComboBox_SetItemData(hAnim, idx, 1);
            if (!animName.Compare(savedName))
                ComboBox_SetCurSel(hAnim, idx);
        }

        EnableWindow(hAnim, TRUE);
    }
    else
        EnableWindow(hAnim, FALSE);

    // Update the dependencies of this
    ILoadUser(hWnd, pb);
}
示例#11
0
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
}
示例#12
0
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);
}
示例#13
0
void CCreateBoundingWindow::Init()
{
	ComboBox_AddString(mBoundingCategoryComboBox, TEXT("Box"));
	ComboBox_AddString(mBoundingCategoryComboBox, TEXT("Sphere"));
	ComboBox_AddString(mBoundingCategoryComboBox, TEXT("Cylinder"));

	ComboBox_SetCurSel(mBoundingCategoryComboBox, 0);
}
示例#14
0
//================================================================================================
//--------------------+++--> Initialize options dialog & customize T-Clock controls as required:
static void OnInit(HWND hDlg)   //----------------------------------------------------------+++-->
{
	HWND week_cb = GetDlgItem(hDlg, IDC_FIRSTWEEK);
	HWND day_cb = GetDlgItem(hDlg, IDC_FIRSTDAY);
	UINT iter;
	if(api.OS >= TOS_VISTA && !api.GetIntEx(L"Calendar",L"bCustom",0)){
		for(iter=GROUP_CALENDAR; iter<=GROUP_CALENDAR_END; ++iter) EnableDlgItem(hDlg,iter,0);
		CheckDlgButton(hDlg,IDCB_USECALENDAR, 0);
	}else CheckDlgButton(hDlg,IDCB_USECALENDAR, 1);
	if(api.OS >= TOS_WIN10){
		int old_calendar = api.GetSystemInt(HKEY_LOCAL_MACHINE, kSectionImmersiveShell, kKeyWin32Tray, 0);
		CheckDlgButton(hDlg, IDC_OLDCALENDAR, old_calendar);
	}else
		EnableDlgItem(hDlg, IDC_OLDCALENDAR, 0);
	/// on Calendar defaults change, also update the Calendar itself to stay sync!
	CheckDlgButton(hDlg, IDCB_SHOW_DOY, api.GetIntEx(L"Calendar",L"ShowDayOfYear",1));
	CheckDlgButton(hDlg, IDCB_SHOWWEEKNUMS, api.GetIntEx(L"Calendar",L"ShowWeekNums",0));
	CheckDlgButton(hDlg, IDCB_CLOSECAL, api.GetIntEx(L"Calendar",L"CloseCalendar",1));
	CheckDlgButton(hDlg, IDCB_CALTOPMOST, api.GetIntEx(L"Calendar",L"CalendarTopMost",0));
#	ifdef WIN2K_COMPAT
	CheckDlgButton(hDlg, IDCB_TRANS2KICONS, api.GetInt(L"Desktop",L"Transparent2kIconText",0));
#	endif // WIN2K_COMPAT
	CheckDlgButton(hDlg, IDCB_MONOFF_ONLOCK, api.GetInt(L"Desktop",L"MonOffOnLock",0));
	CheckDlgButton(hDlg, IDCB_MULTIMON, api.GetInt(L"Desktop",L"Multimon",1));
	
	SendDlgItemMessage(hDlg,IDC_CALMONTHSPIN,UDM_SETRANGE32,1,12);
	SendDlgItemMessage(hDlg,IDC_CALMONTHSPIN,UDM_SETPOS32,0,api.GetInt(L"Calendar",L"ViewMonths",3));
	SendDlgItemMessage(hDlg,IDC_CALMONTHPASTSPIN,UDM_SETRANGE32,0,2);
	SendDlgItemMessage(hDlg,IDC_CALMONTHPASTSPIN,UDM_SETPOS32,0,api.GetInt(L"Calendar",L"ViewMonthsPast",1));
	
	ComboBox_AddString(week_cb, L"week containing January 1 (USA)");
	ComboBox_AddString(week_cb, L"first full week");
	ComboBox_AddString(week_cb, L"first week with four days (EU)");
	ComboBox_SetCurSel(week_cb, GetInternationalInt(L"iFirstWeekOfYear"));
	ComboBox_AddString(day_cb, L"Monday");
	ComboBox_AddString(day_cb, L"Tuesday");
	ComboBox_AddString(day_cb, L"Wednesday");
	ComboBox_AddString(day_cb, L"Thursday");
	ComboBox_AddString(day_cb, L"Friday");
	ComboBox_AddString(day_cb, L"Saturday");
	ComboBox_AddString(day_cb, L"Sunday");
	ComboBox_SetCurSel(day_cb, GetInternationalInt(L"iFirstDayOfWeek"));
	
	if(api.OS > TOS_2000) {
		for(iter=IDCB_TRANS2KICONS_GRP; iter<=IDCB_TRANS2KICONS; ++iter)
			EnableDlgItem(hDlg,iter,FALSE);
	}else{
		for(iter=IDCB_MONOFF_ONLOCK_GRP; iter<=IDCB_MONOFF_ONLOCK; ++iter)
			EnableDlgItem(hDlg,iter,FALSE);
	}
	if(api.OS < TOS_WIN8){
		for(iter=IDCB_MULTIMON_GRP; iter<=IDCB_MULTIMON; ++iter)
			EnableDlgItem(hDlg,iter,FALSE);
		if(api.OS < TOS_VISTA){
			EnableDlgItem(hDlg, IDCB_USECALENDAR, FALSE);
		}
	}
}
示例#15
0
void CDialogInstall::TabContents::Create(HWND owner)
{
	Tab::CreateTabWindow(10, 50, 380, 135, owner);

	static const ControlTemplate::Control s_Controls[] =
	{
		CT_LABEL(-1, 6,
			0, 3, 107, 9,
			WS_VISIBLE, 0),

		CT_COMBOBOX(Id_LanguageComboBox, 0,
			107, 0, 222, 14,
			WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL, 0),

		CT_LABEL(-1, 17,
			0, 21, 107, 9,
			WS_VISIBLE, 0),

		CT_COMBOBOX(Id_InstallationTypeComboBox, 0,
			107, 18, 222, 14,
			WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST | WS_VSCROLL, 0),

		CT_LABEL(-1, 7,
			0, 43, 107, 9,
			WS_VISIBLE, 0),

		CT_EDIT(Id_DestinationEdit, 14,
			107, 40, 192, 14,
			WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_READONLY, WS_EX_CLIENTEDGE),

		CT_BUTTON(Id_DestinationBrowseButton, 9,
			303, 40, 25, 14,
			WS_VISIBLE | WS_TABSTOP, 0),

		CT_CHECKBOX(Id_LaunchOnLoginCheckBox, 10,
			0, 69, 250, 9,
			WS_VISIBLE | WS_TABSTOP, 0),
	};

	CreateControls(s_Controls, _countof(s_Controls), c_Dialog->m_Font, GetString);
	
	HWND item = GetControl(Id_LanguageComboBox);
	ComboBox_AddString(item, L"English - English (United States)");
	ComboBox_SetCurSel(item, 0);

	item = GetControl(Id_InstallationTypeComboBox);
	ComboBox_AddString(item, L"Standard 64-bit installation (reccomended)");
	ComboBox_SetItemData(item, 0, MAKELPARAM(InstallType::Standard, InstallArch::X64));
	ComboBox_AddString(item, L"Standard 32-bit installation");
	ComboBox_SetItemData(item, 1, MAKELPARAM(InstallType::Standard, InstallArch::X32));
	ComboBox_AddString(item, L"Portable 64-bit installation");
	ComboBox_SetItemData(item, 2, MAKELPARAM(InstallType::Portable, InstallArch::X64));
	ComboBox_AddString(item, L"Portable 32-bit installation");
	ComboBox_SetItemData(item, 3, MAKELPARAM(InstallType::Portable, InstallArch::X32));
	ComboBox_SetCurSel(item, 0);
}
	void NewTerrainWindow::addDropdownListPair(const std::string& name, std::vector<UINT> listData)
	{
		const UINT count			  = (UINT)m_items.size();
		const UINT width			  = 2 * m_dropdownListWidth + m_itemMargin;
			  UINT x				  = m_itemMargin;
			  UINT y				  = (count / 2) * (m_dropdownListTextSize + m_dropdownListHeight + m_itemMargin) + m_itemMargin;
		const UINT id				  = m_itemIDStart + count;
		const UINT dropdownListHeight = 200;

		HWND hText = CreateWindow("STATIC", name.c_str(), WS_VISIBLE | WS_CHILD,
								  x, y, width, m_dropdownListTextSize,
								  m_hWnd, NULL, m_hInstance, NULL);

		HFONT hFont = CreateFont(m_dropdownListTextSize, 0, 0, 0, FW_MEDIUM, FALSE, FALSE, FALSE,
								 ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
								 DEFAULT_PITCH | FF_DONTCARE, "Tahoma");
		SendMessage(hText, WM_SETFONT, (WPARAM)hFont, TRUE);

		y += m_dropdownListTextSize;

		HWND hDropdownList1 = CreateWindow("COMBOBOX", "", WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | CBS_DROPDOWNLIST,
									       x, y, m_dropdownListWidth, dropdownListHeight, m_hWnd, (HMENU)id, m_hInstance, NULL);

		x += m_dropdownListWidth + m_itemMargin;

		HWND hDropdownList2 = CreateWindow("COMBOBOX", "", WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | CBS_DROPDOWNLIST,
									       x, y, m_dropdownListWidth, dropdownListHeight, m_hWnd, (HMENU)(id + 1), m_hInstance, NULL);

		hFont = CreateFont(14, 0, 0, 0, FW_MEDIUM, FALSE, FALSE, FALSE,
						   ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
						   DEFAULT_PITCH | FF_DONTCARE, "Tahoma");
		SendMessage(hDropdownList1, WM_SETFONT, (WPARAM)hFont, TRUE);
		SendMessage(hDropdownList2, WM_SETFONT, (WPARAM)hFont, TRUE);

		m_items.push_back(EventElement(name, nullptr));
		m_items.push_back(EventElement(name, nullptr));

		for (std::vector<UINT>::iterator it = listData.begin(); it != listData.end(); it++)
		{
			std::string element = std::to_string((long double)(*it));
			ComboBox_AddString(hDropdownList1, element.c_str());
			ComboBox_AddString(hDropdownList2, element.c_str());

			if (it == listData.begin())
			{
				ComboBox_SelectString(hDropdownList1, -1, element.c_str());
				ComboBox_SelectString(hDropdownList2, -1, element.c_str());
			}
		}

		m_clientHeight += m_dropdownListTextSize + m_dropdownListHeight + m_itemMargin;

		const POINT windowSize	   = getWindowSize();
		const POINT windowPosition = getWindowPosition();
		SetWindowPos(m_hWnd, HWND_TOP, windowPosition.x, windowPosition.y, windowSize.x, windowSize.y, NULL);
	}
示例#17
0
BOOL Dlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) 
{
   chSETDLGICONS(hwnd, IDI_JOBLAB);

   // Save our window handle so that the completion port thread can access it
   g_hwnd = hwnd; 
   
   HWND hwndPriorityClass = GetDlgItem(hwnd, IDC_PRIORITYCLASS);
   ComboBox_AddString(hwndPriorityClass, TEXT("No limit"));
   ComboBox_AddString(hwndPriorityClass, TEXT("Idle"));
   ComboBox_AddString(hwndPriorityClass, TEXT("Below normal"));
   ComboBox_AddString(hwndPriorityClass, TEXT("Normal"));
   ComboBox_AddString(hwndPriorityClass, TEXT("Above normal"));
   ComboBox_AddString(hwndPriorityClass, TEXT("High"));
   ComboBox_AddString(hwndPriorityClass, TEXT("Realtime"));
   ComboBox_SetCurSel(hwndPriorityClass, 0); // Default to "No Limit"

   HWND hwndSchedulingClass = GetDlgItem(hwnd, IDC_SCHEDULINGCLASS);
   ComboBox_AddString(hwndSchedulingClass, TEXT("No limit"));
   for (int n = 0; n <= 9; n++) {
      TCHAR szSchedulingClass[2];
      StringCchPrintf(szSchedulingClass, _countof(szSchedulingClass), 
         TEXT("%u"), n);
      ComboBox_AddString(hwndSchedulingClass, szSchedulingClass);
   }
   ComboBox_SetCurSel(hwndSchedulingClass, 0); // Default to "No Limit"
   SetTimer(hwnd, 1, 10000, NULL);             // 10 second accounting update
   return(TRUE);
}
示例#18
0
void CFixApp::PopulateDialog()
{
    //Populate the GUI scale combobox
    for (size_t i = 1; i < 6; i++)
    {
        wchar_t szBuf[3];
        swprintf_s(szBuf, L"x%Iu", i);
        ComboBox_AddString(m_hWndCBGUIScales, szBuf);
    }
    ComboBox_SetCurSel(m_hWndCBGUIScales, 0);

    //Populate the resolution combobox
    DEVMODE dm = {};
    dm.dmSize = sizeof(dm);
    Resolution r= {};
    for(DWORD iModeNum = 0; EnumDisplaySettings(NULL, iModeNum, &dm) != FALSE; iModeNum++)
    {
        if((dm.dmPelsWidth != r.iX || dm.dmPelsHeight != r.iY) && dm.dmBitsPerPel == 32) //Only add each res once, but don't actually check if it matches the current color depth/refresh rate
        {
            r.iX = dm.dmPelsWidth;
            r.iY = dm.dmPelsHeight;
            m_Resolutions.push_back(r);

            wchar_t szBuffer[20];
            _snwprintf_s(szBuffer, _TRUNCATE, L"%Iux%Iu", r.iX, r.iY);
            int iIndex = ComboBox_AddString(m_hWndCBResolutions, szBuffer);
            ComboBox_SetItemData(m_hWndCBResolutions, iIndex, &(m_Resolutions.back()));
        }
    }
    ComboBox_SetCurSel(m_hWndCBResolutions, 0);


    //Renderers (based on UnEngineWin.h), requires appInit() to have been called
    TArray<FRegistryObjectInfo> Classes;
    Classes.Empty();

    UObject::GetRegistryObjects( Classes, UClass::StaticClass(), URenderDevice::StaticClass(), 0 );
    for( TArray<FRegistryObjectInfo>::TIterator It(Classes); It; ++It )
    {
        FString Path = It->Object, Left, Right;
        if( Path.Split(L".",&Left,&Right)  )
        {
            const wchar_t* pszDesc = Localize(*Right,L"ClassCaption",*Left);
            assert(pszDesc);
            if(ComboBox_FindStringExact(m_hWndCBRenderers, -1, pszDesc) == CB_ERR)
            {
                ComboBox_AddString(m_hWndCBRenderers, pszDesc);
                m_Renderers.emplace_back(static_cast<wchar_t*>(Path.GetCharArray().GetData()));
            }
        }
    }

}
示例#19
0
//-----------------------------------------------------------------------------
// Name: Init
// Object: vars init. Called at WM_INITDIALOG
// Parameters :
//     in  : 
//     out :
//     return : 
//-----------------------------------------------------------------------------
void CFilters::Init()
{
    // add values to combo before loading options
    HWND hWndComboFlags=GetDlgItem(this->hWndDialog,IDC_COMBO_FILTERS_FLAGS);
    ComboBox_AddString(hWndComboFlags,HEAP_WALKER_MEMORY_FLAG_ALL);
    ComboBox_AddString(hWndComboFlags,HEAP_WALKER_MEMORY_FLAG_FIXED);
    ComboBox_AddString(hWndComboFlags,HEAP_WALKER_MEMORY_FLAG_MOVABLE);
    ComboBox_AddString(hWndComboFlags,HEAP_WALKER_MEMORY_FLAG_FREE);

    // load options
    this->LoadOptions();
}
示例#20
0
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);
    }
}
示例#21
0
void plExportDlgImp::IInitDlg(HWND hDlg)
{
    // Set the client path
    const char* path = plMaxConfig::GetClientPath(false, true);
    SetDlgItemText(hDlg, IDC_CLIENT_PATH, path);

    // Set the preshade button
    CheckDlgButton(hDlg, IDC_PRESHADE_CHECK, fPreshade ? BST_CHECKED : BST_UNCHECKED);
    CheckDlgButton(hDlg, IDC_PHYSICAL_CHECK, fPhysicalsOnly ? BST_CHECKED : BST_UNCHECKED);
    CheckDlgButton(hDlg, IDC_LIGHTMAP_CHECK, fLightMap ? BST_CHECKED : BST_UNCHECKED);

    char buf[256];
    sprintf(buf, "Last export took %d:%02d", fLastExportTime/60, fLastExportTime%60);
    SetDlgItemText(hDlg, IDC_LAST_EXPORT, buf);

    SetWindowPos(hDlg, NULL, fXPos, fYPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);

    //
    // Get the names of all the pages in this scene and put them in the combo
    //
    HWND hPages = GetDlgItem(hDlg, IDC_PAGE_COMBO);
    ComboBox_AddString(hPages, kAllPages);

    bool foundPage = false;

    CompSet comps;
    GetPagesRecur((plMaxNode*)GetCOREInterface()->GetRootNode(), comps);
    for (CompSet::iterator it = comps.begin(); it != comps.end(); it++)
    {
        const char* page = LocCompGetPage(*it);
        if (page)
        {
            int idx = ComboBox_AddString(hPages, page);
            if (!strcmp(page, fExportPage))
            {
                foundPage = true;
                ComboBox_SetCurSel(hPages, idx);
            }
        }
    }

    if (!foundPage)
    {
        fExportPage[0] = '\0';
        ComboBox_SetCurSel(hPages, 0);
    }

    CheckRadioButton(hDlg, IDC_RADIO_FILE, IDC_RADIO_DIR, IDC_RADIO_FILE);
    IGetRadio(hDlg);

    SetDlgItemText(hDlg, IDC_EXPORT_PATH, fExportSourceDir);
}
示例#22
0
// Detect TeX editors installed on the system and construct the
// corresponding inverse search commands.
//
// Parameters:
//      hwndCombo   -- (optional) handle to a combo list that will be filled with the list of possible inverse search commands.
// Returns:
//      the inverse search command of the first detected editor (the caller needs to free() the result).
WCHAR *AutoDetectInverseSearchCommands(HWND hwndCombo)
{
    WCHAR *firstEditor = NULL;
    ScopedMem<WCHAR> path(NULL);

    const WCHAR *editorToSkip = NULL;

    for (int i = 0; i < dimof(editor_rules); i++)
    {
        if (editorToSkip && str::Eq(editorToSkip, editor_rules[i].Name))
            continue;
        editorToSkip = NULL;

        path.Set(ReadRegStr(editor_rules[i].RegRoot, editor_rules[i].RegKey, editor_rules[i].RegValue));
        if (!path)
            continue;

        WCHAR *exePath;
        if (editor_rules[i].Type == SiblingPath) {
            // remove file part
            ScopedMem<WCHAR> dir(path::GetDir(path));
            exePath = path::Join(dir, editor_rules[i].BinaryFilename);
        } else if (editor_rules[i].Type == BinaryDir)
            exePath = path::Join(path, editor_rules[i].BinaryFilename);
        else // if (editor_rules[i].Type == BinaryPath)
            exePath = str::Dup(path);

        WCHAR *editorCmd = str::Format(L"\"%s\" %s", exePath, editor_rules[i].InverseSearchArgs);
        free(exePath);

        if (!hwndCombo) {
            // no need to fill a combo box: return immeditately after finding an editor.
            return editorCmd;
        }

        if (!firstEditor)
            firstEditor = str::Dup(editorCmd);
        ComboBox_AddString(hwndCombo, editorCmd);
        free(editorCmd);

        // skip the remaining rules for this editor
        editorToSkip = editor_rules[i].Name;
    }

    // Fall back to notepad as a default handler
    if (!firstEditor) {
        firstEditor = str::Dup(L"notepad %f");
        if (hwndCombo)
            ComboBox_AddString(hwndCombo, firstEditor);
    }
    return firstEditor;
}
示例#23
0
/*****************************************************************************
 * ModuleConfigControl implementation
 *****************************************************************************/
ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this,
                                          module_config_t *p_item,
                                          HWND parent, HINSTANCE hInst,
                                          int * py_pos )
  : ConfigControl( p_this, p_item, parent, hInst )
{
    module_t **p_list;
    module_t *p_parser;

    label = CreateWindow( _T("STATIC"), _FROMMB(p_item->psz_text),
                          WS_CHILD | WS_VISIBLE | SS_LEFT,
                          5, *py_pos, 200, 15,
                          parent, NULL, hInst, NULL );

    *py_pos += 15 + 10;

    combo = CreateWindow( _T("COMBOBOX"), _T(""),
                          WS_CHILD | WS_VISIBLE | CBS_AUTOHSCROLL |
                          CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL,
                          20, *py_pos, 180, 5*15 + 6,
                          parent, NULL, hInst, NULL);

    *py_pos += 15 + 10;

    /* build a list of available modules */
    p_list = module_list_get( NULL );
    ComboBox_AddString( combo, _T("Default") );
    ComboBox_SetItemData( combo, 0, (void *)NULL );
    ComboBox_SetCurSel( combo, 0 );
    //ComboBox_SetText( combo, _T("Default") );

    for( size_t i_index = 0; p_list[i_index]; i_index++ )
    {
        p_parser = p_list[i_index];

        if( module_provides( p_parser, p_item->psz_type ) )
        {
            ComboBox_AddString( combo, _FROMMB(module_GetLongName( p_parser ) ));
            ComboBox_SetItemData( combo, i_index,
                                  (void *) module_get_object( p_parser ) );
            if( p_item->value.psz && !strcmp( p_item->value.psz,
                                             module_get_object( p_parser )) )
            {
                ComboBox_SetCurSel( combo, i_index );
                //ComboBox_SetText( combo, _FROMMB( module_GetLongName(p_parser)) );
            }
        }
    }
    module_list_free( p_list );
}
示例#24
0
// Detect TeX editors installed on the system and construct the
// corresponding inverse search commands.
//
// Parameters:
//      hwndCombo   -- (optional) handle to a combo list that will be filled with the list of possible inverse search commands.
// Returns:
//      the inverse search command of the first detected editor (the caller needs to free() the result).
WCHAR *AutoDetectInverseSearchCommands(HWND hwndCombo)
{
    WCHAR *firstEditor = NULL;
    WStrList foundExes;

    for (int i = 0; i < dimof(editor_rules); i++) {
        ScopedMem<WCHAR> path(ReadRegStr(editor_rules[i].RegRoot, editor_rules[i].RegKey, editor_rules[i].RegValue));
        if (!path)
            continue;

        ScopedMem<WCHAR> exePath;
        if (editor_rules[i].Type == SiblingPath) {
            // remove file part
            ScopedMem<WCHAR> dir(path::GetDir(path));
            exePath.Set(path::Join(dir, editor_rules[i].BinaryFilename));
        }
        else if (editor_rules[i].Type == BinaryDir)
            exePath.Set(path::Join(path, editor_rules[i].BinaryFilename));
        else // if (editor_rules[i].Type == BinaryPath)
            exePath.Set(path.StealData());
        // don't show duplicate entries
        if (foundExes.FindI(exePath) != -1)
            continue;
        // don't show inexistent paths (and don't try again for them)
        if (!file::Exists(exePath)) {
            foundExes.Append(exePath.StealData());
            continue;
        }

        ScopedMem<WCHAR> editorCmd(str::Format(L"\"%s\" %s", exePath, editor_rules[i].InverseSearchArgs));

        if (!hwndCombo) {
            // no need to fill a combo box: return immeditately after finding an editor.
            return editorCmd.StealData();
        }

        ComboBox_AddString(hwndCombo, editorCmd);
        if (!firstEditor)
            firstEditor = editorCmd.StealData();
        foundExes.Append(exePath.StealData());
    }

    // Fall back to notepad as a default handler
    if (!firstEditor) {
        firstEditor = str::Dup(L"notepad %f");
        if (hwndCombo)
            ComboBox_AddString(hwndCombo, firstEditor);
    }
    return firstEditor;
}
示例#25
0
static BOOL TrackRecordFilterDialog_OnInitDialog(HWND hDlg, HWND hwndFocus, LPARAM lParam)
{
	HWND p1charCombo = GetDlgItem(hDlg, IDC_COMBO_P1CHAR);
	HWND p2charCombo = GetDlgItem(hDlg, IDC_COMBO_P2CHAR);

	for (int i = 0; i < TH135AddrGetCharCount(); ++i) {
		ComboBox_AddString(p1charCombo, TH135AddrGetCharName(i)->full);
		ComboBox_AddString(p2charCombo, TH135AddrGetCharName(i)->full);
	}
	ComboBox_SetCurSel(p1charCombo, 0);
	ComboBox_SetCurSel(p2charCombo, 0);

	return TRUE;
}
示例#26
0
/*****************************************************************************
 * ModuleConfigControl implementation
 *****************************************************************************/
ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this,
                                          module_config_t *p_item,
                                          HWND parent, HINSTANCE hInst,
                                          int * py_pos )
  : ConfigControl( p_this, p_item, parent, hInst )
{
    vlc_list_t *p_list;
    module_t *p_parser;

    label = CreateWindow( _T("STATIC"), _FROMMB(p_item->psz_text),
                          WS_CHILD | WS_VISIBLE | SS_LEFT,
                          5, *py_pos, 200, 15,
                          parent, NULL, hInst, NULL );

    *py_pos += 15 + 10;

    combo = CreateWindow( _T("COMBOBOX"), _T(""),
                          WS_CHILD | WS_VISIBLE | CBS_AUTOHSCROLL |
                          CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL,
                          20, *py_pos, 180, 5*15 + 6,
                          parent, NULL, hInst, NULL);

    *py_pos += 15 + 10;

    /* build a list of available modules */
    p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
    ComboBox_AddString( combo, _T("Default") );
    ComboBox_SetItemData( combo, 0, (void *)NULL );
    ComboBox_SetCurSel( combo, 0 );
    //ComboBox_SetText( combo, _T("Default") );
    for( int i_index = 0; i_index < p_list->i_count; i_index++ )
    {
        p_parser = (module_t *)p_list->p_values[i_index].p_object ;

        if( !strcmp( p_parser->psz_capability, p_item->psz_type ) )
        {
            ComboBox_AddString( combo, _FROMMB(p_parser->psz_longname) );
            ComboBox_SetItemData( combo, i_index,
                                  (void*)p_parser->psz_object_name );
            if( p_item->psz_value && !strcmp(p_item->psz_value,
                                             p_parser->psz_object_name) )
            {
                ComboBox_SetCurSel( combo, i_index );
                //ComboBox_SetText( combo, _FROMMB(p_parser->psz_longname) );
            }
        }
    }
    vlc_list_release( p_list );
}
示例#27
0
文件: timer.c 项目: andrejtm/T-Clock
//================================================================================================
//------------------------//----------------------------------+++--> Initialize the "Timer" Dialog:
void OnInit(HWND hDlg)   //-----------------------------------------------------------------+++-->
{
	HWND timer_cb = GetDlgItem(hDlg, IDC_TIMERNAME);
	HWND file_cb = GetDlgItem(hDlg, IDC_TIMERFILE);
	char subkey[TNY_BUFF];
	size_t offset;
	int idx, count;
	timeropt_t* pts;
	
	SendMessage(hDlg, WM_SETICON, ICON_SMALL,(LPARAM)g_hIconTClock);
	SendMessage(hDlg, WM_SETICON, ICON_BIG,(LPARAM)g_hIconTClock);
	// init dialog items
	SendDlgItemMessage(hDlg, IDC_TIMERSECSPIN, UDM_SETRANGE32, 0,59); // 60 Seconds Max
	SendDlgItemMessage(hDlg, IDC_TIMERMINSPIN, UDM_SETRANGE32, 0,59); // 60 Minutes Max
	SendDlgItemMessage(hDlg, IDC_TIMERHORSPIN, UDM_SETRANGE32, 0,23); // 24 Hours Max
	SendDlgItemMessage(hDlg, IDC_TIMERDAYSPIN, UDM_SETRANGE32, 0,7); //  7 Days Max
	/// add default sound files to file dropdown
	ComboBoxArray_AddSoundFiles(&file_cb, 1);
	// add timer to combobox
	offset=wsprintf(subkey,"%s\\Timer",g_szTimersSubKey);
	count=api.GetInt(g_szTimersSubKey, "NumberOfTimers", 0);
	for(idx=0; idx<count; ++idx) {
		pts = (timeropt_t*)malloc(sizeof(timeropt_t));
		wsprintf(subkey+offset,"%d",idx+1);
		pts->second = api.GetInt(subkey, "Seconds",  0);
		pts->minute = api.GetInt(subkey, "Minutes", 10);
		pts->hour   = api.GetInt(subkey, "Hours",    0);
		pts->day    = api.GetInt(subkey, "Days",     0);
		api.GetStr(subkey, "Name", pts->name, sizeof(pts->name), "");
		api.GetStr(subkey, "File", pts->fname, sizeof(pts->fname), "");
		pts->bBlink = (char)api.GetInt(subkey, "Blink", FALSE);
		pts->bRepeat = (char)api.GetInt(subkey, "Repeat", FALSE);
		pts->bActive = (char)api.GetInt(subkey, "Active", FALSE);
		ComboBox_AddString(timer_cb, pts->name);
		ComboBox_SetItemData(timer_cb, idx, pts);
	}
	// add "new timer" item
	pts = (timeropt_t*)calloc(1, sizeof(timeropt_t));
	memcpy(pts->name, "<Add New...>", 13);
	ComboBox_AddString(timer_cb, pts->name);
	ComboBox_SetItemData(timer_cb, count, pts);
	ComboBox_SetCurSel(timer_cb, 0);
	OnTimerName(hDlg);
	SendDlgItemMessage(hDlg, IDC_TIMERTEST, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_hIconPlay);
	SendDlgItemMessage(hDlg, IDC_TIMERDEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_hIconDel);
	
	api.PositionWindow(hDlg,21);
}
示例#28
0
BOOL EditItem_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam )
{
  INT i;
  CHAR szBuf[128];
  HWND hwndCtrl;

  nListContent = -1;

  hwndCtrl = GetDlgItem( hwnd, IDC_EDIT_ITEM_PIXEL_SIZE );
  Edit_LimitText( hwndCtrl, 8 );

  hwndCtrl = GetDlgItem( hwnd, IDC_EDIT_ITEM_NAME );
  Edit_LimitText( hwndCtrl, 30 );

  hwndCtrl = GetDlgItem( hwnd, IDC_EDIT_ITEM_TYPE );

  for( i = 0; i < NUM_ITEM_TYPES; ++i )
  {
    ComboBox_AddString( hwndCtrl, GetItemTypeString( i ) );
  }

  ComboBox_SetCurSel( hwndCtrl, nNewItemType );

  DoubleToString( szBuf, dNewPixelSize, 2 );
  Edit_SetText( GetDlgItem( hwnd, IDC_EDIT_ITEM_PIXEL_SIZE ), szBuf );

  Edit_SetText( GetDlgItem( hwnd, IDC_EDIT_ITEM_NAME ), szNewItemName );

  EditItem_TypeChanged( hwnd );

  AllDialogs_OnInitDialog( hwnd, hwndFocus, lParam );

  return TRUE;

} // EditItem_OnInitDialog
/**
Processing commands for charset combobox (hwndCtl).
*/
void processCharsetCombobox(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 *csl= mygetcharsets(hwnd, pParams);
      LIST *cstmp= csl;

      ComboBox_ResetContent(hwndCtl);

      adjustDropdownHeight(hwndCtl,list_length(csl));

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

      list_free(csl, 1);

      ComboBox_SetText(hwndCtl,pParams->charset);

      break;
    }
  }
}
/**
   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;
    }
  }
}