本文整理汇总了C++中WndForm::ShowModal方法的典型用法代码示例。如果您正苦于以下问题:C++ WndForm::ShowModal方法的具体用法?C++ WndForm::ShowModal怎么用?C++ WndForm::ShowModal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WndForm
的用法示例。
在下文中一共展示了WndForm::ShowModal方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dlgAirspaceShowModal
bool dlgAirspaceShowModal(bool coloredit){
colormode = coloredit;
WndForm *wf = dlgLoadFromXML(CallBackTable, ScreenLandscape ? IDR_XML_AIRSPACE_L : IDR_XML_AIRSPACE_P);
if (!wf) return false;
WndListFrame* wAirspaceList = (WndListFrame*)wf->FindByName(TEXT("frmAirspaceList"));
LKASSERT(wAirspaceList!=NULL);
wAirspaceList->SetBorderKind(BORDERLEFT);
wAirspaceList->SetEnterCallback(OnAirspaceListEnter);
WndOwnerDrawFrame* wAirspaceListEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmAirspaceListEntry"));
if(wAirspaceListEntry) {
wAirspaceListEntry->SetCanFocus(true);
}
UpdateList(wAirspaceList);
changed = false;
wf->ShowModal();
delete wf;
return changed;
}
示例2: LoadDialog
static void
Main()
{
WndForm *form = LoadDialog(NULL, main_window, xmlfile.c_str());
if (form == NULL) {
_ftprintf(stderr, _T("Failed to load resource '%s'\n"), xmlfile.c_str());
return;
}
form->ShowModal();
delete form;
}
示例3: LoadDialog
void
dlgWeatherShowModal()
{
WndForm *wf = LoadDialog(nullptr, UIGlobals::GetMainWindow(),
_T("IDR_XML_WEATHER"));
if (wf == NULL)
return;
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(_T("prpTime"));
assert(wp != nullptr);
DataFieldEnum *dfe = (DataFieldEnum *)wp->GetDataField();
dfe->addEnumText(_("Now"));
for (unsigned i = 1; i < RasterWeather::MAX_WEATHER_TIMES; i++) {
if (RASP.isWeatherAvailable(i)) {
TCHAR timetext[10];
_stprintf(timetext, _T("%04d"), RASP.IndexToTime(i));
dfe->addEnumText(timetext, i);
}
}
dfe->Set(RASP.GetTime());
wp->RefreshDisplay();
wp = (WndProperty *)wf->FindByName(_T("prpDisplayItem"));
assert(wp != nullptr);
dfe = (DataFieldEnum *)wp->GetDataField();
dfe->EnableItemHelp(true);
dfe->addEnumText(_("Terrain"));
for (int i = 1; i <= 15; i++) {
const TCHAR *label = RASP.ItemLabel(i);
if (label != NULL)
dfe->AddChoice(i, label, nullptr, RASP.ItemHelp(i));
}
dfe->Set(RASP.GetParameter());
wp->RefreshDisplay();
wf->ShowModal();
wp = (WndProperty *)wf->FindByName(_T("prpTime"));
assert(wp != nullptr);
dfe = (DataFieldEnum *)wp->GetDataField();
RASP.SetTime(dfe->GetValue());
wp = (WndProperty *)wf->FindByName(_T("prpDisplayItem"));
assert(wp != nullptr);
dfe = (DataFieldEnum *)wp->GetDataField();
RASP.SetParameter(dfe->GetValue());
delete wf;
}
示例4: dlgAirspaceDetails
/*
* only called by #CAirspaceManager::ProcessAirspaceDetailQueue()
* for display AirspaceDetails, use #PopupAirspaceDetail
*/
void dlgAirspaceDetails() {
WndForm* wf = dlgLoadFromXML(CallBackTable, IDR_XML_AIRSPACEDETAILS);
if (!wf) return;
wf->SetTimerNotify(1000, OnTimer);
SetValues(wf);
wf->ShowModal();
delete wf;
wf = NULL;
return;
}
示例5: dlgChecklistShowModal
// checklistmode: 0=notepad 1=logbook 2=...
void dlgChecklistShowModal(short checklistmode){
WndListFrame* wDetails = NULL;
WndOwnerDrawFrame* wDetailsEntry = NULL;
InitNotepad();
LoadChecklist(checklistmode); // check if loaded really something
WndForm* wf = dlgLoadFromXML(CallBackTable, ScreenLandscape ? IDR_XML_CHECKLIST_L : IDR_XML_CHECKLIST_P);
aTextLine.clear();
if (!wf) goto deinit;
wf->SetKeyDownNotify(FormKeyDown);
((WndButton *)wf->FindByName(TEXT("cmdClose")))->SetOnClickNotify(OnCloseClicked);
wDetails = (WndListFrame*)wf->FindByName(TEXT("frmDetails"));
if (!wDetails) {
StartupStore(_T("..... NOTEPAD ERROR NULL frmDetails!\n"));
goto deinit;
}
wDetails->SetBorderKind(BORDERLEFT);
wDetailsEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmDetailsEntry"));
if (!wDetailsEntry) {
StartupStore(_T("..... NOTEPAD ERROR NULL frmDetailsEntry!\n"));
goto deinit;
}
wDetailsEntry->SetCanFocus(true);
page = 0;
NextPage(wf, 0);
wf->ShowModal();
deinit:
delete wf;
DeinitNotepad();
}
示例6: LoadDialog
void
dlgConfigWaypointsShowModal()
{
WndForm *wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
Layout::landscape
? _T("IDR_XML_CONFIG_WAYPOINTS_L")
: _T("IDR_XML_CONFIG_WAYPOINTS"));
assert(wf != nullptr);
WaypointsNeedSave = false;
wf->ShowModal();
if (WaypointsNeedSave &&
ShowMessageBox(_("Save changes to waypoint file?"), _("Waypoints edited"),
MB_YESNO | MB_ICONQUESTION) == IDYES)
SaveWaypoints();
delete wf;
}
示例7: LoadDialog
void
dlgVegaDemoShowModal()
{
WndForm *wf = LoadDialog(CallBackTable, UIGlobals::GetMainWindow(),
_T("IDR_XML_VEGADEMO"));
if (!wf) return;
PopupOperationEnvironment env;
VarioWriteNMEA(_T("PDVSC,S,DemoMode,0"), env);
VarioWriteNMEA(_T("PDVSC,S,DemoMode,3"), env);
LoadFormProperty(*wf, _T("prpVegaDemoW"), UnitGroup::VERTICAL_SPEED, VegaDemoW);
LoadFormProperty(*wf, _T("prpVegaDemoV"), UnitGroup::VERTICAL_SPEED, VegaDemoV);
LoadFormProperty(*wf, _T("prpVegaDemoAudioClimb"), VegaDemoAudioClimb);
wf->ShowModal();
delete wf;
// deactivate demo.
VarioWriteNMEA(_T("PDVSC,S,DemoMode,0"), env);
}
示例8: screen_size
static void
Main()
{
PixelSize screen_size(320, 240);
if (portrait)
std::swap(screen_size.cx, screen_size.cy);
Layout::Initialize(screen_size.cx, screen_size.cy);
SingleWindow main_window;
main_window.Create(_T("RunDialog"), screen_size);
main_window.Show();
WndForm *form = LoadDialog(NULL, main_window, xmlfile.c_str());
if (form == NULL) {
fprintf(stderr, "Failed to load resource '%s'\n",
(const char *)NarrowPathName(xmlfile.c_str()));
return;
}
form->ShowModal();
delete form;
}
示例9: Config
BOOL CDevCProbe::Config(PDeviceDescriptor_t d){
if(m_pDevice != d) {
StartupStore(_T("C-Probe Config : Invalide device descriptor%s"), NEWLINE);
return FALSE;
}
WndForm* wf = dlgLoadFromXML(CallBackTable, IDR_XML_DEVCPROBE);
if(wf) {
WndButton *wBt = NULL;
wBt = (WndButton *)wf->FindByName(TEXT("cmdClose"));
if(wBt){
wBt->SetOnClickNotify(OnCloseClicked);
}
wBt = (WndButton *)wf->FindByName(TEXT("cmdSetCompassCal"));
if(wBt){
wBt->SetOnClickNotify(OnCompassCalClicked);
}
wBt = (WndButton *)wf->FindByName(TEXT("cmdSetCalGyro"));
if(wBt){
wBt->SetOnClickNotify(OnCalGyroClicked);
}
wBt = (WndButton *)wf->FindByName(TEXT("cmdZeroDeltaPress"));
if(wBt){
wBt->SetOnClickNotify(OnZeroDeltaPressClicked);
}
GetFirmwareVersion(m_pDevice);
wf->SetTimerNotify(1000, OnTimer);
wf->ShowModal();
delete wf;
wf=NULL;
}
return TRUE;
}
示例10: WndButton
//.........这里部分代码省略.........
wf = new WndForm(&XCSoarInterface::main_window, _T("frmXcSoarMessageDlg"),
lpCaption, X, Y, Width, Height);
wf->SetFont(MapWindowBoldFont);
wf->SetTitleFont(MapWindowBoldFont);
wf->SetBackColor(Color(0xDA, 0xDB, 0xAB));
// Create text element
wText = new WndFrame(wf, _T("frmMessageDlgText"),
0, Layout::Scale(5), Width, Height);
wText->SetCaption(lpText);
wText->SetFont(MapWindowBoldFont);
wText->SetCaptionStyle(DT_EXPANDTABS | DT_CENTER | DT_NOCLIP | DT_WORDBREAK);
// | DT_VCENTER
/* TODO code: this doesnt work to set font height
dY = wText->GetLastDrawTextHeight() - Height;
*/
dY = Layout::Scale(-40);
wText->resize(Width, wText->GetTextHeight() + 5);
wf->resize(Width, wf->get_size().cy + dY);
y += dY;
// Create buttons
uType = uType & 0x000f;
if (uType == MB_OK || uType == MB_OKCANCEL) {
wButtons[ButtonCount] =
new WndButton(wf, _T(""), gettext(_T("OK")), 0, y, w, h, OnButtonClick);
wButtons[ButtonCount]->SetTag(IDOK);
ButtonCount++;
}
if (uType == MB_YESNO || uType == MB_YESNOCANCEL) {
wButtons[ButtonCount] =
new WndButton(wf, _T(""), gettext(_T("Yes")), 0, y, w, h, OnButtonClick);
wButtons[ButtonCount]->SetTag(IDYES);
ButtonCount++;
wButtons[ButtonCount] =
new WndButton(wf, _T(""), gettext(_T("No")), 0, y, w, h, OnButtonClick);
wButtons[ButtonCount]->SetTag(IDNO);
ButtonCount++;
}
if (uType == MB_ABORTRETRYIGNORE || uType == MB_RETRYCANCEL) {
wButtons[ButtonCount] =
new WndButton(wf, _T(""), gettext(_T("Retry")), 0, y, w, h, OnButtonClick);
wButtons[ButtonCount]->SetTag(IDRETRY);
ButtonCount++;
}
if (uType == MB_OKCANCEL || uType == MB_RETRYCANCEL || uType == MB_YESNOCANCEL) {
wButtons[ButtonCount] =
new WndButton(wf, _T(""), gettext(_T("Cancel")), 0, y, w, h, OnButtonClick);
wButtons[ButtonCount]->SetTag(IDCANCEL);
ButtonCount++;
}
if (uType == MB_ABORTRETRYIGNORE) {
wButtons[ButtonCount] =
new WndButton(wf, _T(""), gettext(_T("Abort")), 0, y, w, h, OnButtonClick);
wButtons[ButtonCount]->SetTag(IDABORT);
ButtonCount++;
wButtons[ButtonCount] =
new WndButton(wf, _T(""), gettext(_T("Ignore")), 0, y, w, h, OnButtonClick);
wButtons[ButtonCount]->SetTag(IDIGNORE);
ButtonCount++;
}
d = Width / (ButtonCount);
x = d / 2 - w / 2;
// Move buttons to the right positions
for (i = 0; i < ButtonCount; i++) {
wButtons[i]->move(x, y);
x += d;
}
// Show MessageBox and save result
res = wf->ShowModal();
delete wf;
#ifdef ALTAIRSYNC
// force a refresh of the window behind
InvalidateRect(hWnd,NULL,true);
UpdateWindow(hWnd);
#endif
return(res);
}
示例11: GetCommandLine
int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
#ifdef _WIN32_WCE
LPWSTR lpCmdLine,
#else
LPSTR lpCmdLine2,
#endif
int nCmdShow)
#endif
{
#ifdef WIN32
#ifndef _WIN32_WCE
/* on Windows (non-CE), the lpCmdLine argument is narrow, and we
have to use GetCommandLine() to get the UNICODE string */
LPCTSTR lpCmdLine = GetCommandLine();
#endif
#ifdef _WIN32_WCE
int argc = 2;
WCHAR arg0[] = _T("");
LPWSTR argv[] = { arg0, lpCmdLine, NULL };
#else
int argc;
LPWSTR* argv = CommandLineToArgvW(lpCmdLine, &argc);
#endif
ResourceLoader::Init(hInstance);
#endif
if (argc < 2) {
fprintf(stderr, "Usage: RunDialog XMLFILE [-portrait]\n");
return 1;
}
unsigned screen_width = 320, screen_height = 240;
if (argc > 2 && _tcscmp(argv[2], _T("-portrait")) == 0) {
screen_width = 240;
screen_height = 320;
}
ScreenGlobalInit screen_init;
Layout::Initialize(screen_width, screen_height);
SingleWindow main_window;
main_window.set(_T("STATIC"), _T("RunDialog"),
0, 0, screen_width, screen_height);
main_window.show();
WndForm *form = LoadDialog(NULL, main_window, argv[1]);
if (form == NULL) {
fprintf(stderr, "Failed to load resource '%s'\n",
(const char *)NarrowPathName(argv[1]));
return 1;
}
form->ShowModal();
delete form;
return 0;
}