当前位置: 首页>>代码示例>>C++>>正文


C++ GetLabel函数代码示例

本文整理汇总了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;
}
开发者ID:0ryuO,项目名称:dolphin-avsync,代码行数:40,代码来源:radiobut.cpp

示例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;
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:40,代码来源:button.cpp

示例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());
}
开发者ID:NoviceF,项目名称:QtFilesystemTreeBuilder,代码行数:22,代码来源:statgetter.cpp

示例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);
  }
}
开发者ID:jwwang,项目名称:gecko-dev-openh264,代码行数:22,代码来源:HTMLTrackElement.cpp

示例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;
}
开发者ID:Oize,项目名称:pspstacklesspython,代码行数:22,代码来源:_Icnmodule.c

示例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
}
开发者ID:Grunji,项目名称:audacity,代码行数:38,代码来源:ControlToolBar.cpp

示例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;
}
开发者ID:TTgogogo,项目名称:retarget-toolkit,代码行数:23,代码来源:ShiftMapHierarchy.cpp

示例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++;
    }
}
开发者ID:stahta01,项目名称:EmBlocks_old,代码行数:23,代码来源:searchtree.cpp

示例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;
}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:42,代码来源:KeyView.cpp

示例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);

}
开发者ID:gitter-badger,项目名称:quinoa,代码行数:24,代码来源:MLAPI_LoadBalanceInverseOperator.cpp

示例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
}
开发者ID:jonntd,项目名称:dynamica,代码行数:25,代码来源:ctrlcmn.cpp

示例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;
}
开发者ID:andoma,项目名称:pdfium,代码行数:24,代码来源:doc_basic.cpp

示例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;
}
开发者ID:Chiranjivee,项目名称:SFML-book,代码行数:24,代码来源:Button.cpp

示例14: GetLabel

wxString wxTopLevelWindowMSW::GetTitle() const
{
    return GetLabel();
}
开发者ID:nwhitehead,项目名称:wxWidgets,代码行数:4,代码来源:toplevel.cpp

示例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
}
开发者ID:erelh,项目名称:gpac,代码行数:88,代码来源:menubtn.cpp


注:本文中的GetLabel函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。