本文整理汇总了C++中GetLabel函数的典型用法代码示例。如果您正苦于以下问题:C++ GetLabel函数的具体用法?C++ GetLabel怎么用?C++ GetLabel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetLabel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetLabel
wxSize wxRadioButton::DoGetBestSize() const
{
static int s_radioSize = 0;
if ( !s_radioSize )
{
wxScreenDC dc;
dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
s_radioSize = dc.GetCharHeight();
// radio button bitmap size under CE is bigger than the font height,
// adding just one pixel seems to work fine for the default font but it
// would be nice to find some better way to find the correct height
#ifdef __WXWINCE__
s_radioSize++;
#endif // __WXWINCE__
}
wxString str = GetLabel();
int wRadio, hRadio;
if ( !str.empty() )
{
GetTextExtent(GetLabelText(str), &wRadio, &hRadio);
wRadio += s_radioSize + GetCharWidth();
if ( hRadio < s_radioSize )
hRadio = s_radioSize;
}
else
{
wRadio = s_radioSize;
hRadio = s_radioSize;
}
wxSize best(wRadio, hRadio);
CacheBestSize(best);
return best;
}
示例2: XtVaGetValues
wxSize wxButton::OldGetBestSize() const
{
Dimension xmargin, ymargin, highlight, shadow, defThickness;
XtVaGetValues( (Widget)m_mainWidget,
XmNmarginWidth, &xmargin,
XmNmarginHeight, &ymargin,
XmNhighlightThickness, &highlight,
XmNshadowThickness, &shadow,
XmNdefaultButtonShadowThickness, &defThickness,
NULL );
int x = 0; int y = 0;
GetTextExtent( GetLabel(), &x, &y );
int margin = highlight * 2 +
( defThickness ? ( ( shadow + defThickness ) * 4 ) : ( shadow * 2 ) );
wxSize best( x + xmargin * 2 + margin,
y + ymargin * 2 + margin );
// all buttons have at least the standard size unless the user explicitly
// wants them to be of smaller size and used wxBU_EXACTFIT style when
// creating the button
if( !HasFlag( wxBU_EXACTFIT ) )
{
wxSize def = GetDefaultSize();
int margin = highlight * 2 +
( defThickness ? ( shadow * 4 + defThickness * 4 ) : 0 );
def.x += margin;
def.y += margin;
if( def.x > best.x )
best.x = def.x;
if( def.y > best.y )
best.y = def.y;
}
return best;
}
示例3: assert
void StatGetter::GetStatsForPath(const QString& rootPath)
{
pathInWork_ = rootPath;
assert(!pathInWork_.isEmpty());
if (IsRunning())
{
RiseRunningThreadWarningMsg();
return;
}
statTree_.clear();
subdirsInCurPathCount_ = 0;
StatsCont cont {statTree_, subdirsInCurPathCount_};
currentThreadClass_.reset(new StatGetterThread(rootPath, cont,
GetProgBar(), GetLabel()) );
connect(&GetWorkerThread(), SIGNAL(started()), currentThreadClass_.data(),
SLOT(onStart()));
RunThread(currentThreadClass_.data());
}
示例4: GetSrclang
void
HTMLTrackElement::CreateTextTrack()
{
nsString label, srcLang;
GetSrclang(srcLang);
GetLabel(label);
TextTrackKind kind;
if (const nsAttrValue* value = GetParsedAttr(nsGkAtoms::kind)) {
kind = static_cast<TextTrackKind>(value->GetEnumValue());
} else {
kind = TextTrackKind::Subtitles;
}
mTrack = new TextTrack(OwnerDoc()->GetParentObject(), kind, label, srcLang,
TextTrackMode::Disabled, TextTrackSource::Track);
mTrack->SetTrackElement(this);
if (mMediaParent) {
mMediaParent->AddTextTrack(mTrack);
}
}
示例5: PyMac_PRECHECK
static PyObject *Icn_GetLabel(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
OSErr _err;
SInt16 labelNumber;
RGBColor labelColor;
Str255 labelString;
#ifndef GetLabel
PyMac_PRECHECK(GetLabel);
#endif
if (!PyArg_ParseTuple(_args, "hO&",
&labelNumber,
PyMac_GetStr255, labelString))
return NULL;
_err = GetLabel(labelNumber,
&labelColor,
labelString);
if (_err != noErr) return PyMac_Error(_err);
_res = Py_BuildValue("O&",
QdRGB_New, &labelColor);
return _res;
}
示例6: RegenerateTooltips
void ControlToolBar::RegenerateTooltips()
{
#if wxUSE_TOOLTIPS
std::vector<wxString> commands;
for (long iWinID = ID_PLAY_BUTTON; iWinID < BUTTON_COUNT; iWinID++)
{
commands.clear();
auto pCtrl = static_cast<AButton*>(this->FindWindow(iWinID));
commands.push_back(pCtrl->GetLabel());
switch (iWinID)
{
case ID_PLAY_BUTTON:
commands.push_back(wxT("Play"));
commands.push_back(_("Loop Play"));
commands.push_back(wxT("PlayLooped"));
break;
case ID_RECORD_BUTTON:
commands.push_back(wxT("Record"));
commands.push_back(_("Append Record"));
commands.push_back(wxT("RecordAppend"));
break;
case ID_PAUSE_BUTTON:
commands.push_back(wxT("Pause"));
break;
case ID_STOP_BUTTON:
commands.push_back(wxT("Stop"));
break;
case ID_FF_BUTTON:
commands.push_back(wxT("SkipEnd"));
break;
case ID_REW_BUTTON:
commands.push_back(wxT("SkipStart"));
break;
}
ToolBar::SetButtonToolTip(*pCtrl, commands);
}
#endif
}
示例7: cvCreateMat
CvMat* ShiftMapHierarchy::CalculateLabelMapGuess()
{
CvMat* output = cvCreateMat(_outputSize.height, _outputSize.width, CV_32SC2);
int num_pixels = _outputSize.width * _outputSize.height;
printf("Getting label map... \n");
for(int i = 0; i < num_pixels; i++)
{
int label = _gc->whatLabel(i);
CvPoint point = GetPoint(i, _outputSize);
CvPoint shift = GetShift(label, _shiftSize);
CvPoint guess = GetLabel(point, _initialGuess);
CvPoint pointLabel = cvPoint(shift.x + guess.x, shift.y + guess.y);
// test
//CvPoint mapped = cvPoint(point.x + pointLabel.x, point.y + pointLabel.y);
//if(IsOutside(mapped, _inputSize))
// printf("test");
SetLabel(point, pointLabel, output);
}
return output;
}
示例8: suffix
void SearchTreeNode::Dump(BasicSearchTree* tree, nSearchTreeNode node_id, const wxString& prefix, wxString& result)
{
wxString suffix(_T(""));
suffix << _T("- \"") << SerializeString(GetLabel(tree)) << _T("\" (") << U2S(node_id) << _T(")");
if (prefix.length() && prefix[prefix.length()-1]=='|')
result << prefix.substr(0,prefix.length()-1) << _T('+') << suffix << _T('\n');
else if (prefix.length() && prefix[prefix.length()-1]==' ')
result << prefix.substr(0,prefix.length()-1) << _T('\\') << suffix << _T('\n');
else
result << prefix << suffix << _T('\n');
wxString newprefix(prefix);
newprefix.append(suffix.length() - 2, _T(' '));
newprefix << _T("|");
SearchTreeLinkMap::iterator i;
unsigned int cnt = 0;
for (i = m_Children.begin(); i!= m_Children.end(); i++)
{
if (cnt == m_Children.size() - 1)
newprefix[newprefix.length() - 1] = _T(' ');
tree->GetNode(i->second,false)->Dump(tree,i->second,newprefix,result);
cnt++;
}
}
示例9: wxASSERT
//
// Returns the value to be presented to accessibility
//
// Current, the command and key are both provided.
//
wxString
KeyView::GetValue(int line)
{
// Make sure line is valid
if (line < 0 || line >= (int) mLines.GetCount())
{
wxASSERT(false);
return wxEmptyString;
}
// Get the label and key values
wxString value;
if (mViewType == ViewByTree)
{
value = GetLabel(LineToIndex(line));
}
else
{
value = GetFullLabel(LineToIndex(line));
}
wxString key = GetKey(LineToIndex(line));
// Add the key if it isn't empty
if (!key.IsEmpty())
{
if (mViewType == ViewByKey)
{
value = key + wxT(" ") + value;
}
else
{
value = value + wxT(" ") + key;
}
}
return value;
}
示例10: StackPush
std::ostream& LoadBalanceInverseOperator::Print(std::ostream& os, const bool verbose) const
{
StackPush();
if (GetMyPID() == 0) {
os << "***MLAPI::InverseOperator" << std::endl;
os << "Label = " << GetLabel() << std::endl;
os << "Number of rows = " << GetRangeSpace().GetNumGlobalElements() << std::endl;
os << "Number of columns = " << GetRangeSpace().GetNumGlobalElements() << std::endl;
os << "Flop count = " << GetFlops() << std::endl;
os << "Cumulative time = " << GetTime() << std::endl;
if (GetTime() != 0.0)
os << "MFlops rate = " << 1.0e-6 * GetFlops() / GetTime() << std::endl;
else
os << "MFlops rate = 0.0" << std::endl;
os << std::endl;
}
StackPop();
return(os);
}
示例11: DoUpdateWindowUI
// wxControl-specific processing after processing the update event
void wxControlBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
{
// call inherited
wxWindowBase::DoUpdateWindowUI(event);
// update label
if ( event.GetSetText() )
{
if ( event.GetText() != GetLabel() )
SetLabel(event.GetText());
}
// Unfortunately we don't yet have common base class for
// wxRadioButton, so we handle updates of radiobuttons here.
// TODO: If once wxRadioButtonBase will exist, move this code there.
#if wxUSE_RADIOBTN
if ( event.GetSetChecked() )
{
wxRadioButton *radiobtn = wxDynamicCastThis(wxRadioButton);
if ( radiobtn )
radiobtn->SetValue(event.GetChecked());
}
#endif // wxUSE_RADIOBTN
}
示例12: PDF_EncodeText
int32_t CPDF_PageLabel::GetPageByLabel(const CFX_ByteStringC& bsLabel) const {
if (!m_pDocument) {
return -1;
}
CPDF_Dictionary* pPDFRoot = m_pDocument->GetRoot();
if (!pPDFRoot) {
return -1;
}
int nPages = m_pDocument->GetPageCount();
CFX_ByteString bsLbl;
CFX_ByteString bsOrig = bsLabel;
for (int i = 0; i < nPages; i++) {
bsLbl = PDF_EncodeText(GetLabel(i));
if (!bsLbl.Compare(bsOrig)) {
return i;
}
}
bsLbl = bsOrig;
int nPage = FXSYS_atoi(bsLbl);
if (nPage > 0 && nPage <= nPages) {
return nPage;
}
return -1;
}
示例13: padding
sf::Vector2f Button::CalculateRequisition() {
float padding( Context::Get().GetEngine().GetProperty<float>( "Padding", shared_from_this() ) );
float spacing( Context::Get().GetEngine().GetProperty<float>( "Spacing", shared_from_this() ) );
const std::string& font_name( Context::Get().GetEngine().GetProperty<std::string>( "FontName", shared_from_this() ) );
unsigned int font_size( Context::Get().GetEngine().GetProperty<unsigned int>( "FontSize", shared_from_this() ) );
const sf::Font& font( *Context::Get().GetEngine().GetResourceManager().GetFont( font_name ) );
auto requisition = Context::Get().GetEngine().GetTextMetrics( m_label, font, font_size );
requisition.y = Context::Get().GetEngine().GetFontLineHeight( font, font_size );
requisition.x += 2 * padding;
requisition.y += 2 * padding;
if( GetChild() ) {
requisition.x += GetChild()->GetRequisition().x;
requisition.y = std::max( requisition.y, GetChild()->GetRequisition().y + 2 * padding );
if( GetLabel().getSize() > 0 ) {
requisition.x += spacing;
}
}
return requisition;
}
示例14: GetLabel
wxString wxTopLevelWindowMSW::GetTitle() const
{
return GetLabel();
}
示例15: GetSize
void wxCustomButton::Paint( wxDC &dc )
{
#if (wxMINOR_VERSION<8)
dc.BeginDrawing();
#endif
int w, h;
GetSize(&w,&h);
wxColour foreColour = GetForegroundColour();
wxColour backColour = GetBackgroundColour();
if (m_focused)
{
backColour.Set( wxMin(backColour.Red() + 20, 255),
wxMin(backColour.Green() + 20, 255),
wxMin(backColour.Blue() + 20, 255) );
}
wxBitmap bitmap;
if (IsEnabled())
{
if (GetValue() && m_bmpSelected.Ok())
bitmap = m_bmpSelected;
else if (m_focused && m_bmpFocus.Ok())
bitmap = m_bmpFocus;
else if (m_bmpLabel.Ok())
bitmap = m_bmpLabel;
}
else
{
// try to create disabled if it doesn't exist
if (!m_bmpDisabled.Ok() && m_bmpLabel.Ok())
m_bmpDisabled = CreateBitmapDisabled(m_bmpLabel);
if (m_bmpDisabled.Ok())
bitmap = m_bmpDisabled;
else if (m_bmpLabel.Ok())
bitmap = m_bmpLabel;
foreColour = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
}
wxBrush brush(backColour, wxSOLID);
dc.SetBackground(brush);
dc.SetBrush(brush);
dc.SetPen(*wxTRANSPARENT_PEN);
dc.DrawRectangle(0, 0, w, h);
if (bitmap.Ok())
dc.DrawBitmap(bitmap, m_bitmapPos.x, m_bitmapPos.y, TRUE );
if (!GetLabel().IsEmpty())
{
dc.SetFont(GetFont());
dc.SetTextBackground(backColour);
dc.SetTextForeground(foreColour);
dc.DrawText(GetLabel(), m_labelPos.x, m_labelPos.y);
}
if (GetValue()) // draw sunken border
{
dc.SetPen(*wxGREY_PEN);
dc.DrawLine(0,h-1,0,0); dc.DrawLine(0,0,w,0);
dc.SetPen(*wxWHITE_PEN);
dc.DrawLine(w-1,1,w-1,h-1); dc.DrawLine(w-1,h-1,0,h-1);
dc.SetPen(*wxBLACK_PEN);
dc.DrawLine(1,h-2,1,1); dc.DrawLine(1,1,w-1,1);
}
else if (((m_button_style & wxCUSTBUT_FLAT) == 0) || m_focused) // draw raised border
{
dc.SetPen(*wxWHITE_PEN);
dc.DrawLine(0,h-2,0,0); dc.DrawLine(0,0,w-1,0);
dc.SetPen(*wxBLACK_PEN);
dc.DrawLine(w-1,0,w-1,h-1); dc.DrawLine(w-1,h-1,-1,h-1);
dc.SetPen(*wxGREY_PEN);
dc.DrawLine(2,h-2,w-2,h-2); dc.DrawLine(w-2,h-2,w-2,1);
}
dc.SetBackground(wxNullBrush);
dc.SetBrush(wxNullBrush);
dc.SetPen(wxNullPen);
#if (wxMINOR_VERSION<8)
dc.EndDrawing();
#endif
}