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

C++ set_text函数代码示例

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

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



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

示例1: add_to_history

void    GLUI_CommandLine::deactivate( void )
{
  // if the commit_flag is set, add the current command to 
  // history and call deactivate as normal

  // Trick deactivate into calling callback if and only if commit_flag set.
  // A bit subtle, but deactivate checks that orig_text and text
  // are the same to decide whether or not to call the callback.
  // Force them to be different for commit, and the same for no commit.
  if (commit_flag) {
    add_to_history(text.c_str());
    orig_text = "";
    Super::deactivate( );
    set_text( "" );
    commit_flag = false;
  }
  else {
    orig_text = text;
  }
}
开发者ID:4ian,项目名称:GD,代码行数:20,代码来源:glui_commandline.cpp


示例2: set_v_size_flags

Label::Label(const String &p_text) {

	align=ALIGN_LEFT;
	valign=VALIGN_TOP;
	text="";
	word_cache=NULL;
	word_cache_dirty=true;
	autowrap=false;
	line_count=0;
	set_v_size_flags(0);
	clip=false;
	set_ignore_mouse(true);
	total_char_cache=0;
	visible_chars=-1;
	percent_visible=1;
	lines_skipped=0;
	max_lines_visible=-1;
	set_text(p_text);
	uppercase=false;
}
开发者ID:SPTelur,项目名称:godot,代码行数:20,代码来源:label.cpp


示例3: add_item

void GlobalSearchPositions::create_objects()
{
	add_item(new BC_MenuItem("16"));
	add_item(new BC_MenuItem("32"));
	add_item(new BC_MenuItem("64"));
	add_item(new BC_MenuItem("128"));
	add_item(new BC_MenuItem("256"));
	add_item(new BC_MenuItem("512"));
	add_item(new BC_MenuItem("1024"));
	add_item(new BC_MenuItem("2048"));
	add_item(new BC_MenuItem("4096"));
	add_item(new BC_MenuItem("8192"));
	add_item(new BC_MenuItem("16384"));
	add_item(new BC_MenuItem("32768"));
	add_item(new BC_MenuItem("65536"));
	add_item(new BC_MenuItem("131072"));
	char string[BCTEXTLEN];
	sprintf(string, "%d", plugin->config.global_positions);
	set_text(string);
}
开发者ID:Cuchulain,项目名称:cinelerra,代码行数:20,代码来源:motionwindow.C


示例4: WARNLOG

bool CRpcResponse::handleExceptions(IXslProcessor *xslp, IMultiException *me, const char *serv, const char *meth, const char *errorXslt)
{
    IEspContext *context=queryContext();
    if (me->ordinality()>0)
    {
        StringBuffer text;
        me->errorMessage(text);
        text.append('\n');
        WARNLOG("Exception(s) in %s::%s - %s", serv, meth, text.str());

        if (errorXslt)
        {
            me->serialize(text.clear());
            StringBuffer theOutput;
            xslTransformHelper(xslp, text.str(), errorXslt, theOutput, context->queryXslParameters());
            set_text(theOutput.str());
        }
    }
    return false;
}
开发者ID:jamienoss,项目名称:HPCC-Platform,代码行数:20,代码来源:soapmessage.cpp


示例5: UCharsetDetector_detect_all

/*
 * call-seq:
 *   detect_all(text=nil, declared_encoding=nil)
 *
 * Find all charset matches that appear to be consistent with the input,
 * returning an array of results.  The results are ordered with the
 * best quality match first.
 *
 * Because the detection only looks at a limited amount of the
 * input byte data, some of the returned charsets may fail to handle
 * the all of input data.
 *
 * Return an error if 
 * * no charset appears to match the data
 * * no input text has been provided (with +text+ or set with #text= )
 */
static VALUE
UCharsetDetector_detect_all(int argc, VALUE *argv, VALUE self)
{
    VALUE text;
    VALUE declared_encoding;
    
    rb_scan_args(argc, argv, "02", &text, &declared_encoding);
    set_text(self, text);
    set_declared_encoding(self, declared_encoding);
    
    UCharsetDetector *detector;
    Data_Get_Struct(self, UCharsetDetector, detector);
    UErrorCode status = U_ZERO_ERROR;
    int32_t matches_found;
    
    const UCharsetMatch **matches = ucsdet_detectAll(detector, &matches_found, &status);
    ensure(status);
    
    VALUE ary = rb_ary_new();
    int i = 0;
    
    for (i = 0; i < matches_found; i++) {
        const char *encoding_name = ucsdet_getName(matches[i], &status);
        ensure(status);

        int32_t encoding_confidence = ucsdet_getConfidence(matches[i], &status);
        ensure(status);
        
        const char *encoding_language = ucsdet_getLanguage(matches[i], &status);
        ensure(status);
        
        VALUE hash = rb_hash_new();
        rb_hash_aset(hash, ID2SYM(rb_intern("encoding")), rb_str_new2(encoding_name));
        rb_hash_aset(hash, ID2SYM(rb_intern("confidence")), INT2NUM(encoding_confidence));
        rb_hash_aset(hash, ID2SYM(rb_intern("language")), rb_str_new2(encoding_language));
        
        rb_ary_push(ary, hash);
    }
    
    return ary;
}
开发者ID:sraach,项目名称:uchardet,代码行数:57,代码来源:uchardet.c


示例6: TEXT

void GaugeCDI::Update(double TrackBearing, double WaypointBearing)
{
  // JMW changed layout here to fit reorganised display
  // insert waypoint bearing ".<|>." into CDIScale string"

  TCHAR CDIScale[] = TEXT("330..340..350..000..010..020..030..040..050..060..070..080..090..100..110..120..130..140..150..160..170..180..190..200..210..220..230..240..250..260..270..280..290..300..310..320..330..340..350..000..010..020..030..040.");
  TCHAR CDIDisplay[25] = TEXT("");
  int j;
  int CDI_WP_Bearing = (int)WaypointBearing/2;
  CDIScale[CDI_WP_Bearing + 9] = 46;
  CDIScale[CDI_WP_Bearing + 10] = 60;
  CDIScale[CDI_WP_Bearing + 11] = 124; // "|" character
  CDIScale[CDI_WP_Bearing + 12] = 62;
  CDIScale[CDI_WP_Bearing + 13] = 46;
  for (j=0;j<24;j++) CDIDisplay[j] = CDIScale[(j + (int)(TrackBearing)/2)];
  CDIDisplay[24] = _T('\0');
  // JMW fix bug! This indicator doesn't always display correctly!

  // JMW added arrows at end of CDI to point to track if way off..
  int deltacdi = iround(WaypointBearing - TrackBearing);

  while (deltacdi>180) {
    deltacdi-= 360;
  }
  while (deltacdi<-180) {
    deltacdi+= 360;
  }
  if (deltacdi>20) {
    CDIDisplay[21]='>';
    CDIDisplay[22]='>';
    CDIDisplay[23]='>';
  }
  if (deltacdi<-20) {
    CDIDisplay[0]='<';
    CDIDisplay[1]='<';
    CDIDisplay[2]='<';
  }

  set_text(CDIDisplay);
  // end of new code to display CDI scale
}
开发者ID:scottp,项目名称:xcsoar,代码行数:41,代码来源:GaugeCDI.cpp


示例7: x

void gui_filterbar_c::fill_tags()
{
    int lnki = 0;
    auto make_ht = [&]( const ts::wsptr &htt ) -> ts::wstr_c
    {
        ts::wstr_c x( CONSTWSTR("<cstm=a\1>"), htt );
        x.append( CONSTWSTR("<cstm=b\1>, ") );
        x.replace_all( CONSTWSTR("\1"), ts::wmake<int>( lnki++ ) );
        return x;
    };

    ts::wstr_c t;
    for (int i = 0; i < BIT_count; ++i)
        t.append( make_ht(tagname(i)) );

    for(const ts::str_c &ht : contacts().get_all_tags())
        t.append(make_ht(from_utf8(ht)));
    
    t.trunc_length(2);
    set_text(t);
}
开发者ID:kjradv,项目名称:Isotoxin,代码行数:21,代码来源:filterbar.cpp


示例8: ERR_FAIL_INDEX

void OptionButton::_select(int p_idx, bool p_emit) {

	if (p_idx < 0)
		return;
	if (p_idx == current)
		return;

	ERR_FAIL_INDEX(p_idx, popup->get_item_count());

	for (int i = 0; i < popup->get_item_count(); i++) {

		popup->set_item_checked(i, i == p_idx);
	}

	current = p_idx;
	set_text(popup->get_item_text(current));
	set_icon(popup->get_item_icon(current));

	if (is_inside_tree() && p_emit)
		emit_signal("item_selected", current);
}
开发者ID:MattUV,项目名称:godot,代码行数:21,代码来源:option_button.cpp


示例9: get_text

void
ItemColorChannel::remove_char()
{
  std::string text = get_text();

  if (text.empty())
  {
    *m_number = 0.0f;
  }
  else
  {
    text.pop_back();

    if (!text.empty()) {
      *m_number = std::stof(text);
    } else {
      *m_number = 0.0f;
    }
  }

  set_text(text);
}
开发者ID:pelya,项目名称:supertux,代码行数:22,代码来源:item_colorchannel.cpp


示例10: in_received_handler

// Called when a message is received from PebbleKitJS
static void in_received_handler(DictionaryIterator *received, void *context) {
  bool ok = false;
  int status = 0;
  Tuple *tuple;
  
	tuple = dict_find(received, STATUS_KEY);
	if(tuple) {
    status = (int)tuple->value->uint32;
		//APP_LOG(APP_LOG_LEVEL_DEBUG, "Received Status: %d", (int)tuple->value->uint32); 
	}
	if (status == 1) {
    /*
  	tuple = dict_find(received, MESSAGE_KEY);
  	if(tuple) {
  		APP_LOG(APP_LOG_LEVEL_DEBUG, "Received Message: %s", tuple->value->cstring);
  	}*/
    
    if (!initialized) {
      initialized = true;
      hide_loadscreen();
      show_window();
    }
    if (tupleInt(received, RECORDING) == 1) {
      vibes_double_pulse();
    }
    mode = tupleInt(received, MODE);
    setMode(mode, tupleInt(received, RECORDING));
    setBattery(tupleInt(received, BATTERY));
    set_text(tupleStr(received, CURRENT), tupleStr(received, REMAIN));
  }
  else {
    if (initialized) {
      initialized = false;
      hide_window();
      show_loadscreen();
    }
    set_loadText(status);
  }
}
开发者ID:kim82,项目名称:PebbleRoundGoPro,代码行数:40,代码来源:main.c


示例11: switch

/**
 * \brief Set the text displayed in the control.
 */
void ptb::key_edit::set_label()
{
  std::string t;

  switch ( m_button.get_type() )
    {
    case bear::input::controller_button::controller_keyboard:
      t = bear::input::keyboard::get_translated_name_of
        (m_button.get_key_info().get_code());
      break;
    case bear::input::controller_button::controller_joystick:
      t = bear::input::joystick_button::get_translated_name_of
        (m_button.get_joystick_button());
      break;
    case bear::input::controller_button::controller_mouse:
      t = bear::input::mouse::get_translated_name_of(m_button.get_mouse_code());
      break;
    default: { }
    }

  set_text(t);
} // key_edit::set_label()
开发者ID:LibreGames,项目名称:plee-the-bear,代码行数:25,代码来源:key_edit.cpp


示例12: inbox

void inbox(DictionaryIterator *iter, void *context) {
  Tuple *t = dict_read_first(iter);
  do {
    switch (t->key) {
      case DISPLAY_MESSAGE:
        set_text(strcpy(DisplayMessage, t->value->cstring));
        break;
      case MESSAGE:
        switch(t->value->int32) {
          case IS_LEVEL:
            car_is_level();
          break;
          case BEGIN_LOGGING:
            begin_logging();
          break;
        };
        break;
      default:
        break;
    };
  } while ((t = dict_read_next(iter)) != NULL);
}
开发者ID:PGestewitz,项目名称:Mousetrap-Car,代码行数:22,代码来源:main.c


示例13: set_text

void textbox::append_text(const std::string& text, bool auto_scroll, const SDL_Color& color)
{
	if(text_image_.get() == NULL) {
		set_text(text, color);
		return;
	}

	//disallow adding multi-line text to a single-line text box
	if(wrap_ == false && std::find_if(text.begin(),text.end(),utils::isnewline) != text.end()) {
		return;
	}
	const bool is_at_bottom = get_position() == get_max_position();
	const wide_string& wtext = utils::string_to_wstring(text);

	const surface new_text = add_text_line(wtext, color);
	surface new_surface = create_compatible_surface(text_image_,std::max<size_t>(text_image_->w,new_text->w),text_image_->h+new_text->h);

	SDL_SetAlpha(new_text.get(),0,0);
	SDL_SetAlpha(text_image_.get(),0,0);

	sdl_blit(text_image_,NULL,new_surface,NULL);

	SDL_Rect target = create_rect(0
			, text_image_->h
			, new_text->w
			, new_text->h);

	sdl_blit(new_text,NULL,new_surface,&target);
	text_image_.assign(new_surface);

	text_.resize(text_.size() + wtext.size());
	std::copy(wtext.begin(),wtext.end(),text_.end()-wtext.size());

	set_dirty(true);
	update_text_cache(false);
	if(auto_scroll && is_at_bottom) scroll_to_bottom();
	handle_text_changed(text_);
}
开发者ID:SkyPrayerStudio,项目名称:War-Of-Kingdom,代码行数:38,代码来源:textbox.cpp


示例14: edit_box

VOID edit_box(LONG tree, WORD sobj)
{
	LONG	obspec; 
	WORD	where, type, exitobj, ok, nilok;
	BYTE	name[9], text[2], bxchar;
	GRECT	p;

	if (rcs_state != ALRT_STATE)
	{
		get_fields(tree, sobj, &type, &obspec, &p);

		ini_tree(&tree, BOXDIAL);
		where = set_obname(tree, BOXNAME, name, ad_view, sobj);
		if ( where != NIL && tree_view() && tree_kind( get_kind(where)) )
			nilok = FALSE;
		else
			nilok = TRUE;
		bxchar = LHIBT(LHIWD(LLGET(obspec)));
		set_text(tree, OCHRITEM, (LONG)ADDR(&text[0]), 2);
		text[0] = bxchar? bxchar: '@';
		text[1] = '\0';

		do {
			exitobj = hndl_dial(tree, OCHRITEM, &p);
			desel_obj(tree, exitobj);
			ok = DEFAULT & GET_FLAGS(tree, exitobj);
		} while (ok && !name_ok(name, where, nilok));

		if (ok)
		{
			rcs_edited = TRUE;
			get_obname(name, ad_view, sobj);
			bxchar = (text[0] == '@')? '\0': text[0];
			LLSET(obspec, (LLGET(obspec) & 0xffffffL) | 
				((LONG) ((UWORD) bxchar) << 24));
		}
	}
}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:38,代码来源:RCSEDIT.C


示例15: setup

void setup()
{
  set_adj("large", "treasure", "sandy");
  set_id("chest");
  set_untouched_desc("There is a large treasure chest at the bottom of the "
      "hole.");
  set_long("The treasure chest is still a bit sandy, but otherwise has weathered well.  There is some writing on the outside of it.");
  set_objects( ([
   ]) );
#ifdef USE_SIZE
  set_size(LARGE);
#endif
#ifdef USE_MASS
  set_mass(LARGE);
#endif
  set_max_capacity(LARGE);
  set_text("Written on the treasure chest is a poem:\n"
      "\tI used to have a treasure chest.\n"
      "\tIt got so heavy that I had to rest.\n"
      "\tI let it slip away from me,\n"
      "\tBut I didn't need it anyway,\n"
      "\tSo I let it slip away...\n");
}	    
开发者ID:Lundex,项目名称:lima,代码行数:23,代码来源:treasure_chest.c


示例16: set_text

void browser::onLoad( Berkelium::Window* win )
{
#ifdef BROWSER_USE_EXCEPTIONS
  try
#endif
  {
    browser_instance& w = *instances.at( win );

    sf::Mutex mtx;
    mtx.lock();
    {
      std::cout << "Browser bindings set." << std::endl;
      set_text( w );
      js::bindings_complete( w );
    }
    mtx.unlock();
  }
#ifdef BROWSER_USE_EXCEPTIONS
  catch( ... )
  {
  }
#endif
}
开发者ID:Yours3lf,项目名称:gl_browser_gui,代码行数:23,代码来源:browser.cpp


示例17: nsatari_search_restore_form

void nsatari_search_restore_form( struct s_search_form_session *s, OBJECT *obj)
{
	if ((s->state.flags & SEARCH_FLAG_SHOWALL) != 0) {
		obj[TOOLBAR_CB_SHOWALL].ob_state |= OS_SELECTED;
	} else {
		obj[TOOLBAR_CB_SHOWALL].ob_state &= ~OS_SELECTED;
	}

	if ((s->state.flags & SEARCH_FLAG_CASE_SENSITIVE) != 0) {
		obj[TOOLBAR_CB_CASESENSE].ob_state |= OS_SELECTED;
	} else {
		obj[TOOLBAR_CB_CASESENSE].ob_state &= ~OS_SELECTED;
	}

	if (s->state.back_avail == false) {
		obj[TOOLBAR_BT_SEARCH_BACK].ob_state |= OS_DISABLED;
	} else {
		obj[TOOLBAR_BT_SEARCH_BACK].ob_state &= ~OS_DISABLED;
	}

	TEDINFO *t = ((TEDINFO *)get_obspec(obj, TOOLBAR_TB_SRCH));
	set_text(obj, TOOLBAR_TB_SRCH, s->state.text, t->te_txtlen);
}
开发者ID:kyllikki,项目名称:netsurf,代码行数:23,代码来源:search.c


示例18: LOG


//.........这里部分代码省略.........
                    forward_button->set_picture("gui/game/next");
                }
                Engine::get_gui()->refresh_gui();
            }
            else{
                hide_buttons();
                Engine::close_notification_bar();
            }
        });

        this->add(forward_button);
    }
    if(type == TextBoxType::ExternalScriptHelp){
        forward_button->move_text(0.0f, 0.0f);
        forward_button->set_picture("gui/game/next");

        forward_button->set_on_click([&] () {
            LOG(INFO) << "forward button pressed";

            if(text_stack.can_forward()){
                traverse_text(Direction::NEXT);

                if(!text_stack.can_forward()){
                    forward_button->set_picture("gui/game/next");
                    forward_button->set_visible(false);
                    forward_button->set_clickable(false);
                }
                Engine::get_gui()->refresh_gui();
            }
        });

        this->add(forward_button);
    }
    else if(type == TextBoxType::Display){
        forward_button->move_text(0.0f, 0.0f);
        forward_button->set_picture("gui/game/next");

        forward_button->set_on_click([&] () {
            LOG(INFO) << "forward button pressed";

            if(text_stack.can_forward()){
                traverse_text(Direction::NEXT);

                if(!text_stack.can_forward()){
                    forward_button->set_picture("gui/game/next");
                }
                else if(text_stack.can_forward()){
                    forward_button->set_picture("gui/game/next");
                }

                if(!text_stack.can_backward()){
                    backward_button->set_picture("gui/game/prev");
                }
                else if(text_stack.can_backward()){
                    backward_button->set_picture("gui/game/prev");
                }
                Engine::get_gui()->refresh_gui();
            }
        });

        backward_button->move_text(0.0f, 0.0f);
        backward_button->set_picture("gui/game/prev");

        backward_button->set_on_click([&] () {
            LOG(INFO) << "backward button pressed";

            if(text_stack.can_backward()){
                traverse_text(Direction::PREVIOUS);

                if(!text_stack.can_backward()){
                    backward_button->set_picture("gui/game/prev");
                }
                else if(text_stack.can_backward()){
                    backward_button->set_picture("gui/game/prev");
                }

                if(!text_stack.can_forward()){
                    forward_button->set_picture("gui/game/next");
                }
                else if(text_stack.can_forward()){
                    forward_button->set_picture("gui/game/next");
                }

                Engine::get_gui()->refresh_gui();
            }
        });

        this->add(forward_button);
        this->add(backward_button);
    }
    // text object for notifications
    text = std::make_shared<GUIText>();
    text->set_width(1.0f);
    text->set_height(1.0f);
    text->set_x_offset(0.0f);
    text->set_y_offset(0.0f);

    set_text("");
    this->add(text);
}
开发者ID:ALEXLCC,项目名称:pyland,代码行数:101,代码来源:text_box.cpp


示例19: set_text

void TextBox::clear_text() {
    set_text("");
    text_stack.clear();
    Engine::get_gui()->refresh_gui();
}
开发者ID:ALEXLCC,项目名称:pyland,代码行数:5,代码来源:text_box.cpp


示例20: write_controls

  void write_controls(const SfxOptions& options) {
    DisableEvents de(*this);

    set_list_pos(module_ctrl_id, ArcAPI::sfx().find_by_name(options.name));

    set_check(replace_icon_ctrl_id, options.replace_icon);
    set_text(icon_path_ctrl_id, options.icon_path);

    set_check(replace_version_ctrl_id, options.replace_version);
    set_text(ver_info_product_name_ctrl_id, options.ver_info.product_name);
    set_text(ver_info_version_ctrl_id, options.ver_info.version);
    set_text(ver_info_company_name_ctrl_id, options.ver_info.company_name);
    set_text(ver_info_file_description_ctrl_id, options.ver_info.file_description);
    set_text(ver_info_comments_ctrl_id, options.ver_info.comments);
    set_text(ver_info_legal_copyright_ctrl_id, options.ver_info.legal_copyright);

    set_check(append_install_config_ctrl_id, options.append_install_config);
    set_text(install_config_title_ctrl_id, options.install_config.title);
    set_text(install_config_begin_prompt_ctrl_id, options.install_config.begin_prompt);
    TriState value;
    if (options.install_config.progress == L"yes")
      value = triTrue;
    else if (options.install_config.progress == L"no")
      value = triFalse;
    else
      value = triUndef;
    set_check3(install_config_progress_ctrl_id, value);
    set_text(install_config_run_program_ctrl_id, options.install_config.run_program);
    set_text(install_config_directory_ctrl_id, options.install_config.directory);
    set_text(install_config_execute_file_ctrl_id, options.install_config.execute_file);
    set_text(install_config_execute_parameters_ctrl_id, options.install_config.execute_parameters);
  }
开发者ID:landswellsong,项目名称:FAR,代码行数:32,代码来源:sfx.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ set_thread_flag函数代码示例发布时间:2022-05-30
下一篇:
C++ set_test_name函数代码示例发布时间: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