本文整理汇总了C++中SetLabel函数的典型用法代码示例。如果您正苦于以下问题:C++ SetLabel函数的具体用法?C++ SetLabel怎么用?C++ SetLabel使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetLabel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: m_OSMPropList
CWaypoints::CPoint::CPoint(double dLon, double dLat, int iAltitude, const wchar_t * wcName)
: m_OSMPropList()
{
static int iNextId = 0;
m_iId = iNextId++;
m_dLongitude = dLon;
m_dLatitude = dLat;
Cache();
m_iAltitude = iAltitude;
SetLabel(wcName);
m_iRadius = 0;
SYSTEMTIME st;
FILETIME ft;
GetSystemTime(&st);
SystemTimeToFileTime(&st, &ft);
m_dLastUsed = double(ft.dwHighDateTime) * double(1 << 16) * double(1 << 16)
+ double(ft.dwLowDateTime);
m_fInProximity = false;
}
示例2: PreCreation
bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
if( !CreateControl( parent, id, pos, size, style,
wxDefaultValidator, name ) )
return false;
m_labelWidget = (WXWidget) 0;
PreCreation();
Widget parentWidget = (Widget) parent->GetClientWidget();
Widget borderWidget =
(Widget) wxCreateBorderWidget( (WXWidget)parentWidget, style );
m_labelWidget =
XtVaCreateManagedWidget (name.mb_str(),
xmLabelWidgetClass,
borderWidget ? borderWidget : parentWidget,
wxFont::GetFontTag(), m_font.GetFontTypeC(XtDisplay(parentWidget)),
XmNalignment, ((style & wxALIGN_RIGHT) ? XmALIGNMENT_END :
((style & wxALIGN_CENTRE) ? XmALIGNMENT_CENTER :
XmALIGNMENT_BEGINNING)),
XmNrecomputeSize, ((style & wxST_NO_AUTORESIZE) ? TRUE : FALSE),
NULL);
m_mainWidget = borderWidget ? borderWidget : m_labelWidget;
SetLabel(label);
wxSize best = GetBestSize();
if( size.x != -1 ) best.x = size.x;
if( size.y != -1 ) best.y = size.y;
PostCreation();
AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
pos.x, pos.y, best.x, best.y);
return true;
}
示例3: fscanf
void Matrix::Read(FILE *f) {
int r, c;
char buffer[100];
fscanf(f, " %s =", buffer);
buffer[strlen(buffer) - 1] = 0;
SetLabel(buffer);
fscanf(f, " [ %d x %d ]", &r, &c);
Dimension(r, c);
for (int c = 0; c < cols; c++) {
fscanf(f, " %s", buffer);
SetColumnLabel(c, buffer);
}
for (int r = 0; r < rows; r++)
for (int c = 0; c < cols; c++) fscanf(f, " %lf", &((*this)[r][c]));
}
示例4: event
bool wxMenu::HandleCommandUpdateStatus( wxMenuItem* item, wxWindow* senderWindow )
{
int menuid = item ? item->GetId() : 0;
wxUpdateUIEvent event(menuid);
event.SetEventObject( this );
bool processed = false;
// Try the menu's event handler
{
wxEvtHandler *handler = GetEventHandler();
if ( handler )
processed = handler->ProcessEvent(event);
}
// Try the window the menu was popped up from
// (and up through the hierarchy)
if ( !processed )
{
wxWindow *win = GetWindow();
if ( win )
processed = win->HandleWindowEvent(event);
}
if ( !processed && senderWindow != NULL)
{
processed = senderWindow->HandleWindowEvent(event);
}
if ( processed )
{
// if anything changed, update the changed attribute
if (event.GetSetText())
SetLabel(menuid, event.GetText());
if (event.GetSetChecked())
Check(menuid, event.GetChecked());
if (event.GetSetEnabled())
Enable(menuid, event.GetEnabled());
}
return processed;
}
示例5: Bounds
void InputRequest::Init(const char* label, const char* text, const char* btn0_label, const char* btn1_label, const char* btn2_label)
{
BRect frame = Bounds();
fIrView = new InputRequestView(frame, btn0_label, btn1_label, btn2_label);
// now move and resize the window with the calculated width of our view
BRect screenRect = fScreen.Frame();
MoveTo(BPoint(screenRect.Width()/2-fIrView->Width()/2, screenRect.Height()/2-IR_WINDOW_HEIGHT/2-125));
ResizeTo(fIrView->Width(), IR_WINDOW_HEIGHT);
AddChild(fIrView);
SetLabel(label);
SetText(text);
fIrView->SelectText();
//init
fButton_index = -1;
}
示例6: BMenuItem
AppMenuItem::AppMenuItem(const char* appSig, int category)
:
BMenuItem(kEmptyStr, NULL),
fCategory(category),
fIcon(NULL),
fIsValid(false)
{
if (be_roster->FindApp(appSig, &fAppRef) == B_NO_ERROR) {
fIcon = new BBitmap(BRect(0.0, 0.0, 15.0, 15.0), B_RGBA32);
if (BNodeInfo::GetTrackerIcon(&fAppRef, fIcon, B_MINI_ICON) == B_OK) {
BEntry appEntry(&fAppRef);
if (appEntry.InitCheck() == B_OK) {
char name[B_FILE_NAME_LENGTH];
appEntry.GetName(name);
SetLabel(name);
fIsValid = true;
}
}
}
}
示例7: SetLabel
void CargoBody::Init()
{
m_hitpoints = 1.0f;
SetLabel(Equip::types[m_type].name);
SetMassDistributionFromModel();
std::vector<Color> colors;
//metallic blue-orangeish color scheme
colors.push_back(Color(255, 198, 64));
colors.push_back(Color(0, 222, 255));
colors.push_back(Color(255, 255, 255));
SceneGraph::ModelSkin skin;
skin.SetColors(colors);
skin.SetDecal("pioneer");
skin.Apply(GetModel());
GetModel()->SetColors(colors);
Properties().Set("type", EnumStrings::GetString("EquipType", m_type));
}
示例8: SetLabel
void GCardReaderMenu::ShowChipCardDetected()
{
const char* arypcLabels[8];
SetLabel(GSoftKeysWindowTemplate::eSOFT_R3, " "); //hide the label
memset( arypcLabels, 0, sizeof(arypcLabels) );
arypcLabels[0] = "";
arypcLabels[1] = "";
arypcLabels[2] = "";
arypcLabels[3] = "Chip detected,";
arypcLabels[4] = "";
arypcLabels[5] = "please wait...";
arypcLabels[6] = " ";
UpdateUserLabels(7, arypcLabels);
}
示例9: SetLabel
//------------------------------------------------------------------------------
void BMenuField::InitObject(const char *label)
{
fLabel = NULL;
fMenu = NULL;
fMenuBar = NULL;
fAlign = B_ALIGN_LEFT;
fStringWidth = 0;
fEnabled = true;
fSelected = false;
fTransition = false;
fFixedSizeMB = false;
fMenuTaskID = -1;
SetLabel(label);
if (label)
fDivider = (float)floor(Frame().Width() / 2.0f);
else
fDivider = 0;
}
示例10: ModPlanDlg
void ModPanel::OnPanelProps(wxCommandEvent& event) {
// Get the copied node:
iONode ini = (iONode)event.GetClientData();
if( ini != NULL && StrOp.equals( wModPlan.name(), NodeOp.getName( ini ) ) ) {
// PropertiesDialog:
m_ModPlanDlg = new ModPlanDlg( this, ini );
if( wxID_OK == m_ModPlanDlg->ShowModal() ) {
SetLabel(wxString( wModPlan.getsubtitle( ini ),wxConvUTF8 ));
wxGetApp().getFrame()->setPlanTitle( wModPlan.gettitle( ini ) );
}
m_ModPlanDlg->Destroy();
m_ModPlanDlg = NULL;
}
else {
iONode cmd = NodeOp.inst( wSysCmd.name(), NULL, ELEMENT_NODE );
wSysCmd.setcmd( cmd, wSysCmd.getmodplan );
wxGetApp().sendToRocrail( cmd, false );
cmd->base.del(cmd);
}
}
示例11: wxStaticText
ExplanationLabel::ExplanationLabel(wxWindow *parent, const wxString& label)
: wxStaticText(parent, wxID_ANY, ""),
m_text(label),
m_wrapWidth(-1)
{
m_text.Replace("\n", " ");
SetLabel(m_text);
#if defined(__WXOSX__)
SetWindowVariant(wxWINDOW_VARIANT_SMALL);
SetForegroundColour(wxColour("#777777"));
#elif defined(__WXGTK__)
SetWindowVariant(wxWINDOW_VARIANT_SMALL);
#else
SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT));
#endif
SetInitialSize(wxSize(10,10));
Bind(wxEVT_SIZE, &ExplanationLabel::OnSize, this);
}
示例12: SetForegroundColour
void wxGenericFontButton::UpdateFont()
{
if ( !m_selectedFont.Ok() )
return;
SetForegroundColour(m_data.GetColour());
if (HasFlag(wxFNTP_USEFONT_FOR_LABEL))
{
// use currently selected font for the label...
wxButton::SetFont(m_selectedFont);
}
if (HasFlag(wxFNTP_FONTDESC_AS_LABEL))
{
SetLabel(wxString::Format(wxT("%s, %d"),
m_selectedFont.GetFaceName().c_str(),
m_selectedFont.GetPointSize()));
}
}
示例13: Create
CViewHeader::CViewHeader(wxWindow* pParent, const wxString& label)
{
Create(pParent, wxID_ANY);
m_pComboBox = new CComboBoxEx(this);
m_pLabel = new wxStaticText(this, wxID_ANY, label, wxDefaultPosition, wxDefaultSize);
wxSize size = GetSize();
size.SetHeight(m_pComboBox->GetBestSize().GetHeight() + border_offset);
SetLabel(label);
SetSize(size);
#ifdef __WXMSW__
m_pComboBox->Connect(wxID_ANY, wxEVT_PAINT, (wxObjectEventFunction)(wxEventFunction)(wxPaintEventFunction)&CViewHeader::OnComboPaint, 0, this);
m_pComboBox->Connect(wxID_ANY, wxEVT_LEFT_DOWN, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&CViewHeader::OnComboMouseEvent, 0, this);
m_pComboBox->Connect(wxID_ANY, wxEVT_LEFT_UP, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&CViewHeader::OnComboMouseEvent, 0, this);
m_bLeftMousePressed = false;
#endif //__WXMSW__
}
示例14: ShowDebug
bool TSliderComponent::ChangeProperty(string APropertyName, string APropertyValue)
{
ShowDebug(string("ChangeProperty Name=") + APropertyName + string(" Value=") + APropertyValue);
if (LockLooper())
{
FPropertyList->SetPropertyValue(APropertyName,APropertyValue);
SetStandardProperties(APropertyName.c_str(),APropertyValue.c_str());
SetFrameProperties(APropertyName.c_str(),APropertyValue.c_str(),this);
SetSizingProperties(APropertyName.c_str(),APropertyValue.c_str(),this);
SetFlagsProperties(APropertyName.c_str(),APropertyValue.c_str(),this);
if (FindPropertyName(APropertyName,PROP_LABEL)) SetLabel(APropertyValue.c_str());
if (FindPropertyName(APropertyName,PROP_MESSAGE)) ((TSliderCodeGenerator *)FCodeGenerator)->CreateMessageReceived(!FLoaded);
UnlockLooper();
return TComponent::ChangeProperty(APropertyName,APropertyValue);
}
return false;
}
示例15: CreateControls
bool ProjectPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
{
////@begin ProjectPanel member initialisation
m_ProjectCtrl = NULL;
////@end ProjectPanel member initialisation
////@begin ProjectPanel creation
wxPanel::Create( parent, id, pos, size, style );
CreateControls();
if (GetSizer())
{
GetSizer()->SetSizeHints(this);
}
////@end ProjectPanel creation
SetLabel( SYMBOL_PROJECTPANEL_TITLE );
return true;
}