您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wxConstCast函数代码示例

51自学网 2021-06-03 10:09:02
  C++
这篇教程C++ wxConstCast函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wxConstCast函数的典型用法代码示例。如果您正苦于以下问题:C++ wxConstCast函数的具体用法?C++ wxConstCast怎么用?C++ wxConstCast使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wxConstCast函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetHWND

void wxSpinCtrl::DoGetPosition(int *x, int *y) const{    // hack: pretend that our HWND is the text control just for a moment    WXHWND hWnd = GetHWND();    wxConstCast(this, wxSpinCtrl)->m_hWnd = m_hwndBuddy;    wxSpinButton::DoGetPosition(x, y);    wxConstCast(this, wxSpinCtrl)->m_hWnd = hWnd;}
开发者ID:AlexHayton,项目名称:decoda,代码行数:10,


示例2: wxConstCast

BSLXMLERRCODE CBSLXMLDocumentEx::SetPosition(const wxChar* pPosition){    m_pLastPosition = m_pCurrentPosition;    m_pCurrentPosition = wxConstCast(pPosition, wxChar);    return BSLXMLERR_SUCCESS;}
开发者ID:romw,项目名称:boincsentinels,代码行数:7,


示例3: wxConstCast

wxColour wxColourDatabase::Find(const wxString& colour) const{    wxColourDatabase * const self = wxConstCast(this, wxColourDatabase);    self->Initialize();    // make the comparaison case insensitive and also match both grey and gray    wxString colName = colour;    colName.MakeUpper();    wxString colNameAlt = colName;    if ( !colNameAlt.Replace(wxT("GRAY"), wxT("GREY")) )        colNameAlt.clear();    wxStringToColourHashMap::iterator it = m_map->find(colName);    if ( it == m_map->end() && !colNameAlt.empty() )        it = m_map->find(colNameAlt);    if ( it != m_map->end() )        return *(it->second);    // we did not find any result in existing colours:    // we won't use wxString -> wxColour conversion because the    // wxColour::Set(const wxString &) function which does that conversion    // internally uses this function (wxColourDatabase::Find) and we want    // to avoid infinite recursion !    return wxNullColour;}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:25,


示例4: wxConstCast

wxHtmlCell *wxHtmlCell::GetRootCell() const{    wxHtmlCell *c = wxConstCast(this, wxHtmlCell);    while ( c->m_Parent )        c = c->m_Parent;    return c;}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:7,


示例5: wxConstCast

void ContentBoxCtrol::CacheItem(size_t n) const{    if ( !m_cache->Has(n) )    {        if ( !m_htmlParser )        {            ContentBoxCtrol *self = wxConstCast(this, ContentBoxCtrol);            self->m_htmlParser = LENMUS_NEW wxHtmlWinParser(self);            LMB_TagHandler* pTagHandler = LENMUS_NEW LMB_TagHandler(m_appScope);            m_htmlParser->AddTagHandler(pTagHandler);            m_htmlParser->SetDC(LENMUS_NEW wxClientDC(self));            m_htmlParser->SetFS(&self->m_filesystem);            // use system's default GUI font by default:            m_htmlParser->SetFontFace("Tahoma");            m_htmlParser->SetFontSize(10);            //m_htmlParser->SetStandardFonts();        }        wxHtmlContainerCell *cell = (wxHtmlContainerCell *)m_htmlParser->                Parse(OnGetItemMarkup(n));        wxCHECK_RET( cell, "wxHtmlParser::Parse() returned NULL?" );        // set the cell's ID to item's index so that CellCoordsToPhysical()        // can quickly find the item:        cell->SetId(wxString::Format("%lu", (unsigned long)n));        cell->Layout(GetClientSize().x - 2*GetMargins().x);        m_cache->Store(n, cell);    }}
开发者ID:gouchi,项目名称:lenmus,代码行数:34,


示例6: dc

wxSize StripMenuButton::GetTextSize(){	wxClientDC dc(wxConstCast(this, StripMenuButton));	wxCoord width, height;	dc.GetMultiLineTextExtent(GetLabel(), &width, &height);	return wxSize(width, height);	}
开发者ID:CSRedRat,项目名称:desura-app,代码行数:7,


示例7: dc

wxSize wxGenericStaticText::DoGetBestClientSize() const{    wxClientDC dc(wxConstCast(this, wxGenericStaticText));    wxCoord width, height;    dc.GetMultiLineTextExtent(GetLabel(), &width, &height);    return wxSize(width, height);}
开发者ID:jonntd,项目名称:dynamica,代码行数:7,


示例8: wxConstCast

wxVideoMode wxApp::GetDisplayMode() const{    if ( !m_videoMode.IsOk() )        wxConstCast(this, wxApp)->m_videoMode = GetCurrentVideoMode();    return m_videoMode;}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:7,


示例9: wxLogLastError

void wxDIB::DoGetObject() const{    // only do something if we have a valid DIB but we don't [yet] have valid    // data    if ( m_handle && !m_data )    {        // although all the info we need is in BITMAP and so we don't really        // need DIBSECTION we still ask for it as modifying the bit values only        // works for the real DIBs and not for the bitmaps and it's better to        // check for this now rather than trying to find out why it doesn't        // work later        DIBSECTION ds;        if ( !GetDIBSection(m_handle, &ds) )        {            wxLogLastError(wxT("GetObject(hDIB)"));            return;        }        wxDIB *self = wxConstCast(this, wxDIB);        self->m_width = ds.dsBm.bmWidth;        self->m_height = ds.dsBm.bmHeight;        self->m_depth = ds.dsBm.bmBitsPixel;        self->m_data = ds.dsBm.bmBits;    }}
开发者ID:BloodRedd,项目名称:gamekit,代码行数:26,


示例10: wxConstCast

void wxHtmlListBox::CacheItem(size_t n) const{    if ( !m_cache->Has(n) )    {        if ( !m_htmlParser )        {            wxHtmlListBox *self = wxConstCast(this, wxHtmlListBox);            self->m_htmlParser = new wxHtmlWinParser(self);            m_htmlParser->SetDC(new wxClientDC(self));            m_htmlParser->SetFS(&self->m_filesystem);#if !wxUSE_UNICODE            if (GetFont().IsOk())                m_htmlParser->SetInputEncoding(GetFont().GetEncoding());#endif            // use system's default GUI font by default:            m_htmlParser->SetStandardFonts();        }        wxHtmlContainerCell *cell = (wxHtmlContainerCell *)m_htmlParser->                                    Parse(OnGetItemMarkup(n));        wxCHECK_RET( cell, wxT("wxHtmlParser::Parse() returned NULL?") );        // set the cell's ID to item's index so that CellCoordsToPhysical()        // can quickly find the item:        cell->SetId(wxString::Format(wxT("%lu"), (unsigned long)n));        cell->Layout(GetClientSize().x - 2*GetMargins().x);        m_cache->Store(n, cell);    }}
开发者ID:beanhome,项目名称:dev,代码行数:32,


示例11: wxConstCast

wxFontInstance *wxFontMgrFontRefData::GetFontInstance(float scale, bool antialiased) const{    wxConstCast(this, wxFontMgrFontRefData)->EnsureValidFont();    return m_fontFace->GetFontInstance(m_info.pointSize * scale,                                       antialiased);}
开发者ID:BauerBox,项目名称:wxWidgets,代码行数:7,


示例12: wxConstCast

// -------------------------------------------------------------------------------- //wxCoord guAlListBox::OnMeasureItem( size_t n ) const{    // Code taken from the generic/listctrl.cpp file    guAlListBox * self = wxConstCast( this, guAlListBox );    self->SetItemHeight( ALLISTBOX_ITEM_SIZE );    return wxCoord( ALLISTBOX_ITEM_SIZE );}
开发者ID:anonbeat,项目名称:guayadeque,代码行数:9,


示例13: wxConstCast

// staticwxDocVector wxTrunkDocView::GetDocumentsVector(const wxDocManager& docManager){    wxDocVector docs;    const wxList& list = wxConstCast(&docManager, wxDocManager)->GetDocuments();    for (wxList::const_iterator it = list.begin(); it != list.end(); it++)        docs.push_back(wxStaticCast(*it, wxDocument));    return docs;}
开发者ID:tchv71,项目名称:StartPP,代码行数:10,


示例14: wxConstCast

int wxListBox::GetItemsPerPage() const{    if ( !m_itemsPerPage )    {        wxConstCast(this, wxListBox)->CalcItemsPerPage();    }    return m_itemsPerPage;}
开发者ID:project-renard-survey,项目名称:chandler,代码行数:9,


示例15: wxConstCast

const wxString& wxFSFile::GetMimeType() const{    if ( m_MimeType.empty() && !m_Location.empty() )    {        wxConstCast(this, wxFSFile)->m_MimeType =            wxFileSystemHandler::GetMimeTypeFromExt(m_Location);    }    return m_MimeType;}
开发者ID:BauerBox,项目名称:wxWidgets,代码行数:10,


示例16: wxConstCast

wxSize wxStaticText::DoGetBestClientSize() const{    wxStaticText *self = wxConstCast(this, wxStaticText);    wxClientDC dc(self);    dc.SetFont(GetFont());    wxCoord width, height;    dc.GetMultiLineTextExtent(GetLabel(), &width, &height);    return wxSize(width, height);}
开发者ID:AlexHayton,项目名称:decoda,代码行数:10,


示例17: wxCHECK_RET

void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,                           wxCoord *descent, wxCoord *externalLeading,                           wxFont *theFont) const{    wxCHECK_RET( Ok(), wxT("invalid dc") );    wxCHECK_RET( m_font.Ok(), wxT("no font selected") );    wxCHECK_RET( !theFont || theFont->Ok(), wxT("invalid font") );    wxFont oldFont;    if ( theFont != NULL )    {        oldFont = m_font;        wxConstCast(this, wxDC)->SetFont(*theFont);    }    wxCoord xx = 0, yy = 0;    DFBRectangle rect;    wxIDirectFBFontPtr f = GetCurrentFont();    if ( f->GetStringExtents(wxSTR_TO_DFB(string), -1, &rect, NULL) )    {        // VS: YDEV is corrent, it should *not* be XDEV, because font's are        //     only scaled according to m_scaleY        xx = YDEV2LOGREL(rect.w);        yy = YDEV2LOGREL(rect.h);        if ( descent )        {            int d;            if ( f->GetDescender(&d) )                *descent = YDEV2LOGREL(-d);            else                *descent = 0;        }    }    if ( x ) *x = xx;    if ( y ) *y = yy;    if ( externalLeading ) *externalLeading = 0;    if ( theFont != NULL )        wxConstCast(this, wxDC)->SetFont(oldFont);}
开发者ID:hgwells,项目名称:tive,代码行数:43,


示例18: wxConstCast

wxHtmlCell *wxHtmlCell::FindCellByPos(wxCoord x, wxCoord y,                                      unsigned flags) const{    if ( x >= 0 && x < m_Width && y >= 0 && y < m_Height )    {        return wxConstCast(this, wxHtmlCell);    }    else    {        if ((flags & wxHTML_FIND_NEAREST_AFTER) &&                (y < 0 || (y < 0+m_Height && x < 0+m_Width)))            return wxConstCast(this, wxHtmlCell);        else if ((flags & wxHTML_FIND_NEAREST_BEFORE) &&                 (y >= 0+m_Height || (y >= 0 && x >= 0)))            return wxConstCast(this, wxHtmlCell);        else            return NULL;    }}
开发者ID:gitrider,项目名称:wxsj2,代码行数:19,


示例19: wxCHECK_MSG

size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs,                                      wxArrayString *commands,                                      const wxFileType::MessageParameters& params) const{    wxCHECK_MSG( !m_ext.empty(), 0, wxT("GetAllCommands() needs an extension") );    if ( m_strFileType.empty() )    {        // get it from the registry        wxFileTypeImpl *self = wxConstCast(this, wxFileTypeImpl);        wxRegKey rkey(wxRegKey::HKCR, m_ext);        if ( !rkey.Exists() || !rkey.QueryValue(wxEmptyString, self->m_strFileType) )        {            wxLogDebug(wxT("Can't get the filetype for extension '%s'."),                       m_ext.c_str());            return 0;        }    }    // enum all subkeys of HKCR/filetype/shell    size_t count = 0;    wxRegKey rkey(wxRegKey::HKCR, m_strFileType  + wxT("//shell"));    long dummy;    wxString verb;    bool ok = rkey.GetFirstKey(verb, dummy);    while ( ok )    {        wxString command = wxFileType::ExpandCommand(GetCommand(verb), params);        // we want the open bverb to eb always the first        if ( verb.CmpNoCase(wxT("open")) == 0 )        {            if ( verbs )                verbs->Insert(verb, 0);            if ( commands )                commands->Insert(command, 0);        }        else // anything else than "open"        {            if ( verbs )                verbs->Add(verb);            if ( commands )                commands->Add(command);        }        count++;        ok = rkey.GetNextKey(verb, dummy);    }    return count;}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:54,


示例20: dc

wxSize wxGenericStaticText::DoGetBestClientSize() const{    wxClientDC dc(wxConstCast(this, wxGenericStaticText));#if wxUSE_MARKUP    if ( m_markupText )        return m_markupText->Measure(dc);#endif // wxUSE_MARKUP    return dc.GetMultiLineTextExtent(GetLabel());}
开发者ID:Anonymous2,项目名称:project64,代码行数:11,


示例21: Clear

BSLXMLERRCODE CBSLXMLDocumentEx::SetDocument(const wxChar* pszDocument){    if (NULL == pszDocument)    {        return BSLXMLERR_INVALID_PARAMETER;    }    Clear();    m_strDocument = pszDocument;    m_pCurrentPosition = wxConstCast(m_strDocument.wx_str(), wxChar);    return BSLXMLERR_SUCCESS;}
开发者ID:romw,项目名称:boincsentinels,代码行数:13,


示例22: wxConstCast

bool wxSoundBackendSDL::IsAvailable() const{    if (m_initialized)        return true;    if (SDL_WasInit(SDL_INIT_AUDIO) != SDL_INIT_AUDIO)    {        if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE) == -1)            return false;    }    wxConstCast(this, wxSoundBackendSDL)->m_initialized = true;    wxLogTrace(wxT("sound"), wxT("initialized SDL audio subsystem"));    return true;}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:13,


示例23: WXREGEX_IF_NEED_LEN

bool wxRegExImpl::Matches(const wxRegChar *str,                          int flags                          WXREGEX_IF_NEED_LEN(size_t len)) const{    wxCHECK_MSG( IsValid(), false, wxT("must successfully Compile() first") );    // translate our flags to regexec() ones    wxASSERT_MSG( !(flags & ~(wxRE_NOTBOL | wxRE_NOTEOL)),                  wxT("unrecognized flags in wxRegEx::Matches") );    int flagsRE = 0;    if ( flags & wxRE_NOTBOL )        flagsRE |= REG_NOTBOL;    if ( flags & wxRE_NOTEOL )        flagsRE |= REG_NOTEOL;    // allocate matches array if needed    wxRegExImpl *self = wxConstCast(this, wxRegExImpl);    if ( !m_Matches && m_nMatches )    {        self->m_Matches = new wxRegExMatches(m_nMatches);    }    wxRegExMatches::match_type matches = m_Matches ? m_Matches->get() : NULL;    // do match it#if defined WXREGEX_USING_BUILTIN    int rc = wx_re_exec(&self->m_RegEx, str, len, NULL, m_nMatches, matches, flagsRE);#elif defined WXREGEX_USING_RE_SEARCH    int rc = str ? ReSearch(&self->m_RegEx, str, len, matches, flagsRE) : REG_BADPAT;#else    int rc = str ? regexec(&self->m_RegEx, str, m_nMatches, matches, flagsRE) : REG_BADPAT;#endif    switch ( rc )    {        case 0:            // matched successfully            return true;        default:            // an error occurred            wxLogError(_("Failed to find match for regular expression: %s"),                       GetErrorMsg(rc, !str).c_str());            // fall through        case REG_NOMATCH:            // no match            return false;    }}
开发者ID:DumaGit,项目名称:winsparkle,代码行数:51,


示例24: wxCHECK_MSG

  // Get the position and size of the field's internal bounding rectanglebool wxStatusBarGeneric::GetFieldRect(int n, wxRect& rect) const{    wxCHECK_MSG( (n >= 0) && (n < m_nFields), false,                 _T("invalid status bar field index") );    // FIXME: workarounds for OS/2 bugs have nothing to do here (VZ)    int width, height;#ifdef __WXPM__    GetSize(&width, &height);#else    GetClientSize(&width, &height);#endif    // we cache m_widthsAbs between calls and recompute it if client    // width has changed (or when it is initially empty)    if ( m_widthsAbs.IsEmpty() || (m_lastClientWidth != width) )    {        wxConstCast(this, wxStatusBarGeneric)->            m_widthsAbs = CalculateAbsWidths(width);        // remember last width for which we have recomputed the widths in pixels        wxConstCast(this, wxStatusBarGeneric)->            m_lastClientWidth = width;    }    rect.x = 0;    for ( int i = 0; i < n; i++ )    {        rect.x += m_widthsAbs[i];    }    rect.x += m_borderX;    rect.y = m_borderY;    rect.width = m_widthsAbs[n] - 2*m_borderX;    rect.height = height - 2*m_borderY;    return true;}
开发者ID:252525fb,项目名称:rpcs3,代码行数:39,


示例25: wxConstCast

// -------------------------------------------------------------------------------- //int guPLSoListBox::GetSelectedSongs( guTrackArray * tracks, const bool isdrag ) const{    unsigned long cookie;    guPLSoListBox * self = wxConstCast( this, guPLSoListBox );    self->m_ItemsMutex.Lock();    int item = GetFirstSelected( cookie );    while( item != wxNOT_FOUND )    {        tracks->Add( new guTrack( m_Items[ item ] ) );        item = GetNextSelected( cookie );    }    self->m_ItemsMutex.Unlock();    return tracks->Count();}
开发者ID:anonbeat,项目名称:guayadeque,代码行数:15,


示例26: GetHWND

void wxSpinCtrl::DoGetPosition(int *x, int *y) const{    // Because both subcontrols are mirrored manually    // (for layout direction purposes, see note)    // and leftmost control can be either spin or buddy text    // we need to get positions for both controls    // and return this with lower horizonal value.    // Note:    // Logical positions in manual mirroring:    // our layout == parent layout  =>  x(Text) < x(Button)    // our layout != parent layout  =>  x(Button) < x(Text)    // hack: pretend that our HWND is the text control just for a moment    int xBuddy;    WXHWND hWnd = GetHWND();    wxConstCast(this, wxSpinCtrl)->m_hWnd = m_hwndBuddy;    wxSpinButton::DoGetPosition(&xBuddy, y);    int xText;    wxConstCast(this, wxSpinCtrl)->m_hWnd = hWnd;    wxSpinButton::DoGetPosition(&xText, y);    *x = wxMin(xBuddy, xText);}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:24,



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


C++ wxCopyRectToRECT函数代码示例
C++ wxCommandEventHandler函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。