本文整理汇总了C++中TEXT_SetText函数的典型用法代码示例。如果您正苦于以下问题:C++ TEXT_SetText函数的具体用法?C++ TEXT_SetText怎么用?C++ TEXT_SetText使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TEXT_SetText函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _StartPlay
/**
* @brief Start play
* @param filename: pointer to the video file name
* @retval None
*/
static uint8_t _StartPlay(GUI_MOVIE_HANDLE *hmovie, char * filename, FIL * file, uint16_t x0, uint16_t y0)
{
static char tmp[FILEMGR_FILE_NAME_SIZE];
int ms, frames;
uint32_t duration;
WM_HWIN hItem;
if(f_open(file, filename, FA_OPEN_EXISTING | FA_READ) == FR_OK)
{
PrevFrameIndex = 0;
LostFrames = 0;
previous_total = 0;
GUI_MOVIE_GetInfoEx(_GetData, file, &Video_Info);
*hmovie = GUI_MOVIE_CreateEx(_GetData, file, _cbNotify) ;
GUI_MOVIE_SetPeriod (*hmovie, VIDEO_FRAME_TIME);
if((Video_Info.xSize == 0) || (Video_Info.ySize == 0) ||
(Video_Info.xSize > 1024) || (Video_Info.ySize > 768))
{
GUI_MOVIE_Delete(*hmovie);
return 1;
}
GUI_MOVIE_Show(*hmovie, ((LCD_GetXSize() - Video_Info.xSize)/2), ((LCD_GetYSize() - Video_Info.ySize)/2), 0);
hTimer = WM_CreateTimer(playbackwin, 0, 1000, 0);
/* Update video total time */
hItem = WM_GetDialogItem(playbackwin, ID_TIME);
ms = Video_Info.msPerFrame;
frames = Video_Info.NumFrames;
duration = (frames * ms)/1000;
sprintf((char *)tmp , "%02lu:%02lu", duration/60, duration%60 );
TEXT_SetText(hItem, tmp);
WM_InvalidateWindow(playbackwin);
elapsed_time = 0;
hItem = WM_GetDialogItem(playbackwin, ID_VIDEO_NAME);
FILEMGR_GetFileOnly (tmp, filename);
TEXT_SetText(hItem, tmp);
hItem = WM_GetDialogItem(playbackwin, ID_ELAPSED_TIME);
TEXT_SetText(hItem, "00:00");
WM_InvalidateWindow(hItem);
WM_Paint(hItem);
}
return 0;
}
示例2: _cbAudioProcess
/**
* @brief callback for audio process
* @param pMsg: pointer to data structure of type WM_MESSAGE
* @retval None
*/
static void _cbAudioProcess(WM_MESSAGE * pMsg) {
uint32_t Id;
static WM_HTIMER hProcessTimer;
WM_HWIN hItem;
char tmp[] = "00:00/00:00";
uint32_t duration;
switch (pMsg->MsgId)
{
case WM_CREATE:
hProcessTimer = WM_CreateTimer(pMsg->hWin, ID_PROCESS_TIMER, 1000, 0);
break;
case WM_TIMER:
Id = WM_GetTimerId(pMsg->Data.v);
if(Id == ID_PROCESS_TIMER)
{
if(AUDIO_RECORDER_GetState() == AUDIO_RECORDER_RECORDING)
{
/*Set elapsed time */
duration = AUDIO_RECORDER_GetElapsedTime();
sprintf((char *)tmp , "%02lu:%02lu", duration/60, duration%60 );
hItem = WM_GetDialogItem(hMainWin, ID_ELAPSED_TIME);
TEXT_SetText(hItem, tmp);
}
if(AUDIO_RECORDER_GetState() == AUDIO_RECORDER_PLAYING)
{
/*Set elapsed time */
duration = AUDIO_RECORDER_GetTotalTime() - AUDIO_RECORDER_GetPlayedTime();
sprintf((char *)tmp , "%02lu:%02lu", duration/60, duration%60);
hItem = WM_GetDialogItem(hMainWin, ID_ELAPSED_TIME);
TEXT_SetText(hItem, tmp);
}
WM_RestartTimer(pMsg->Data.v, 1000);
}
break;
case WM_DELETE:
WM_DeleteTimer(hProcessTimer);
break;
default:
WM_DefaultProc(pMsg);
}
}
示例3: DisPage
//
//page
//
const void DisPage()
{
char PAGE[20] = "";
TEXT_SetFont(mainwinText[4],&GUI_Font30);
if (Language == 0)
{
sprintf(PAGE,"所处 0%d页/共 0%d页",thispage,pageNum);
TEXT_SetText(mainwinText[4],PAGE);
}
else
{
sprintf(PAGE,"PAGE 0%d/0%d",thispage,pageNum);
TEXT_SetText(mainwinText[4],PAGE);
}
}
示例4: _RefreshBrowser
/**
* @brief Refresh browser.
* @param hWin: pointer to the parent handle
* @retval None
*/
static void _RefreshBrowser ( WM_HWIN hWin) {
WM_HWIN hItem, Hint;
TREEVIEW_ITEM_Handle hTreeView;
uint32_t free, total;
char str[FILEMGR_FULL_PATH_SIZE];
GUI_Exec();
/* Show Hint */
Hint = WM_CreateWindowAsChild(30,
120,
180, 32,
hWin,
WM_CF_SHOW ,
_cbHint,
0);
GUI_Exec();
hItem = WM_GetDialogItem(hWin, ID_PROGBAR_USB);
if(k_StorageGetStatus (USB_DISK_UNIT))
{
free = k_StorageGetFree(USB_DISK_UNIT);
total = k_StorageGetCapacity(USB_DISK_UNIT);
PROGBAR_SetValue (hItem, ((total - free) * 100)/total);
hItem = WM_GetDialogItem(hWin, ID_TEXT_USB);
sprintf(str, "USB Disk [%lu MB]", total / (2 * 1024));
TEXT_SetText(hItem, str);
}
else
{
PROGBAR_SetValue (hItem, 0);
hItem = WM_GetDialogItem(hWin, ID_TEXT_USB);
TEXT_SetText(hItem, "USB Disk [N/A]" );
}
hTreeView = WM_GetDialogItem(hWin, ID_TREEVIEW);
hItem = TREEVIEW_GetItem(hTreeView, 0, TREEVIEW_GET_FIRST);
if(hItem != 0)
{
TREEVIEW_ITEM_Delete (hItem);
}
ExploreDisks(hTreeView);
WM_DeleteWindow(Hint);
}
示例5: _cbDialog
static void _cbDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
hItem = pMsg->hWin;
FRAMEWIN_SetText(hItem, "welcome");
FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
FRAMEWIN_SetTitleVis(hItem, 0);
//
// Initialization of 'Text'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, GUI_FONT_20B_1);
TEXT_SetTextColor(hItem, 0x000000FF);
TEXT_SetText(hItem, "welcome to use our system");
//
// Initialization of 'Text'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetFont(hItem, GUI_FONT_16B_1);
TEXT_SetTextColor(hItem, 0x008000FF);
TEXT_SetText(hItem, "The elderly assistant");
//
// Initialization of 'Text'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_2);
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetText(hItem, "Just a moment, please. ");
//
// Initialization of 'Text'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_3);
TEXT_SetText(hItem, "second");
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
// USER START (Optionally insert additional code for further widget initialization)
// USER END
break;
// USER START (Optionally insert additional message handling)
// USER END
default:
WM_DefaultProc(pMsg);
break;
}
}
示例6: update_motif
void update_motif(void)
{
motif_t * m = db->motifs;
for (uint32_t i = 1; i < current_motif_index; i++)
m = m->next;
sprintf(current_motif_title, "%i/%i -- %s", (int)current_motif_index, (int)db->nb_motifs, m->name);
current_motif_desc = m->desc;
MULTIEDIT_SetText(motif_desc_widget, current_motif_desc);
TEXT_SetText(motif_name_widget, current_motif_title);
led_clear();
point_t * p = m->points;
while (p != NULL)
{
led_set(p->x, p->y, p->z);
p = p->next;
}
clear_points2blink();
option_t * o = m->options;
while (o != NULL)
{
handle_option(o);
o = o->next;
}
}
示例7: Login_SetText
void Login_SetText(WM_HWIN hWin,const char *Value)
{
WM_HWIN hItem;
hItem=WM_GetDialogItem(hWin, GUI_ID_TEXT1);
TEXT_SetText(hItem, Value);
GUI_Exec();
}
示例8: _cbNotifyStateChange
/**
* @brief Notify State Change
* @param pMsg: pointer to data structure of type WM_MESSAGE
* @retval None
*/
void _cbNotifyStateChange (void)
{
WM_HWIN hItem;
if(AUDIO_RECORDER_GetState() == AUDIO_RECORDER_SUSPENDED)
{
if(RecorderMode == RECORDER_MODE_PLAYING)
{
RecorderMode = RECORDER_MODE_PLAY_IDLE;
hItem = WM_GetDialogItem(hMainWin, ID_RECORD_REC_CANCEL_PLAY);
WM_InvalidateWindow(hItem);
WM_Update(hItem);
}
if(RecorderMode == RECORDER_MODE_RECORDING)
{
RecorderMode = RECORDER_MODE_REC_IDLE;
}
hItem = WM_GetDialogItem(hMainWin, ID_EQUAL);
IMAGE_SetBitmap(hItem, &bmframe0);
WM_InvalidateWindow(hItem);
WM_Update(hItem);
if(hMainWin != 0)
{
hItem = WM_GetDialogItem(hMainWin, ID_ELAPSED_TIME);
TEXT_SetText(hItem, "00:00");
WM_Update(hItem);
}
}
}
示例9: redraw_panel_resurs
/*****************************
Peremaljovuvannja paneli resursu
*****************************/
void redraw_panel_resurs(void)
{
EDIT_SetText(hEdit, _aBitmapItem[ICONVIEW_RES_COUNTER_ID].pExplanation[sel_language]);
char string_tmp[10 + 1];
unsigned int value_tmp;
value_tmp = resurs_tmp;
if (int_to_str (value_tmp, string_tmp))TEXT_SetText(Resurs_v[0], string_tmp);
value_tmp = resurs_count_tmp;
if (int_to_str (value_tmp, string_tmp))TEXT_SetText(Resurs_v[1], string_tmp);
WM_HWIN FocussedWindow = (Resurs_FrameWin);
WM_SetFocus(FocussedWindow);
}
示例10: VNC_SERVER_LogMessage
/**
* @brief Game window Startup
* @param hWin: pointer to the parent handle.
* @param xpos: X position
* @param ypos: Y position
* @retval None
*/
void VNC_SERVER_LogMessage (const char *message)
{
WM_HWIN hItem;
hItem = WM_GetDialogItem(hVncWin, ID_VNC_STATUS);
TEXT_SetText(hItem, message);
}
示例11: MainTask
/*
*********************************************************************************************************
* 函 数 名: MainTask
* 功能说明: GUI主函数
* 形 参: 无
* 返 回 值: 无
*********************************************************************************************************
*/
void MainTask(void)
{
int Value = 0;
WM_HWIN hDlgFrame;
/* 初始化 */
GUI_Init();
// TOUCH_Calibration();
GUI_CURSOR_Show();
WM_SetCallback(WM_HBKWIN, _cbBkWindow);
WM_SetCreateFlags(WM_CF_MEMDEV);
hDlgFrame = 0;
while(1)
{
WM_HWIN hDlg, hText;
char acText[3] = {0};
GUI_Delay(100);
/* 如果对话框被关闭就重新的将其再打开 */
if (!WM_IsWindow(hDlgFrame))
{
Value = 0;
hDlgFrame = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), &_cbCallback, 0, 0, 0);
}
Value = (Value + 1) % 100;
acText[0] = '0' + Value / 10;
acText[1] = '0' + Value % 10;
hDlg = WM_GetClientWindow(hDlgFrame);
hText = WM_GetDialogItem(hDlg, GUI_ID_TEXT0);
TEXT_SetText(hText, acText);
}
}
示例12: _cbDialog
/*********************************************************************
*
* _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int Id, NCode;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of '_tAboutL1'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
TEXT_SetText(hItem, "J&S Open Source Instruments");
TEXT_SetTextAlign(hItem, GUI_TA_RIGHT | GUI_TA_VCENTER);
//
// Initialization of '_tAboutL2'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_1);
TEXT_SetText(hItem, "Prowered By James Kong");
TEXT_SetTextAlign(hItem, GUI_TA_RIGHT | GUI_TA_VCENTER);
//
// Initialization of '_tAboutL3'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_2);
TEXT_SetText(hItem, "Shawn Gao");
TEXT_SetTextAlign(hItem, GUI_TA_RIGHT | GUI_TA_VCENTER);
//
// Initialization of '_tAboutL5'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_3);
TEXT_SetText(hItem, "2013-2014 Some Right Reserved");
//
// Initialization of '_tAboutL4'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_4);
TEXT_SetText(hItem, "This work is licensed under CC-BY-SA 4.0");
// USER START (Optionally insert additional code for further widget initialization)
// USER END
break;
// USER START (Optionally insert additional message handling)
// USER END
default:
WM_DefaultProc(pMsg);
break;
}
}
示例13: Table
//.........这里部分代码省略.........
static WM_HWIN l_hDlg;
static WM_CALLBACK *l_cb_WM_HBKWIN;
static const GUI_WIDGET_CREATE_INFO l_dialog[] = {
{ &FRAMEWIN_CreateIndirect, "Dining Philosopher Problem",
0, 30, 30, 260, 180, FRAMEWIN_CF_MOVEABLE },
{ &TEXT_CreateIndirect, "Philosopher 0",
GUI_ID_TEXT9, 50, 10, 0, 0, TEXT_CF_LEFT },
{ &TEXT_CreateIndirect, "Philosopher 1",
GUI_ID_TEXT9, 50, 30, 0, 0, TEXT_CF_LEFT },
{ &TEXT_CreateIndirect, "Philosopher 2",
GUI_ID_TEXT9, 50, 50, 0, 0, TEXT_CF_LEFT },
{ &TEXT_CreateIndirect, "Philosopher 3",
GUI_ID_TEXT9, 50, 70, 0, 0, TEXT_CF_LEFT },
{ &TEXT_CreateIndirect, "Philosopher 4",
GUI_ID_TEXT9, 50, 90, 0, 0, TEXT_CF_LEFT },
{ &TEXT_CreateIndirect, "Table",
GUI_ID_TEXT9, 50, 110, 0, 0, TEXT_CF_LEFT },
{ &TEXT_CreateIndirect, "thinking",
GUI_ID_TEXT0, 130, 10, 0, 0, TEXT_CF_LEFT },
{ &TEXT_CreateIndirect, "thinking",
GUI_ID_TEXT1, 130, 30, 0, 0, TEXT_CF_LEFT },
{ &TEXT_CreateIndirect, "thinking",
GUI_ID_TEXT2, 130, 50, 0, 0, TEXT_CF_LEFT },
{ &TEXT_CreateIndirect, "thinking",
GUI_ID_TEXT3, 130, 70, 0, 0, TEXT_CF_LEFT },
{ &TEXT_CreateIndirect, "thinking",
GUI_ID_TEXT4, 130, 90, 0, 0, TEXT_CF_LEFT },
{ &TEXT_CreateIndirect, "serving",
GUI_ID_TEXT5, 130, 110, 0, 0, TEXT_CF_LEFT },
{ &BUTTON_CreateIndirect,"PAUSE",
GUI_ID_BUTTON0, 160, 130, 80, 30 }
};
//..........................................................................*/
static void onMainWndGUI(WM_MESSAGE* pMsg) {
switch (pMsg->MsgId) {
case WM_PAINT: {
GUI_SetBkColor(GUI_GRAY);
GUI_Clear();
GUI_SetColor(GUI_BLACK);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("Dining Philosophers - Demo", 160, 5);
break;
}
default: {
WM_DefaultProc(pMsg);
break;
}
}
}
//..........................................................................*/
static void onDialogGUI(WM_MESSAGE * pMsg) {
switch (pMsg->MsgId) {
case WM_INIT_DIALOG: {
break;
}
case WM_NOTIFY_PARENT: {
switch (pMsg->Data.v) {
case WM_NOTIFICATION_RELEASED: { // react only if released */
switch (WM_GetId(pMsg->hWinSrc)) {
case GUI_ID_BUTTON0: {
// static PAUSE event for the Table AO */
static QEvent const pauseEvt = { PAUSE_SIG, 0 };
AO_Table->POST(&pauseEvt, &l_onDialogGUI);
break;
}
}
break;
}
}
break;
}
default: {
WM_DefaultProc(pMsg);
break;
}
}
}
//..........................................................................*/
static void displyPhilStat(uint8_t n, char const *stat) {
TEXT_SetText(WM_GetDialogItem(l_hDlg, GUI_ID_TEXT0 + n), stat);
WM_Exec(); // update the screen and invoke WM callbacks */
QS_BEGIN(PHILO_STAT, AO_Philo[n]) // application-specific record begin */
QS_U8(1, n); // Philosopher number */
QS_STR(stat); // Philosopher status */
QS_END()
}
//..........................................................................*/
static void displyTableStat(char const *stat) {
TEXT_SetText(WM_GetDialogItem(l_hDlg, GUI_ID_TEXT5), stat);
WM_Exec(); // update the screen and invoke WM callbacks */
QS_BEGIN(TABLE_STAT, AO_Table) // application-specific record begin */
QS_STR(stat); // Philosopher status */
QS_END()
}
示例14: GUIDEMO_ShowInfo
/*********************************************************************
*
* GUIDEMO_ShowInfo
*/
void GUIDEMO_ShowInfo(const char * acInfo) {
TEXT_Handle hText;
if (WM_IsVisible(_hDialogInfo)) {
hText = WM_GetDialogItem(_hDialogInfo, GUI_ID_TEXT0);
TEXT_SetText(hText, acInfo);
}
}
示例15: _cbDialog
/*********************************************************************
*
* _cbDialog
*/
static void _cbDialog(WM_MESSAGE * pMsg) {
WM_HWIN hItem;
int Id, NCode;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of 'Demo'
//
hItem = pMsg->hWin;
FRAMEWIN_SetText(hItem, "GUIBuilder Demo");
FRAMEWIN_SetFont(hItem, GUI_FONT_24B_ASCII);
FRAMEWIN_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
FRAMEWIN_SetTextColor(hItem, 0x00FF8000);
SCROLLBAR_CreateAttached(hItem, 0);
SCROLLBAR_CreateAttached(hItem, SCROLLBAR_CF_VERTICAL);
//
// Initialization of 'Text'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_TEXT_0);
TEXT_SetText(hItem, "This is a text!");
TEXT_SetTextAlign(hItem, GUI_TA_HCENTER | GUI_TA_VCENTER);
TEXT_SetTextColor(hItem, 0x00000000);
TEXT_SetFont(hItem, GUI_FONT_16B_ASCII);
// USER START (Optionally insert additional code for further widget initialization)
// USER END
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc);
NCode = pMsg->Data.v;
switch(Id) {
case ID_BUTTON_0: // Notifications sent by 'Button'
switch(NCode) {
case WM_NOTIFICATION_CLICKED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
case WM_NOTIFICATION_RELEASED:
// USER START (Optionally insert code for reacting on notification message)
// USER END
break;
// USER START (Optionally insert additional code for further notification handling)
// USER END
}
break;
// USER START (Optionally insert additional code for further Ids)
// USER END
}
break;
// USER START (Optionally insert additional message handling)
// USER END
default:
WM_DefaultProc(pMsg);
break;
}
}