[DEV] better init in some widget
This commit is contained in:
parent
8b8f48b654
commit
4872bfcbf9
2
external/etk
vendored
2
external/etk
vendored
@ -1 +1 @@
|
|||||||
Subproject commit fb13e03dc913ccd56c27aef4c780e68e3b384b84
|
Subproject commit 951a94c0d9cb72b558f0152e76dd44c2b2818791
|
@ -47,22 +47,21 @@ namespace ewol
|
|||||||
alignJustify
|
alignJustify
|
||||||
} aligneMode_te;
|
} aligneMode_te;
|
||||||
private:
|
private:
|
||||||
ewol::Drawing m_vectorialDraw; //!< This is used to draw background selection and other things ...
|
ewol::Drawing m_vectorialDraw; //!< This is used to draw background selection and other things ...
|
||||||
private:
|
private:
|
||||||
int32_t m_nbCharDisplayed; //!< prevent some error in calculation size.
|
int32_t m_nbCharDisplayed; //!< prevent some error in calculation size.
|
||||||
vec3 m_sizeDisplayStart; //!< The start windows of the display.
|
vec3 m_sizeDisplayStart; //!< The start windows of the display.
|
||||||
vec3 m_sizeDisplayStop; //!< The end windows of the display.
|
vec3 m_sizeDisplayStop; //!< The end windows of the display.
|
||||||
bool m_needDisplay; //!< This just need the display and not the size rendering.
|
bool m_needDisplay; //!< This just need the display and not the size rendering.
|
||||||
|
vec3 m_position; //!< The current position to draw
|
||||||
vec3 m_position; //!< The current position to draw
|
vec3 m_clippingPosStart; //!< Clipping start position
|
||||||
vec3 m_clippingPosStart; //!< Clipping start position
|
vec3 m_clippingPosStop; //!< Clipping stop position
|
||||||
vec3 m_clippingPosStop; //!< Clipping stop position
|
bool m_clippingEnable; //!< true if the clipping must be activated
|
||||||
bool m_clippingEnable; //!< true if the clipping must be activated
|
|
||||||
private:
|
private:
|
||||||
draw::Color m_color; //!< The text foreground color
|
draw::Color m_color; //!< The text foreground color
|
||||||
draw::Color m_colorBg; //!< The text background color
|
draw::Color m_colorBg; //!< The text background color
|
||||||
draw::Color m_colorCursor; //!< The text cursor color
|
draw::Color m_colorCursor; //!< The text cursor color
|
||||||
draw::Color m_colorSelection; //!< The text Selection color
|
draw::Color m_colorSelection; //!< The text Selection color
|
||||||
private:
|
private:
|
||||||
ewol::font::mode_te m_mode; //!< font display property : Regular/Bold/Italic/BoldItalic
|
ewol::font::mode_te m_mode; //!< font display property : Regular/Bold/Italic/BoldItalic
|
||||||
bool m_kerning; //!< Kerning enable or disable on the next elements displayed
|
bool m_kerning; //!< Kerning enable or disable on the next elements displayed
|
||||||
|
@ -36,7 +36,9 @@ widget::Button::Button(etk::UString newLabel, etk::UString shaperName) :
|
|||||||
m_value(false),
|
m_value(false),
|
||||||
m_mouseHover(false),
|
m_mouseHover(false),
|
||||||
m_buttonPressed(false),
|
m_buttonPressed(false),
|
||||||
m_imageDisplaySize(32)
|
m_imageDisplaySize(32),
|
||||||
|
m_selectableAreaPos(0,0),
|
||||||
|
m_selectableAreaSize(0,0)
|
||||||
{
|
{
|
||||||
AddEventId(ewolEventButtonPressed);
|
AddEventId(ewolEventButtonPressed);
|
||||||
AddEventId(ewolEventButtonDown);
|
AddEventId(ewolEventButtonDown);
|
||||||
@ -173,7 +175,7 @@ void widget::Button::OnRegenerateDisplay(void)
|
|||||||
vec2 padding = m_shaper.GetPadding();
|
vec2 padding = m_shaper.GetPadding();
|
||||||
// to know the size of one Line :
|
// to know the size of one Line :
|
||||||
vec3 minSize = m_displayText.CalculateSize('A');
|
vec3 minSize = m_displayText.CalculateSize('A');
|
||||||
vec3 curentTextSize;
|
vec3 curentTextSize(0,0,0);
|
||||||
if( false == m_toggleMode
|
if( false == m_toggleMode
|
||||||
|| false == m_value
|
|| false == m_value
|
||||||
|| m_labelToggle.Size()==0) {
|
|| m_labelToggle.Size()==0) {
|
||||||
|
@ -33,21 +33,21 @@ const char * const ewolEventEntrySelect = "ewol-Entry-Select";
|
|||||||
|
|
||||||
|
|
||||||
widget::Entry::Entry(etk::UString newData) :
|
widget::Entry::Entry(etk::UString newData) :
|
||||||
m_shaper("THEME:GUI:widgetEntry.conf")
|
m_shaper("THEME:GUI:widgetEntry.conf"),
|
||||||
|
m_data(""),
|
||||||
|
m_textColorFg(draw::color::black),
|
||||||
|
m_textColorBg(draw::color::white),
|
||||||
|
m_userSize(50),
|
||||||
|
m_displayStartPosition(0),
|
||||||
|
m_displayCursor(false),
|
||||||
|
m_displayCursorPos(0),
|
||||||
|
m_displayCursorPosSelection(0)
|
||||||
{
|
{
|
||||||
|
m_textColorBg.a = 0xAF;
|
||||||
|
SetCanHaveFocus(true);
|
||||||
AddEventId(ewolEventEntryClick);
|
AddEventId(ewolEventEntryClick);
|
||||||
AddEventId(ewolEventEntryEnter);
|
AddEventId(ewolEventEntryEnter);
|
||||||
AddEventId(ewolEventEntryModify);
|
AddEventId(ewolEventEntryModify);
|
||||||
m_displayStartPosition = 0;
|
|
||||||
m_displayCursorPos = 0;
|
|
||||||
m_displayCursorPosSelection = 0;
|
|
||||||
m_userSize = 50;
|
|
||||||
m_displayCursor = false;
|
|
||||||
m_textColorFg = draw::color::black;
|
|
||||||
|
|
||||||
m_textColorBg = draw::color::white;
|
|
||||||
m_textColorBg.a = 0xAF;
|
|
||||||
SetCanHaveFocus(true);
|
|
||||||
ShortCutAdd("ctrl+w", ewolEventEntryClean);
|
ShortCutAdd("ctrl+w", ewolEventEntryClean);
|
||||||
ShortCutAdd("ctrl+x", ewolEventEntryCut);
|
ShortCutAdd("ctrl+x", ewolEventEntryCut);
|
||||||
ShortCutAdd("ctrl+c", ewolEventEntryCopy);
|
ShortCutAdd("ctrl+c", ewolEventEntryCopy);
|
||||||
|
@ -34,20 +34,16 @@ namespace widget {
|
|||||||
class Entry : public ewol::Widget
|
class Entry : public ewol::Widget
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
float m_pos[4];
|
ewol::Shaper m_shaper;
|
||||||
int32_t m_GLposText;
|
ewol::Text m_oObjectText; //!< text display
|
||||||
int32_t m_GLstate;
|
etk::UString m_data; //!< sting that must be displayed
|
||||||
private:
|
draw::Color m_textColorFg; //!< Text color
|
||||||
ewol::Shaper m_shaper;
|
draw::Color m_textColorBg; //!< Background color
|
||||||
ewol::Text m_oObjectText; //!< text display
|
int32_t m_userSize; //!< Display size requested by the user
|
||||||
etk::UString m_data; //!< sting that must be displayed
|
int32_t m_displayStartPosition; //!< ofset in pixel of the display of the UString
|
||||||
draw::Color m_textColorFg; //!< Text color
|
bool m_displayCursor; //!< Cursor mus be display only when the widget has the focus
|
||||||
draw::Color m_textColorBg; //!< Background color
|
int32_t m_displayCursorPos; //!< Cursor position in number of Char
|
||||||
int32_t m_userSize; //!< Display size requested by the user
|
int32_t m_displayCursorPosSelection; //!< Selection position end (can be befor or after cursor and == m_displayCursorPos chan no selection availlable
|
||||||
int32_t m_displayStartPosition; //!< ofset in pixel of the display of the UString
|
|
||||||
bool m_displayCursor; //!< Cursor mus be display only when the widget has the focus
|
|
||||||
int32_t m_displayCursorPos; //!< Cursor position in number of Char
|
|
||||||
int32_t m_displayCursorPosSelection; //!< Selection position end (can be befor or after cursor and == m_displayCursorPos chan no selection availlable
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Contuctor
|
* @brief Contuctor
|
||||||
|
@ -20,26 +20,24 @@
|
|||||||
#define __class__ "Widget"
|
#define __class__ "Widget"
|
||||||
|
|
||||||
ewol::Widget::Widget(void) :
|
ewol::Widget::Widget(void) :
|
||||||
m_userMaxSize(-1,-1)
|
m_hide(false),
|
||||||
|
m_zoom(1.0f),
|
||||||
|
m_origin(0,0),
|
||||||
|
m_size(10,10),
|
||||||
|
m_minSize(-1,-1),
|
||||||
|
m_userMinSize(-1,-1),
|
||||||
|
m_userMaxSize(-1,-1),
|
||||||
|
m_userExpend(false,false),
|
||||||
|
m_userFill(false,false),
|
||||||
|
m_hasFocus(false),
|
||||||
|
m_canFocus(false),
|
||||||
|
m_limitMouseEvent(3),
|
||||||
|
m_allowRepeateKeyboardEvent(true),
|
||||||
|
m_needRegenerateDisplay(true),
|
||||||
|
m_grabCursor(false),
|
||||||
|
m_cursorDisplay(ewol::cursorArrow)
|
||||||
{
|
{
|
||||||
m_allowRepeateKeyboardEvent = true;
|
|
||||||
m_limitMouseEvent = 3;
|
|
||||||
m_needRegenerateDisplay = true;
|
|
||||||
m_origin.setValue(0,0);
|
|
||||||
m_size.setValue(10,10);
|
|
||||||
m_minSize.setValue(-1,-1);
|
|
||||||
// user settings :
|
|
||||||
m_userMinSize.setValue(-1,-1);
|
|
||||||
SetExpendX();
|
|
||||||
SetExpendY();
|
|
||||||
SetFillX();
|
|
||||||
SetFillY();
|
|
||||||
m_canFocus = false;
|
|
||||||
m_hasFocus = false;
|
|
||||||
m_hide = false;
|
|
||||||
m_zoom = 1.0;
|
|
||||||
m_grabCursor = false;
|
|
||||||
m_cursorDisplay = ewol::cursorArrow;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -49,7 +47,6 @@ ewol::Widget::~Widget(void)
|
|||||||
ewol::widgetManager::Rm(this);
|
ewol::widgetManager::Rm(this);
|
||||||
// clean all the short-cut ...
|
// clean all the short-cut ...
|
||||||
ShortCutClean();
|
ShortCutClean();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user