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

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

51自学网 2021-06-01 21:12:15
  C++
这篇教程C++ GetParamNode函数代码示例写得很实用,希望能帮到您。

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

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

示例1: XRC_MAKE_INSTANCE

wxObject *CGBmpButton::DoCreateResource(){    XRC_MAKE_INSTANCE(button, wxBitmapButton)    button->Create(m_parentAsWindow,                   GetID(),                   GetBitmap(wxT("bitmap"), wxART_BUTTON),                   GetPosition(), GetSize(),                   GetStyle(wxT("style"), wxBU_AUTODRAW),                   wxDefaultValidator,                   GetName());    if (GetBool(wxT("default"), 0))        button->SetDefault();    SetupWindow(button);    if (GetParamNode(wxT("selected")))        button->SetBitmapSelected(GetBitmap(wxT("selected")));    if (GetParamNode(wxT("focus")))        button->SetBitmapFocus(GetBitmap(wxT("focus")));    if (GetParamNode(wxT("disabled")))        button->SetBitmapDisabled(GetBitmap(wxT("disabled")));    if (GetParamNode(wxT("hover")))        button->SetBitmapHover(GetBitmap(wxT("hover")));    return button;}
开发者ID:k3a,项目名称:Panther3D-2,代码行数:26,


示例2: CreateChildrenPrivately

wxObject * MaxCheckListBoxXmlHandler::DoCreateResource(){    if (m_class == wxT("wxCheckListBox"))    {        // need to build the list of strings from children        m_insideBox = true;        CreateChildrenPrivately(NULL, GetParamNode(wxT("content")));        XRC_MAKE_INSTANCE(control, MaxCheckListBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetPosition(), GetSize(),                        strList,                        GetStyle(),                        wxDefaultValidator,                        GetName());        // step through children myself (again.)        wxXmlNode *n = GetParamNode(wxT("content"));        if (n)            n = n->GetChildren();        int i = 0;        while (n)        {            if (n->GetType() != wxXML_ELEMENT_NODE ||                n->GetName() != wxT("item"))               { n = n->GetNext(); continue; }            // checking boolean is a bit ugly here (see GetBool() )            wxString v = n->GetPropVal(wxT("checked"), wxEmptyString);            v.MakeLower();            if (v == wxT("1"))                control->Check( i, true );            i++;            n = n->GetNext();        }		control->MaxBind(_wx_wxchecklistbox_wxCheckListBox__xrcNew(control));        SetupWindow(control);        strList.Clear();    // dump the strings        return control;    }    else    {        // on the inside now.        // handle <item checked="boolean">Label</item>        // add to the list        wxString str = GetNodeContent(m_node);        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)            str = wxGetTranslation(str, m_resource->GetDomain());        strList.Add(str);        return NULL;    }}
开发者ID:BlitzMaxModules,项目名称:wx.mod,代码行数:60,


示例3: GetParamNode

wxObject *wxSimplebookXmlHandler::DoCreateResource(){    if (m_class == wxS("simplebookpage"))    {        wxXmlNode *n = GetParamNode(wxS("object"));        if ( !n )            n = GetParamNode(wxS("object_ref"));        if (n)        {            bool old_ins = m_isInside;            m_isInside = false;            wxObject *item = CreateResFromNode(n, m_simplebook, NULL);            m_isInside = old_ins;            wxWindow *wnd = wxDynamicCast(item, wxWindow);            if (wnd)            {                m_simplebook->AddPage(wnd, GetText(wxS("label")),                                      GetBool(wxS("selected")));            }            else            {                ReportError(n, "simplebookpage child must be a window");            }            return wnd;        }        else        {            ReportError("simplebookpage must have a window child");            return NULL;        }    }    else    {        XRC_MAKE_INSTANCE(sb, wxSimplebook)        sb->Create(m_parentAsWindow,                   GetID(),                   GetPosition(), GetSize(),                   GetStyle(wxS("style")),                   GetName());        SetupWindow(sb);        wxSimplebook *old_par = m_simplebook;        m_simplebook = sb;        bool old_ins = m_isInside;        m_isInside = true;        CreateChildren(m_simplebook, true/*only this handler*/);        m_isInside = old_ins;        m_simplebook = old_par;        return sb;    }}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:58,


示例4: GetParamNode

wxObject *wxCollapsiblePaneXmlHandler::DoCreateResource(){    if (m_class == wxT("panewindow"))   // read the XRC for the pane window    {        wxXmlNode *n = GetParamNode(wxT("object"));        if ( !n )            n = GetParamNode(wxT("object_ref"));        if (n)        {            bool old_ins = m_isInside;            m_isInside = false;            wxObject *item = CreateResFromNode(n, m_collpane->GetPane(), NULL);            m_isInside = old_ins;            return item;        }        else        {            ReportError("no control within panewindow");            return NULL;        }    }    else    {        XRC_MAKE_INSTANCE(ctrl, wxCollapsiblePane)        wxString label = GetText(wxT("label"));        if (label.empty())        {            ReportParamError("label", "label cannot be empty");            return NULL;        }        ctrl->Create(m_parentAsWindow,                    GetID(),                    label,                    GetPosition(), GetSize(),                    GetStyle(wxT("style"), wxCP_DEFAULT_STYLE),                    wxDefaultValidator,                    GetName());        ctrl->Collapse(GetBool(wxT("collapsed")));        SetupWindow(ctrl);        wxCollapsiblePane *old_par = m_collpane;        m_collpane = ctrl;        bool old_ins = m_isInside;        m_isInside = true;        CreateChildren(m_collpane, true/*only this handler*/);        m_isInside = old_ins;        m_collpane = old_par;        return ctrl;    }}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:57,


示例5: XRC_MAKE_INSTANCE

wxObject *wxButtonXmlHandler::DoCreateResource(){   XRC_MAKE_INSTANCE(button, wxButton)   button->Create(m_parentAsWindow,                    GetID(),                    GetText(wxT("label")),                    GetPosition(), GetSize(),                    GetStyle(),                    wxDefaultValidator,                    GetName());    if (GetBool(wxT("default"), 0))        button->SetDefault();    if ( GetParamNode("bitmap") )    {        wxDirection dir;        const wxString dirstr = GetParamValue("direction");        if ( dirstr.empty() || dirstr == "wxLEFT" )            dir = wxLEFT;        else if ( dirstr == "wxRIGHT" )            dir = wxRIGHT;        else if ( dirstr == "wxTOP" )            dir = wxTOP;        else if ( dirstr == "wxBOTTOM" )            dir = wxBOTTOM;        else        {            ReportError            (                GetParamNode("bitmapposition"),                wxString::Format                (                    "Invalid bitmap position /"%s/": must be one of "                    "wxLEFT|wxRIGHT|wxTOP|wxBOTTOM.",                    dirstr                )            );            dir = wxLEFT;        }        button->SetBitmap(GetBitmap("bitmap", wxART_BUTTON), dir);    }    SetupWindow(button);    return button;}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:50,


示例6: ReportError

wxObject *wxBitmapComboBoxXmlHandler::DoCreateResource(){    if (m_class == wxT("ownerdrawnitem"))    {        if ( !m_combobox )        {            ReportError("ownerdrawnitem only allowed within a wxBitmapComboBox");            return NULL;        }        m_combobox->Append(GetText(wxT("text")),                           GetBitmap(wxT("bitmap")));        return m_combobox;    }    else /*if( m_class == wxT("wxBitmapComboBox"))*/    {        // find the selection        long selection = GetLong( wxT("selection"), -1 );        XRC_MAKE_INSTANCE(control, wxBitmapComboBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetText(wxT("value")),                        GetPosition(), GetSize(),                        0,                        NULL,                        GetStyle(),                        wxDefaultValidator,                        GetName());        m_isInside = true;        m_combobox = control;        wxXmlNode *children_node = GetParamNode(wxT("object"));        wxXmlNode *n = children_node;        while (n)        {            if ((n->GetType() == wxXML_ELEMENT_NODE) &&                (n->GetName() == wxT("object")))            {                CreateResFromNode(n, control, NULL);            }            n = n->GetNext();        }        m_isInside = false;        m_combobox = NULL;        if (selection != -1)            control->SetSelection(selection);        SetupWindow(control);        return control;    }}
开发者ID:beanhome,项目名称:dev,代码行数:60,


示例7: XRC_MAKE_INSTANCE

wxObject *wxButtonXmlHandler::DoCreateResource(){   XRC_MAKE_INSTANCE(button, wxButton)   button->Create(m_parentAsWindow,                    GetID(),                    GetText(wxT("label")),                    GetPosition(), GetSize(),                    GetStyle(),                    wxDefaultValidator,                    GetName());    if (GetBool(wxT("default"), 0))        button->SetDefault();    if ( GetParamNode("bitmap") )    {        button->SetBitmap(GetBitmap("bitmap", wxART_BUTTON),                          GetDirection("bitmapposition"));    }    SetupWindow(button);    return button;}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:25,


示例8: GetParamNode

wxObject* wxSizerXmlHandler::Handle_sizeritem(){    // find the item to be managed by this sizeritem    wxXmlNode *n = GetParamNode(wxT("object"));    if ( !n )        n = GetParamNode(wxT("object_ref"));    // did we find one?    if (n)    {        // create a sizer item for it        wxSizerItem* sitem = MakeSizerItem();        // now fetch the item to be managed        bool old_gbs = m_isGBS;        bool old_ins = m_isInside;        wxSizer *old_par = m_parentSizer;        m_isInside = false;        if (!IsSizerNode(n)) m_parentSizer = NULL;        wxObject *item = CreateResFromNode(n, m_parent, NULL);        m_isInside = old_ins;        m_parentSizer = old_par;        m_isGBS = old_gbs;        // and figure out what type it is        wxSizer *sizer = wxDynamicCast(item, wxSizer);        wxWindow *wnd = wxDynamicCast(item, wxWindow);        if (sizer)            sitem->AssignSizer(sizer);        else if (wnd)            sitem->AssignWindow(wnd);        else            ReportError(n, "unexpected item in sizer");        // finally, set other wxSizerItem attributes        SetSizerItemAttributes(sitem);        AddSizerItem(sitem);        return item;    }    else /*n == NULL*/    {        ReportError("no window/sizer/spacer within sizeritem object");        return NULL;    }}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:47,


示例9: wxASSERT

wxObject *wxStdDialogButtonSizerXmlHandler::DoCreateResource(){    if (m_class == wxT("wxStdDialogButtonSizer"))    {        wxASSERT( !m_parentSizer );        wxSizer *s = m_parentSizer = new wxStdDialogButtonSizer;        m_isInside = true;        CreateChildren(m_parent, true/*only this handler*/);        m_parentSizer->Realize();        m_isInside = false;        m_parentSizer = NULL;        return s;    }    else // m_class == "button"    {        wxASSERT( m_parentSizer );        // find the item to be managed by this sizeritem        wxXmlNode *n = GetParamNode(wxT("object"));        if ( !n )            n = GetParamNode(wxT("object_ref"));        // did we find one?        if (n)        {            wxObject *item = CreateResFromNode(n, m_parent, NULL);            wxButton *button = wxDynamicCast(item, wxButton);            if (button)                m_parentSizer->AddButton(button);            else                ReportError(n, "expected wxButton");            return item;        }        else /*n == NULL*/        {            ReportError("no button within wxStdDialogButtonSizer");            return NULL;        }    }}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:47,


示例10: GetLong

wxObject *wxRadioBoxXmlHandler::DoCreateResource(){     if( m_class == wxT("wxRadioBox"))    {        // find the selection        long selection = GetLong( wxT("selection"), -1 );        // need to build the list of strings from children        m_insideBox = TRUE;        CreateChildrenPrivately( NULL, GetParamNode(wxT("content")));        wxString *strings = (wxString *) NULL;        if( strList.GetCount() > 0 )        {            strings = new wxString[strList.GetCount()];            int count = strList.GetCount();            for( int i = 0; i < count; i++ )                strings[i]=strList[i];        }        XRC_MAKE_INSTANCE(control, wxRadioBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetText(wxT("label")),                        GetPosition(), GetSize(),                        strList.GetCount(),                        strings,                        GetLong(wxT("dimension"), 1),                        GetStyle(),                        wxDefaultValidator,                        GetName());        if (selection != -1)            control->SetSelection(selection);        SetupWindow(control);        if (strings != NULL)            delete[] strings;        strList.Clear();    // dump the strings           return control;    }    else    {        // on the inside now.        // handle <item selected="boolean">Label</item>        // add to the list        wxString str = GetNodeContent(m_node);        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)            str = wxGetTranslation(str);        strList.Add(str);        return NULL;    }}
开发者ID:mentat,项目名称:YardSale,代码行数:58,


示例11: GetParamNode

wxObject* MyWxSimplebookXmlHandler::DoCreateResource(){    if(m_class == wxT("simplebookpage")) {        wxXmlNode* n = GetParamNode(wxT("object"));        if(!n) n = GetParamNode(wxT("object_ref"));        if(n) {            bool old_ins = m_isInside;            m_isInside = false;            wxObject* item = CreateResFromNode(n, m_notebook, NULL);            m_isInside = old_ins;            wxWindow* wnd = wxDynamicCast(item, wxWindow);            if(wnd) {                m_notebook->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected")), wxNOT_FOUND);            } else                wxLogError(wxT("Error in resource."));            return wnd;        } else {            wxLogError(wxT("Error in resource: no control within notebook's <page> tag."));            return NULL;        }    }    else {        wxSimplebook* nb =            new wxSimplebook(m_parentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle(wxT("style")));        wxString showEffect = GetText("effect", false);        nb->SetEffect(wxCrafter::ShowEffectFromString(showEffect));        nb->SetName(GetName());        SetupWindow(nb);        wxSimplebook* old_par = m_notebook;        m_notebook = nb;        bool old_ins = m_isInside;        m_isInside = true;        CreateChildren(m_notebook, true /*only this handler*/);        m_isInside = old_ins;        m_notebook = old_par;        return nb;    }}
开发者ID:eranif,项目名称:codelite,代码行数:45,


示例12: wxCHECK_MSG

wxObject * MaxBitmapComboBoxXmlHandler::DoCreateResource(){    if (m_class == wxT("ownerdrawnitem"))    {        wxCHECK_MSG(m_combobox, NULL, wxT("Incorrect syntax of XRC resource: ownerdrawnitem not within a bitmapcombobox!"));        m_combobox->Append(GetText(wxT("text")), GetBitmap(wxT("bitmap"), wxART_MISSING_IMAGE));        return m_combobox;    }    else /*if( m_class == wxT("wxBitmapComboBox"))*/    {        // find the selection        long selection = GetLong( wxT("selection"), -1 );        XRC_MAKE_INSTANCE(control, MaxBitmapComboBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetText(wxT("value")),                        GetPosition(), GetSize(),                        0,                        NULL,                        GetStyle(),                        wxDefaultValidator,                        GetName());		control->MaxBind(_wx_wxbitmapcombobox_wxBitmapComboBox__xrcNew(control));        m_isInside = true;        m_combobox = control;        wxXmlNode *children_node = GetParamNode(wxT("object"));        wxXmlNode *n = children_node;        while (n)        {            if ((n->GetType() == wxXML_ELEMENT_NODE) &&                (n->GetName() == wxT("object")))            {                CreateResFromNode(n, control, NULL);            }            n = n->GetNext();        }        m_isInside = false;        m_combobox = NULL;        if (selection != -1)            control->SetSelection(selection);        SetupWindow(control);        return control;    }}
开发者ID:BlitzMaxModules,项目名称:wx.mod,代码行数:57,


示例13: GetLong

wxObject * MaxOwnerDrawnComboBoxXmlHandler::DoCreateResource(){    if( m_class == wxT("wxOwnerDrawnComboBox"))    {        // find the selection        long selection = GetLong( wxT("selection"), -1 );        // need to build the list of strings from children        m_insideBox = true;        CreateChildrenPrivately(NULL, GetParamNode(wxT("content")));        XRC_MAKE_INSTANCE(control, MaxOwnerDrawnComboBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetText(wxT("value")),                        GetPosition(), GetSize(),                        strList,                        GetStyle(),                        wxDefaultValidator,                        GetName());		control->MaxBind(_wx_wxownerdrawncombobox_wxOwnerDrawnComboBox__xrcNew(control));        wxSize sizeBtn=GetSize(wxT("buttonsize"));        if (sizeBtn != wxDefaultSize)            control->SetButtonPosition(sizeBtn.GetWidth(), sizeBtn.GetHeight());        if (selection != -1)            control->SetSelection(selection);        SetupWindow(control);        strList.Clear();    // dump the strings        return control;    }    else    {        // on the inside now.        // handle <item>Label</item>        // add to the list        wxString str = GetNodeContent(m_node);        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)            str = wxGetTranslation(str, m_resource->GetDomain());        strList.Add(str);        return NULL;    }}
开发者ID:BlitzMaxModules,项目名称:wx.mod,代码行数:52,


示例14: XRC_MAKE_INSTANCE

wxObject *wxEditableListBoxXmlHandler::DoCreateResource(){    if ( m_class == EDITLBOX_CLASS_NAME )    {        // create the control itself        XRC_MAKE_INSTANCE(control, wxEditableListBox)        control->Create        (            m_parentAsWindow,            GetID(),            GetText("label"),            GetPosition(),            GetSize(),            GetStyle(),            GetName()        );        SetupWindow(control);        // if any items are given, add them to the control        wxXmlNode * const contents = GetParamNode("content");        if ( contents )        {            m_insideBox = true;            CreateChildrenPrivately(NULL, contents);            m_insideBox = false;            control->SetStrings(m_items);            m_items.clear();        }        return control;    }    else if ( m_insideBox && m_node->GetName() == EDITLBOX_ITEM_NAME )    {        wxString str = GetNodeContent(m_node);        if ( m_resource->GetFlags() & wxXRC_USE_LOCALE )            str = wxGetTranslation(str, m_resource->GetDomain());        m_items.push_back(str);        return NULL;    }    else    {        ReportError("Unexpected node inside wxEditableListBox");        return NULL;    }}
开发者ID:esrrhs,项目名称:fuck-music-player,代码行数:49,


示例15: GetLong

wxObject *wxComboBoxXmlHandler::DoCreateResource(){    if( m_class == wxT("wxComboBox"))    {        // find the selection        long selection = GetLong( wxT("selection"), -1 );        // need to build the list of strings from children        m_insideBox = true;        CreateChildrenPrivately(NULL, GetParamNode(wxT("content")));        XRC_MAKE_INSTANCE(control, wxComboBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetText(wxT("value")),                        GetPosition(), GetSize(),                        strList,                        GetStyle(),                        wxDefaultValidator,                        GetName());        if (selection != -1)            control->SetSelection(selection);        SetupWindow(control);        const wxString hint = GetText(wxS("hint"));        if ( !hint.empty() )            control->SetHint(hint);        strList.Clear();    // dump the strings        return control;    }    else    {        // on the inside now.        // handle <item>Label</item>        // add to the list        strList.Add(GetNodeText(m_node, wxXRC_TEXT_NO_ESCAPE));        return NULL;    }}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:46,


示例16: GetLong

wxObject *wxSimpleHtmlListBoxXmlHandler::DoCreateResource(){    if ( m_class == wxT("wxSimpleHtmlListBox"))    {        // find the selection        long selection = GetLong(wxT("selection"), -1);        // need to build the list of strings from children        m_insideBox = true;        CreateChildrenPrivately(NULL, GetParamNode(wxT("content")));        m_insideBox = false;        XRC_MAKE_INSTANCE(control, wxSimpleHtmlListBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetPosition(), GetSize(),                        strList,                        GetStyle(wxT("style"), wxHLB_DEFAULT_STYLE),                        wxDefaultValidator,                        GetName());        if (selection != -1)            control->SetSelection(selection);        SetupWindow(control);        strList.Clear();    // dump the strings        return control;    }    else    {        // on the inside now.        // handle <item>Label</item>        // add to the list        wxString str = GetNodeContent(m_node);        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)            str = wxGetTranslation(str, m_resource->GetDomain());        strList.Add(str);        return NULL;    }}
开发者ID:CyberIntelMafia,项目名称:clamav-devel,代码行数:44,


示例17: GetParamNode

wxObject *wxAuiNotebookXmlHandler::DoCreateResource(){    if (m_class == wxT("notebookpage"))    {        wxXmlNode *anb = GetParamNode(wxT("object"));        if (!anb)            anb = GetParamNode(wxT("object_ref"));        if (anb)        {            bool old_ins = m_isInside;            m_isInside = false;            wxObject *item = CreateResFromNode(anb, m_notebook, NULL);            m_isInside = old_ins;            wxWindow *wnd = wxDynamicCast(item, wxWindow);            if (wnd)            {                if ( HasParam(wxT("bitmap")) )                {                    m_notebook->AddPage(wnd,                                        GetText(wxT("label")),                                        GetBool(wxT("selected")),                                        GetBitmap(wxT("bitmap"), wxART_OTHER));                }                else                {                    m_notebook->AddPage(wnd,                                        GetText(wxT("label")),                                        GetBool(wxT("selected")));                }            }            else            {                ReportError(anb, "notebookpage child must be a window");            }            return wnd;        }        else        {            ReportError("notebookpage must have a window child");            return NULL;        }    }    else    {        XRC_MAKE_INSTANCE(anb, wxAuiNotebook)        anb->Create(m_parentAsWindow,                    GetID(),                    GetPosition(),                    GetSize(),                    GetStyle(wxT("style")));        SetupWindow(anb);        wxAuiNotebook *old_par = m_notebook;        m_notebook = anb;        bool old_ins = m_isInside;        m_isInside = true;        CreateChildren(m_notebook, true/*only this handler*/);        m_isInside = old_ins;        m_notebook = old_par;        return anb;    }}
开发者ID:chromylei,项目名称:third_party,代码行数:68,


示例18: wxCHECK_MSG

//.........这里部分代码省略.........           {               m_toolbar->Realize();               m_toolbar->EnableTool(GetID(),false);           }        }        return m_toolbar; // must return non-NULL    }    else if (m_class == _T("separator"))    {        wxCHECK_MSG(m_toolbar, NULL, _("Incorrect syntax of XRC resource: separator not within a toolbar!"));        m_toolbar->AddSeparator();        return m_toolbar; // must return non-NULL    }    else /*<object class="wxToolBar">*/    {        m_isAddon=(m_class == _T("wxToolBarAddOn"));        if(m_isAddon)        { // special case: Only add items to toolbar          toolbar=(wxToolBar*)m_instance;          // XRC_MAKE_INSTANCE(toolbar, wxToolBar);        }        else        {            int style = GetStyle(_T("style"), wxNO_BORDER | wxTB_HORIZONTAL);            #ifdef __WXMSW__            if (!(style & wxNO_BORDER)) style |= wxNO_BORDER;            #endif            XRC_MAKE_INSTANCE(toolbar, wxToolBar)            toolbar->Create(m_parentAsWindow,                             GetID(),                             GetPosition(),                             GetSize(),                             style,                             GetName());            wxSize bmpsize = GetSize(_T("bitmapsize"));            if (!(bmpsize == wxDefaultSize))                toolbar->SetToolBitmapSize(bmpsize);            wxSize margins = GetSize(_T("margins"));            if (!(margins == wxDefaultSize))                toolbar->SetMargins(margins.x, margins.y);            long packing = GetLong(_T("packing"), -1);            if (packing != -1)                toolbar->SetToolPacking(packing);            long separation = GetLong(_T("separation"), -1);            if (separation != -1)                toolbar->SetToolSeparation(separation);        }        wxXmlNode *children_node = GetParamNode(_T("object"));        if (!children_node)           children_node = GetParamNode(_T("object_ref"));        if (children_node == NULL) return toolbar;        m_isInside = TRUE;        m_toolbar = toolbar;        wxXmlNode *n = children_node;        while (n)        {            if ((n->GetType() == wxXML_ELEMENT_NODE) &&                (n->GetName() == _T("object") || n->GetName() == _T("object_ref")))            {                wxObject *created = CreateResFromNode(n, toolbar, NULL);                wxControl *control = wxDynamicCast(created, wxControl);                if (!IsOfClass(n, _T("tool")) &&                    !IsOfClass(n, _T("separator")) &&                    control != NULL &&                    control != toolbar)                {                    //Manager::Get()->GetLogManager()->DebugLog(F(_T("control=%p, parent=%p, toolbar=%p"), control, control->GetParent(), toolbar));                    toolbar->AddControl(control);                }            }            n = n->GetNext();        }        toolbar->Realize();        m_isInside = FALSE;        m_toolbar = NULL;        if(!m_isAddon)        {            if (m_parentAsWindow && !GetBool(_T("dontattachtoframe")))            {                wxFrame *parentFrame = wxDynamicCast(m_parent, wxFrame);                if (parentFrame)                    parentFrame->SetToolBar(toolbar);            }        }        m_isAddon=false;        return toolbar;    }}
开发者ID:stahta01,项目名称:codeblocks_r7456,代码行数:101,


示例19: ReportError

wxObject *wxAuiToolBarXmlHandler::DoCreateResource(){    if (m_class == wxS("tool"))    {        if ( !m_toolbar )        {            ReportError("tool only allowed inside a wxAuiToolBar");            return NULL;        }        wxItemKind kind = wxITEM_NORMAL;        if (GetBool(wxS("radio")))            kind = wxITEM_RADIO;        if (GetBool(wxS("toggle")))        {            if ( kind != wxITEM_NORMAL )            {                ReportParamError                (                    "toggle",                    "tool can't have both <radio> and <toggle> properties"                );            }            kind = wxITEM_CHECK;        }#if wxUSE_MENUS        // check whether we have dropdown tag inside        wxMenu *menu = NULL; // menu for drop down items        wxXmlNode * const nodeDropdown = GetParamNode("dropdown");        if ( nodeDropdown )        {            // also check for the menu specified inside dropdown (it is            // optional and may be absent for e.g. dynamically-created            // menus)            wxXmlNode * const nodeMenu = GetNodeChildren(nodeDropdown);            if ( nodeMenu )            {                wxObject *res = CreateResFromNode(nodeMenu, NULL);                menu = wxDynamicCast(res, wxMenu);                if ( !menu )                {                    ReportError                    (                        nodeMenu,                        "drop-down tool contents can only be a wxMenu"                    );                }                if ( GetNodeNext(nodeMenu) )                {                    ReportError                    (                        GetNodeNext(nodeMenu),                        "unexpected extra contents under drop-down tool"                    );                }            }        }#endif        wxAuiToolBarItem * const tool =            m_toolbar->AddTool                       (                          GetID(),                          GetText(wxS("label")),                          GetBitmap(wxS("bitmap"), wxART_TOOLBAR, m_toolSize),                          GetBitmap(wxS("bitmap2"), wxART_TOOLBAR, m_toolSize),                          kind,                          GetText(wxS("tooltip")),                          GetText(wxS("longhelp")),                          NULL                       );        if ( GetBool(wxS("disabled")) )            m_toolbar->EnableTool(GetID(), false);#if wxUSE_MENUS        if (menu)        {            tool->SetHasDropDown(true);            tool->SetUserData(m_menuHandler.RegisterMenu(m_toolbar, GetID(), menu));        }#endif        return m_toolbar; // must return non-NULL    }    else if (m_class == wxS("separator") || m_class == wxS("space") || m_class == wxS("label"))    {        if ( !m_toolbar )        {            ReportError("separators only allowed inside wxAuiToolBar");            return NULL;        }        if ( m_class == wxS("separator") )            m_toolbar->AddSeparator();        else if (m_class == wxS("space"))//.........这里部分代码省略.........
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:101,


示例20: XRC_MAKE_INSTANCE

wxObject *wxTreebookXmlHandler::DoCreateResource(){    if (m_class == wxT("wxTreebook"))    {        XRC_MAKE_INSTANCE(tbk, wxTreebook)        tbk->Create(m_parentAsWindow,                    GetID(),                    GetPosition(), GetSize(),                    GetStyle(wxT("style")),                    GetName());        wxTreebook * old_par = m_tbk;        m_tbk = tbk;        bool old_ins = m_isInside;        m_isInside = true;        wxArrayTbkPageIndexes old_treeContext = m_treeContext;        m_treeContext.Clear();        CreateChildren(m_tbk, true/*only this handler*/);        m_treeContext = old_treeContext;        m_isInside = old_ins;        m_tbk = old_par;        return tbk;    }//    else ( m_class == wxT("treebookpage") )    wxXmlNode *n = GetParamNode(wxT("object"));    wxWindow *wnd = NULL;    if ( !n )        n = GetParamNode(wxT("object_ref"));    if (n)    {        bool old_ins = m_isInside;        m_isInside = false;        wxObject *item = CreateResFromNode(n, m_tbk, NULL);        m_isInside = old_ins;        wnd = wxDynamicCast(item, wxWindow);        if (wnd == NULL && item != NULL)            wxLogError(wxT("Error in resource: control within treebook's <page> tag is not a window."));    }    size_t depth = GetLong( wxT("depth") );    if( depth <= m_treeContext.Count() )    {        // first prepare the icon        int imgIndex = wxNOT_FOUND;        if ( HasParam(wxT("bitmap")) )        {            wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER);            wxImageList *imgList = m_tbk->GetImageList();            if ( imgList == NULL )            {                imgList = new wxImageList( bmp.GetWidth(), bmp.GetHeight() );                m_tbk->AssignImageList( imgList );            }            imgIndex = imgList->Add(bmp);        }        // then add the page to the corresponding parent        if( depth < m_treeContext.Count() )            m_treeContext.RemoveAt(depth, m_treeContext.Count() - depth );        if( depth == 0)        {            m_tbk->AddPage(wnd,                GetText(wxT("label")), GetBool(wxT("selected")), imgIndex);        }        else        {            m_tbk->InsertSubPage(m_treeContext.Item(depth - 1), wnd,                GetText(wxT("label")), GetBool(wxT("selected")), imgIndex);        }        m_treeContext.Add( m_tbk->GetPageCount() - 1);    }    else        wxLogError(wxT("Error in resource. wxTreebookPage has an invalid depth."));    return wnd;}
开发者ID:AlexHayton,项目名称:decoda,代码行数:88,


示例21: GetParamNode

wxObject *wxChoicebookXmlHandler::DoCreateResource(){    if (m_class == wxT("choicebookpage"))    {        wxXmlNode *n = GetParamNode(wxT("object"));        if ( !n )            n = GetParamNode(wxT("object_ref"));        if (n)        {            bool old_ins = m_isInside;            m_isInside = false;            wxObject *item = CreateResFromNode(n, m_choicebook, NULL);            m_isInside = old_ins;            wxWindow *wnd = wxDynamicCast(item, wxWindow);            if (wnd)            {                m_choicebook->AddPage(wnd, GetText(wxT("label")),                                           GetBool(wxT("selected")));                if ( HasParam(wxT("bitmap")) )                {                    wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER);                    wxImageList *imgList = m_choicebook->GetImageList();                    if ( imgList == NULL )                    {                        imgList = new wxImageList( bmp.GetWidth(), bmp.GetHeight() );                        m_choicebook->AssignImageList( imgList );                    }                    int imgIndex = imgList->Add(bmp);                    m_choicebook->SetPageImage(m_choicebook->GetPageCount()-1, imgIndex );                }                else if ( HasParam(wxT("image")) )                {                    if ( m_choicebook->GetImageList() )                    {                        m_choicebook->SetPageImage(m_choicebook->GetPageCount()-1,                                                   GetLong(wxT("image")) );                    }                    else // image without image list?                    {                        ReportError(n, "image can only be used in conjunction "                                       "with imagelist");                    }                }            }            else            {                ReportError(n, "choicebookpage child must be a window");            }            return wnd;        }        else        {            ReportError("choicebookpage must have a window child");            return NULL;        }    }    else    {        XRC_MAKE_INSTANCE(nb, wxChoicebook)        nb->Create(m_parentAsWindow,                   GetID(),                   GetPosition(), GetSize(),                   GetStyle(wxT("style")),                   GetName());        wxImageList *imagelist = GetImageList();        if ( imagelist )            nb->AssignImageList(imagelist);        wxChoicebook *old_par = m_choicebook;        m_choicebook = nb;        bool old_ins = m_isInside;        m_isInside = true;        CreateChildren(m_choicebook, true/*only this handler*/);        m_isInside = old_ins;        m_choicebook = old_par;        return nb;    }}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:85,


示例22: GetLong

wxObject *wxRadioBoxXmlHandler::DoCreateResource(){    if ( m_class == wxT("wxRadioBox"))    {        // find the selection        long selection = GetLong( wxT("selection"), -1 );        // need to build the list of strings from children        m_insideBox = true;        CreateChildrenPrivately( NULL, GetParamNode(wxT("content")));        XRC_MAKE_INSTANCE(control, wxRadioBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetText(wxT("label")),                        GetPosition(), GetSize(),                        m_labels,                        GetLong(wxT("dimension"), 1),                        GetStyle(),                        wxDefaultValidator,                        GetName());        if (selection != -1)            control->SetSelection(selection);        SetupWindow(control);        const unsigned count = m_labels.size();        for( unsigned i = 0; i < count; i++ )        {#if wxUSE_TOOLTIPS            if ( !m_tooltips[i].empty() )                control->SetItemToolTip(i, m_tooltips[i]);#endif // wxUSE_TOOLTIPS#if wxUSE_HELP            if ( m_helptextSpecified[i] )                control->SetItemHelpText(i, m_helptexts[i]);#endif // wxUSE_HELP            if ( !m_isShown[i] )                control->Show(i, false);            if ( !m_isEnabled[i] )                control->Enable(i, false);        }        // forget information about the items of this radiobox, we should start        // afresh for the next one        m_labels.clear();#if wxUSE_TOOLTIPS        m_tooltips.clear();#endif // wxUSE_TOOLTIPS#if wxUSE_HELP        m_helptexts.clear();        m_helptextSpecified.clear();#endif // wxUSE_HELP        m_isShown.clear();        m_isEnabled.clear();        return control;    }    else // inside the radiobox element    {        // we handle handle <item>Label</item> constructs here, and the item        // tag can have tooltip, helptext, enabled and hidden attributes        // For compatibility, labels are not escaped in XRC by default and        // label="1" attribute needs to be explicitly specified to handle them        // consistently with the other labels.        m_labels.push_back(GetNodeText(m_node,                                       GetBoolAttr("label", 0)                                        ? 0                                        : wxXRC_TEXT_NO_ESCAPE));#if wxUSE_TOOLTIPS        m_tooltips.push_back(GetNodeText(GetParamNode(wxT("tooltip")),                                         wxXRC_TEXT_NO_ESCAPE));#endif // wxUSE_TOOLTIPS#if wxUSE_HELP        const wxXmlNode* const nodeHelp = GetParamNode(wxT("helptext"));        m_helptexts.push_back(GetNodeText(nodeHelp, wxXRC_TEXT_NO_ESCAPE));        m_helptextSpecified.push_back(nodeHelp != NULL);#endif // wxUSE_HELP        m_isEnabled.push_back(GetBoolAttr("enabled", 1));        m_isShown.push_back(!GetBoolAttr("hidden", 0));        return NULL;    }}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:93,


示例23: GetLong

wxObject *wxRadioBoxXmlHandler::DoCreateResource(){    if ( m_class == wxT("wxRadioBox"))    {        // find the selection        long selection = GetLong( wxT("selection"), -1 );        // need to build the list of strings from children        m_insideBox = true;        CreateChildrenPrivately( NULL, GetParamNode(wxT("content")));        XRC_MAKE_INSTANCE(control, wxRadioBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetText(wxT("label")),                        GetPosition(), GetSize(),                        m_labels,                        GetLong(wxT("dimension"), 1),                        GetStyle(),                        wxDefaultValidator,                        GetName());        if (selection != -1)            control->SetSelection(selection);        SetupWindow(control);        const unsigned count = m_labels.size();        for( unsigned i = 0; i < count; i++ )        {#if wxUSE_TOOLTIPS            if ( !m_tooltips[i].empty() )                control->SetItemToolTip(i, m_tooltips[i]);#endif // wxUSE_TOOLTIPS#if wxUSE_HELP            if ( m_helptextSpecified[i] )                control->SetItemHelpText(i, m_helptexts[i]);#endif // wxUSE_HELP            if ( !m_isShown[i] )                control->Show(i, false);            if ( !m_isEnabled[i] )                control->Enable(i, false);        }        // forget information about the items of this radiobox, we should start        // afresh for the next one        m_labels.clear();#if wxUSE_TOOLTIPS        m_tooltips.clear();#endif // wxUSE_TOOLTIPS#if wxUSE_HELP        m_helptexts.clear();        m_helptextSpecified.clear();#endif // wxUSE_HELP        m_isShown.clear();        m_isEnabled.clear();        return control;    }    else // inside the radiobox element    {        // we handle handle <item>Label</item> constructs here, and the item        // tag can have tooltip, helptext, enabled and hidden attributes        wxString label = GetNodeContent(m_node);        wxString tooltip;        m_node->GetAttribute(wxT("tooltip"), &tooltip);        wxString helptext;        bool hasHelptext = m_node->GetAttribute(wxT("helptext"), &helptext);        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)        {            label = wxGetTranslation(label, m_resource->GetDomain());            if ( !tooltip.empty() )                tooltip = wxGetTranslation(tooltip, m_resource->GetDomain());            if ( hasHelptext )                helptext = wxGetTranslation(helptext, m_resource->GetDomain());        }        m_labels.push_back(label);#if wxUSE_TOOLTIPS        m_tooltips.push_back(tooltip);#endif // wxUSE_TOOLTIPS#if wxUSE_HELP        m_helptexts.push_back(helptext);        m_helptextSpecified.push_back(hasHelptext);#endif // wxUSE_HELP        m_isEnabled.push_back(GetBoolAttr("enabled", 1));        m_isShown.push_back(!GetBoolAttr("hidden", 0));        return NULL;    }//.........这里部分代码省略.........
开发者ID:BradleyKarkanen,项目名称:pcsx2,代码行数:101,


示例24: XRC_MAKE_INSTANCE

wxObject* MYwxTreebookXmlHandler::DoCreateResource(){    if(m_class == wxT("wxTreebook")) {        XRC_MAKE_INSTANCE(tbk, wxTreebook)        tbk->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle(wxT("style")), GetName());        wxTreebook* old_par = m_tbk;        m_tbk = tbk;        bool old_ins = m_isInside;        m_isInside = true;        wxArrayTbkPageIndexes old_treeContext = m_treeContext;        m_treeContext.Clear();        CreateChildren(m_tbk, true /*only this handler*/);        wxXmlNode* node = GetParamNode(wxT("object"));        int pageIndex = 0;        for(unsigned int i = 0; i < m_tbk->GetPageCount(); i++) {            if(m_tbk->GetPage(i)) {                wxXmlNode* child = node->GetChildren();                while(child) {                    if(child->GetName() == wxT("expanded") && child->GetNodeContent() == wxT("1"))                        m_tbk->ExpandNode(pageIndex, true);                    child = child->GetNext();                }                pageIndex++;            }        }        m_treeContext = old_treeContext;        m_isInside = old_ins;        m_tbk = old_par;        return tbk;    }    //    else ( m_class == wxT("treebookpage") )    wxXmlNode* n = GetParamNode(wxT("object"));    wxWindow* wnd = NULL;    if(!n) n = GetParamNode(wxT("object_ref"));    if(n) {        bool old_ins = m_isInside;        m_isInside = false;        wxObject* item = CreateResFromNode(n, m_tbk, NULL);        m_isInside = old_ins;        wnd = wxDynamicCast(item, wxWindow);    }    size_t depth = GetLong(wxT("depth"));    if(depth <= m_treeContext.GetCount()) {        // first prepare the icon        int imgIndex = wxNOT_FOUND;        if(HasParam(wxT("bitmap"))) {            wxBitmap bmp = GetBitmap(wxT("bitmap"), wxART_OTHER);            wxImageList* imgList = m_tbk->GetImageList();            if(imgList == NULL) {                imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight());                m_tbk->AssignImageList(imgList);            }            imgIndex = imgList->Add(bmp);        } else if(HasParam(wxT("image"))) {            if(m_tbk->GetImageList()) {                imgIndex = GetLong(wxT("image"));            } else // image without image list?            {            }        }        // then add the page to the corresponding parent        if(depth < m_treeContext.GetCount()) m_treeContext.RemoveAt(depth, m_treeContext.GetCount() - depth);        if(depth == 0) {            m_tbk->AddPage(wnd, GetText(wxT("label")), GetBool(wxT("selected")), imgIndex);        } else {            m_tbk->InsertSubPage(m_treeContext.Item(depth - 1), wnd, GetText(wxT("label")), GetBool(wxT("selected")),                                 imgIndex);        }        m_treeContext.Add(m_tbk->GetPageCount() - 1);    } else {        // ReportParamError("depth", "invalid depth");    }    return wnd;}
开发者ID:eranif,项目名称:codelite,代码行数:92,


示例25: wxT

wxObject *wxCheckListBoxXmlHandler::DoCreateResource(){    if (m_class == wxT("wxCheckListBox")#if WXWIN_COMPATIBILITY_2_4        || m_class == wxT("wxCheckList")#endif       )    {#if WXWIN_COMPATIBILITY_2_4        if (m_class == wxT("wxCheckList"))            wxLogDebug(wxT("'wxCheckList' name is deprecated, use 'wxCheckListBox' instead."));#endif        // need to build the list of strings from children        m_insideBox = true;        CreateChildrenPrivately(NULL, GetParamNode(wxT("content")));        wxString *strings = (wxString *) NULL;        if (strList.GetCount() > 0)        {            strings = new wxString[strList.GetCount()];            int count = strList.GetCount();            for(int i = 0; i < count; i++)                strings[i] = strList[i];        }        XRC_MAKE_INSTANCE(control, wxCheckListBox)        control->Create(m_parentAsWindow,                        GetID(),                        GetPosition(), GetSize(),                        strList.GetCount(),                        strings,                        GetStyle(),                        wxDefaultValidator,                        GetName());        // step through children myself (again.)        wxXmlNode *n = GetParamNode(wxT("content"));        if (n) n = n->GetChildren();        int i = 0;        while (n)        {            if (n->GetType() != wxXML_ELEMENT_NODE ||                n->GetName() != wxT("item"))               { n = n->GetNext(); continue; }            // checking boolean is a bit ugly here (see GetBool() )            wxString v = n->GetPropVal(wxT("checked"), wxEmptyString);            v.MakeLower();            if (v && v == wxT("1"))                control->Check( i, true );            i++;            n = n->GetNext();        }        SetupWindow(control);        if (strings != NULL)            delete[] strings;        strList.Clear();    // dump the strings        return control;    }    else    {        // on the inside now.        // handle <item checked="boolean">Label</item>        // add to the list        wxString str = GetNodeContent(m_node);        if (m_resource->GetFlags() & wxXRC_USE_LOCALE)            str = wxGetTranslation(str);        strList.Add(str);        return NULL;    }}
开发者ID:gitrider,项目名称:wxsj2,代码行数:76,


示例26: wxStaticCast

wxObject* wxRibbonXmlHandler::Handle_button(){    wxRibbonButtonBar *buttonBar = wxStaticCast(m_parent, wxRibbonButtonBar);    wxRibbonButtonKind  kind = wxRIBBON_BUTTON_NORMAL;    if (GetBool(wxT("hybrid")))        kind = wxRIBBON_BUTTON_HYBRID;    // FIXME: The code below uses wxXmlNode directly but this can't be done    //        in the ribbon library code as it would force it to always link    //        with the xml library. Disable it for now but the real solution    //        would be to virtualize GetChildren() and GetNext() methods via    //        wxXmlResourceHandler, just as we already do for many others.    //    // FIXME: If re-enabling, don't forget to update the docs and RELAG NG schema!#if 0 // wxUSE_MENUS    // check whether we have dropdown tag inside    wxMenu *menu = NULL; // menu for drop down items    wxXmlNode * const nodeDropdown = GetParamNode("dropdown");    if ( nodeDropdown )    {        if (kind == wxRIBBON_BUTTON_NORMAL)            kind = wxRIBBON_BUTTON_DROPDOWN;        // also check for the menu specified inside dropdown (it is        // optional and may be absent for e.g. dynamically-created        // menus)        wxXmlNode * const nodeMenu = nodeDropdown->GetChildren();        if ( nodeMenu )        {            wxObject *res = CreateResFromNode(nodeMenu, NULL);            menu = wxDynamicCast(res, wxMenu);            if ( !menu )            {                ReportError                (                    nodeMenu,                    "drop-down tool contents can only be a wxMenu"                );            }            if ( nodeMenu->GetNext() )            {                ReportError                (                    nodeMenu->GetNext(),                    "unexpected extra contents under drop-down tool"                );            }        }    }#endif // wxUSE_MENUS    if (!buttonBar->AddButton(GetID(),                              GetText("label"),                              GetBitmap ("bitmap"),                              GetBitmap ("small-bitmap"),                              GetBitmap ("disabled-bitmap"),                              GetBitmap ("small-disabled-bitmap"),                              kind,                              GetText("help")))    {        ReportError ("could not create button");    }    if ( GetBool(wxT("disabled")) )            buttonBar->EnableButton(GetID(), false);    return NULL; // nothing to return}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:71,


示例27: wxCHECK_MSG

wxObject *wxToolBarXmlHandler::DoCreateResource(){    if (m_class == wxT("tool"))    {        wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: tool not within a toolbar!"));        if (GetPosition() != wxDefaultPosition)        {            m_toolbar->AddTool(GetID(),                               GetBitmap(wxT("bitmap"), wxART_TOOLBAR),                               GetBitmap(wxT("bitmap2"), wxART_TOOLBAR),                               GetBool(wxT("toggle")),                               GetPosition().x,                               GetPosition().y,                               NULL,                               GetText(wxT("tooltip")),                               GetText(wxT("longhelp")));        }        else        {            wxItemKind kind = wxITEM_NORMAL;            if (GetBool(wxT("radio")))                kind = wxITEM_RADIO;            if (GetBool(wxT("toggle")))            {                wxASSERT_MSG( kind == wxITEM_NORMAL,                              _T("can't have both toggleable and radion button at once") );                kind = wxITEM_CHECK;            }            m_toolbar->AddTool(GetID(),                               GetText(wxT("label")),                               GetBitmap(wxT("bitmap"), wxART_TOOLBAR),                               GetBitmap(wxT("bitmap2"), wxART_TOOLBAR),                               kind,                               GetText(wxT("tooltip")),                               GetText(wxT("longhelp")));            if ( GetBool(wxT("disabled")) )                m_toolbar->EnableTool(GetID(), false);        }        return m_toolbar; // must return non-NULL    }    else if (m_class == wxT("separator"))    {        wxCHECK_MSG(m_toolbar, NULL, wxT("Incorrect syntax of XRC resource: separator not within a toolbar!"));        m_toolbar->AddSeparator();        return m_toolbar; // must return non-NULL    }    else /*<object class="wxToolBar">*/    {        int style = GetStyle(wxT("style"), wxNO_BORDER | wxTB_HORIZONTAL);#ifdef __WXMSW__        if (!(style & wxNO_BORDER)) style |= wxNO_BORDER;#endif        XRC_MAKE_INSTANCE(toolbar, wxToolBar)        toolbar->Create(m_parentAsWindow,                         GetID(),                         GetPosition(),                         GetSize(),                         style,                         GetName());        wxSize bmpsize = GetSize(wxT("bitmapsize"));        if (!(bmpsize == wxDefaultSize))            toolbar->SetToolBitmapSize(bmpsize);        wxSize margins = GetSize(wxT("margins"));        if (!(margins == wxDefaultSize))            toolbar->SetMargins(margins.x, margins.y);        long packing = GetLong(wxT("packing"), -1);        if (packing != -1)            toolbar->SetToolPacking(packing);        long separation = GetLong(wxT("separation"), -1);        if (separation != -1)            toolbar->SetToolSeparation(separation);        if (HasParam(wxT("bg")))            toolbar->SetBackgroundColour(GetColour(wxT("bg")));        wxXmlNode *children_node = GetParamNode(wxT("object"));        if (!children_node)           children_node = GetParamNode(wxT("object_ref"));        if (children_node == NULL) return toolbar;        m_isInside = true;        m_toolbar = toolbar;        wxXmlNode *n = children_node;        while (n)        {            if ((n->GetType() == wxXML_ELEMENT_NODE) &&                (n->GetName() == wxT("object") || n->GetName() == wxT("object_ref")))            {                wxObject *created = CreateResFromNode(n, toolbar, NULL);                wxControl *control = wxDynamicCast(created, wxControl);                if (!IsOfClass(n, wxT("tool")) &&//.........这里部分代码省略.........
开发者ID:hgwells,项目名称:tive,代码行数:101,


示例28: ReportError

wxObject *wxToolBarXmlHandlerEx::DoCreateResource(){	if (m_class == wxT("tool"))	{		if (!m_toolbar)		{			ReportError("tool only allowed inside a wxToolBar");			return NULL;		}		wxItemKind kind = wxITEM_NORMAL;		if (GetBool(wxT("radio")))			kind = wxITEM_RADIO;		if (GetBool(wxT("toggle")))		{			if (kind != wxITEM_NORMAL)			{				ReportParamError					(					"toggle",					"tool can't have both <radio> and <toggle> properties"					);			}			kind = wxITEM_CHECK;		}#if wxUSE_MENUS		// check whether we have dropdown tag inside		wxMenu *menu = NULL; // menu for drop down items		wxXmlNode * const nodeDropdown = GetParamNode("dropdown");		if (nodeDropdown)		{			if (kind != wxITEM_NORMAL)			{				ReportParamError					(					"dropdown",					"drop-down tool can't have neither <radio> nor <toggle> properties"					);			}			kind = wxITEM_DROPDOWN;			// also check for the menu specified inside dropdown (it is			// optional and may be absent for e.g. dynamically-created			// menus)			wxXmlNode * const nodeMenu = nodeDropdown->GetChildren();			if (nodeMenu)			{				wxObject *res = CreateResFromNode(nodeMenu, NULL);				menu = dynamic_cast<wxMenu*>(res);				if (!menu)				{					ReportError						(						nodeMenu,						"drop-down tool contents can only be a wxMenu"						);				}				if (nodeMenu->GetNext())				{					ReportError						(						nodeMenu->GetNext(),						"unexpected extra contents under drop-down tool"						);				}			}		}#endif		wxBitmap bitmap = GetBitmap(wxT("bitmap"), wxART_TOOLBAR, m_iconSize);		wxBitmap bitmap2 = GetBitmap(wxT("bitmap2"), wxART_TOOLBAR, m_iconSize);#ifdef __WXMAC__		if( bitmap.IsOk() ) {			if( bitmap.GetSize().x < 24 ) {				bitmap = wxBitmap(bitmap.ConvertToImage().Size(wxSize(24, 24), wxPoint(4, 4)));			}		}		if( bitmap2.IsOk() ) {			if( bitmap2.GetSize().x < 24 ) {				bitmap2 = wxBitmap(bitmap2.ConvertToImage().Size(wxSize(24, 24), wxPoint(4, 4)));			}		}#endif#ifdef __WXGTK3__		// We need to provide a disabled bitmap.		if( !bitmap2.IsOk() && bitmap.IsOk() ) {			bitmap2 = wxBitmap(bitmap.ConvertToImage().ConvertToGreyscale());		}#endif		wxToolBarToolBase * const tool =			m_toolbar->AddTool			(			GetID(),			GetText(wxT("label")),			bitmap,//.........这里部分代码省略.........
开发者ID:RanesJan,项目名称:it340midterm,代码行数:101,



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


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