Exemple #1
0
ewol::widget::Button::Button() :
  signalPressed(this, "pressed", "Button is pressed"),
  signalDown(this, "down", "Button is DOWN"),
  signalUp(this, "up", "Button is UP"),
  signalEnter(this, "enter", "The cursor enter inside the button"),
  signalLeave(this, "leave", "the cursor leave the button"),
  signalValue(this, "value", "button value change"),
  propertyShape(this, "shape", "{ewol}THEME:GUI:Button.json", "The display name for config file", &ewol::widget::Button::onChangePropertyShape),
  propertyValue(this, "value", false, "Value of the Button", &ewol::widget::Button::onChangePropertyValue),
  propertyLock(this, "lock", lockNone, "Lock the button in a special state to permit changing state only by the coder", &ewol::widget::Button::onChangePropertyLock),
  propertyToggleMode(this, "toggle", false, "The Button can toogle", &ewol::widget::Button::onChangePropertyToggleMode),
  propertyEnableSingle(this, "enable-single", false, "If one element set in the Button ==> display only set", &ewol::widget::Button::onChangePropertyEnableSingle),
  m_mouseHover(false),
  m_buttonPressed(false),
  m_selectableAreaPos(0,0),
  m_selectableAreaSize(0,0) {
	addObjectType("ewol::widget::Button");
	
	// set property list:
	propertyLock.add(lockNone, "none");
	propertyLock.add(lockWhenPressed, "pressed");
	propertyLock.add(lockWhenReleased, "released");
	propertyLock.add(lockAccess, "access");
	
	propertyCanFocus.setDirectCheck(true);
	
	// shaper satatus update:
	CheckStatus();
	// Limit event at 1:
	setMouseLimit(1);
}
Exemple #2
0
ewol::widget::ListFileSystem::ListFileSystem() :
  signalFileSelect(*this, "file-select"),
  signalFileValidate(*this, "file-validate"),
  signalFolderSelect(*this, "folder-select"),
  signalFolderValidate(*this, "folder-validate"),
  m_selectedLine(-1),
  m_folder(*this, "path", "/", "Path to display"),
  m_selectFile(*this, "select", "", "selection af a specific file"),
  m_showFile(*this, "show-file", true, "display files"),
  m_showFolder(*this, "show-folder", true, "display folders"),
  m_showHidden(*this, "show-hidden", true, "Show the hidden element (file, folder, ...)"),
  m_showTemporaryFile(*this, "show-temporary", true, "display temporary files") {
	addObjectType("ewol::widget::ListFileSystem");
	#if defined(__TARGET_OS__Windows)
		m_folder = "c:/";
	#endif
	m_colorProperty = ewol::resource::ColorFile::create("{ewol}THEME:COLOR:ListFileSystem.json");
	if (m_colorProperty != nullptr) {
		m_colorIdText = m_colorProperty->request("text");
		m_colorIdBackground1 = m_colorProperty->request("background1");
		m_colorIdBackground2 = m_colorProperty->request("background2");
		m_colorIdBackgroundSelected = m_colorProperty->request("selected");
	}
	setMouseLimit(1);
};
Exemple #3
0
ewol::widget::ColorBar::ColorBar() :
  signalChange(*this, "change", "Color value change") {
	addObjectType("ewol::widget::ColorBar");
	m_currentUserPos.setValue(0,0);
	m_currentColor = etk::color::black;
	setCanHaveFocus(true);
	setMouseLimit(1);
}
Exemple #4
0
ewol::widget::ButtonColor::ButtonColor() :
  signalChange(*this, "change", "Button color change value"),
  m_widgetContextMenu(nullptr),
  m_textColorFg(*this, "color", etk::color::black, "Current color") {
	addObjectType("ewol::widget::ButtonColor");
	changeStatusIn(STATUS_UP);
	setCanHaveFocus(true);
	// Limit event at 1:
	setMouseLimit(1);
}
Exemple #5
0
ewol::widget::ColorBar::ColorBar() :
    signalChange(this, "change", "Color value change"),
    propertyValue(this, "color",
                  etk::color::black,
                  "Current color",
                  &ewol::widget::ColorBar::onChangePropertyValue) {
    addObjectType("ewol::widget::ColorBar");
    m_currentUserPos.setValue(0,0);
    propertyCanFocus.setDirectCheck(true);
    setMouseLimit(1);
}
Exemple #6
0
ewol::widget::ButtonColor::ButtonColor() :
  signalChange(this, "change", "Button color change value"),
  propertyValue(this, "color", etk::color::black, "Current color", &ewol::widget::ButtonColor::onChangePropertyValue),
  propertyShape(this, "shape", "{ewol}THEME:GUI:Button.json", "shape of the widget", &ewol::widget::ButtonColor::onChangePropertyShape),
  m_widgetContextMenu(nullptr) {
	addObjectType("ewol::widget::ButtonColor");
	changeStatusIn(STATUS_UP);
	// Limit event at 1:
	setMouseLimit(1);
	propertyCanFocus.setDirectCheck(true);
}
Exemple #7
0
ewol::widget::Slider::Slider() :
  signalChange(*this, "change"),
  m_value(*this, "value", 0.0f, "Value of the Slider"),
  m_min(*this, "min", 0.0f, "Minium value"),
  m_max(*this, "max", 10.0f, "Maximum value"),
  m_step(*this, "step", 1.0f, "Step size") {
	addObjectType("ewol::widget::Slider");
	
	m_textColorFg = etk::color::black;
	
	m_textColorBg = etk::color::black;
	m_textColorBg.setA(0x3F);
	setCanHaveFocus(true);
	// Limit event at 1:
	setMouseLimit(1);
}
Exemple #8
0
ewol::widget::ContextMenu::ContextMenu():
  m_shaper(*this, "shaper", "the display name for config file"),
  m_arrowPos(*this, "arrow-position", vec2(0,0), "Position of the arrow in the pop-up"),
  m_arrawBorder(*this, "arrow-mode", markTop, "position of the arrow") {
	addObjectType("ewol::widget::ContextMenu");
	m_arrawBorder.add(markTop, "top");
	m_arrawBorder.add(markRight, "right");
	m_arrawBorder.add(markButtom, "buttom");
	m_arrawBorder.add(markLeft, "left");
	m_arrawBorder.add(markNone, "none");
	
	m_userExpand.set(bvec2(false,false));
	
	m_offset = 20;
	
	m_colorBackGroung = etk::color::white;
	
	m_colorBorder = etk::color::black;
	m_colorBorder.setA(0x7F);
	
	setMouseLimit(1);
}