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

C++ set_height函数代码示例

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

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



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

示例1: GuiContext

GuiFlatButton::GuiFlatButton(std::string string, GLfloat x, GLfloat y) : GuiContext(x,y)
{
    label = new GuiLabel(FontManager::font("small"), string, 0, 0, 1.0, true);
    background = new GuiColorRect(0, 0, label->get_width()+20, label->get_height()+10);

    add(background);
    add(label);

    GuiContext::set_width(background->get_width());
    set_height(background->get_height());

    // State
    active = false;
    enabled = true;

    // Customisation
    Color4fSet((&activeColor), 0.0f, 0.0f, 0.0f, 0.9f);
    Color4fSet((&inactiveColor), 0.0f, 0.0f, 0.0f, 0.4f);
    deactivate();

    // Highlight on mouseover
    onMouseEnter = boost::bind(&GuiFlatButton::activate, this);
    onMouseExit = boost::bind(&GuiFlatButton::deactivate, this);

    // Poor man's reflection
    className = "GuiFlatButton";
}
开发者ID:BlazingGriffin,项目名称:Distant-Star-Prototype,代码行数:27,代码来源:gui_flat_button.cpp


示例2: set_left

Rectangle::Rectangle(float Width, float Height)
{
	set_left   ( 0 );
	set_bottom ( 0 );	
	set_width  ( Width  );
	set_height ( Height );	
}
开发者ID:stenniswood,项目名称:bk_code,代码行数:7,代码来源:rectangle.cpp


示例3: set_height

struct node *rot_RL(struct node *old) {
    struct node *right, *ret;

    right = old->right;
    ret = right->left;
    old->right = ret->left;
    right->left = ret->right;
    ret->left = old;
    ret->right = right;

    set_height(old);
    set_height(right);
    set_height(ret);

    return ret;
}
开发者ID:vitorohe,项目名称:Tarea3Alg,代码行数:16,代码来源:avl.c


示例4: set_height

void Edit::on_enter()
{
#ifdef __windows__
    if(Keyboard::is_pressed(0x0D))
#endif	
#ifdef __gnu_linux__	
	if(Keyboard::is_pressed(0xff0d))
#endif		
	{
		if(is_multilined()) // a multilined editor
		{
			if(get_text().length() >= get_character_limit()) // if text length has reached character_limit
			{
				// double the height of the edit
				set_height(get_height() * 2); // GOOD!
				// add to the character_limit (new character_limit)
				set_character_limit(get_character_limit() + get_character_limit());  // ???
				// newline???
				set_text(get_text() + "\n");
				// reset cursor x position
				set_cursor_x(0);
				// set cursor y position
				int char_height = 12;
				set_cursor_y(get_cursor_y() + char_height);
			}
		}
	}	
}
开发者ID:sidpoison,项目名称:dokun,代码行数:28,代码来源:edit.cpp


示例5: free

struct node *delete_node(struct node *root) {
    struct node *child, *aux;
    unsigned int key;
    if (root->left == NULL) {
        aux = root->right;
        free(root);
        return aux;
    } else if (root->right == NULL) {
        aux = root->left;
        free(root);
        return aux;
    } else {

        if (root->right->left == NULL) {
            child = root->right;
            root->value = child->value;
            root->key = child->key;
            root->right = child->right;
            free(child);
        } else {
            key = root->key;
            child = node_min(root->right);
            root->value = child->value;
            root->key = child->key;
            child->key = key;
            delete_rec(root, key);
        }
        
        set_height(root);
        return rebalance(root);
    }
}
开发者ID:vitorohe,项目名称:Tarea3Alg,代码行数:32,代码来源:avl.c


示例6: set_width

 Rect& Rect::operator=(const RECT& r)
 {
     origin_.SetPoint(r.left, r.top);
     set_width(r.right - r.left);
     set_height(r.bottom - r.top);
     return *this;
 }
开发者ID:Strongc,项目名称:Chrome_Library,代码行数:7,代码来源:rect.cpp


示例7: image_format

YCbCrInput::YCbCrInput(const ImageFormat &image_format,
                       const YCbCrFormat &ycbcr_format,
                       unsigned width, unsigned height,
                       YCbCrInputSplitting ycbcr_input_splitting)
	: image_format(image_format),
	  ycbcr_format(ycbcr_format),
	  ycbcr_input_splitting(ycbcr_input_splitting),
	  width(width),
	  height(height),
	  resource_pool(NULL)
{
	pbos[0] = pbos[1] = pbos[2] = 0;
	texture_num[0] = texture_num[1] = texture_num[2] = 0;

	set_width(width);
	set_height(height);

	pixel_data[0] = pixel_data[1] = pixel_data[2] = NULL;
	owns_texture[0] = owns_texture[1] = owns_texture[2] = false;

	register_uniform_sampler2d("tex_y", &uniform_tex_y);

	if (ycbcr_input_splitting == YCBCR_INPUT_SPLIT_Y_AND_CBCR) {
		num_channels = 2;
		register_uniform_sampler2d("tex_cbcr", &uniform_tex_cb);
	} else {
		assert(ycbcr_input_splitting == YCBCR_INPUT_PLANAR);
		num_channels = 3;
		register_uniform_sampler2d("tex_cb", &uniform_tex_cb);
		register_uniform_sampler2d("tex_cr", &uniform_tex_cr);
	}
}
开发者ID:j-b-m,项目名称:movit,代码行数:32,代码来源:ycbcr_input.cpp


示例8: set_camera_type

void CharacterCamera::_set(const String& p_name, const Variant& p_value) {

	if (p_name=="type")
		set_camera_type((CameraType)((int)(p_value)));
	else if (p_name=="orbit")
		set_orbit(p_value);
	else if (p_name=="height")
		set_height(p_value);
	else if (p_name=="inclination")
		set_inclination(p_value);
	else if (p_name=="max_orbit_x")
		set_max_orbit_x(p_value);
	else if (p_name=="min_orbit_x")
		set_min_orbit_x(p_value);
	else if (p_name=="max_distance")
		set_max_distance(p_value);
	else if (p_name=="min_distance")
		set_min_distance(p_value);
	else if (p_name=="distance")
		set_distance(p_value);
	else if (p_name=="clip")
		set_clip(p_value);
	else if (p_name=="autoturn")
		set_autoturn(p_value);
	else if (p_name=="autoturn_tolerance")
		set_autoturn_tolerance(p_value);
	else if (p_name=="autoturn_speed")
		set_autoturn_speed(p_value);

}
开发者ID:lonesurvivor,项目名称:godot,代码行数:30,代码来源:character_camera.cpp


示例9: setup

void setup() {
   set_name( "bear" );
   set_desc( "a furry bear" );
   set_height( 200 );
   set_weight( 8000 );

   set_stats( ({ 6, 4, -2, 8, -4 }) );
开发者ID:Yuffster,项目名称:discworld_distribution_mudlib,代码行数:7,代码来源:bear.c


示例10: setup

void setup() {
   set_name( "guppy" );
   set_long( "Fish,  yes.  A fish.  Nice generic standard fish thing.\n" );
   set_height( 15 );
   set_weight( 40 );
   set_desc( "a beautiful looking guppy" );

   set_stats( ({ -2, 14, -4, -4, -6 }) );
开发者ID:Yuffster,项目名称:discworld_distribution_mudlib,代码行数:8,代码来源:guppy.c


示例11: setup

void setup() {
   set_name( "weasel" );
   set_long( "A small brown furred animal.\n" );
   set_height( 15 );
   set_weight( 30 );
   set_desc( "small brown meateater" );

   set_stats( ({ -2, 8, -2, -4, -4 }) );
开发者ID:Yuffster,项目名称:discworld_distribution_mudlib,代码行数:8,代码来源:weasel.c


示例12: set_type

	/* COPY CONSTRUCTOR */
	DrawingObject::DrawingObject(const DrawingObject& o)
	{
		set_type(o.type());
		set_left(o.left());
		set_bottom(o.bottom());
		set_width(o.width());
		set_height(o.height());
	}
开发者ID:amweeden06,项目名称:SRSem-Project-2009,代码行数:9,代码来源:DrawingObject.cpp


示例13: ui_button

ship_selection_button::ship_selection_button(ui_container* parent) : ui_button(parent) {
    set_width(16.f);
    set_height(16.f);
    set_halign(horizontal_alignment::left);
    set_valign(vertical_alignment::top);
    set_margin(10.f);
    selection_state = ship_selection_button_state::unknown;
}
开发者ID:timonthomas,项目名称:SpaceShipsArcade,代码行数:8,代码来源:ShipSelectionButton.cpp


示例14: setup

void setup() {
   set_name( "vulture" );
   set_long( "A largish, rather scruffy-looking bird with an ugly, "
      "featherless head and a big crooked beak.\n" );
   set_desc( "a somewhat evil-looking old vulture\n" );
   set_height( 40 );
   set_weight( 200 );

   set_stats( ({ 0, 14, -4, 2, -6 }) );
开发者ID:Yuffster,项目名称:discworld_distribution_mudlib,代码行数:9,代码来源:vulture.c


示例15: insert

int insert(ROOT *r, int data)
{
 NODE *new_node, *root = *r;
 int left_h = -1, right_h = -1;
 int diff,rotation_type;

 //tree is empty
 if(root == NULL)
 {
  new_node = (NODE *)malloc(sizeof(NODE));
  new_node->info = data;
  new_node->height = 0;
  new_node->left = new_node->right = NULL;
  *r = new_node;
  return 0;
 }
 if(root->left)
  left_h = root->left->height;
 if(root->right)
  right_h = root->right->height;

 if(compare(data, root->info)<0)
 {
  left_h = insert(&(root->left), data);
  rotation_type = find_rotation_type(root->info, root->left->info, data);
 }
 else if(compare(data, root->info)>0)
 {
  right_h = insert(&(root->right), data);
  rotation_type = find_rotation_type(root->info, root->right->info, data);
 }
 else
 {
    printf("Value repeated");
    return -1;
 }

 diff = left_h-right_h;
 if(diff>1 || diff<-1)
 {
	printf("Tree is Un-Balanced at node data %d ", root->info);
	if(rotation_type == 1)
	    printf("required LL rotation\n");
	if(rotation_type == 2)
	    printf("required RL rotation\n");
	if(rotation_type == 3)
	    printf("required LR rotation\n");
	if(rotation_type == 4)
	    printf("required RR rotation\n");
	//this call is for doing rotation
	do_rotation(r,rotation_type);
	printf("rotation done successfully\n");
  root = *r;
 }

 return set_height(root);
}
开发者ID:ankurayadav,项目名称:dsa,代码行数:57,代码来源:heightbalancedtree.C


示例16: rotate_RR

void rotate_RR(ROOT *r)
{
 NODE *r1=*r,*r2,*t1,*t2,*t3;

 r2 = r1->right;
 t1 = r1->left;
 t2 = r2->left;
 t3 = r2->right;


 r1->right = t2;
 r2->left = r1;

 set_height(r1);
 set_height(r2);

 *r = r2;
}
开发者ID:ankurayadav,项目名称:dsa,代码行数:18,代码来源:heightbalancedtree.C


示例17: location

void button::calculate_size()
{
	if (type_ == TYPE_IMAGE){
		SDL_Rect loc_image = location();
#ifdef SDL_GPU
		loc_image.h = image_.height();
		loc_image.w = image_.width();
#else
		loc_image.h = image_->h;
		loc_image.w = image_->w;
#endif
		set_location(loc_image);
		return;
	}
	SDL_Rect const &loc = location();
	bool change_size = loc.h == 0 || loc.w == 0;

	if (!change_size) {
		unsigned w = loc.w - (type_ == TYPE_PRESS || type_ == TYPE_TURBO ? horizontal_padding : checkbox_horizontal_padding + base_width_);
		if (type_ != TYPE_IMAGE)
		{
			int fs = font_size;
			int style = TTF_STYLE_NORMAL;
			std::string::const_iterator i_beg = label_text_.begin(), i_end = label_text_.end(),
				i = font::parse_markup(i_beg, i_end, &fs, NULL, &style);
			if (i != i_end) {
				std::string tmp(i, i_end);
				label_text_.erase(i - i_beg, i_end - i_beg);
				label_text_ += font::make_text_ellipsis(tmp, fs, w, style);
			}
		}
	}

	if (type_ != TYPE_IMAGE){
		textRect_ = font::draw_text(NULL, screen_area(), font_size,
									font::BUTTON_COLOR, label_text_, 0, 0);
	}

	if (!change_size)
		return;

	set_height(std::max(textRect_.h+vertical_padding,base_height_));
	if(type_ == TYPE_PRESS || type_ == TYPE_TURBO) {
		if(spacing_ == MINIMUM_SPACE) {
			set_width(textRect_.w + horizontal_padding);
		} else {
			set_width(std::max(textRect_.w+horizontal_padding,base_width_));
		}
	} else {
		if(label_text_.empty()) {
			set_width(base_width_);
		} else {
			set_width(checkbox_horizontal_padding + textRect_.w + base_width_);
		}
	}
}
开发者ID:gb056,项目名称:wesnoth,代码行数:56,代码来源:button.cpp


示例18: set_type

	Exit::Exit()
	{
		set_type("EXIT");
		set_left(EXIT_LEFT);
		set_bottom(EXIT_BOTTOM);
		set_width(EXIT_WIDTH);
		set_height(EXIT_HEIGHT);
		add_input(CircuitObject());
		close();
	}
开发者ID:amweeden06,项目名称:SRSem-Project-2009,代码行数:10,代码来源:Exit.cpp


示例19: GmoBox

//=======================================================================================
// GmoBoxControl
//=======================================================================================
GmoBoxControl::GmoBoxControl(Control* ctrl, const UPoint& origin,
                             LUnits width, LUnits height, ImoStyle* style)
    : GmoBox(GmoObj::k_box_control, ctrl->get_owner_imo() )
    , m_pStyle(style)
    , m_pControl(ctrl)
{
    set_origin(origin);
    set_width(width);
    set_height(height);
}
开发者ID:lenmus,项目名称:lenmus,代码行数:13,代码来源:lomse_gm_basic.cpp


示例20: set_height

/**
 * \brief Set the height in the image resource.
 * \param height The new value.
 */
void bf::sprite::set_clip_height( const unsigned int height )
{
  if ( m_clip_height != height )
    {
      m_clip_height = height;
      m_spritepos_entry.clear();

      if ( get_auto_size() )
        set_height(height);
    }
} // sprite::set_clip_height()
开发者ID:yannicklm,项目名称:bear,代码行数:15,代码来源:sprite.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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