Back to index

nux  3.0.0
TestTextEntry.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2012 Inalogic Inc.
00003  *
00004  * This program is free software: you can redistribute it and/or modify it
00005  * under the terms of the GNU General Public License version 3, as published
00006  * by the  Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful, but
00009  * WITHOUT ANY WARRANTY; without even the implied warranties of
00010  * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
00011  * PURPOSE.  See the GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * version 3 along with this program.  If not, see
00015  * <http://www.gnu.org/licenses/>
00016  *
00017  * Authored by: Jay Taoko <jaytaoko@inalogic.com>
00018  *
00019  */
00020 
00021 #ifndef TEST_TEXT_ENTRY_H
00022 #define TEST_TEXT_ENTRY_H
00023 
00024 #include "Nux/TextEntry.h"
00025 
00026 namespace nux {
00027 class TestTextEntry: public nux::TextEntry
00028 {
00029   NUX_DECLARE_OBJECT_TYPE(TestTextEntry, TextEntry);
00030 public:
00031   TestTextEntry(NUX_FILE_LINE_PROTO);
00032   ~TestTextEntry();
00033 
00034   void ResetEvents();
00035   void ResetKeyFocusEvents();
00036 
00037   bool has_focus_;
00038   bool registered_mouse_down_;
00039   bool registered_mouse_up_;
00040   bool registered_mouse_drag_;
00041   bool registered_mouse_click_;
00042   bool registered_mouse_double_click_;
00043   bool registered_mouse_move_;
00044   bool registered_mouse_enter_;
00045   bool registered_mouse_leave_;
00046   bool registered_object_destroyed_;
00047 
00048   bool registered_begin_keynav_focus_;
00049   bool registered_end_keynav_focus_;
00050 
00051   bool registered_text_changed_;
00052 
00053   nux::KeyNavDirection key_nav_direction_; 
00054 
00055 protected:
00056   bool mouse_in_;
00057   bool mouse_mouse_drag_;
00058   bool mouse_mouse_down_;
00059 
00060 
00061   void OnMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags);
00062   void OnMouseUp(int x, int y, unsigned long button_flags, unsigned long key_flags);
00063   void OnMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
00064   void OnMouseClick(int x, int y, unsigned long button_flags, unsigned long key_flags);
00065   void OnMouseDoubleClick(int x, int y, unsigned long button_flags, unsigned long key_flags);
00066   void OnMouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
00067   void OnMouseEnter(int x, int y, unsigned long button_flags, unsigned long key_flags);
00068   void OnMouseLeave(int x, int y, unsigned long button_flags, unsigned long key_flags);
00069   void OnKeyNavFocusChange(nux::Area* area, bool has_focus, nux::KeyNavDirection direction);
00070   void OnBeginKeyFocus();
00071   void OnEndKeyFocus();
00072   void OnObjectDestroyed(Object* object);
00073 
00074   void OnTextChanged(TextEntry* text_entry);
00075 };
00076 
00077 }
00078 #endif // TEST_TEXT_ENTRY_H
00079