本文整理汇总了C++中WndButton::SetCaption方法的典型用法代码示例。如果您正苦于以下问题:C++ WndButton::SetCaption方法的具体用法?C++ WndButton::SetCaption怎么用?C++ WndButton::SetCaption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WndButton
的用法示例。
在下文中一共展示了WndButton::SetCaption方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadWindow
void
MacCreadyEditPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
LoadWindow(call_back_table, parent, _T("IDR_XML_INFOBOXMACCREADYEDIT"));
TCHAR caption[16];
WndButton *button = (WndButton *)form.FindByName(_T("cmdPlusBig"));
assert(button != NULL);
FormatUserVerticalSpeed(
Units::ToSysVSpeed(GetUserVerticalSpeedStep() * 5), caption, false);
button->SetCaption(caption);
button = (WndButton *)form.FindByName(_T("cmdPlusSmall"));
assert(button != NULL);
FormatUserVerticalSpeed(
Units::ToSysVSpeed(GetUserVerticalSpeedStep()), caption, false);
button->SetCaption(caption);
button = (WndButton *)form.FindByName(_T("cmdMinusBig"));
assert(button != NULL);
FormatUserVerticalSpeed(
Units::ToSysVSpeed(-GetUserVerticalSpeedStep() * 5), caption, false);
button->SetCaption(caption);
button = (WndButton *)form.FindByName(_T("cmdMinusSmall"));
assert(button != NULL);
FormatUserVerticalSpeed(
Units::ToSysVSpeed(-GetUserVerticalSpeedStep()), caption, false);
button->SetCaption(caption);
}
示例2: tpv
static void
RefreshView()
{
wTaskView->invalidate();
OrderedTaskPoint* tp = ordered_task->get_tp(active_index);
if (!tp)
return;
Refreshing = true; // tell onChange routines not to save form!
TPLabelObservationZone ozv;
ObservationZoneConstVisitor &visitor = ozv;
visitor.Visit(*tp->get_oz());
WndFrame* wfrm = NULL;
wfrm = ((WndFrame*)wf->FindByName(_T("lblType")));
if (wfrm)
wfrm->SetCaption(OrderedTaskPointName(ordered_task->get_factory().getType(*tp)));
WndButton* wb;
wb = ((WndButton*)wf->FindByName(_T("butPrevious")));
if (wb)
wb->set_enabled(active_index > 0);
wb = ((WndButton*)wf->FindByName(_T("butNext")));
if (wb)
wb->set_enabled(active_index < (ordered_task->task_size() - 1));
wb = (WndButton*)wf->FindByName(_T("cmdOptionalStarts"));
assert(wb);
wb->set_visible(active_index == 0);
if (ordered_task->optional_start_points_size() == 0)
wb->SetCaption(_("Enable Alternate Starts"));
else {
TCHAR tmp[50];
_stprintf(tmp, _T("%s (%d)"), _("Edit Alternates"),
ordered_task->optional_start_points_size());
wb->SetCaption(tmp);
}
EnableSizeEdit(ordered_task->get_factory_type() != TaskBehaviour::FACTORY_FAI_GENERAL);
TCHAR bufType[100];
TCHAR bufNamePrefix[100];
TPLabelTaskPoint tpv(bufType, bufNamePrefix);
TaskPointConstVisitor &tp_visitor = tpv;
tp_visitor.Visit(*tp);
wf->SetCaption(tpv.textType);
wfrm = ((WndFrame*)wf->FindByName(_T("lblLocation")));
if (wfrm) {
TCHAR buff[100];
_stprintf(buff, _T("%s %s"), tpv.textNamePrefix,
tp->get_waypoint().Name.c_str());
wfrm->SetCaption(buff);
}
Refreshing = false; // reactivate onChange routines
}
示例3:
static void
OnPauseClicked(WndButton &button)
{
paused = !paused;
if (paused) {
button.SetCaption(_("Resume"));
device->SetMonitor(NULL);
} else {
button.SetCaption(_("Pause"));
device->SetMonitor(bridge);
}
}
示例4:
void
PortMonitorGlue::TogglePause()
{
paused = !paused;
if (paused) {
pause_button->SetCaption(_("Resume"));
device.SetMonitor(nullptr);
} else {
pause_button->SetCaption(_("Pause"));
device.SetMonitor(&bridge);
}
}
示例5: assert
static void
UpdateButton(const TCHAR *button, const TCHAR *caption)
{
WndButton* b = (WndButton*)dialog->FindByName(button);
assert(b != NULL);
b->SetCaption(caption);
}
示例6:
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"));
}
示例7: GetList
void
WifiListWidget::UpdateButtons()
{
const unsigned cursor = GetList().GetCursorIndex();
if (cursor < networks.size()) {
const auto &info = networks[cursor];
if (info.id >= 0) {
connect_button->SetCaption(_("Remove"));
connect_button->SetEnabled(true);
} else if (info.signal_level >= 0) {
connect_button->SetCaption(_("Connect"));
connect_button->SetEnabled(true);
}
} else {
connect_button->SetEnabled(false);
}
}
示例8: RefreshView
void
TaskListPanel::OnMoreClicked()
{
more = !more;
more_button->SetCaption(more ? _("Less") : _("More"));
task_store->Scan(more);
RefreshView();
}
示例9:
static void
SetButtons()
{
WndButton* wb;
if ((wb = (WndButton *)wf->FindByName(_T("cmdDump"))) != NULL) {
wb->set_visible(glide_polar.HasBallast());
wb->SetCaption(XCSoarInterface::GetComputerSettings().ballast_timer_active ?
_("Stop") : _("Dump"));
}
}
示例10: assert
static void
UpdateAckButton()
{
assert(airspace);
if (airspace_warnings == NULL)
return;
WndButton* ack = (WndButton*)wf->FindByName(_T("cmdAcknowledge"));
assert(ack != NULL);
ack->SetCaption(airspace_warnings->get_ack_day(*airspace) ?
_("Enable") : _("Ack Day"));
}
示例11: ShowAirspaceWarningsToUser
// Called periodically to show new airspace warning messages to user
// return 1 only for requesting run analysis
// This is called by WINMAIN thread, every second (1hz)
short ShowAirspaceWarningsToUser()
{
if (msg.originator != NULL) return 0; // Dialog already open
bool there_is_message = CAirspaceManager::Instance().PopWarningMessage(&msg);
if (!there_is_message) return 0; // no message to display
airspace_copy = CAirspaceManager::Instance().GetAirspaceCopy(msg.originator);
bool ackdialog_required = false;
TCHAR msgbuf[128];
// which message we need to show?
switch (msg.event) {
default:
// normally not show
DoStatusMessage(TEXT("Unknown airspace warning message"));
break; //Unknown msg type
case aweNone:
case aweMovingInsideFly: // normal, no msg, normally this msg type shouldn't get here
case awePredictedEnteringFly: // normal, no msg, normally this msg type shouldn't get here
case aweMovingOutsideNonfly: // normal, no msg, normally this msg type shouldn't get here
break;
case awePredictedLeavingFly:
case aweNearOutsideFly:
case aweLeavingFly:
case awePredictedEnteringNonfly:
case aweNearInsideNonfly:
case aweEnteringNonfly:
case aweMovingInsideNonfly: // repeated messages
case aweMovingOutsideFly: // repeated messages
ackdialog_required = true;
break;
case aweEnteringFly:
// LKTOKEN [email protected]_ "Entering"
if( _tcsnicmp( airspace_copy.Name(), airspace_copy.TypeName() ,_tcslen(airspace_copy.TypeName())) == 0)
_stprintf(msgbuf,TEXT("%s %s"),gettext(TEXT("[email protected]_")),airspace_copy.Name());
else
_stprintf(msgbuf,TEXT("%s %s %s"),gettext(TEXT("[email protected]_")),airspace_copy.TypeName(),airspace_copy.Name());
// wsprintf(msgbuf, TEXT("%s %s %s "), gettext(TEXT("[email protected]_")),airspace_copy.TypeName(), airspace_copy.Name());
DoStatusMessage(msgbuf);
break;
case aweLeavingNonFly:
// LKTOKEN [email protected]_ "Leaving"
if( _tcsnicmp( airspace_copy.Name(), airspace_copy.TypeName() ,_tcslen(airspace_copy.TypeName())) == 0)
_stprintf(msgbuf,TEXT("%s %s"),gettext(TEXT("[email protected]_")),airspace_copy.Name());
else
_stprintf(msgbuf,TEXT("%s %s %s"),gettext(TEXT("[email protected]_")),airspace_copy.TypeName(),airspace_copy.Name());
// wsprintf(msgbuf, TEXT("%s %s %s"), gettext(TEXT("[email protected]_")),airspace_copy.TypeName(), airspace_copy.Name());
DoStatusMessage(msgbuf);
break;
}
// show dialog to user if needed
if (ackdialog_required && (airspace_copy.WarningLevel() == msg.warnlevel)) {
if (!ScreenLandscape)
dlg = dlgLoadFromXML(CallBackTable, NULL, hWndMainWindow, TEXT("IDR_XML_LKAIRSPACEWARNING_L"));
else
dlg = dlgLoadFromXML(CallBackTable, NULL, hWndMainWindow, TEXT("IDR_XML_LKAIRSPACEWARNING"));
if (dlg==NULL) {
StartupStore(_T("------ LKAirspaceWarning setup FAILED!%s"),NEWLINE); //@ 101027
return 0;
}
dlg->SetKeyDownNotify(OnKeyDown);
dlg->SetTimerNotify(OnTimer);
timer_counter = AirspaceWarningDlgTimeout; // Auto closing dialog in x secs
WndButton *wb = (WndButton*)dlg->FindByName(TEXT("cmdAckForTime"));
if (wb) {
TCHAR stmp2[40];
wsprintf(stmp2,TEXT("%s (%dmin)"), gettext(TEXT("[email protected]_")), AcknowledgementTime/60);
wb->SetCaption(stmp2);
}
dlgLKAirspaceFill();
#ifndef DISABLEAUDIO
if (EnableSoundModes) LKSound(_T("LK_AIRSPACE.WAV")); // 100819
#endif
if( _tcsnicmp( airspace_copy.Name(), airspace_copy.TypeName() ,_tcslen(airspace_copy.TypeName())) == 0)
_stprintf(msgbuf,TEXT("%s"),airspace_copy.Name());
else
_stprintf(msgbuf,TEXT("%s %s"),airspace_copy.TypeName(),airspace_copy.Name());
// _stprintf(msgbuf,_T("%s: %s %s"),gettext(_T("[email protected]_")),airspace_copy.TypeName(),airspace_copy.Name());
dlg->SetCaption(msgbuf);
//.........这里部分代码省略.........
示例12: dlgLKAirspaceFill
//.........这里部分代码省略.........
}
#endif
int hdist;
int vdist;
int bearing;
bool inside;
TCHAR stmp[21];
TCHAR buffer[80];
wp = (WndProperty*)dlg->FindByName(TEXT("prpType"));
if (wp) {
if (airspace_copy.Flyzone()) {
wsprintf(buffer,TEXT("%s %s"), gettext(TEXT("FLY")), airspace_copy.TypeName());
} else {
wsprintf(buffer,TEXT("%s %s"), gettext(TEXT("NOFLY")), airspace_copy.TypeName());
}
wp->SetText( buffer );
// wp->SetBackColor( airspace_copy.TypeColor());
// wp->SetForeColor( ContrastTextColor(airspace_copy.TypeColor()));
wp->RefreshDisplay();
}
// Unfortunatelly virtual methods don't work on copied instances
// we have to ask airspacemanager to perform the required calculations
//inside = airspace_copy.CalculateDistance(&hdist, &bearing, &vdist);
//inside = CAirspaceManager::Instance().AirspaceCalculateDistance(msg.originator, &hdist, &bearing, &vdist);
bool distances_ready = airspace_copy.GetDistanceInfo(inside, hdist, bearing, vdist);
wp = (WndProperty*)dlg->FindByName(TEXT("prpHDist"));
if (wp) {
TCHAR stmp2[40];
if (distances_ready) {
Units::FormatUserDistance((double)abs(hdist),stmp, 10);
if (hdist<0) {
// LKTOKEN [email protected]_ "to leave"
wsprintf(stmp2, TEXT("%s %s"), stmp, gettext(TEXT("[email protected]_")));
} else {
// LKTOKEN [email protected]_ "to enter"
wsprintf(stmp2,TEXT("%s %s"), stmp, gettext(TEXT("[email protected]_")));
}
} else {
// no distance info calculated
// LKTOKEN [email protected]_ "Too far, not calculated"
wsprintf(stmp2,gettext(TEXT("[email protected]_")));
}
wp->SetText(stmp2);
wp->RefreshDisplay();
}
wp = (WndProperty*)dlg->FindByName(TEXT("prpVDist"));
if (wp) {
TCHAR stmp2[40];
if (distances_ready) {
Units::FormatUserAltitude((double)abs(vdist),stmp, 10);
if (vdist<0) {
// LKTOKEN [email protected]_ "below"
wsprintf(stmp2,TEXT("%s %s"), stmp, gettext(TEXT("[email protected]_")));
} else {
// LKTOKEN [email protected]_ "above"
wsprintf(stmp2,TEXT("%s %s"), stmp, gettext(TEXT("[email protected]_")));
}
} else {
// no distance info calculated
// LKTOKEN [email protected]_ "Too far, not calculated"
wsprintf(stmp2,gettext(TEXT("[email protected]_")));
}
wp->SetText(stmp2);
wp->RefreshDisplay();
}
wp = (WndProperty*)dlg->FindByName(TEXT("prpTopAlt"));
if (wp) {
TCHAR stmp2[40];
CAirspaceManager::Instance().GetAirspaceAltText(stmp2, 40, airspace_copy.Top());
wp->SetText(stmp2);
wp->RefreshDisplay();
}
wp = (WndProperty*)dlg->FindByName(TEXT("prpBaseAlt"));
if (wp) {
TCHAR stmp2[40];
CAirspaceManager::Instance().GetAirspaceAltText(stmp2, 40, airspace_copy.Base());
wp->SetText(stmp2);
wp->RefreshDisplay();
}
wb = (WndButton*)dlg->FindByName(TEXT("cmdClose"));
if (wb) {
TCHAR stmp2[40];
wsprintf(stmp2,TEXT("%s (%d)"), gettext(TEXT("[email protected]_")), timer_counter);
wb->SetCaption(stmp2);
}
}
示例13: 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);
}
}
示例14: SetCalcVisibility
void
AnalysisWidget::SetCalcCaption(const TCHAR *caption)
{
details_button.SetCaption(caption);
SetCalcVisibility(!StringIsEmpty(caption));
}
示例15: ShowFormControl
static void
RefreshView()
{
wTaskView->invalidate();
OrderedTaskPoint* tp = ordered_task->get_tp(active_index);
if (!tp)
return;
Refreshing = true; // tell onChange routines not to save form!
ShowFormControl(*wf, _T("frmOZLine"), false);
ShowFormControl(*wf, _T("frmOZSector"), false);
ShowFormControl(*wf, _T("frmOZCylinder"), false);
const ObservationZonePoint &oz = *tp->get_oz();
switch (oz.shape) {
case ObservationZonePoint::SECTOR:
case ObservationZonePoint::ANNULAR_SECTOR:
ShowFormControl(*wf, _T("frmOZSector"), true);
LoadFormProperty(*wf, _T("prpOZSectorRadius"),
ugDistance, ((const SectorZone &)oz).getRadius());
LoadFormProperty(*wf, _T("prpOZSectorStartRadial"),
((const SectorZone &)oz).getStartRadial().value_degrees());
LoadFormProperty(*wf, _T("prpOZSectorFinishRadial"),
((const SectorZone &)oz).getEndRadial().value_degrees());
if (oz.shape == ObservationZonePoint::ANNULAR_SECTOR) {
LoadFormProperty(*wf, _T("prpOZSectorInnerRadius"),
ugDistance, ((const AnnularSectorZone &)oz).getInnerRadius());
ShowFormControl(*wf, _T("prpOZSectorInnerRadius"), true);
} else
ShowFormControl(*wf, _T("prpOZSectorInnerRadius"), false);
break;
case ObservationZonePoint::LINE:
ShowFormControl(*wf, _T("frmOZLine"), true);
LoadFormProperty(*wf, _T("prpOZLineLength"), ugDistance,
((const LineSectorZone &)oz).getLength());
break;
case ObservationZonePoint::CYLINDER:
ShowFormControl(*wf, _T("frmOZCylinder"), true);
LoadFormProperty(*wf, _T("prpOZCylinderRadius"), ugDistance,
((const CylinderZone &)oz).getRadius());
break;
default:
break;
}
WndFrame* wfrm = NULL;
wfrm = ((WndFrame*)wf->FindByName(_T("lblType")));
if (wfrm)
wfrm->SetCaption(OrderedTaskPointName(ordered_task->get_factory().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->set_visible(active_index == 0);
if (ordered_task->optional_start_points_size() == 0)
wb->SetCaption(_("Enable Alternate Starts"));
else {
TCHAR tmp[50];
_stprintf(tmp, _T("%s (%d)"), _("Edit Alternates"),
ordered_task->optional_start_points_size());
wb->SetCaption(tmp);
}
EnableSizeEdit(ordered_task->get_factory_type() != TaskBehaviour::FACTORY_FAI_GENERAL);
TCHAR bufType[100];
TCHAR bufNamePrefix[100];
switch (tp->GetType()) {
case TaskPoint::START:
_tcscpy(bufType, _T("Start point"));
_tcscpy(bufNamePrefix, _T("Start: "));
break;
case TaskPoint::AST:
_tcscpy(bufType, _T("Task point"));
_stprintf(bufNamePrefix, _T("%d: "), active_index);
break;
case TaskPoint::AAT:
_tcscpy(bufType, _T("Assigned area point"));
_stprintf(bufNamePrefix, _T("%d: "), active_index);
break;
//.........这里部分代码省略.........