本文整理汇总了C++中WndButton::SetVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ WndButton::SetVisible方法的具体用法?C++ WndButton::SetVisible怎么用?C++ WndButton::SetVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WndButton
的用法示例。
在下文中一共展示了WndButton::SetVisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateVisibility
void UpdateVisibility() {
assert(visible);
edit_button->SetVisible(show_edit);
mutate_button->SetVisible(show_mutate);
down_button->SetVisible(show_down);
up_button->SetVisible(show_up);
clear_all_button->Show();
}
示例2:
void
AirspaceConfigPanel::SetButtonsVisible(bool active)
{
if (buttonColors != NULL)
buttonColors->SetVisible(active);
if (buttonMode != NULL)
buttonMode->SetVisible(active);
}
示例3:
void
PolarConfigPanel::SetVisible(bool active)
{
if (buttonList != NULL)
buttonList->SetVisible(active);
if (buttonImport != NULL)
buttonImport->SetVisible(active);
if (buttonExport != NULL)
buttonExport->SetVisible(active);
}
示例4:
void
WaypointDetailsWidget::UpdatePage()
{
info_dock.SetVisible(page == 0);
details_panel.SetVisible(page == 1);
commands_dock.SetVisible(page == 2);
bool image_page = page >= 3;
if (!images.empty()) {
image_window.SetVisible(image_page);
magnify_button.SetVisible(image_page);
shrink_button.SetVisible(image_page);
}
}
示例5:
void
FlightSetupPanel::SetButtons()
{
dump_button->SetVisible(polar_settings.glide_polar_task.HasBallast());
const ComputerSettings &settings = CommonInterface::GetComputerSettings();
dump_button->SetCaption(settings.polar.ballast_timer_active
? _("Stop") : _("Dump"));
}
示例6: UpdateTextboxProp
static void UpdateTextboxProp(void)
{
WndProperty *wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpText"));
if (wp) {
wp->SetText(edittext);
if(WaypointKeyRed)
wp->SetCaption(MsgToken(949));
else
wp->SetCaption(TEXT("Text"));
}
wp = (WndProperty*)wf->FindByName(TEXT("prpUnit"));
if(wp && wKeyboardPopupWndProperty) {
DataField* pField = wKeyboardPopupWndProperty->GetDataField();
if(pField) {
wp->SetCaption(pField->GetUnits());
wp->RefreshDisplay();
wp->Redraw();
}
}
{
WndButton *wb;
if(WaypointKeyRed)
{
ReduceKeysByWaypointList();
wb = (WndButton*) wf->FindByName(TEXT("prpDate")); if(wb != NULL) wb->SetVisible(false);
wb = (WndButton*) wf->FindByName(TEXT("prpTime")); if(wb != NULL) wb->SetVisible(false);
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMatch"));; if(wp != NULL) wp->SetVisible(WaypointKeyRed);
/*
CharUpper(szLanguageFile);
BOOL bGerChar = false;
if( _tcscmp(szLanguageFile,_T("GERMAN.LNG"))==0)
bGerChar = true;
wb = (WndButton*) wf->FindByName(TEXT("prpAe")); if(wb != NULL) wb->SetVisible(bGerChar);
wb = (WndButton*) wf->FindByName(TEXT("prpOe")); if(wb != NULL) wb->SetVisible(bGerChar);
wb = (WndButton*) wf->FindByName(TEXT("prpUe")); if(wb != NULL) wb->SetVisible(bGerChar);
*/
}
}
示例7: RemoveKeys
void RemoveKeys(char *EnabledKeyString, unsigned char size)
{
bool bA=false, bB=false, bC=false, bD=false, bE=false, bF=false, bG=false, bH=false, bI=false,
bJ=false, bK=false, bL=false, bM=false, bN=false, bO=false, bP=false, bQ=false, bR=false,
bS=false, bT=false, bU=false, bV=false, bW=false, bX=false, bY=false, bZ=false, b0=false,
b1=false, b2=false, b3=false, b4=false, b5=false, b6=false, b7=false, b8=false, b9=false,
bUe=false, bOe=false, bAe=false, bDot=false, bMin=false, bAt=false, bUn=false ;
unsigned int i=0;
for (i = 0; i < size; i++ )
{
switch (EnabledKeyString[i])
{
case 'a': case 'A': bA = true; break;
case 'b': case 'B': bB = true; break;
case 'c': case 'C': bC = true; break;
case 'd': case 'D': bD = true; break;
case 'e': case 'E': bE = true; break;
case 'f': case 'F': bF = true; break;
case 'g': case 'G': bG = true; break;
case 'h': case 'H': bH = true; break;
case 'i': case 'I': bI = true; break;
case 'j': case 'J': bJ = true; break;
case 'k': case 'K': bK = true; break;
case 'l': case 'L': bL = true; break;
case 'm': case 'M': bM = true; break;
case 'n': case 'N': bN = true; break;
case 'o': case 'O': bO = true; break;
case 'p': case 'P': bP = true; break;
case 'q': case 'Q': bQ = true; break;
case 'r': case 'R': bR = true; break;
case 's': case 'S': bS = true; break;
case 't': case 'T': bT = true; break;
case 'u': case 'U': bU = true; break;
case 'v': case 'V': bV = true; break;
case 'w': case 'W': bW = true; break;
case 'x': case 'X': bX = true; break;
case 'y': case 'Y': bY = true; break;
case 'z': case 'Z': bZ = true; break;
/*
case '\xF6': case '\xD6': bUe = true; break; // ü Ü
case '\xFC': case '\xDC': bOe = true; break; //ö Ö
case '\xE4': case '\xC4': bAe = true; break; // ä Ä
*/
case '0': b0 = true; break;
case '1': b1 = true; break;
case '2': b2 = true; break;
case '3': b3 = true; break;
case '4': b4 = true; break;
case '5': b5 = true; break;
case '6': b6 = true; break;
case '7': b7 = true; break;
case '8': b8 = true; break;
case '9': b9 = true; break;
case '.': bDot = true; break;
case '-': bMin = true; break;
case '@': bAt = true; break;
case '_': bUn = true; break;
// case ' ': bSpace = true; break;
default: break;
}
}
WndButton *wb;
wb = (WndButton*) wf->FindByName(TEXT("prpA")); if(wb != NULL) wb->SetVisible(bA);
wb = (WndButton*) wf->FindByName(TEXT("prpB")); if(wb != NULL) wb->SetVisible(bB);
wb = (WndButton*) wf->FindByName(TEXT("prpC")); if(wb != NULL) wb->SetVisible(bC);
wb = (WndButton*) wf->FindByName(TEXT("prpD")); if(wb != NULL) wb->SetVisible(bD);
wb = (WndButton*) wf->FindByName(TEXT("prpE")); if(wb != NULL) wb->SetVisible(bE);
wb = (WndButton*) wf->FindByName(TEXT("prpF")); if(wb != NULL) wb->SetVisible(bF);
wb = (WndButton*) wf->FindByName(TEXT("prpG")); if(wb != NULL) wb->SetVisible(bG);
wb = (WndButton*) wf->FindByName(TEXT("prpH")); if(wb != NULL) wb->SetVisible(bH);
wb = (WndButton*) wf->FindByName(TEXT("prpI")); if(wb != NULL) wb->SetVisible(bI);
wb = (WndButton*) wf->FindByName(TEXT("prpJ")); if(wb != NULL) wb->SetVisible(bJ);
wb = (WndButton*) wf->FindByName(TEXT("prpK")); if(wb != NULL) wb->SetVisible(bK);
wb = (WndButton*) wf->FindByName(TEXT("prpL")); if(wb != NULL) wb->SetVisible(bL);
wb = (WndButton*) wf->FindByName(TEXT("prpM")); if(wb != NULL) wb->SetVisible(bM);
wb = (WndButton*) wf->FindByName(TEXT("prpN")); if(wb != NULL) wb->SetVisible(bN);
wb = (WndButton*) wf->FindByName(TEXT("prpO")); if(wb != NULL) wb->SetVisible(bO);
wb = (WndButton*) wf->FindByName(TEXT("prpP")); if(wb != NULL) wb->SetVisible(bP);
wb = (WndButton*) wf->FindByName(TEXT("prpQ")); if(wb != NULL) wb->SetVisible(bQ);
wb = (WndButton*) wf->FindByName(TEXT("prpR")); if(wb != NULL) wb->SetVisible(bR);
wb = (WndButton*) wf->FindByName(TEXT("prpS")); if(wb != NULL) wb->SetVisible(bS);
wb = (WndButton*) wf->FindByName(TEXT("prpT")); if(wb != NULL) wb->SetVisible(bT);
wb = (WndButton*) wf->FindByName(TEXT("prpU")); if(wb != NULL) wb->SetVisible(bU);
wb = (WndButton*) wf->FindByName(TEXT("prpV")); if(wb != NULL) wb->SetVisible(bV);
wb = (WndButton*) wf->FindByName(TEXT("prpW")); if(wb != NULL) wb->SetVisible(bW);
wb = (WndButton*) wf->FindByName(TEXT("prpX")); if(wb != NULL) wb->SetVisible(bX);
wb = (WndButton*) wf->FindByName(TEXT("prpY")); if(wb != NULL) wb->SetVisible(bY);
wb = (WndButton*) wf->FindByName(TEXT("prpZ")); if(wb != NULL) wb->SetVisible(bZ);
wb = (WndButton*) wf->FindByName(TEXT("prp0")); if(wb != NULL) wb->SetVisible(b0);
wb = (WndButton*) wf->FindByName(TEXT("prp1")); if(wb != NULL) wb->SetVisible(b1);
wb = (WndButton*) wf->FindByName(TEXT("prp2")); if(wb != NULL) wb->SetVisible(b2);
wb = (WndButton*) wf->FindByName(TEXT("prp3")); if(wb != NULL) wb->SetVisible(b3);
//.........这里部分代码省略.........
示例8: dlgStatusShowModal
void dlgStatusShowModal(int start_page){
if (start_page==-1) {
multi_page = true;
status_page = max(0,min(NUMPAGES-1,status_page));
} else {
status_page = start_page;
multi_page = false;
}
first = true;
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgStatus.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_STATUS"));
if (!wf) return;
#if FASTPAGE
// LButtonUp notify will intercept ALL touchscreen and then ALSO process them
// normally, such as in buttons. For this reason we must use TouchContext.
wf->SetLButtonUpNotify(TouchKeyDown);
#endif
wf->SetKeyDownNotify(FormKeyDown);
((WndButton *)wf->FindByName(TEXT("cmdClose")))->SetOnClickNotify(OnCloseClicked);
wStatus0 = ((WndFrame *)wf->FindByName(TEXT("frmStatusFlight")));
wStatus1 = ((WndFrame *)wf->FindByName(TEXT("frmStatusSystem")));
wStatus2 = ((WndFrame *)wf->FindByName(TEXT("frmStatusTask")));
wStatus3 = ((WndFrame *)wf->FindByName(TEXT("frmStatusRules")));
wStatus4 = ((WndFrame *)wf->FindByName(TEXT("frmStatusTimes")));
wStatus5 = ((WndFrame *)wf->FindByName(TEXT("frmStatusExtDevice")));
//ASSERT(wStatus0!=NULL);
//ASSERT(wStatus1!=NULL);
//ASSERT(wStatus2!=NULL);
//ASSERT(wStatus3!=NULL);
//ASSERT(wStatus4!=NULL);
//ASSERT(wStatus5!=NULL);
wf->SetTimerNotify(OnTimerNotify);
if (!multi_page) {
WndButton *wb;
wb = ((WndButton *)wf->FindByName(TEXT("cmdNext")));
if (wb != NULL) {
wb->SetVisible(false);
}
wb = ((WndButton *)wf->FindByName(TEXT("cmdPrev")));
if (wb != NULL) {
wb->SetVisible(false);
}
}
nearest_waypoint = FindNearestWayPoint(GPS_INFO.Longitude,
GPS_INFO.Latitude,
100000.0, true); // big range limit
UpdateValuesSystem();
UpdateValuesFlight();
UpdateValuesTask();
UpdateValuesRules();
UpdateValuesTimes();
NextPage(0); // just to turn proper pages on/off
wf->ShowModal();
delete wf;
wf = NULL;
}
示例9: SetValues
static void SetValues(bool first=false) {
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskFinishLine"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (first) {
// LKTOKEN [email protected]_ = "Cylinder"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "Line"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "FAI Sector"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
}
dfe->Set(FinishLine);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskFinishRadius"));
if (wp) {
wp->GetDataField()->SetAsFloat(lround(FinishRadius*DISTANCEMODIFY*DISTANCE_ROUNDING)/DISTANCE_ROUNDING);
wp->GetDataField()->SetUnits(Units::GetDistanceName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskStartLine"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (first) {
// LKTOKEN [email protected]_ = "Cylinder"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "Line"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "FAI Sector"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
}
dfe->SetDetachGUI(true); // disable call to OnAATEnabled
dfe->Set(StartLine);
dfe->SetDetachGUI(false);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskStartRadius"));
if (wp) {
wp->GetDataField()->SetAsFloat(lround(StartRadius*DISTANCEMODIFY*DISTANCE_ROUNDING)/DISTANCE_ROUNDING);
wp->GetDataField()->SetUnits(Units::GetDistanceName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskFAISector"));
if (wp) {
wp->SetVisible(AATEnabled==0);
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (first) {
// LKTOKEN [email protected]_ = "Cylinder"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "FAI Sector"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
dfe->addEnumText(gettext(TEXT("DAe 0.5/10")));
}
dfe->SetDetachGUI(true); // disable call to OnAATEnabled
dfe->Set(SectorType);
dfe->SetDetachGUI(false);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpTaskSectorRadius"));
if (wp) {
wp->SetVisible(AATEnabled==0);
wp->GetDataField()->SetAsFloat(lround(SectorRadius*DISTANCEMODIFY*DISTANCE_ROUNDING)/DISTANCE_ROUNDING);
wp->GetDataField()->SetUnits(Units::GetDistanceName());
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpAutoAdvance"));
if (wp) {
DataFieldEnum* dfe;
dfe = (DataFieldEnum*)wp->GetDataField();
if (first) {
// LKTOKEN [email protected]_ = "Manual"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ "Auto"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "Arm"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
// LKTOKEN [email protected]_ = "Arm start"
dfe->addEnumText(gettext(TEXT("[email protected]_")));
}
dfe->Set(AutoAdvance);
wp->RefreshDisplay();
}
wp = (WndProperty*)wf->FindByName(TEXT("prpMinTime"));
if (wp) {
wp->SetVisible(AATEnabled>0);
wp->GetDataField()->SetAsFloat(AATTaskLength);
wp->RefreshDisplay();
//.........这里部分代码省略.........
示例10: dlgTaskWaypointShowModal
void dlgTaskWaypointShowModal(int itemindex, int tasktype, bool addonly){
wf = NULL;
if (!ScreenLandscape) {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgTaskWaypoint_L.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_TASKWAYPOINT_L"));
} else {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgTaskWaypoint.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_TASKWAYPOINT"));
}
if (ISPARAGLIDER) {
if(DoOptimizeRoute())
AATEnabled=TRUE;
EnableMultipleStartPoints=false;
}
twItemIndex = itemindex;
twType = tasktype;
if (!wf) return;
//ASSERT(wf!=NULL);
// wf->SetKeyDownNotify(FormKeyDown);
wStart = ((WndFrame *)wf->FindByName(TEXT("frmStart")));
wTurnpoint = ((WndFrame *)wf->FindByName(TEXT("frmTurnpoint")));
wAATTurnpoint = ((WndFrame *)wf->FindByName(TEXT("frmAATTurnpoint")));
wFinish = ((WndFrame *)wf->FindByName(TEXT("frmFinish")));
//ASSERT(wStart!=NULL);
//ASSERT(wTurnpoint!=NULL);
//ASSERT(wAATTurnpoint!=NULL);
//ASSERT(wFinish!=NULL);
WndButton* wb;
if (addonly) {
wb = (WndButton *)wf->FindByName(TEXT("butSelect"));
if (wb) {
wb->SetVisible(false);
}
wb = (WndButton *)wf->FindByName(TEXT("butRemove"));
if (wb) {
wb->SetVisible(false);
}
wb = (WndButton *)wf->FindByName(TEXT("butDetails"));
if (wb) {
wb->SetVisible(false);
}
wb = (WndButton *)wf->FindByName(TEXT("butDown"));
if (wb) {
wb->SetVisible(false);
}
wb = (WndButton *)wf->FindByName(TEXT("butUp"));
if (wb) {
wb->SetVisible(false);
}
} else {
if (!ValidTaskPoint(twItemIndex-1)) {
wb = (WndButton *)wf->FindByName(TEXT("butUp"));
if (wb) {
wb->SetVisible(false);
}
}
if (!ValidTaskPoint(twItemIndex+1)) {
wb = (WndButton *)wf->FindByName(TEXT("butDown"));
if (wb) {
wb->SetVisible(false);
}
}
}
SetWaypointValues(true);
switch (twType) {
case 0:
wStart->SetVisible(1);
wTurnpoint->SetVisible(0);
wAATTurnpoint->SetVisible(0);
wFinish->SetVisible(0);
break;
case 1:
wStart->SetVisible(0);
if (AATEnabled) {
wTurnpoint->SetVisible(0);
wAATTurnpoint->SetVisible(1);
} else {
wTurnpoint->SetVisible(1);
wAATTurnpoint->SetVisible(0);
}
wFinish->SetVisible(0);
//.........这里部分代码省略.........
示例11: dlgTaskOverviewShowModal
void dlgTaskOverviewShowModal(int Idx){
UpLimit = 0;
LowLimit = 0;
ItemIndex = Idx; //-1;
showAdvanced = false;
wf = NULL;
if (!ScreenLandscape) {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgTaskOverview_L.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_TASKOVERVIEW_L"));
} else {
char filename[MAX_PATH];
LocalPathS(filename, TEXT("dlgTaskOverview.xml"));
wf = dlgLoadFromXML(CallBackTable,
filename,
hWndMainWindow,
TEXT("IDR_XML_TASKOVERVIEW"));
}
if (!wf) return;
WndButton *wb = (WndButton*)wf->FindByName(TEXT("cmdTimegates"));
if (wb) wb->SetVisible(false);
if (ISPARAGLIDER) {
if (PGOptimizeRoute) AATEnabled=true; // force it on
EnableMultipleStartPoints=false;
if (wb) wb->SetVisible(true);
wb = (WndButton*)wf->FindByName(TEXT("cmdDelete"));
if (wb) wb->SetVisible(false);
}
UpdateCaption();
wfAdvanced = ((WndFrame *)wf->FindByName(TEXT("frmAdvanced")));
wTaskList = (WndListFrame*)wf->FindByName(TEXT("frmTaskList"));
wTaskList->SetBorderKind(BORDERLEFT);
wTaskList->SetEnterCallback(OnTaskListEnter);
wTaskList->SetWidth(wf->GetWidth() - wTaskList->GetLeft()-2);
wTaskListEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmTaskListEntry"));
// ScrollbarWidth is initialised from DrawScrollBar in WindowControls, so it might not be ready here
if ( wTaskList->ScrollbarWidth == -1) {
#if defined (PNA)
#define SHRINKSBFACTOR 1.0 // shrink width factor. Range .1 to 1 where 1 is very "fat"
#else
#define SHRINKSBFACTOR 0.75 // shrink width factor. Range .1 to 1 where 1 is very "fat"
#endif
wTaskList->ScrollbarWidth = (int) (SCROLLBARWIDTH_INITIAL * ScreenDScale * SHRINKSBFACTOR);
}
wTaskListEntry->SetWidth(wTaskList->GetWidth() - wTaskList->ScrollbarWidth - 5);
wTaskListEntry = (WndOwnerDrawFrame*)wf-> FindByName(TEXT("frmTaskListEntry"));
wTaskListEntry->SetCanFocus(true);
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpFile"));
if (wp) {
DataFieldFileReader* dfe;
dfe = (DataFieldFileReader*)wp->GetDataField();
TCHAR suff[10];
_stprintf(suff,_T("*%S"),LKS_TSK);
dfe->ScanDirectoryTop(_T(LKD_TASKS),suff);
_stprintf(suff,_T("*%S"),LKS_OLD_TSK);
dfe->ScanDirectoryTop(_T(LKD_TASKS),suff);
_stprintf(suff,_T("*%S"),LKS_WP_CUP);
dfe->ScanDirectoryTop(_T(LKD_TASKS),suff);
wp->RefreshDisplay();
}
UpdateFilePointer();
// initialise and turn on the display
OverviewRefreshTask();
UpdateAdvanced();
wTaskList->SetItemIndexPos(Idx);
wTaskList->Redraw();
wTaskListEntry->SetFocused(true,NULL);
wf->ShowModal();
// now retrieve back the properties...
//.........这里部分代码省略.........
示例12: PanelWidget
static void
RefreshView()
{
wTaskView->Invalidate();
OrderedTaskPoint &tp = ordered_task->GetPoint(active_index);
dock->SetWidget(new PanelWidget());
ObservationZonePoint &oz = tp.GetObservationZone();
const bool is_fai_general =
ordered_task->GetFactoryType() == TaskFactoryType::FAI_GENERAL;
properties_widget = CreateObservationZoneEditWidget(oz, is_fai_general);
if (properties_widget != nullptr) {
properties_widget->SetListener(&listener);
dock->SetWidget(properties_widget);
}
WndFrame* wfrm = nullptr;
wfrm = ((WndFrame*)wf->FindByName(_T("lblType")));
if (wfrm)
wfrm->SetCaption(OrderedTaskPointName(ordered_task->GetFactory().GetType(tp)));
SetFormControlEnabled(*wf, _T("butPrevious"), active_index > 0);
SetFormControlEnabled(*wf, _T("butNext"),
active_index < (ordered_task->TaskSize() - 1));
WndButton* wb;
wb = (WndButton*)wf->FindByName(_T("cmdOptionalStarts"));
assert(wb);
wb->SetVisible(active_index == 0);
if (!ordered_task->HasOptionalStarts())
wb->SetCaption(_("Enable Alternate Starts"));
else {
StaticString<50> tmp;
tmp.Format(_T("%s (%d)"), _("Edit Alternates"),
ordered_task->GetOptionalStartPointCount());
wb->SetCaption(tmp);
}
CheckBoxControl &score_exit = *(CheckBoxControl *)
wf->FindByName(_T("ScoreExit"));
if (tp.GetType() == TaskPointType::AST) {
const ASTPoint &ast = (const ASTPoint &)tp;
score_exit.Show();
score_exit.SetState(ast.GetScoreExit());
} else
score_exit.Hide();
StaticString<100> name_prefix_buffer, type_buffer;
switch (tp.GetType()) {
case TaskPointType::START:
type_buffer = _("Start point");
name_prefix_buffer = _T("Start: ");
break;
case TaskPointType::AST:
type_buffer = _("Task point");
name_prefix_buffer.Format(_T("%d: "), active_index);
break;
case TaskPointType::AAT:
type_buffer = _("Assigned area point");
name_prefix_buffer.Format(_T("%d: "), active_index);
break;
case TaskPointType::FINISH:
type_buffer = _("Finish point");
name_prefix_buffer = _T("Finish: ");
break;
default:
gcc_unreachable();
}
wf->SetCaption(type_buffer);
wfrm = ((WndFrame*)wf->FindByName(_T("lblLocation")));
if (wfrm) {
StaticString<100> buffer;
buffer.Format(_T("%s %s"), name_prefix_buffer.c_str(),
tp.GetWaypoint().name.c_str());
wfrm->SetCaption(buffer);
}
}
示例13: dlgStatusShowModal
void dlgStatusShowModal(int start_page){
if (start_page==-1) {
multi_page = true;
status_page = max(0,min(NUMPAGES-1,status_page));
} else {
status_page = start_page;
multi_page = false;
}
first = true;
wf = dlgLoadFromXML(CallBackTable,
TEXT("dlgStatus.xml"),
XCSoarInterface::main_window,
TEXT("IDR_XML_STATUS"));
if (!wf) return;
wf->SetKeyDownNotify(FormKeyDown);
((WndButton *)wf->FindByName(TEXT("cmdClose")))->SetOnClickNotify(OnCloseClicked);
wStatus0 = ((WndFrame *)wf->FindByName(TEXT("frmStatusFlight")));
wStatus1 = ((WndFrame *)wf->FindByName(TEXT("frmStatusSystem")));
wStatus2 = ((WndFrame *)wf->FindByName(TEXT("frmStatusTask")));
wStatus3 = ((WndFrame *)wf->FindByName(TEXT("frmStatusRules")));
wStatus4 = ((WndFrame *)wf->FindByName(TEXT("frmStatusTimes")));
assert(wStatus0!=NULL);
assert(wStatus1!=NULL);
assert(wStatus2!=NULL);
assert(wStatus3!=NULL);
assert(wStatus4!=NULL);
wf->SetTimerNotify(OnTimerNotify);
if (!multi_page) {
WndButton *wb;
wb = ((WndButton *)wf->FindByName(TEXT("cmdNext")));
if (wb != NULL) {
wb->SetVisible(false);
}
wb = ((WndButton *)wf->FindByName(TEXT("cmdPrev")));
if (wb != NULL) {
wb->SetVisible(false);
}
}
nearest_waypoint = FindNearestWayPoint(way_points,
XCSoarInterface::main_window.map,
XCSoarInterface::Basic().Location,
100000.0, true); // big range limit
UpdateValuesSystem();
UpdateValuesFlight();
UpdateValuesTask();
UpdateValuesRules();
UpdateValuesTimes();
NextPage(0); // just to turn proper pages on/off
wf->ShowModal();
delete wf;
wf = NULL;
}
示例14: dlgTaskOverviewShowModal
void dlgTaskOverviewShowModal(int Idx){
UpLimit = 0;
LowLimit = 0;
ItemIndex = Idx; //-1;
showAdvanced = false;
wf = dlgLoadFromXML(CallBackTable, ScreenLandscape ? IDR_XML_TASKOVERVIEW_L : IDR_XML_TASKOVERVIEW_P);
if (!wf) return;
WndButton *wb = (WndButton*)wf->FindByName(TEXT("cmdTimegates"));
if (wb) wb->SetVisible(false);
if (ISPARAGLIDER) {
if (PGOptimizeRoute) AATEnabled=true; // force it on
EnableMultipleStartPoints=false;
if (wb) wb->SetVisible(true);
wb = (WndButton*)wf->FindByName(TEXT("cmdDelete"));
if (wb) wb->SetVisible(false);
}
UpdateCaption();
wfAdvanced = ((WndFrame *)wf->FindByName(TEXT("frmAdvanced")));
wTaskList = (WndListFrame*)wf->FindByName(TEXT("frmTaskList"));
wTaskList->SetBorderKind(BORDERLEFT);
wTaskList->SetEnterCallback(OnTaskListEnter);
wTaskListEntry = (WndOwnerDrawFrame*)wf->FindByName(TEXT("frmTaskListEntry"));
wTaskListEntry->SetCanFocus(true);
WndProperty* wp;
wp = (WndProperty*)wf->FindByName(TEXT("prpFile"));
if (wp) {
wp->SetVisible(false);
DataFieldFileReader* dfe = static_cast<DataFieldFileReader*>(wp->GetDataField());
if(dfe) {
dfe->ScanDirectoryTop(_T(LKD_TASKS), _T("*" LKS_TSK));
#ifdef OLDTASK_COMPAT
dfe->ScanDirectoryTop(_T(LKD_TASKS), _T("*" LKS_OLD_TSK));
#endif
dfe->ScanDirectoryTop(_T(LKD_TASKS), _T("*" LKS_WP_CUP));
dfe->ScanDirectoryTop(_T(LKD_TASKS), _T("*" LKS_WP_GPX));
}
wp->RefreshDisplay();
}
UpdateFilePointer();
// initialise and turn on the display
OverviewRefreshTask();
UpdateAdvanced();
wTaskList->SetItemIndexPos(Idx);
wTaskList->Redraw();
wTaskListEntry->SetFocus();
wf->ShowModal();
// now retrieve back the properties...
RefreshTask();
delete wf;
wf = NULL;
}
示例15: PanelWidget
void
TaskPointWidget::RefreshView()
{
map.Invalidate();
OrderedTaskPoint &tp = ordered_task->GetPoint(active_index);
properties_dock.SetWidget(new PanelWidget());
ObservationZonePoint &oz = tp.GetObservationZone();
const bool is_fai_general =
ordered_task->GetFactoryType() == TaskFactoryType::FAI_GENERAL;
properties_widget = CreateObservationZoneEditWidget(oz, is_fai_general);
if (properties_widget != nullptr) {
properties_widget->SetListener(this);
properties_dock.SetWidget(properties_widget);
}
type_label.SetCaption(OrderedTaskPointName(ordered_task->GetFactory().GetType(tp)));
previous_button->SetEnabled(active_index > 0);
next_button->SetEnabled(active_index < (ordered_task->TaskSize() - 1));
optional_starts.SetVisible(active_index == 0);
if (!ordered_task->HasOptionalStarts())
optional_starts.SetCaption(_("Enable Alternate Starts"));
else {
StaticString<50> tmp;
tmp.Format(_T("%s (%d)"), _("Edit Alternates"),
ordered_task->GetOptionalStartPointCount());
optional_starts.SetCaption(tmp);
}
if (tp.GetType() == TaskPointType::AST) {
const ASTPoint &ast = (const ASTPoint &)tp;
score_exit.Show();
score_exit.SetState(ast.GetScoreExit());
} else
score_exit.Hide();
StaticString<100> name_prefix_buffer, type_buffer;
switch (tp.GetType()) {
case TaskPointType::START:
type_buffer = _("Start point");
name_prefix_buffer = _T("Start: ");
break;
case TaskPointType::AST:
type_buffer = _("Task point");
name_prefix_buffer.Format(_T("%d: "), active_index);
break;
case TaskPointType::AAT:
type_buffer = _("Assigned area point");
name_prefix_buffer.Format(_T("%d: "), active_index);
break;
case TaskPointType::FINISH:
type_buffer = _("Finish point");
name_prefix_buffer = _T("Finish: ");
break;
default:
gcc_unreachable();
}
dialog.SetCaption(type_buffer);
{
StaticString<100> buffer;
buffer.Format(_T("%s %s"), name_prefix_buffer.c_str(),
tp.GetWaypoint().name.c_str());
waypoint_name.SetCaption(buffer);
}
}