예제 #1
0
BoxContainer::BoxContainer(bool p_vertical) {

	vertical=p_vertical;
	align = ALIGN_BEGIN;
//	set_ignore_mouse(true);
	set_stop_mouse(false);
}
예제 #2
0
EditorAssetLibraryItem::EditorAssetLibraryItem() {

	Ref<StyleBoxEmpty> border;
	border.instance();
	/*border->set_default_margin(MARGIN_LEFT,5);
	border->set_default_margin(MARGIN_RIGHT,5);
	border->set_default_margin(MARGIN_BOTTOM,5);
	border->set_default_margin(MARGIN_TOP,5);*/
	add_style_override("panel",border);

	HBoxContainer *hb = memnew( HBoxContainer );
	add_child(hb);

	icon = memnew( TextureButton );
	icon->set_default_cursor_shape(CURSOR_POINTING_HAND);
	icon->connect("pressed",this,"_asset_clicked");

	hb->add_child(icon);

	VBoxContainer *vb = memnew( VBoxContainer );

	hb->add_child(vb);
	vb->set_h_size_flags(SIZE_EXPAND_FILL);

	title = memnew( LinkButton );
	title->set_text("My Awesome Addon");
	title->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER);
	title->connect("pressed",this,"_asset_clicked");
	vb->add_child(title);


	category = memnew( LinkButton );
	category->set_text("Editor Tools");
	category->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER);
	title->connect("pressed",this,"_category_clicked");
	vb->add_child(category);

	author = memnew( LinkButton );
	author->set_text("Johny Tolengo");
	author->set_underline_mode(LinkButton::UNDERLINE_MODE_ON_HOVER);
	title->connect("pressed",this,"_author_clicked");
	vb->add_child(author);

	HBoxContainer *rating_hb = memnew( HBoxContainer );
	vb->add_child(rating_hb);

	for(int i=0;i<5;i++) {
		stars[i]=memnew(TextureFrame);
		rating_hb->add_child(stars[i]);
	}
	price = memnew( Label );
	price->set_text("Free");
	vb->add_child(price);

	set_custom_minimum_size(Size2(250,100));
	set_h_size_flags(SIZE_EXPAND_FILL);

	set_stop_mouse(false);
}
예제 #3
0
Button::Button(const String &p_text) {
	
	flat=false;
	clip_text=false;
	set_stop_mouse(true);
	set_text(p_text);
	align=ALIGN_CENTER;
}
예제 #4
0
GraphNode::GraphNode() {

	overlay=OVERLAY_DISABLED;
	show_close=false;
	connpos_dirty=true;
	set_stop_mouse(false);
	modulate=Color(1,1,1,1);
	comment=false;
	resizeable=false;
	resizing=false;
}
예제 #5
0
파일: line_edit.cpp 프로젝트: SPTelur/godot
LineEdit::LineEdit() {

align = ALIGN_LEFT;
cached_width = 0;
cursor_pos=0;
window_pos=0;
window_has_focus=true;
max_length = 0;
pass=false;
placeholder_alpha=0.6;

selection_clear();
set_focus_mode( FOCUS_ALL );
editable=true;
set_default_cursor_shape(CURSOR_IBEAM);
set_stop_mouse(true);

draw_caret=true;
caret_blink_enabled=false;
caret_blink_timer = memnew(Timer);
add_child(caret_blink_timer);
caret_blink_timer->set_wait_time(0.65);
caret_blink_timer->connect("timeout", this,"_toggle_draw_caret");
cursor_set_blink_enabled(false);

menu = memnew( PopupMenu );
add_child(menu);
menu->add_item(TTR("Cut"),MENU_CUT,KEY_MASK_CMD|KEY_X);
menu->add_item(TTR("Copy"),MENU_COPY,KEY_MASK_CMD|KEY_C);
menu->add_item(TTR("Paste"),MENU_PASTE,KEY_MASK_CMD|KEY_V);
menu->add_separator();
menu->add_item(TTR("Select All"),MENU_SELECT_ALL,KEY_MASK_CMD|KEY_A);
menu->add_item(TTR("Clear"),MENU_CLEAR);
menu->add_separator();
menu->add_item(TTR("Undo"),MENU_UNDO,KEY_MASK_CMD|KEY_Z);
menu->connect("item_pressed",this,"menu_option");
expand_to_text_length=false;


}
예제 #6
0
GridContainer::GridContainer() {

	set_stop_mouse(false);
	columns=1;
}
예제 #7
0
GraphNode::GraphNode() {
	show_close=false;
	connpos_dirty=true;
	set_stop_mouse(false);
}