本文整理汇总了C++中Dialog::Initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ Dialog::Initialize方法的具体用法?C++ Dialog::Initialize怎么用?C++ Dialog::Initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dialog
的用法示例。
在下文中一共展示了Dialog::Initialize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ADerefAs
// Return user's response to prompt
char*
AGetString(char* szPrompt, char* szDefault, char* buffer, int size)
{
Dialog d;
grip gTextBox;
TTextBox* pTextBox;
TControlInfo ci;
d.Initialize(0, 0, DG_DFT_WINDOW);
ci.x = 5;
ci.y = 5;
ci.cap = szPrompt;
d.AddLabel(&ci);
ci.x = 10;
ci.y = 25;
ci.cap = szDefault;
ci.len = 20;
gTextBox = d.AddTextBox(&ci);
pTextBox = ADerefAs(TTextBox, gTextBox);
d.Activate(M_MODAL);
d.JustifyWindow(DG_JUST_CENTER, DG_JUST_CENTER);
pTextBox->Select();
// get string from edit box
strncpy(buffer, pTextBox->editLine, size);
buffer[size - 1] = NULL;
d.Deactivate();
return buffer;
}
示例2:
bool
AAlert(char* msg)
{
#define CONFIRMED 1
Dialog d;
TControlInfo ci;
d.Initialize(0, 0, DG_DFT_WINDOW);
ci.x = 5;
ci.y = 5;
ci.cap = msg;
d.AddLabel(&ci);
ci.y = 25;
ci.cap = "Ok";
ci.value = CONFIRMED;
ci.key = K_Y;
ci.exit = TRUE;
d.AddButton(&ci);
d.Activate(M_MODAL);
d.JustifyWindow(DG_JUST_CENTER, DG_JUST_CENTER);
return (d.EventLoop() == CONFIRMED) ? TRUE : FALSE;
}
示例3: itoa
// Return user's response to prompt
int32
AGetNumber(char* szPrompt, int32 dDefault)
{
Dialog d;
grip gTextBox;
TTextBox* pTextBox;
int ret;
char sz[40];
TControlInfo ci;
d.Initialize(0, 0, DG_DFT_WINDOW);
ci.x = 5;
ci.y = 5;
ci.cap = szPrompt;
d.AddLabel(&ci);
ci.x = 10;
ci.y = 25;
ci.cap = itoa(dDefault, sz, 10);
ci.len = 20;
gTextBox = d.AddTextBox(&ci);
pTextBox = ADerefAs(TTextBox, gTextBox);
d.Activate(M_MODAL);
d.JustifyWindow(DG_JUST_CENTER, DG_JUST_CENTER);
pTextBox->Select();
// get string from edit box
ret = atoi(pTextBox->editLine);
d.Deactivate();
return (int32) ret;
}