本文整理匯總了C++中Edit_SetText函數的典型用法代碼示例。如果您正苦於以下問題:C++ Edit_SetText函數的具體用法?C++ Edit_SetText怎麽用?C++ Edit_SetText使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Edit_SetText函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: CmdSignatureDlg_DisplaySig
void FASTCALL CmdSignatureDlg_DisplaySig( HWND hwnd, int index )
{
char sz[ _MAX_FNAME ];
HWND hwndList;
HWND hwndEdit;
HNDFILE fh;
hwndList = GetDlgItem( hwnd, IDD_LIST );
hwndEdit = GetDlgItem( hwnd, IDD_EDIT );
ComboBox_GetLBText( hwndList, index, sz );
lstrcat( sz, ".sig" );
if( ( fh = Ameol2_OpenFile( sz, DSD_SIG, AOF_READ ) ) != HNDFILE_ERROR )
{
WORD wSize;
LPSTR lpText;
INITIALISE_PTR(lpText);
wSize = LOWORD( Amfile_GetFileSize( fh ) );
if( fNewMemory( &lpText, wSize + 1 ) )
{
if( Amfile_Read( fh, lpText, wSize ) != wSize )
DiskReadError( hwnd, sz, FALSE, FALSE );
else
{
lpText[ wSize ] = '\0';
Edit_SetText( hwndEdit, lpText );
}
FreeMemory( &lpText );
}
Amfile_Close( fh );
}
else
Edit_SetText( hwndEdit, "" );
SetWindowLong( hwnd, DWL_USER, (LPARAM)index );
}
示例2: LookVkeyToItem
/*
* LookVkeyToItem: Handle WM_VKTOITEM messages.
*/
int LookVkeyToItem(HWND hwnd, UINT key, HWND hwndListbox, int iCaret)
{
char buf[MAXNAME + 1];
int len;
len = Edit_GetText(info->hwndFind, buf, MAXNAME);
/* Backspace removes last character, if any */
if (key == VK_BACK)
{
if (len != 0)
{
buf[len - 1] = '\0';
Edit_SetText(info->hwndFind, buf);
}
return -2;
}
/* Add letter character to edit box */
key = tolower(key);
if (key >= 'a' && key <= 'z')
{
if (len < MAXNAME)
{
buf[len + 1] = '\0';
buf[len] = tolower(key);
Edit_SetText(info->hwndFind, buf);
}
return -2;
}
return -1;
}
示例3: Init_Settings
/*------------------------------------------------------------------------------------------------------------------
-- 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);
}
示例4: getDlgItem
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;
}
示例5: GetDlgItem
//
// Option window
//
void
OptionTabWindow::init(HWND w)
{
struct HpcMenuInterface::HpcMenuPreferences &pref = HPC_PREFERENCE;
_window = w;
TabWindow::init(_window);
_spin_edit = GetDlgItem(_window, IDC_OPT_AUTO_INPUT);
_spin = CreateUpDownControl(WS_CHILD | WS_BORDER | WS_VISIBLE |
UDS_SETBUDDYINT | UDS_ALIGNRIGHT, 80, 0, 50, 50, _window,
IDC_OPT_AUTO_UPDOWN, _app._instance, _spin_edit, 60, 1, 30);
BOOL onoff = pref.auto_boot ? TRUE : FALSE;
EnableWindow(_spin_edit, onoff);
EnableWindow(_spin, onoff);
SET_CHECK(AUTO, pref.auto_boot);
if (pref.auto_boot) {
TCHAR tmp[32];
wsprintf(tmp, TEXT("%d"), pref.auto_boot);
Edit_SetText(_spin_edit, tmp);
}
SET_CHECK(VIDEO, pref.reverse_video);
SET_CHECK(PAUSE, pref.pause_before_boot);
SET_CHECK(DEBUG, pref.load_debug_info);
SET_CHECK(SAFETY, pref.safety_message);
Edit_SetText(GetDlgItem(w, IDC_OPT_EXTKOPT), pref.boot_extra);
}
示例6: ViewNoises_NoiseChanged
VOID ViewNoises_NoiseChanged( HWND hwnd )
{
INT i;
CHAR szBuf[128];
LRESULT lResult;
lResult = ListBox_GetCurSel(GetDlgItem(hwnd, IDC_NOISE_LIST));
if (lResult >= 0 && lResult < po->nNoises)
{
i = (INT)lResult;
DoubleToString(szBuf, po->pNoiseData[i].radius, 0);
Edit_SetText(GetDlgItem(hwnd, IDC_NOISE_RADIUS), szBuf);
DoubleToString(szBuf, po->pNoiseData[i].height, 0);
Edit_SetText(GetDlgItem(hwnd, IDC_NOISE_HEIGHT), szBuf);
wsprintf(szBuf, "%d", po->pNoiseData[i].delay);
Edit_SetText(GetDlgItem(hwnd, IDC_NOISE_DELAY), szBuf);
}
return;
} // ViewNoises_NoiseChanged
示例7: EditNoise_OnInitDialog
BOOL EditNoise_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
CHAR szBuf[128];
HWND hwndCtrl;
hwndCtrl = GetDlgItem(hwnd, IDC_EDIT_NOISE_NAME);
Edit_LimitText(hwndCtrl, 30);
Edit_SetText(hwndCtrl, szNewNoiseName);
hwndCtrl = GetDlgItem(hwnd, IDC_EDIT_NOISE_RADIUS);
Edit_LimitText(hwndCtrl, 8);
DoubleToString(szBuf, dNewRadius, 0);
Edit_SetText(hwndCtrl, szBuf);
hwndCtrl = GetDlgItem(hwnd, IDC_EDIT_NOISE_HEIGHT);
Edit_LimitText(hwndCtrl, 8);
DoubleToString(szBuf, dNewHeight, 0);
Edit_SetText(hwndCtrl, szBuf);
hwndCtrl = GetDlgItem(hwnd, IDC_EDIT_NOISE_DELAY);
Edit_LimitText(hwndCtrl, 8);
wsprintf(szBuf, "%d", nNewDelay);
Edit_SetText(hwndCtrl, szBuf);
EditNoise_InitList(hwnd);
AllDialogs_OnInitDialog(hwnd, hwndFocus, lParam);
return TRUE;
} // EditNoise_OnInitDialog
示例8: EditItem_OnInitDialog
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
示例9: LoadState
void LoadState() {
Edit_SetText( hwAnswer, reader.get_answer(curr).c_str() );
Edit_SetText( hwInfo, stats.getHeaderString2(curr).c_str() );
int temp_mark = reader.get_mark(curr);
SendMessage( hwTrue, (UINT) BM_SETCHECK, temp_mark == Reader::true_mark, 0);
SendMessage( hwFalse, (UINT) BM_SETCHECK, temp_mark == Reader::false_mark, 0);
SendMessage( hwUnchecked, (UINT) BM_SETCHECK, temp_mark == Reader::unset, 0);
}
示例10: LoadState
void LoadState()
{
Edit_SetText( hwQuestion, ex.get_question(curr).c_str() );
Edit_SetText( hwAnswer, ex.get_answer(curr).c_str() );
char tmp[128];
sprintf_s( tmp, "Вопрос номер %d из %d.", curr+1 , ex.size());
Edit_SetText( hwNumber, tmp );
}
示例11: _insert_item
void
MainTabWindow::init(HWND w)
{
HpcMenuInterface &menu = HPC_MENU;
struct HpcMenuInterface::HpcMenuPreferences &pref = HPC_PREFERENCE;
_window = w;
// insert myself to tab-control
TabWindow::init(w);
// setup child.
TCHAR *entry;
int i;
// kernel directory path
for (i = 0; entry = menu.dir(i); i++)
_insert_item(w, entry, IDC_MAIN_DIR);
SendDlgItemMessage(w, IDC_MAIN_DIR, CB_SETCURSEL, menu.dir_default(),
0);
// platform
_sort_platids(w);
// kernel file name.
Edit_SetText(GetDlgItem(w, IDC_MAIN_KERNEL), pref.kernel_user ?
pref.kernel_user_file : TEXT("netbsd.gz"));
// root file system.
int fs = pref.rootfs + IDC_MAIN_ROOT_;
_set_check(fs, TRUE);
_edit_md_root = GetDlgItem(w, IDC_MAIN_ROOT_MD_OPS);
Edit_SetText(_edit_md_root, pref.rootfs_file);
EnableWindow(_edit_md_root, fs == IDC_MAIN_ROOT_MD ? TRUE : FALSE);
// layout checkbox and editbox.
layout();
// set default kernel boot options.
_set_check(IDC_MAIN_OPTION_A, pref.boot_ask_for_name);
_set_check(IDC_MAIN_OPTION_D, pref.boot_debugger);
_set_check(IDC_MAIN_OPTION_S, pref.boot_single_user);
_set_check(IDC_MAIN_OPTION_V, pref.boot_verbose);
_set_check(IDC_MAIN_OPTION_H, pref.boot_serial);
// serial console speed.
TCHAR *speed_tab[] = { L"9600", L"19200", L"115200", 0 };
int sel = 0;
i = 0;
for (TCHAR **speed = speed_tab; *speed; speed++, i++) {
_insert_item(w, *speed, IDC_MAIN_OPTION_H_SPEED);
if (_wtoi(*speed) == pref.serial_speed)
sel = i;
}
_combobox_serial_speed = GetDlgItem(_window, IDC_MAIN_OPTION_H_SPEED);
SendDlgItemMessage(w, IDC_MAIN_OPTION_H_SPEED, CB_SETCURSEL, sel, 0);
EnableWindow(_combobox_serial_speed, pref.boot_serial);
}
示例12: DocWndSetInfo
static void DocWndSetInfo(char *info, char *filename)
{
int buffer_size = BUFFER_SIZE;
if(!IsWindow(hDocWnd) || !DocWndFlag)
return;
if(DocWndInfoLock()==FALSE)
return;
Edit_SetText(GetDlgItem(hDocWnd,IDC_EDIT_INFO),info);
Edit_SetText(GetDlgItem(hDocWnd,IDC_EDIT_FILENAME),filename);
DocWndInfoUnLock();
}
示例13: TEXT
//
// PopulateTransportStreamInfo
//
BOOL CProgramProperties::PopulateTransportStreamInfo( )
{
TCHAR sz[60];
HRESULT hr =StringCchPrintf(sz, 60, TEXT("%d\0"), m_stream_id);
Edit_SetText(GetDlgItem(m_hwndDialog, IDC_StreamIdEDIT), sz);
hr = StringCchPrintf(sz, 60, TEXT("%d\0"), m_pat_version);
Edit_SetText(GetDlgItem(m_hwndDialog, IDC_PatVersionEDIT), sz);
return TRUE;
}
示例14: ViewTriggers_TriggerChanged
VOID ViewTriggers_TriggerChanged( HWND hwnd )
{
INT i;
CHAR szBuf[128];
LRESULT lResult;
lResult = ListBox_GetCurSel( GetDlgItem( hwnd, IDC_TRIGGER_LIST ) );
if ( lResult >= 0 && lResult < pLevel->nTriggers )
{
i = (INT)lResult;
DoubleToString( szBuf, pLevel->pTriggerData[i].radius, 0 );
Edit_SetText( GetDlgItem( hwnd, IDC_TRIGGER_RADIUS ), szBuf );
DoubleToString( szBuf, pLevel->pTriggerData[i].height, 0 );
Edit_SetText( GetDlgItem( hwnd, IDC_TRIGGER_HEIGHT ), szBuf );
CheckDlgButton( hwnd,
IDC_TRIGGER_PROXIMITY,
(pLevel->pTriggerData[i].flags & TF_PROXIMITY_TRIGGER) ? 1 : 0 );
CheckDlgButton( hwnd,
IDC_TRIGGER_USER,
(pLevel->pTriggerData[i].flags & TF_USER_TRIGGER) ? 1 : 0 );
CheckDlgButton( hwnd,
IDC_TRIGGER_SOUND,
(pLevel->pTriggerData[i].flags & TF_SOUND) ? 1 : 0 );
CheckDlgButton( hwnd,
IDC_TRIGGER_END_LEVEL,
(pLevel->pTriggerData[i].flags & TF_END_LEVEL) ? 1 : 0 );
CheckDlgButton( hwnd,
IDC_TRIGGER_END_GAME,
(pLevel->pTriggerData[i].flags & TF_END_GAME) ? 1 : 0 );
if (pLevel->pTriggerData[i].flags & TF_ITEM_REQUIRED)
{
Static_SetText( GetDlgItem( hwnd, IDC_TRIGGER_ITEM_REQUIRED ),
GetItemTypeString( pLevel->pTriggerData[i].item_type ) );
}
else
{
Static_SetText( GetDlgItem( hwnd, IDC_TRIGGER_ITEM_REQUIRED ),
(LPSTR)"" );
}
}
return;
} // ViewTriggers_TriggerChanged
示例15: thAviaoAterrar
DWORD WINAPI thAviaoAterrar(LPVOID p)
{
HWND hDlg = (HWND)p;
for (int i=0; i < 26; ++i) {
Edit_SetText(GetDlgItem(hDlg, Landing_Animate_Id[i]), TEXT("A01"));
Sleep(200);
Edit_SetText(GetDlgItem(hDlg, Landing_Animate_Id[i]), TEXT(" "));
}
return 0;
}