• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AddCtrl函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: AddControls

void AddControls(TWinControl* AWinControl, TStrings* Strings)
{
    for(int i=0; i < AWinControl->ControlCount; i++)
    {
        if (dynamic_cast<TWinControl*>(AWinControl->Controls[i]))
            AddControls(dynamic_cast<TWinControl*>(AWinControl->Controls[i]), Strings);
        else
            AddCtrl(AWinControl->Controls[i], Strings);
        AddCtrl(AWinControl, Strings);
    }
}
开发者ID:kaan3434,项目名称:gvindelen,代码行数:11,代码来源:MainForm.cpp


示例2: ScaleX

/**
 *  fügt eine ProgressBar hinzu.
 *
 *  @author OLiver
 */
ctrlProgress *Window::AddProgress(unsigned int id,
								  unsigned short x,
								  unsigned short y,
								  unsigned short width,
								  unsigned short height,
								  TextureColor tc,
								  unsigned short button_minus,
								  unsigned short button_plus,
								  unsigned short maximum,
								  const std::string& tooltip,
								  unsigned short x_padding,
								  unsigned short y_padding,
								  unsigned int force_color,
								  const std::string& button_minus_tooltip,
								  const std::string& button_plus_tooltip)
{
	if(scale)
	{
		x = ScaleX(x);
		y = ScaleY(y);
		width = ScaleX(width);
		height = ScaleY(height);
	}

	return AddCtrl(id, new ctrlProgress(this, id, x, y, width, height, tc, button_minus, button_plus, maximum, x_padding, y_padding, force_color, tooltip, button_minus_tooltip, button_plus_tooltip));
}
开发者ID:MiyaxinPittahai,项目名称:s25rttr,代码行数:31,代码来源:Window.cpp


示例3: va_start

/**
 *  fügt ein variables TextCtrl hinzu.
 *
 *  @param[in] x          X-Koordinate des Steuerelements
 *  @param[in] y          Y-Koordinate des Steuerelements
 *  @param[in] formatstr  Der Formatstring des Steuerelements
 *  @param[in] color      Textfarbe
 *  @param[in] format     Formatierung des Textes
 *                          @p 0    - Text links ( standard )
 *                          @p glArchivItem_Font::DF_CENTER  - Text mittig
 *                          @p glArchivItem_Font::DF_RIGHT   - Text rechts
 *                          @p glArchivItem_Font::DF_TOP     - Text oben ( standard )
 *                          @p glArchivItem_Font::DF_VCENTER - Text vertikal zentriert
 *                          @p glArchivItem_Font::DF_BOTTOM  - Text unten
 *  @param[in] font       Schriftart
 *  @param[in] parameters Anzahl der nachfolgenden Parameter
 *  @param[in] ...        die variablen Parameter
 *
 *  @author OLiver
 */
ctrlVarText *Window::AddVarText(unsigned int id, 
								unsigned short x, 
								unsigned short y, 
								 const std::string& formatstr, 
								unsigned int color, 
								unsigned int format, 
								glArchivItem_Font *font, 
								unsigned int parameters, 
								...)
{
	ctrlVarText *ctrl;
	va_list liste;
	va_start(liste, parameters);

	if(scale)
	{
		x = ScaleX(x);
		y = ScaleY(y);
	}

	ctrl = new ctrlVarText(this, id, x, y, formatstr, color, format, font, parameters, liste);
	
	va_end(liste);

	return AddCtrl(id, ctrl);
}
开发者ID:MiyaxinPittahai,项目名称:s25rttr,代码行数:46,代码来源:Window.cpp


示例4: AddCtrl

SjDlgCtrl* SjDlgControls::AddCheckCtrl(const wxString& id, const wxString& label, long value, long defaultValue)
{
	SjDlgCtrl* dc = AddCtrl(SJ_DLG_CHECKCTRL_TYPE, id, label);
	dc->m_value = wxString::Format(wxT("%i"), (int)value);
	dc->m_defaultValue = wxString::Format(wxT("%i"), (int)defaultValue);
	return dc;
}
开发者ID:boh1996,项目名称:silverjuke,代码行数:7,代码来源:dialog.cpp


示例5: hgeCreate

TKShellMenu::TKShellMenu()
{
    _hge = hgeCreate(HGE_VERSION);
    _bg = new hgeSprite(_hge->Texture_Load("img\\ShellMenuBg.png"),0,0,800,600);

    _hBgMusic = _hge->Effect_Load("music\\pause.ogg");
    _cursor = new hgeSprite(_hge->Texture_Load("img\\cursor.png"), 0, 0, 32, 32);
    _font = new hgeFont("img\\font1.fnt");

    AddCtrl(new hgeGUIMenuItem(1, _font, 0, 185, 300, 0.0f, "Single"));
    AddCtrl(new hgeGUIMenuItem(2, _font, 0, 185, 340, 0.1f, "MultiPlayer"));
    AddCtrl(new hgeGUIMenuItem(3, _font, 0, 185, 380, 0.2f, "About"));
    AddCtrl(new hgeGUIMenuItem(4, _font, 0, 185, 420, 0.3f, "Exit"));

    SetNavMode(HGEGUI_UPDOWN|HGEGUI_CYCLED);
    SetCursor(_cursor);
    SetFocus(1);
    Enter();
}
开发者ID:Kogava,项目名称:TankBattle,代码行数:19,代码来源:TKShellMenu.hpp


示例6: GUIAppWindow

LoginWindow::LoginWindow(GUIApp *parentApp, int _id, float x, float y,bool fixed ) :  GUIAppWindow(parentApp,_id, x,y, 200, 200 )

{

    font = Game::Instance()->GetSysInterface()->GetFont(TANK_FONT_1);

    edit1 = new GUIAppEdit(GUIAPP_ID_EDIT_USERNAME,40, 50, 120, font, GUIAPPEDIT_FLAGS_NOMARL,16);
    AddCtrl(edit1);

    edit2 = new GUIAppEdit(GUIAPP_ID_EDIT_PASSWORD,40, 80, 120, font, GUIAPPEDIT_FLAGS_PASSWORD,16);
    AddCtrl(edit2);

    label1 = new GUIAppLabel(GUIAPP_ID_LABLE_STATUS, 40,110, font, "press connect button", 0xffffffff,0);
    AddCtrl(label1);


// active elements
    button = new GUIAppButton(GUIAPP_ID_BTN_LOGIN, 70, 140, 60, 20,NULL,0,0);
    AddCtrl(button);

}
开发者ID:BGCX261,项目名称:zlmtank-svn-to-git,代码行数:21,代码来源:sclogin.cpp


示例7: ScaleX

/**
 *  fügt ein mehrzeiliges TextCtrl hinzu.
 *
 *  @author Devil
 */
ctrlMultiline* Window::AddMultiline(unsigned int id,
                                    unsigned short x,
                                    unsigned short y,
                                    unsigned short width,
                                    unsigned short height,
                                    TextureColor tc,
                                    glArchivItem_Font* font,
                                    unsigned int format)
{
    if(scale_)
    {
        x = ScaleX(x);
        y = ScaleY(y);
        width = ScaleX(width);
        height = ScaleY(height);
    }

    return AddCtrl(id, new ctrlMultiline(this, id, x, y, width, height, tc, font, format));
}
开发者ID:jhkl,项目名称:s25client,代码行数:24,代码来源:Window.cpp


示例8: wxDialog

DialogDummyVideo::DialogDummyVideo(wxWindow *parent)
: wxDialog(parent, -1, _("Dummy video options"))
, fps(OPT_GET("Video/Dummy/FPS")->GetDouble())
, width(OPT_GET("Video/Dummy/Last/Width")->GetInt())
, height(OPT_GET("Video/Dummy/Last/Height")->GetInt())
, length(OPT_GET("Video/Dummy/Last/Length")->GetInt())
, color(OPT_GET("Colour/Video Dummy/Last Colour")->GetColor())
, pattern(OPT_GET("Video/Dummy/Pattern")->GetBool())
{
	SetIcon(GETICON(use_dummy_video_menu_16));

	auto res_sizer = new wxBoxSizer(wxHORIZONTAL);
	res_sizer->Add(spin_ctrl(this, 1, 10000, &width), wxSizerFlags(1).Expand());
	res_sizer->Add(new wxStaticText(this, -1, " x "), wxSizerFlags().Center());
	res_sizer->Add(spin_ctrl(this, 1, 10000, &height), wxSizerFlags(1).Expand());

	auto color_sizer = new wxBoxSizer(wxHORIZONTAL);
	auto color_btn = new ColourButton(this, wxSize(30, 17), false, color);
	color_sizer->Add(color_btn, wxSizerFlags().DoubleBorder(wxRIGHT));
	color_sizer->Add(new wxCheckBox(this, -1, _("Checkerboard &pattern"), wxDefaultPosition, wxDefaultSize, 0, wxGenericValidator(&pattern)), wxSizerFlags(1).Center());

	sizer = new wxFlexGridSizer(2, 5, 5);
	AddCtrl(_("Video resolution:"), resolution_shortcuts(this, width, height));
	AddCtrl("", res_sizer);
	AddCtrl(_("Color:"), color_sizer);
	AddCtrl(_("Frame rate (fps):"), spin_ctrl(this, .1, 1000.0, &fps));
	AddCtrl(_("Duration (frames):"), spin_ctrl(this, 2, 36000000, &length)); // Ten hours of 1k FPS
	AddCtrl("", length_display = new wxStaticText(this, -1, ""));

	wxStdDialogButtonSizer *btn_sizer = CreateStdDialogButtonSizer(wxOK | wxCANCEL | wxHELP);
	btn_sizer->GetHelpButton()->Bind(wxEVT_BUTTON, std::bind(&HelpButton::OpenPage, "Dummy Video"));

	auto main_sizer = new wxBoxSizer(wxVERTICAL);
	main_sizer->Add(sizer, wxSizerFlags(1).Border().Expand());
	main_sizer->Add(new wxStaticLine(this, wxHORIZONTAL), wxSizerFlags().HorzBorder().Expand());
	main_sizer->Add(btn_sizer, wxSizerFlags().Expand().Border());

	UpdateLengthDisplay();

	SetSizerAndFit(main_sizer);
	CenterOnParent();

	Bind(wxEVT_COMBOBOX, &DialogDummyVideo::OnResolutionShortcut, this);
	color_btn->Bind(EVT_COLOR, [=](wxThreadEvent& e) { color = color_btn->GetColor(); });
	Bind(wxEVT_SPINCTRL, [=](wxCommandEvent&) {
		TransferDataFromWindow();
		UpdateLengthDisplay();
	});
}
开发者ID:KagamiChan,项目名称:Aegisub,代码行数:49,代码来源:dialog_dummy_video.cpp


示例9: wxWizardPageSimple

	PageOneQualityParameters::PageOneQualityParameters(ModelReconstructionWizard *parent)
		: wxWizardPageSimple(parent)
	{
		ReconstructionUserPreferences_t defaultParameters;
		//Boite principale pour aligner les contrôles à gauche
        wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);

		
	    //Ajout du "slider"
		AddCtrl(new wxSlider(this,WIZARD_CTRL_SLIDER_DEPTH,defaultParameters.depth,5,10,wxDefaultPosition,wxDefaultSize,wxSL_HORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS),_("Model solving"),mainSizer);
		//Ajout du choix du mode de triangularisation du modèle
		wxArrayString triangulationMethods;
		triangulationMethods.push_back(_("Marching cube")); //TRIANGULATION_METHOD_MARCHING_CUBE
		wxComboBox* triangulationMethod= new wxComboBox(this,WIZARD_CTRL_COMBO_TRIANGULATION_MODE,triangulationMethods[defaultParameters.triangulationMethod],wxDefaultPosition,wxDefaultSize,triangulationMethods);
		triangulationMethod->SetSelection(defaultParameters.triangulationMethod);
		AddCtrl(triangulationMethod,_("Triangulation method"),mainSizer);
		//Ajout de la liste déroulante du choix de la méthode adaptative
		wxArrayString adaptativeMethods;
		adaptativeMethods.push_back(_("None"));					//ADAPTATIVE_MESH_METHOD_NONE
		adaptativeMethods.push_back(_("Vertices translation"));	//ADAPTATIVE_MESH_METHOD_VERTICE_TRANSLATION
		wxComboBox* adaptativeMethod=new wxComboBox(this,WIZARD_CTRL_COMBO_ADAPTATIVE_REMESH_MODE,adaptativeMethods[defaultParameters.adaptativeMeshMethod],wxDefaultPosition,wxDefaultSize,adaptativeMethods);
		adaptativeMethod->SetSelection(defaultParameters.adaptativeMeshMethod);
		AddCtrl(adaptativeMethod,_("Remesh adaptation"),mainSizer);
		//Ajout de la liste déroulante du choix de la méthode de simplification
		wxArrayString simplificationMethods;
		simplificationMethods.push_back(_("Edge collapse"));		//MESH_SIMPLIFICATION_METHOD_EDGE_COLLAPSE
		wxComboBox* simplificationMethod=new wxComboBox(this,WIZARD_CTRL_COMBO_SIMPLIFICATION_MODE,simplificationMethods[defaultParameters.meshSimplificationMethod],wxDefaultPosition,wxDefaultSize,simplificationMethods);
		simplificationMethod->SetSelection(defaultParameters.meshSimplificationMethod);
		AddCtrl(simplificationMethod,_("Reduction of the number of surfaces"),mainSizer);
		//Ajout du choix de la qualité min des triangles
		AddCtrl(new wxSlider(this,WIZARD_CTRL_SLIDER_TRIANGLE_QUALITY,(int)(defaultParameters.minTriangleQuality*100),0,62,wxDefaultPosition,wxDefaultSize,wxSL_HORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS),_("Quality constraint"),mainSizer);
		//Ajout du choix de l'approximation de la simplification
		AddCtrl(new wxSlider(this,WIZARD_CTRL_SLIDER_EPSILON_MERGE,(int)(defaultParameters.mergeEpsilon*1000),900,1000,wxDefaultPosition,wxDefaultSize,wxSL_HORIZONTAL | wxSL_AUTOTICKS | wxSL_LABELS),_("Approximation constraint"),mainSizer);
		//Finalisation de l'initialisation des contrôles
        SetSizer(mainSizer);
        mainSizer->Fit(this);
	}
开发者ID:Ifsttar,项目名称:I-Simpa,代码行数:37,代码来源:WizardRemeshModel.cpp


示例10: ConfigDialogCtrlSet

CameraConfigDialogCtrlSet::CameraConfigDialogCtrlSet(wxWindow *pParent, GuideCamera *pCamera, AdvancedDialog *pAdvancedDialog, BrainCtrlIdMap& CtrlMap)
    : ConfigDialogCtrlSet(pParent, pAdvancedDialog, CtrlMap)
{
    assert(pCamera);

    m_pCamera = pCamera;

    if (m_pCamera->HasSubframes)
    {
        m_pUseSubframes = new wxCheckBox(GetParentWindow(AD_cbUseSubFrames), wxID_ANY, _("Use Subframes"));
        AddCtrl(CtrlMap, AD_cbUseSubFrames, m_pUseSubframes, _("Check to only download subframes (ROIs). Sub-frame size is equal to search region size."));
    }

    int numRows = (int)m_pCamera->HasGainControl + (int)m_pCamera->HasDelayParam + (int)m_pCamera->HasPortNum + 1;

    int width = StringWidth(_T("0000")) + 30;
    // Pixel size always
    m_pPixelSize = NewSpinnerDouble(GetParentWindow(AD_szPixelSize), width, m_pCamera->GetCameraPixelSize(), 0.0, 99.9, 0.1,
        _("Guide camera un-binned pixel size in microns. Used with the guide telescope focal length to display guiding error in arc-seconds."));
    AddLabeledCtrl(CtrlMap, AD_szPixelSize, _("Pixel size"), m_pPixelSize, "");

    // Gain control
    if (m_pCamera->HasGainControl)
    {
        int width = StringWidth(_T("0000")) + 30;
        m_pCameraGain = NewSpinnerInt(GetParentWindow(AD_szGain), width, 100, 0, 100, 1);
        AddLabeledCtrl(CtrlMap, AD_szGain, _("Camera gain"), m_pCameraGain, _("Camera gain, default = 95 % , lower if you experience noise or wish to guide on a very bright star. Not available on all cameras."));
    }

    // Binning
    m_binning = 0;
    if (m_pCamera->MaxBinning > 1)
    {
        wxArrayString opts;
        m_pCamera->GetBinningOpts(&opts);
        int width = StringArrayWidth(opts);
        m_binning = new wxChoice(GetParentWindow(AD_binning), wxID_ANY, wxPoint(-1, -1),
            wxSize(width + 35, -1), opts);
        AddLabeledCtrl(CtrlMap, AD_binning, _("Binning"), m_binning, _("Camera pixel binning"));
    }

    // Delay parameter
    if (m_pCamera->HasDelayParam)
    {
        int width = StringWidth(_T("0000")) + 30;
        m_pDelay = NewSpinnerInt(GetParentWindow(AD_szDelay), width, 5, 0, 250, 150);
        AddLabeledCtrl(CtrlMap, AD_szDelay, _("Delay"), m_pDelay, _("LE Read Delay (ms) , Adjust if you get dropped frames"));
    }

    // Port number
    if (m_pCamera->HasPortNum)
    {
        wxString port_choices[] = {
            _T("Port 378"), _T("Port 3BC"), _T("Port 278"), _T("COM1"), _T("COM2"), _T("COM3"), _T("COM4"),
            _T("COM5"), _T("COM6"), _T("COM7"), _T("COM8"), _T("COM9"), _T("COM10"), _T("COM11"), _T("COM12"),
            _T("COM13"), _T("COM14"), _T("COM15"), _T("COM16"),
        };

        int width = StringArrayWidth(port_choices, WXSIZEOF(port_choices));
        m_pPortNum = new wxChoice(GetParentWindow(AD_szPort), wxID_ANY, wxPoint(-1, -1),
            wxSize(width + 35, -1), WXSIZEOF(port_choices), port_choices);
        AddLabeledCtrl(CtrlMap, AD_szPort, _("LE Port"), m_pPortNum, _("Port number for long-exposure control"));
    }

    if (m_pCamera->HasCooler)
    {
        wxSizer *sz = new wxBoxSizer(wxHORIZONTAL);
        m_coolerOn = new wxCheckBox(GetParentWindow(AD_cooler), wxID_ANY, _("Cooler On"));
        m_coolerOn->SetToolTip(_("Turn camera cooler on or off"));
        sz->Add(m_coolerOn, wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL).Border(wxRIGHT));
        m_coolerSetpt = NewSpinnerInt(GetParentWindow(AD_szDelay), width, 5, -99, 99, 1);
        wxSizer *szt = MakeLabeledControl(AD_cooler, _("Set Temperature"), m_coolerSetpt, _("Cooler setpoint temperature"));
        sz->Add(szt, wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL));
        AddGroup(CtrlMap, AD_cooler, sz);
    }

    // Watchdog timeout
    {
        int width = StringWidth(_T("0000")) + 30;
        m_timeoutVal = NewSpinnerInt(GetParentWindow(AD_szCameraTimeout), width, 5, 5, 9999, 1);
        AddLabeledCtrl(CtrlMap, AD_szCameraTimeout, _("Disconnect nonresponsive\ncamera after (seconds)"), m_timeoutVal,
            wxString::Format(_("The camera will be disconnected if it fails to respond for this long. "
            "The default value, %d seconds, should be appropriate for most cameras."), DefaultGuideCameraTimeoutMs / 1000));
    }
}
开发者ID:AndresPozo,项目名称:phd2,代码行数:85,代码来源:camera.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AddCustomScripts函数代码示例发布时间:2022-05-30
下一篇:
C++ AddCreature函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap