[DEV] better init in some widget

This commit is contained in:
Edouard DUPIN 2013-03-01 09:14:12 +01:00
parent 8b8f48b654
commit 4872bfcbf9
6 changed files with 56 additions and 62 deletions

2
external/etk vendored

@ -1 +1 @@
Subproject commit fb13e03dc913ccd56c27aef4c780e68e3b384b84
Subproject commit 951a94c0d9cb72b558f0152e76dd44c2b2818791

View File

@ -47,22 +47,21 @@ namespace ewol
alignJustify
} aligneMode_te;
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:
int32_t m_nbCharDisplayed; //!< prevent some error in calculation size.
vec3 m_sizeDisplayStart; //!< The start 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.
vec3 m_position; //!< The current position to draw
vec3 m_clippingPosStart; //!< Clipping start position
vec3 m_clippingPosStop; //!< Clipping stop position
bool m_clippingEnable; //!< true if the clipping must be activated
int32_t m_nbCharDisplayed; //!< prevent some error in calculation size.
vec3 m_sizeDisplayStart; //!< The start 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.
vec3 m_position; //!< The current position to draw
vec3 m_clippingPosStart; //!< Clipping start position
vec3 m_clippingPosStop; //!< Clipping stop position
bool m_clippingEnable; //!< true if the clipping must be activated
private:
draw::Color m_color; //!< The text foreground color
draw::Color m_colorBg; //!< The text background color
draw::Color m_colorCursor; //!< The text cursor color
draw::Color m_colorSelection; //!< The text Selection color
draw::Color m_color; //!< The text foreground color
draw::Color m_colorBg; //!< The text background color
draw::Color m_colorCursor; //!< The text cursor color
draw::Color m_colorSelection; //!< The text Selection color
private:
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

View File

@ -36,7 +36,9 @@ widget::Button::Button(etk::UString newLabel, etk::UString shaperName) :
m_value(false),
m_mouseHover(false),
m_buttonPressed(false),
m_imageDisplaySize(32)
m_imageDisplaySize(32),
m_selectableAreaPos(0,0),
m_selectableAreaSize(0,0)
{
AddEventId(ewolEventButtonPressed);
AddEventId(ewolEventButtonDown);
@ -173,7 +175,7 @@ void widget::Button::OnRegenerateDisplay(void)
vec2 padding = m_shaper.GetPadding();
// to know the size of one Line :
vec3 minSize = m_displayText.CalculateSize('A');
vec3 curentTextSize;
vec3 curentTextSize(0,0,0);
if( false == m_toggleMode
|| false == m_value
|| m_labelToggle.Size()==0) {

View File

@ -33,21 +33,21 @@ const char * const ewolEventEntrySelect = "ewol-Entry-Select";
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(ewolEventEntryEnter);
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+x", ewolEventEntryCut);
ShortCutAdd("ctrl+c", ewolEventEntryCopy);

View File

@ -34,20 +34,16 @@ namespace widget {
class Entry : public ewol::Widget
{
private:
float m_pos[4];
int32_t m_GLposText;
int32_t m_GLstate;
private:
ewol::Shaper m_shaper;
ewol::Text m_oObjectText; //!< text display
etk::UString m_data; //!< sting that must be displayed
draw::Color m_textColorFg; //!< Text color
draw::Color m_textColorBg; //!< Background color
int32_t m_userSize; //!< Display size requested by the user
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
ewol::Shaper m_shaper;
ewol::Text m_oObjectText; //!< text display
etk::UString m_data; //!< sting that must be displayed
draw::Color m_textColorFg; //!< Text color
draw::Color m_textColorBg; //!< Background color
int32_t m_userSize; //!< Display size requested by the user
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:
/**
* @brief Contuctor

View File

@ -20,26 +20,24 @@
#define __class__ "Widget"
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);
// clean all the short-cut ...
ShortCutClean();
}