这篇教程C++ update_canvas函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中update_canvas函数的典型用法代码示例。如果您正苦于以下问题:C++ update_canvas函数的具体用法?C++ update_canvas怎么用?C++ update_canvas使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了update_canvas函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: assertvoid ttext_box::update_offsets(){ assert(config()); boost::intrusive_ptr<const ttext_box_definition::tresolution> conf = boost::dynamic_pointer_cast<const ttext_box_definition::tresolution>( config()); assert(conf); text_height_ = font::get_max_height(conf->text_font_size); game_logic::map_formula_callable variables; variables.add("height", variant(get_height())); variables.add("width", variant(get_width())); variables.add("text_font_height", variant(text_height_)); text_x_offset_ = conf->text_x_offset(variables); text_y_offset_ = conf->text_y_offset(variables); // Since this variable doesn't change set it here instead of in // update_canvas(). for(auto & tmp : canvas()) { tmp.set_variable("text_font_height", variant(text_height_)); } // Force an update of the canvas since now text_font_height is known. update_canvas();}
开发者ID:ArtBears,项目名称:wesnoth,代码行数:30,
示例2: get_hint GraphicGUI::resize_event(int w, int h){ int difference = h - get_h(); int canvas_xdiff = get_w() - canvas->get_w(); int canvas_ydiff = get_h() - canvas->get_h(); canvas->reposition_window(canvas->get_x(), canvas->get_y(), w - canvas_xdiff, h - canvas_ydiff); freq_text->reposition_window(freq_text->get_x(), freq_text->get_y() + difference); value_text->reposition_window(value_text->get_x(), value_text->get_y() + difference); freq_title->reposition_window(freq_title->get_x(), freq_title->get_y() + difference); level_title->reposition_window(level_title->get_x(), level_title->get_y() + difference); size_title->reposition_window(size_title->get_x(), size_title->get_y() + difference); reset->reposition_window(reset->get_x(), reset->get_y() + difference); size->reposition_window(size->get_x(), size->get_y() + difference); draw_ticks(); update_canvas(); flash(); plugin->w = w; plugin->h = h; plugin->send_configure_change(); return 1;}
开发者ID:petterreinholdtsen,项目名称:cinelerra-hv,代码行数:34,
示例3: set_cursorvoid ttext_::set_selection(size_t start, int length){ const size_t text_size = text_.get_length(); if(start >= text_size) { start = text_size; } if(length == 0) { set_cursor(start, false); return; } // The text pos/size type differs in both signedness and size with the // selection length. Such is life. const int sel_start = std::min<size_t>(start, std::numeric_limits<int>::max()); const int sel_max_length = std::min<size_t>(text_size - start, std::numeric_limits<int>::max()); const bool backwards = length < 0; if(backwards && -length > sel_start) { length = -sel_start; } else if(!backwards && length > sel_max_length) { length = sel_max_length; } set_selection_start(start); set_selection_length(length); update_canvas();}
开发者ID:shikadilord,项目名称:wesnoth,代码行数:31,
示例4: update_canvasvoid ParametricWindow::update_gui(){ for(int i = 0; i < BANDS; i++) bands[i]->update_gui(); wetness->update(plugin->config.wetness); size->update(plugin->config.window_size); update_canvas();}
开发者ID:knutj,项目名称:cinelerra,代码行数:8,
示例5: update_canvasvoid tlabel::set_link_color(const std::string & color){ if(color == link_color_) { return; } link_color_ = color; update_canvas(); set_is_dirty(true);}
开发者ID:ArtBears,项目名称:wesnoth,代码行数:9,
示例6: get_text_widthvoid GraphicGUI::create_objects(){ int margin = plugin->get_theme()->widget_border; int x = get_text_width(SMALLFONT, "-00") + LINE_W4 + margin; int y = margin; int freq_h = get_text_height(SMALLFONT) + LINE_W4; add_subwindow(canvas = new GraphicCanvas(plugin, this, x, y, get_w() - x - margin, get_h() - // BC_Pot::calculate_h() - BC_TextBox::calculate_h(this, MEDIUMFONT, 1, 1) - margin * 3 - y - freq_h)); y += canvas->get_h() + freq_h + margin; int x1 = x; int y1 = y; add_subwindow(freq_title = new BC_Title(x, y, "Frequency:")); x += freq_title->get_w() + margin; add_subwindow(freq_text = new FreqTextBox(plugin, this, x, y, 100)); x += freq_text->get_w() + margin; add_subwindow(level_title = new BC_Title(x, y, "Level:")); x += level_title->get_w() + margin; add_subwindow(value_text = new ValueTextBox(plugin, this, x, y, 100)); x += value_text->get_w() + margin; add_subwindow(reset = new GraphicReset(plugin, this, x, y)); x += reset->get_w() + margin; // x = x1;// y += value_text->get_h() + margin; add_subwindow(size_title = new BC_Title(x, y, "Window size:")); x += size_title->get_w() + margin; add_subwindow(size = new GraphicSize(this, plugin, x, y)); size->create_objects(); size->update(plugin->config.window_size); x += size->get_w() + margin;// add_subwindow(title = new BC_Title(x, y, "Wetness:"));// x += title->get_w() + margin;// add_subwindow(wetness = new GraphicWetness(this, plugin, // x, // y)); draw_ticks(); update_canvas(); show_window();}
开发者ID:petterreinholdtsen,项目名称:cinelerra-hv,代码行数:56,
示例7: update_canvasvoid tcontrol::set_text_alignment(const PangoAlignment text_alignment){ if(text_alignment_ == text_alignment) { return; } text_alignment_ = text_alignment; update_canvas(); set_is_dirty(true);}
开发者ID:ArtBears,项目名称:wesnoth,代码行数:10,
示例8: set_layout_sizevoid tcontrol::set_label(const t_string& label){ if(label == label_) { return; } label_ = label; set_layout_size(tpoint(0, 0)); update_canvas(); set_is_dirty(true);}
开发者ID:ArtBears,项目名称:wesnoth,代码行数:11,
示例9: delete_selectionvoid ttext_::insert_char(const utf8::string& unicode){ delete_selection(); if(text_.insert_text(selection_start_, unicode)) { // Update status set_cursor(selection_start_ + 1, false); update_canvas(); set_is_dirty(true); }}
开发者ID:shikadilord,项目名称:wesnoth,代码行数:12,
示例10: copy_from_clipboardvoid ttext_::paste_selection(const bool mouse){ const std::string& text = copy_from_clipboard(mouse); if(text.empty()) { return; } delete_selection(); selection_start_ += text_.insert_text(selection_start_, text); update_canvas(); set_dirty();}
开发者ID:blackberry,项目名称:Wesnoth,代码行数:14,
示例11: update_canvasvoid tpanel::set_hole_variable(int left, int right){ if (left < 0 || right < 0) { return; } if (left != hole_left_ || right != hole_right_) { hole_left_ = left; hole_right_ = right; if (x_ >= 0) { update_canvas(); set_dirty(); } }}
开发者ID:suxinde2009,项目名称:Rose,代码行数:15,
示例12: frame_timer_callbackstatic void frame_timer_callback(void *data){ struct timeval prev; getuptime(&prev); frame++; if (frame >= FRAMES) frame = 0; update_canvas(frame_canvas, frames[frame]); struct timeval cur; getuptime(&cur); plan_frame_timer(tv_sub_diff(&cur, &prev));}
开发者ID:jvesely,项目名称:helenos,代码行数:16,
示例13: add_subwindowvoid CompressorWindow::create_objects(){ int x = 35, y = 10; int control_margin = 130; add_subwindow(canvas = new CompressorCanvas(plugin, x, y, get_w() - x - control_margin - 10, get_h() - y - 70)); canvas->set_cursor(CROSS_CURSOR, 0, 0); x = get_w() - control_margin; add_subwindow(new BC_Title(x, y, _("Reaction secs:"))); y += 20; add_subwindow(reaction = new CompressorReaction(plugin, x, y)); y += 30; add_subwindow(new BC_Title(x, y, _("Decay secs:"))); y += 20; add_subwindow(decay = new CompressorDecay(plugin, x, y)); y += 30; add_subwindow(new BC_Title(x, y, _("Trigger Type:"))); y += 20; add_subwindow(input = new CompressorInput(plugin, x, y)); input->create_objects(); y += 30; add_subwindow(new BC_Title(x, y, _("Trigger:"))); y += 20; add_subwindow(trigger = new CompressorTrigger(plugin, x, y)); if(plugin->config.input != CompressorConfig::TRIGGER) trigger->disable(); y += 30; add_subwindow(smooth = new CompressorSmooth(plugin, x, y)); y += 60; add_subwindow(clear = new CompressorClear(plugin, x, y)); x = 10; y = get_h() - 40; add_subwindow(new BC_Title(x, y, _("Point:"))); x += 50; add_subwindow(x_text = new CompressorX(plugin, x, y)); x += 110; add_subwindow(new BC_Title(x, y, _("x"))); x += 20; add_subwindow(y_text = new CompressorY(plugin, x, y)); draw_scales(); update_canvas(); show_window();}
开发者ID:petterreinholdtsen,项目名称:cinelerra-hv,代码行数:47,
示例14: update_canvasvoid tscrollbar_::set_item_position(const unsigned item_position){ // Set the value always execute since we update a part of the state. item_position_ = item_position > item_count_ - visible_items_ ? item_count_ - visible_items_ : item_position; item_position_ = (item_position_ + step_size_ - 1) / step_size_; if(all_items_visible()) { item_position_ = 0; } // Determine the pixel offset of the item position. positioner_offset_ = static_cast<unsigned>(item_position_ * pixels_per_step_); update_canvas(); assert(item_position_ <= item_count_ - visible_items_);}
开发者ID:Coffee--,项目名称:wesnoth-old,代码行数:20,
示例15: get_xvoid ttext_box::handle_mouse_selection(tpoint mouse, const bool start_selection){ mouse.x -= get_x(); mouse.y -= get_y(); // FIXME we don't test for overflow in width if(mouse.x < static_cast<int>(text_x_offset_) || mouse.y < static_cast<int>(text_y_offset_) || mouse.y >= static_cast<int>(text_y_offset_ + text_height_)) { return; } int offset = get_column_line(tpoint(mouse.x - text_x_offset_, mouse.y - text_y_offset_)).x; if(offset < 0) { return; } set_cursor(offset, !start_selection); update_canvas(); set_is_dirty(true); dragging_ |= start_selection;}
开发者ID:CliffsDover,项目名称:wesnoth,代码行数:23,
示例16: set_icon_name void set_icon_name(const std::string& icon_name) { icon_name_ = icon_name; update_canvas(); }
开发者ID:RushilPatel,项目名称:BattleForWesnoth,代码行数:2,
注:本文中的update_canvas函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ update_count函数代码示例 C++ update_brightness函数代码示例 |