本文整理汇总了C++中set_height函数的典型用法代码示例。如果您正苦于以下问题:C++ set_height函数的具体用法?C++ set_height怎么用?C++ set_height使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_height函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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";
}
示例2: set_left
Rectangle::Rectangle(float Width, float Height)
{
set_left ( 0 );
set_bottom ( 0 );
set_width ( Width );
set_height ( Height );
}
示例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;
}
示例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);
}
}
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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 }) );
示例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 }) );
示例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 }) );
示例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());
}
示例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;
}
示例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 }) );
示例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);
}