本文整理匯總了C++中Codef函數的典型用法代碼示例。如果您正苦於以下問題:C++ Codef函數的具體用法?C++ Codef怎麽用?C++ Codef使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Codef函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: switch
/*! \brief Create the dialogue.
*
* \return void
*
*/
void wxsRichTextFormattingDialog::OnBuildCreatingCode()
{
wxString sFlags;
switch(GetLanguage())
{
case wxsCPP:
AddHeader(_T("<wx/richtext/richtextformatdlg.h>"), GetInfo().ClassName, 0);
for(int i = 0;arrPageValueNames[i];i++){
if(m_iFlags & arrPageValues[i]){
sFlags << arrPageValueNames[i] << _T("|");
}
}
if(sFlags.IsEmpty()){
sFlags = _T("0");
}
else{
sFlags.RemoveLast();
}
#if wxCHECK_VERSION(2, 9, 0)
Codef(_T("%C(%s, %W, %t, %I, %P, %S);\n"), sFlags.wx_str(), m_sTitle.wx_str());
#else
Codef(_T("%C(%s, %W, %t, %I, %P, %S);\n"), sFlags.c_str(), m_sTitle.c_str());
#endif
BuildSetupWindowCode();
break;
default:
wxsCodeMarks::Unknown(_T("wxsRichTextFormattingDialog::OnBuildCreatingCode"), GetLanguage());
}
}
示例2: switch
void wxsHtmlWindow::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/html/htmlwin.h>"),GetInfo().ClassName,0);
Codef(_T("%C(%W, %I, %P, %S, %T, %N);\n"));
if ( Borders.Value )
Codef(_T("%ASetBorders(%s);\n"),Borders.GetPixelsCode(GetCoderContext()).wx_str());
if ( !Url.empty() )
Codef(_T("%ALoadPage(%t);\n"),Url.wx_str());
else if ( !HtmlCode.empty() )
Codef(_T("%ASetPage(%t);\n"),HtmlCode.wx_str());
BuildSetupWindowCode();
break;
}
default:
{
wxsCodeMarks::Unknown(_T("wxsHtmlWindow::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例3: switch
/*! \brief Build the code that creates the control.
*
* \return void
*
*/
void wxsLCDClock::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("\"wx/KWIC/LCDClock.h\""),GetInfo().ClassName);
Codef(_T("%C(%W,%P,%S);\n"));
// 6 digits is the default value.
if (m_iNumDigits && m_iNumDigits != 6){
Codef(_T("%ASetNumberDigits(%d);\n"), static_cast<int>(m_iNumDigits));
}
wxString ss = m_cdLightColour.BuildCode( GetCoderContext() );
if (!ss.IsEmpty()) Codef(_T("%ASetLightColour(%s);\n"), ss.wx_str());
ss = m_cdGrayColour.BuildCode( GetCoderContext() );
if (!ss.IsEmpty()) Codef(_T("%ASetGrayColour(%s);\n"), ss.wx_str());
BuildSetupWindowCode();
break;
}
default:
wxsCodeMarks::Unknown(_T("wxsLCDClock::OnBuildCreatingCode"),GetLanguage());
}
}
示例4: GetVarName
void wxsMathPlot::OnBuildCreatingCode()
{
wxString inc;
wxString vname;
wxString aname;
wxString cname;
// we only know C++ language
if (GetLanguage() != wxsCPP) wxsCodeMarks::Unknown(_T("wxsMathPlot::OnBuildCreatingCode"),GetLanguage());
// who we are
vname = GetVarName();
// include files
AddHeader(_("<mathplot.h>"), GetInfo().ClassName, 0);
// create the panel
Codef(_T("%s = new mpWindow(%W, %I, %P, %S, %T);\n"), vname.wx_str());
BuildSetupWindowCode();
// add children
AddChildrenCode();
// and do it all
Codef(_T("%AUpdateAll();\n"));
Codef(_T("%AFit();\n"));
}
示例5: switch
void wxsSingleInstanceChecker::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/utils.h>"), GetInfo().ClassName, 0);
AddHeader(_T("<wx/snglinst.h>"),GetInfo().ClassName, 0);
if ( AppName.IsEmpty() )
{
AddHeader(_T("<wx/app.h>"), GetInfo().ClassName, 0);
Codef( _T("%C(wxTheApp->GetAppName() + _T(\"_\") + wxGetUserId() + _T(\"_Guard\"));\n") );
}
else
{
Codef(_T("%C(%n + wxGetUserId() + _T(\"_Guard\"));\n"), ( AppName + _T("_") ).wx_str() );
}
BuildSetupWindowCode();
break;
}
default:
{
wxsCodeMarks::Unknown( _T("wxsSingleInstanceChecker::OnBuildCreatingCode"), GetLanguage() );
}
}
}
示例6: switch
void wxsFileDialog::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/filedlg.h>"),GetInfo().ClassName,hfInPCH);
if ( m_Wildcard.empty() )
{
Codef(_T("%C(%W, %t, %t, %t, wxFileSelectorDefaultWildcardStr, %T, %P, %S, %N);\n"),
m_Message.wx_str(),
m_DefaultDir.wx_str(),
m_DefaultFile.wx_str());
}
else
{
Codef(_T("%C(%W, %t, %t, %t, %t, %T, %P, %S, %N);\n"),
m_Message.wx_str(),
m_DefaultDir.wx_str(),
m_DefaultFile.wx_str(),
m_Wildcard.wx_str());
}
BuildSetupWindowCode();
return;
}
default:
{
wxsCodeMarks::Unknown(_T("wxsFileDialog::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例7: switch
/*! \brief Create the initial control.
*
* \return void
*
*/
void wxsRichTextStyleComboCtrl::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/richtext/richtextstyles.h>"),GetInfo().ClassName,hfInPCH);
Codef(_T("%C(%W, %I, %P, %S, %T);\n"));
if(!m_sControl.IsEmpty()){
Codef( _T("%ASetRichTextCtrl(%s);\n"), m_sControl.wx_str());
}
if(!m_sStyleSheet.IsEmpty()){
Codef( _T("%ASetStyleSheet(%s);\n"), m_sStyleSheet.wx_str());
Codef( _T("%AUpdateStyles();\n"));
}
BuildSetupWindowCode();
return;
}
default:
{
wxsCodeMarks::Unknown(_T("wxsRichTextStyleComboCtrl::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例8: switch
void wxsChoicebook::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/choicebk.h>"),GetInfo().ClassName,0);
AddHeader(_T("<wx/notebook.h>"),_T("wxNotebookEvent"),0);
Codef(_T("%C(%W, %I, %P, %S, %T, %N);\n"));
BuildSetupWindowCode();
AddChildrenCode();
for ( int i=0; i<GetChildCount(); i++ )
{
wxsChoicebookExtra* Extra = (wxsChoicebookExtra*)GetChildExtra(i);
#if wxCHECK_VERSION(2, 9, 0)
Codef(_T("%AAddPage(%o, %t, %b);\n"),i,Extra->m_Label.wx_str(),Extra->m_Selected);
#else
Codef(_T("%AAddPage(%o, %t, %b);\n"),i,Extra->m_Label.c_str(),Extra->m_Selected);
#endif
}
break;
}
default:
{
wxsCodeMarks::Unknown(_T("wxsChoicebook::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例9: switch
void wxsListbook::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/listbook.h>"),GetInfo().ClassName,0);
AddHeader(_T("<wx/notebook.h>"),_T("wxNotebookEvent"),0);
Codef(_T("%C(%W, %I, %P, %S, %T, %N);\n"));
BuildSetupWindowCode();
AddChildrenCode();
for ( int i=0; i<GetChildCount(); i++ )
{
wxsListbookExtra* LBExtra = (wxsListbookExtra*)GetChildExtra(i);
Codef(_T("%AAddPage(%o, %t, %b);\n"),i,LBExtra->m_Label.wx_str(),LBExtra->m_Selected);
}
break;
}
case wxsUnknownLanguage: // fall-through
default:
{
wxsCodeMarks::Unknown(_T("wxsListbook::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例10: switch
void wxsChoice::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/choice.h>"),GetInfo().ClassName,hfInPCH);
Codef(_T("%C(%W, %I, %P, %S, 0, 0, %T, %V, %N);\n"));
for ( size_t i = 0; i < ArrayChoices.GetCount(); ++i )
{
if ( DefaultSelection == (int)i )
{
Codef(_T("%ASetSelection( "));
}
Codef(_T("%AAppend(%t)"),ArrayChoices[i].wx_str());
if ( DefaultSelection == (int)i )
{
Codef(_T(" )"));
}
Codef(_T(";\n"));
}
BuildSetupWindowCode();
return;
}
case wxsUnknownLanguage: // fall through
default:
{
wxsCodeMarks::Unknown(_T("wxsChoice::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例11: switch
void wxsSplitterWindow::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/splitter.h>"),GetInfo().ClassName,0);
AddHeader(_T("<wx/splitter.h>"),_T("wxSplitterEvent"),0);
Codef(_T("%C(%W, %I, %P, %S, %T, %N);\n"));
BuildSetupWindowCode();
if ( MinSize != -1 ) Codef(_T("%ASetMinimumPaneSize(%d);\n"),MinSize);
AddChildrenCode();
if ( GetChildCount() == 0 )
{
}
else if ( GetChildCount() == 1 )
{
Codef(_T("%AInitialize(%o);\n"),0);
}
else
{
Codef(_T("%ASplit%s(%o, %o);\n"),((Orientation==wxHORIZONTAL) ? _T("Horizontally") : _T("Vertically")),0,1);
if ( SashPos != 0 ) Codef(_T("%ASetSashPosition(%d);\n"),SashPos);
}
break;
}
default:
{
wxsCodeMarks::Unknown(_T("wxsSplitterWindow::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例12: switch
void wxsDialog::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/dialog.h>"),GetInfo().ClassName,hfInPCH);
Codef(_T("%C(%W, %I, %t, wxDefaultPosition, wxDefaultSize, %T, %N);\n"),Title.wx_str());
if ( !GetBaseProps()->m_Size.IsDefault || (GetPropertiesFlags()&flSource && IsRootItem() && GetBaseProps()->m_SizeFromArg) )
{
Codef(_T("%ASetClientSize(%S);\n"));
}
if ( !GetBaseProps()->m_Position.IsDefault || (GetPropertiesFlags()&flSource && IsRootItem() && GetBaseProps()->m_PositionFromArg) )
{
Codef(_T("%AMove(%P);\n"));
}
BuildSetupWindowCode();
AddChildrenCode();
if ( Centered )
{
Codef(_T("%ACenter();\n"));
}
return;
}
case wxsUnknownLanguage: // fall-through
default:
{
wxsCodeMarks::Unknown(_T("wxsDialog::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例13: switch
/*! \brief Create the initial control.
*
* \return void
*
*/
void wxsFontPickerCtrl::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/fontpicker.h>"),GetInfo().ClassName,0);
wxString sFntName = GetCoderContext()->GetUniqueName(_T("PickerFont"));
wxString sFnt = m_fdFont.BuildFontCode(sFntName, GetCoderContext());
if ( sFnt.Len()==0 )
{
sFntName = wxT("wxNullFont");
}
Codef(_T("%s"), sFnt.wx_str());
Codef(_T("%C(%W, %I, %s, %P, %S, %T, %V, %N);\n"), sFntName.wx_str());
BuildSetupWindowCode();
return;
}
case wxsUnknownLanguage: // fall-through
default:
{
wxsCodeMarks::Unknown(_T("wxsFontPickerCtrl::OnBuildCreatingCode"),GetLanguage());
}
}
}
示例14: switch
void wxsMenu::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
AddHeader(_T("<wx/menu.h>"),GetInfo().ClassName,hfInPCH);
if ( IsPointer() )
{
// There's no Create() method for wxMenu so we call ctor only when creating pointer
Codef(_T("%C();\n"));
}
for ( int i=0; i<GetChildCount(); i++ )
{
GetChild(i)->BuildCode(GetCoderContext());
}
if ( GetParent() && GetParent()->GetClassName()==_T("wxMenuBar") )
{
Codef(_T("%MAppend(%O, %t);\n"),m_Label.wx_str());
}
BuildSetupWindowCode();
break;
case wxsUnknownLanguage: // fall-through
default:
wxsCodeMarks::Unknown(_T("wxsMenu::OnBuildCreatingCode"),GetLanguage());
}
}
示例15: switch
/*! \brief Create the initial control.
*
* \return void
*
*/
void wxsAnimationCtrl::OnBuildCreatingCode()
{
switch ( GetLanguage() )
{
case wxsCPP:
{
AddHeader(_T("<wx/animate.h>"),GetInfo().ClassName,hfInPCH);
wxString sAnimName = GetCoderContext()->GetUniqueName(_T("anim"));
Codef(_T("\twxAnimation %s(%n);\n"), sAnimName.wx_str(), m_sAnimation.wx_str());
Codef(_T("%C(%W, %I, %s, %P, %S, %T, %N);\n"), sAnimName.wx_str());
if(!m_bmpInactive.IsEmpty()){
Codef(_T("%ASetInactiveBitmap(%i);\n"), &m_bmpInactive, _T("wxART_OTHER"));
}
if(m_bPlay){
Codef(_T("%APlay();\n"));
}
BuildSetupWindowCode();
return;
}
case wxsUnknownLanguage: // fall-through
default:
{
wxsCodeMarks::Unknown(_T("wxsAnimationCtrl::OnBuildCreatingCode"),GetLanguage());
}
}
}