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

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

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

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

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

示例1: GameState

MainMenuState::MainMenuState(Vector2 screenSize, ALLEGRO_KEYBOARD_STATE* keyState, ALLEGRO_KEYBOARD_STATE* prevKeyState, ALLEGRO_MOUSE_STATE* mouseState, ALLEGRO_MOUSE_STATE* prevMouseState, ALLEGRO_FONT* font)    : GameState(screenSize, keyState, prevKeyState, mouseState, prevMouseState){    cout << "Main State initialized" << endl;    this->font = font;    background = al_load_bitmap("assets/img/selectGameScreen/Starfield.png");    leftDoor = GameObject("assets/img/selectGameScreen/Leftblastdoor.png", Vector2(1, 1), 30, Vector2());    rightDoor = GameObject("assets/img/selectGameScreen/Rightblastdoor.png", Vector2(1, 1), 30, Vector2(457, 0));    //457 = 559 (size of left door) - 102 (overlap between doors)    mainButton = Button("assets/img/selectGameScreen/StartButton.png", Vector2(1, 1), 100, "assets/img/selectGameScreen/StartButton.png", Vector2(1, 1), 100, "assets/img/selectGameScreen/StartButtonHover.png", Vector2(2, 1), 100, Vector2(300, 200), true);    cout << "Main button loaded" << endl;    opening = false;    /***********************************************************************************************     ****************************************** Planets ********************************************     ***********************************************************************************************/    Vector2 center = Vector2(getScreenSize().x / 2, getScreenSize().y / 2);    planets.push_back(PlanetButton("Play", font, "assets/img/gameMenuCircles/Center.png", center, 0, 0, 0.001, 0.001));    planets.push_back(PlanetButton("Instructions", font, "assets/img/gameMenuCircles/Planet1.png", center, 175, M_PI / 2, 0.0003, 0.002));    planets.push_back(PlanetButton("Back", font, "assets/img/gameMenuCircles/Planet3.png", center, 350, M_PI, -0.0002, -0.0015));    planets.push_back(PlanetButton("Quit", font, "assets/img/gameMenuCircles/Planet2.png", center, 410, M_PI, -0.00015, 0.003));}
开发者ID:rdelfin,项目名称:SpaceTowers,代码行数:27,


示例2: playButtonLocation

MenuState::MenuState(sf::Font& mainFont, ScoreBoard* scoreBoard) {    if (!menuBg.load(menuResPath, sf::Vector2u(pixelSizeX, pixelSizeY), level, xPixels, yPixels))        throw std::runtime_error("Failed to load the tilemap probably because file was not found.");    sf::Vector2f playButtonLocation(screenResWidth / 2 - buttonSizeX / 2, screenResHeight / 2 - buttonSizeY / 2);    sf::Vector2f exitButtonLocation(playButtonLocation);    exitButtonLocation.y += buttonSizeY * 2;    playButton = Button("PLAY", playButtonLocation, mainFont);    exitButton = Button("EXIT", exitButtonLocation, mainFont);    playButton.activate();    introText.setString("SNAKE!");    introText.setColor(sf::Color(84, 191, 88));    introText.setPosition(screenResWidth / 2 - buttonSizeX + pixelSizeX, screenResHeight / 2 - 3 * buttonSizeY);    introText.setCharacterSize(210);    introText.setFont(mainFont);    highScore.setString(scoreBoard->getHighScore());    highScore.setCharacterSize(pixelSizeX * 3);    highScore.setPosition(pixelSizeX * 2, screenResHeight / 2 + pixelSizeY * 3);    highScore.setFont(mainFont);    highScoreHeader.setString("Highscore");    highScoreHeader.setCharacterSize(pixelSizeX * 3);    highScoreHeader.setPosition(0, screenResHeight / 2);    highScoreHeader.setFont(mainFont);    //buttonArr[0] = playButton;    //buttonArr[1] = exitButton;    //arrSize = 2;    //activeIndex = 0;    //snakeLogo;}
开发者ID:jjkjiang,项目名称:Snake,代码行数:32,


示例3: main

void main() {     TRISA=0x01;     TRISB=0x00;Start:     PORTA=0x00;     Data=0x00;     PORTA=0x02; //Set Latch HIGH     Delay_ms(2);     PORTA=0x00;     Delay_ms(1);     if (Button(&PORTA, 0, 1, 1))temp1=0;     else temp1=1;     Data|=temp1;     for(i=1;i<8;i++){//Read();          Delay_ms(1);          PORTA=0x04;          temp1=0;          if (Button(&PORTA, 0, 1, 1))temp1=0;          else temp1=BITS[i];          Data|=temp1;          Delay_ms(1);          PORTA=0x00;     }     PORTB=Data;     goto Start;}
开发者ID:miguel28,项目名称:Electronica-PIC-Projects,代码行数:27,


示例4: visible

Menu::Menu() :	visible(true){	onCredits = false;	bg.LoadFromFile("img/menubg.png");	title.LoadFromFile("img/title.png");	float bx = 310, by = 430;	bLvl1 = Button(bx, by);	bLvl1.setText("Initiation");	bLvl1.setCallback(Menu::initLevel1);	by += 25;	bLvl2 = Button(bx, by);	bLvl2.setText("La tourmente");	bLvl2.setCallback(Menu::initLevel2);	by += 25;	bLvl3 = Button(bx, by);	bLvl3.setText("Challenge++");	bLvl3.setCallback(Menu::initLevel3);	by += 25;	bShowCredits = Button(580,715);	bShowCredits.setCallback(Menu::actionShowCredits);	bShowCredits.setText("Credits");	bHideCredits = Button(580,715);	bHideCredits.setCallback(Menu::actionHideCredits);	bHideCredits.setText("Retour");}
开发者ID:ekryyn,项目名称:Douayfense,代码行数:34,


示例5: button_test

LevelEditorMenu::LevelEditorMenu(ResourceManager* resourceManager) :button_test(sf::Vector2f(10.0f, 10.0f), resourceManager->getTexture("Graphics/Menu/test.png")),button_save(sf::Vector2f(202.0f, 10.0f), resourceManager->getTexture("Graphics/Menu/save.png")),button_tiles(sf::Vector2f(394.0f, 10.0f), resourceManager->getTexture("Graphics/Menu/tiles.png")),button_clear(sf::Vector2f(202.0f, 45.0f), resourceManager->getTexture("Graphics/Menu/clear.png")),button_toggleGrid(sf::Vector2f(10.0f, 45.0f), resourceManager->getTexture("Graphics/Menu/toggle_grid.png")),button_toggleCollisionLines(sf::Vector2f(394.0f, 45.0f), resourceManager->getTexture("Graphics/Menu/toggle_collision_lines.png")){    items.push_back(&button_save);    items.push_back(&button_test);    items.push_back(&button_tiles);    items.push_back(&button_toggleGrid);    items.push_back(&button_clear);    items.push_back(&button_toggleCollisionLines);    //! Buttons for button_tiles    float blockPosX = 10.0f, blockPosY = 80.0f;    for (int i = 0; i < BUTTONT_TILES_CHILDS_SIZE - 1; ++i) //! First 3 buttons are blocks    {        std::stringstream ss; ss << i + 1;        button_tiles_childs[i] = Button(sf::Vector2f(blockPosX, blockPosY), resourceManager->getTexture("Graphics/Menu/block" + ss.str() + ".png"));        blockPosX += 60.0f;    }    button_tiles_childs[3] = Button(sf::Vector2f(190.0f, 95.0f), resourceManager->getTexture("Graphics/Menu/collision_pointer.png"), nullptr, false);    for (int i = 0; i < BUTTONT_TILES_CHILDS_SIZE; ++i)        button_tiles.items.push_back(&button_tiles_childs[i]);}
开发者ID:Steef435,项目名称:Platformer-SFML-2,代码行数:30,


示例6: Button

MainMenu::MainMenu() {    playButton = Button(325,400,150,50,sf::Color(97,56,11),"New");    loadButton = Button(325,280,150,50,sf::Color(97,56,11),"Load");    title = sf::Text();    title.setString("Splunk");    title.setCharacterSize(50);    title.setFont(ResourceManager::PixelFont);}
开发者ID:smiegrin,项目名称:Splunk,代码行数:8,


示例7: Button

NS_IMETHODIMPTaskbarPreviewButton::SetHasBorder(PRBool hasBorder) {  if (hasBorder)    Button().dwFlags &= ~THBF_NOBACKGROUND;  else    Button().dwFlags |= THBF_NOBACKGROUND;  return Update();}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:8,


示例8: setName

Options::Options(std::string menuName){	setName(menuName);	menuButtons = std::vector<Button>();	menuButtons.push_back(Button(73, 79, 230, 255, 400, 100, 100, 100, "Option1", "Option 1",12));	menuButtons.push_back(Button(135, 230, 84, 255, 400, 100, 100, 210, "Option2", "Option2",12));	menuButtons.push_back(Button(230, 78, 68, 255, 400, 100, 100, 320, "Back", "Go Back",12));};
开发者ID:HeroesOfBinary,项目名称:ZombieElias,代码行数:9,


示例9: safe_new

void SongControl::showGui() {  if (_gui)    _gui->deleteMe();  _gui = safe_new(Frame(_gui_parent, 0, 0, 0, 0, 1));  safe_new(Button(_gui, 0, 0, "Play", playAction()));  safe_new(Button(_gui, 0, 0, "Stop", stopAction()));  safe_new(Button(_gui, 0, 0, "Plus", increaseTempoAction()));  safe_new(Button(_gui, 0, 0, "Minus", decreaseTempoAction()));  _gui->packHorizontally(5);}
开发者ID:czestmyr,项目名称:Brewsic,代码行数:11,


示例10: init

void init(){  grabber.init(pa("-i"));  bool c_arg = pa("-c");  gui << Draw().handle("draw").label("input image")      << Image().handle("cropped").label("cropped")      << ( VBox().maxSize(c_arg ? 0 : 12,99).minSize(c_arg ? 0 : 12,1)           << Button("save as ..").handle("saveAs")           << Button("overwrite input").handle("overwrite")           << Combo("0,90,180,270").handle("rot").label("rotation")           << CheckBox("rectangular",!pa("-r")).handle("rect")           << Button("Batch crop...").handle("batch")           << ( HBox().label("rectification size")                << Spinner(1,4096,640).handle("s1")                << Label(":")                << Spinner(1,4096,480).handle("s2")                )           << (HBox()                << Fps().handle("fps")               << CamCfg()               )           )      << Show();  if(!c_arg){    gui["batch"].registerCallback(batch_crop);  }  const ImgBase *image = grabber.grab();  if(!c_arg){    mouse_1 = new Mouse1(image->getSize());    gui["draw"].install(mouse_1);  }  mouse_2 = new Mouse2(image->getSize());  gui["draw"].install(mouse_2);    DrawHandle draw = gui["draw"];  draw->setImageInfoIndicatorEnabled(false);    if(!c_arg){    gui["rect"].registerCallback(rectangular_changed);    rectangular_changed();    if(*pa("-i",0) != "file" || FileList(*pa("-i",1)).size() != 1){      gui["overwrite"].disable();    }else{      gui["overwrite"].registerCallback(overwrite);    }    gui["saveAs"].registerCallback(save_as);  }}
开发者ID:ethz-asl,项目名称:iclcv,代码行数:52,


示例11: generateMenu

void generateMenu(std::vector<Button> &buttons, std::vector<Sine> &sines) {        // draw buttons    buttons.push_back(Button(100, 150, "250"));    buttons.push_back(Button(100, 250, "1000"));    buttons.push_back(Button(100, 350, "2000"));        // load up sounds    sines.push_back(Sine(250));    sines.push_back(Sine(1000));    sines.push_back(Sine(2000));    }
开发者ID:jborowski,项目名称:SFML_Sandbox,代码行数:13,


示例12: NS_ENSURE_SUCCESS

NS_IMETHODIMPTaskbarPreviewButton::SetImage(imgIContainer *img) {  if (Button().hIcon)    ::DestroyIcon(Button().hIcon);  if (img) {    nsresult rv;    rv = nsWindowGfx::CreateIcon(img, PR_FALSE, 0, 0, &Button().hIcon);    NS_ENSURE_SUCCESS(rv, rv);  } else {    Button().hIcon = NULL;  }  return Update();}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:13,


示例13: visible

IngameMenu::IngameMenu() :	visible(false){	float bx = 310, by = 250;	bQuit = Button(bx, by);	bQuit.setText("Quitter");	bQuit.setCallback(IngameMenu::quitAction);	by += 25;	bCancel = Button(bx, by);	bCancel.setText("Annuler");	bCancel.setCallback(IngameMenu::cancelAction);	by += 25;}
开发者ID:ekryyn,项目名称:Douayfense,代码行数:15,


示例14: NS_ENSURE_SUCCESS

NS_IMETHODIMPTaskbarPreviewButton::SetImage(imgIContainer *img) {  if (Button().hIcon)    ::DestroyIcon(Button().hIcon);  if (img) {    nsresult rv;    rv = nsWindowGfx::CreateIcon(img, false, 0, 0,                                 nsWindowGfx::GetIconMetrics(nsWindowGfx::kRegularIcon),                                 &Button().hIcon);    NS_ENSURE_SUCCESS(rv, rv);  } else {    Button().hIcon = nullptr;  }  return Update();}
开发者ID:abhishekvp,项目名称:gecko-dev,代码行数:15,


示例15: initWindowUploader

//need to add button for uploadingvoid initWindowUploader(int width, int height){	windowUploader = SDL_CreateWindow("Image To Upload", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height + (ButtonHeight + 26), 0);	rendererUploader = SDL_CreateRenderer(windowUploader, -1, 0);	string filepath = ExePath() + '//' + "screenshot.bmp";	image = SDL_LoadBMP(filepath.c_str());	imageTexture = SDL_CreateTextureFromSurface(rendererUploader, image);	//uploadButton = SDL_LoadBMP("uploadbutton.bmp");	//buttonTexture = SDL_CreateTextureFromSurface(rendererUploader, uploadButton);	SDL_SetRenderDrawColor(rendererUploader, 255, 255, 255, 0);	SDL_RenderClear(rendererUploader);	SDL_Rect imageRect = { 0 , 0, width, height };	SDL_RenderCopy(rendererUploader, imageTexture, NULL, &imageRect);	//SDL_Rect buttonRect = { width - (ButtonWidth + 13), height + 13, ButtonWidth, ButtonHeight };	//SDL_RenderCopy(rendererUploader, buttonTexture, NULL, &buttonRect);	//add buttons	uploadButton = Button(width - (ButtonWidth + 13), height + 13, ButtonWidth, ButtonHeight, "UploadButtonSprite.bmp");	uploadButton.show(rendererUploader);	SDL_RenderPresent(rendererUploader);	uploaderRunning = true;	initKeyBindings();}
开发者ID:yaegerbomb,项目名称:BlackPenguin,代码行数:34,


示例16: NS_ENSURE_ARG_POINTER

NS_IMETHODIMPMouseEvent::GetButton(int16_t* aButton){  NS_ENSURE_ARG_POINTER(aButton);  *aButton = Button();  return NS_OK;}
开发者ID:Acidburn0zzz,项目名称:tor-browser,代码行数:7,


示例17: init

void init(){  gui << Plot().handle("plot")      << Button("run").handle("run")       << Show();  vq.init(pa("-n"));    URand cs(-5,5);  GRand gr(0,pa("-v"));  int n=pa("-s");  for(int i=pa("-c");i>=0;--i){    V2 c(cs,cs);    for(int j=0;j<n;++j){      D.push_back(c + V2(gr,gr));    }  }    PlotHandle plot = gui["plot"];  plot->setPropertyValue("tics.y-distance",2);  plot->setPropertyValue("tics.x-distance",2);  plot->label("data");  plot->scatter(&D[0][0],&D[0][1],D.size(),2,2);  plot->linewidth(2);}
开发者ID:ethz-asl,项目名称:iclcv,代码行数:26,


示例18: main

int main (){	int ret;	Rect windRect;	long start,end,amount;		/* Initialize all the needed managers. */	InitGraf(&qd.thePort);	InitFonts();	InitWindows();	InitMenus();	TEInit();	InitDialogs(nil);	InitCursor();	//ProfilerInit(collectDetailed, bestTimeBase, 1000, 50);	//ProfilerSetStatus(true);	windRect = qd.screenBits.bounds;	InsetRect(&windRect, 50, 50);	pWindow = NewCWindow(nil, &windRect, "/pMpeg", true, documentProc, (WindowPtr) -1, false, 0);        start = TickCount();    main2();    end = TickCount();    amount = end - start;    fprintf(stderr, "Time taken %d memoryAllocator %d /n", amount,counter);   //	ProfilerDump("/pProfile.out");         do {	} while (!Button());}
开发者ID:Adorkable-forkable,项目名称:Scratch.app.for.iOS,代码行数:35,


示例19: Init

        void StatusBar::Init() {            backgrnd = NXUI["StatusBar.img"]["base"]["backgrnd"];            backgrnd2 = NXUI["StatusBar.img"]["base"]["backgrnd2"];            gauge_bar = NXUI["StatusBar.img"]["gauge"]["bar"];            gauge_grad = NXUI["StatusBar.img"]["gauge"]["graduation"];            // Load level numbers            Node levels = NXUI["Basic.img"]["LevelNo"];            for (uint8_t i = 0; i < 10; ++i) {                level_no[i] = levels[i];            }            buttons.push_back(Button(NXUI["StatusBar.img"]["BtMenu"], 0, 0));            buttons.push_back(Button(NXUI["StatusBar.img"]["BtShop"], 0, 0));            buttons.push_back(Button(NXUI["StatusBar.img"]["BtShort"], 0, 0));        }
开发者ID:bumblabumbadit,项目名称:NoLifeStory,代码行数:16,


示例20: addButton

void NGLScene::addButton(ngl::Vec2 _pos, ngl::Vec2 _size, ngl::Vec4 _color, Button::Action _action){  GLuint textureID = 0;  //GLuint textureID = loadTexture(_textureFile);  //std::cout << "textureID: " << textureID << std::endl;  m_buttons.push_back(Button(_pos, _size, _color, _action, textureID));}
开发者ID:i7621149,项目名称:Specialist,代码行数:7,


示例21: memnew

EditorHelpSearch::EditorHelpSearch(EditorNode *p_editor) {	editor=p_editor;	VBoxContainer *vbc = memnew( VBoxContainer );	add_child(vbc);	set_child_rect(vbc);	HBoxContainer *sb_hb = memnew( HBoxContainer);	search_box = memnew( LineEdit );	sb_hb->add_child(search_box);	search_box->set_h_size_flags(SIZE_EXPAND_FILL);	Button *sb = memnew( Button("Search"));	sb->connect("pressed",this,"_update_search");	sb_hb->add_child(sb);	vbc->add_margin_child("Search:",sb_hb);	search_box->connect("text_changed",this,"_text_changed");	search_box->connect("input_event",this,"_sbox_input");	search_options = memnew( Tree );	vbc->add_margin_child("Matches:",search_options,true);	get_ok()->set_text("View");	get_ok()->set_disabled(true);	register_text_enter(search_box);	set_hide_on_ok(false);	search_options->connect("item_activated",this,"_confirmed");	set_title("Search Classes");//	search_options->set_hide_root(true);}
开发者ID:HiddenDark,项目名称:godot,代码行数:27,


示例22: VarioSettingMenu

void VarioSettingMenu(void){    uint8_t button_state, button_prev_state;    uint16_t timeout = VARIO_SETTING_MENU_TIMEOUT;    VarioSettingEnterSound();    while(ButtonState())		// wait for button to be released        delay_ms(1);    CheckBuzzerStart();    VarioSettingPlayDelay = VARIO_SETTING_PLAY_DELAY/3;    VarioSettingPlayState = VARIO_STATE_IDDLE;    button_prev_state = ButtonState();    do    {        CheckBuzzer(true);        button_state = ButtonState();        if ((!button_state)&&(button_prev_state))        {            timeout = VARIO_SETTING_MENU_TIMEOUT;            VarioSettingButtonPushed();        }        button_prev_state = button_state;        VarioSettingPlay();        BuzzerTask();    } while( (Button() != BUTTON_LONG) && timeout-- );    VarioSettingExitSound(); 	// exit Vario settings}
开发者ID:kkthx,项目名称:le-BipBip,代码行数:29,


示例23: Button

bool MenuButtonStripPreview::AddButton(const std::string &norm_path, const std::string &hover_path,									   const sf::Vector2f &pos, bool selected, std::string dest,									   std::string prvw_img_path, sf::Vector2f &prvw_img_pos){	bool ret = true;	Button temp_btn = Button();	if (temp_btn.Initialise(norm_path, hover_path, pos, selected, dest))	{		ret = false;	}	vec_btn_.push_back(temp_btn);	sf::Texture temp_txtre = sf::Texture();	if (!temp_txtre.loadFromFile(prvw_img_path))	{		OutputDebugString(L"Error loading lobby preview texture");		ret = false;	}	preview_image_.setTexture(temp_txtre);	preview_image_.setPosition(prvw_img_pos);	return ret;}
开发者ID:djquirke,项目名称:MSG,代码行数:26,


示例24: wxGetMouseState

wxMouseState wxGetMouseState(){    wxMouseState ms;    wxPoint pt = wxGetMousePosition();    ms.SetX(pt.x);    ms.SetY(pt.y);#if TARGET_API_MAC_OSX    UInt32 buttons = GetCurrentButtonState();    ms.SetLeftDown( (buttons & 0x01) != 0 );    ms.SetMiddleDown( (buttons & 0x04) != 0 );    ms.SetRightDown( (buttons & 0x02) != 0 );#else    ms.SetLeftDown( Button() );    ms.SetMiddleDown( 0 );    ms.SetRightDown( 0 );#endif    UInt32 modifiers = GetCurrentKeyModifiers();    ms.SetControlDown(modifiers & controlKey);    ms.SetShiftDown(modifiers & shiftKey);    ms.SetAltDown(modifiers & optionKey);    ms.SetMetaDown(modifiers & cmdKey);    return ms;}
开发者ID:hgwells,项目名称:tive,代码行数:27,


示例25: Window

MixerGui::MixerGui(SafePtr<IControl> parent, MainMixer* mixer): Window(parent, 0, 0, 600, 300, "Main mixer"), _mixer(mixer) {  SafePtr<IControl> hframe = safe_new(Frame(safePtr(), 0, 0, 600, 300, 0));  // Main volume controls  SafePtr<IControl> frame = safe_new(Frame(hframe, 0, 0, 20, 300, 0));  SafePtr<Label> header  = safe_new(Label(frame, 0, 20, "M")).cast<Label>();  SafePtr<Slider> slider = safe_new(Slider(frame, 0, 40, 280, 0.0, 1.5, &_mixer->getMasterVolume()->_vol, 50)).cast<Slider>();  header->setPreferedSize(0, 14, 1);  slider->setPreferedSize(0, 0, 1);  frame->packVertically(5);  frame->setPreferedSize(0, 0, 1);  for (int i = 0; i < _mixer->getChannels(); ++i) {    char buffer[16];    sprintf(buffer, "Ch.%i", i+1);    SafePtr<IControl> frame = safe_new(Frame(hframe, 0, 0, 20, 300, 0));    SafePtr<Button> button = safe_new(Button(frame, 0, 0, "SQ.", mixer->getSynthQueue(i)->showGuiAction())).cast<Button>();    SafePtr<Label> header  = safe_new(Label(frame, 0, 20, buffer)).cast<Label>();    SafePtr<Slider> slider = safe_new(Slider(frame, 0, 40, 280, 0.0, 1.5, &_mixer->getVolume(i)->_vol, 50)).cast<Slider>();    button->setPreferedSize(0, 22, 1);    header->setPreferedSize(0, 14, 1);    slider->setPreferedSize(0, 0, 1);    frame->packVertically(5);    frame->setPreferedSize(0, 0, 1);  }  hframe->packHorizontally(5);}
开发者ID:czestmyr,项目名称:Brewsic,代码行数:34,


示例26: memnew

EditorPluginSettings::EditorPluginSettings() {	plugin_config_dialog = memnew(PluginConfigDialog);	plugin_config_dialog->config("");	add_child(plugin_config_dialog);	HBoxContainer *title_hb = memnew(HBoxContainer);	title_hb->add_child(memnew(Label(TTR("Installed Plugins:"))));	title_hb->add_spacer();	create_plugin = memnew(Button(TTR("Create")));	create_plugin->connect("pressed", this, "_create_clicked");	title_hb->add_child(create_plugin);	update_list = memnew(Button(TTR("Update")));	update_list->connect("pressed", this, "update_plugins");	title_hb->add_child(update_list);	add_child(title_hb);	plugin_list = memnew(Tree);	plugin_list->set_v_size_flags(SIZE_EXPAND_FILL);	plugin_list->set_columns(5);	plugin_list->set_column_titles_visible(true);	plugin_list->set_column_title(0, TTR("Name:"));	plugin_list->set_column_title(1, TTR("Version:"));	plugin_list->set_column_title(2, TTR("Author:"));	plugin_list->set_column_title(3, TTR("Status:"));	plugin_list->set_column_title(4, TTR("Edit:"));	plugin_list->set_column_expand(0, true);	plugin_list->set_column_expand(1, false);	plugin_list->set_column_expand(2, false);	plugin_list->set_column_expand(3, false);	plugin_list->set_column_expand(4, false);	plugin_list->set_column_min_width(1, 100 * EDSCALE);	plugin_list->set_column_min_width(2, 250 * EDSCALE);	plugin_list->set_column_min_width(3, 80 * EDSCALE);	plugin_list->set_column_min_width(4, 40 * EDSCALE);	plugin_list->set_hide_root(true);	plugin_list->connect("item_edited", this, "_plugin_activity_changed");	VBoxContainer *mc = memnew(VBoxContainer);	mc->add_child(plugin_list);	mc->set_v_size_flags(SIZE_EXPAND_FILL);	mc->set_h_size_flags(SIZE_EXPAND_FILL);	add_child(mc);	updating = false;}
开发者ID:Paulloz,项目名称:godot,代码行数:47,


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