additional Andrew provided Termux mods +
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / bctextbox.h
index ffc5c0e429c0ca29d4f4b0d4154b38317a2ca02e..ec4142784788cd96d2d201820c986808643b9d6b 100644 (file)
@@ -55,17 +55,17 @@ class BC_TextBox : public BC_SubWindow
 // may be local fixed/dynamic, or shared fixed ref via set_text
        char *text;
 // always local dynamic
-       wchar_t *wtext;
+       wchr_t *wtext;
 public:
 // size > 0: fixed buffer, size == 0: dynamic buffer
 // size < 0: fixed shared buffer via set_text
        BC_TextBox(int x, int y, int w, int rows, int size, char *text,
                int has_border=1, int font=MEDIUMFONT);
-       BC_TextBox(int x, int y, int w, int rows, int size, wchar_t *wtext,
+       BC_TextBox(int x, int y, int w, int rows, int size, wchr_t *wtext,
                int has_border=1, int font=MEDIUMFONT);
        BC_TextBox(int x, int y, int w, int rows, const char *text,
                int has_border=1, int font=MEDIUMFONT, int is_utf8=1);
-       BC_TextBox(int x, int y, int w, int rows, const wchar_t *wtext,
+       BC_TextBox(int x, int y, int w, int rows, const wchr_t *wtext,
                int has_border=1, int font=MEDIUMFONT, int is_utf8=1);
        BC_TextBox(int x, int y, int w, int rows, int64_t text,
                int has_border=1, int font=MEDIUMFONT);
@@ -87,7 +87,7 @@ public:
        void set_selection(int char1, int char2, int ibeam);
        void wset_selection(int char1, int char2, int ibeam);
        int update(const char *text);
-       int update(const wchar_t *wtext);
+       int update(const wchr_t *wtext);
        int update(int64_t value);
        int update(float value);
        void disable();
@@ -110,7 +110,7 @@ public:
        int activate();
        int deactivate();
        const char* get_text();
-       const wchar_t* get_wtext();
+       const wchr_t* get_wtext();
        void set_text(char *text, int isz);
        int wdemand(int len);
        int tdemand(int len);
@@ -177,7 +177,7 @@ private:
        void copy_selection(int clipboard_num);
        void paste_selection(int clipboard_num);
        void delete_selection(int letter1, int letter2, int text_len);
-       void insert_text(const wchar_t *wcp, int len=-1);
+       void insert_text(const wchr_t *wcp, int len=-1);
 // Reformat text according to separators.
 // ibeam_left causes the ibeam to move left.
        int is_separator(const char *txt, int i);
@@ -195,7 +195,7 @@ private:
        int tstrcmp(const char *cp);
        char *tstrcpy(const char *cp);
        char *tstrcat(const char *cp);
-       int text_update(const wchar_t *wcp, int wsz, char *tcp, int tsz);
+       int text_update(const wchr_t *wcp, int wsz, char *tcp, int tsz);
        int wtext_update();
 
 // Top left of text relative to window
@@ -257,7 +257,7 @@ class BC_ScrollTextBox
        BC_ScrollTextBoxYScroll *yscroll;
        BC_WindowBase *parent_window;
        const char *default_text;
-       const wchar_t *default_wtext;
+       const wchr_t *default_wtext;
        int default_size;
        int x, y, w, rows;
 
@@ -270,7 +270,7 @@ public:
                const char *default_text, int default_size=BCTEXTLEN);
         BC_ScrollTextBox(BC_WindowBase *parent_window,
                 int x, int y, int w, int rows,
-                const wchar_t *default_wtext, int default_size=BCTEXTLEN);
+                const wchr_t *default_wtext, int default_size=BCTEXTLEN);
        virtual ~BC_ScrollTextBox();
        void create_objects();
 
@@ -281,7 +281,7 @@ public:
        void set_text(char *text, int isz);
        int set_text_row(int n);
        void update(const char *text);
-       void update(const wchar_t *wtext);
+       void update(const wchr_t *wtext);
        void reposition_window(int x, int y, int w, int rows);
        void update_scrollbars();
 // accessors
@@ -295,7 +295,7 @@ public:
 // forward functions
        int get_h();
        const char *get_text();
-       const wchar_t *get_wtext();
+       const wchr_t *get_wtext();
        int get_buttonpress();
        void wset_selection(int char1, int char2, int ibeam);
        void set_selection(int char1, int char2, int ibeam);
@@ -306,7 +306,7 @@ class BC_ScrollTextBoxText : public BC_TextBox
 {
 public:
        BC_ScrollTextBoxText(BC_ScrollTextBox *gui, const char *text);
-       BC_ScrollTextBoxText(BC_ScrollTextBox *gui, const wchar_t *wtext);
+       BC_ScrollTextBoxText(BC_ScrollTextBox *gui, const wchr_t *wtext);
        virtual ~BC_ScrollTextBoxText();
        int handle_event();
        int motion_event();
@@ -349,15 +349,21 @@ public:
        virtual ~BC_PopupTextBox();
        int create_objects();
        virtual int handle_event();
-       const char* get_text();
-       const wchar_t* get_wtext();
+
+       const char *get_text();
+       const wchr_t *get_wtext();
        int get_number();
+       void set_number(int v);
        int get_x();
        int get_y();
        int get_w();
        int get_h();
        int get_show_query();
        void set_show_query(int v);
+       int get_back_color();
+       void set_back_color(int v);
+
+       void set_tooltip(const char *text);
 
        void update(const char *text);
        void update_list(ArrayList<BC_ListBoxItem*> *data);
@@ -368,9 +374,9 @@ public:
 
 private:
        int x, y, text_w, list_h;
-       int list_format;
+       int list_format, list_item;
        const char *default_text;
-       const wchar_t *default_wtext;
+       const wchr_t *default_wtext;
        ArrayList<BC_ListBoxItem*> *list_items;
        BC_PopupTextBoxText *textbox;
        BC_PopupTextBoxList *listbox;
@@ -381,7 +387,7 @@ class BC_PopupTextBoxText : public BC_TextBox
 {
 public:
        BC_PopupTextBoxText(BC_PopupTextBox *popup, int x, int y, const char *text);
-       BC_PopupTextBoxText(BC_PopupTextBox *popup, int x, int y, const wchar_t *wtext);
+       BC_PopupTextBoxText(BC_PopupTextBox *popup, int x, int y, const wchr_t *wtext);
        virtual ~BC_PopupTextBoxText();
        int handle_event();
        BC_PopupTextBox *popup;
@@ -396,40 +402,33 @@ public:
 };
 
 
+class BC_TumbleTextBox;
 class BC_TumbleTextBoxText;
-class BC_TumbleTextBoxTumble;
+class BC_FTextTumbler;
+class BC_ITextTumbler;
+
 
 class BC_TumbleTextBox
 {
 public:
        BC_TumbleTextBox(BC_WindowBase *parent_window,
-               int64_t default_value,
-               int64_t min,
-               int64_t max,
-               int x,
-               int y,
-               int text_w);
+               int64_t default_value, int64_t min, int64_t max,
+               int x, int y, int text_w);
        BC_TumbleTextBox(BC_WindowBase *parent_window,
-               int default_value,
-               int min,
-               int max,
-               int x,
-               int y,
-               int text_w);
+               int default_value, int min, int max,
+               int x, int y, int text_w);
        BC_TumbleTextBox(BC_WindowBase *parent_window,
-               float default_value,
-               float min,
-               float max,
-               int x,
-               int y,
-               int text_w);
+               float default_value, float min, float max,
+               int x, int y, int text_w, int precision=4);
        virtual ~BC_TumbleTextBox();
 
        int create_objects();
        void reset();
        virtual int handle_event();
+       virtual int handle_up_event();
+       virtual int handle_down_event();
        const char* get_text();
-       const wchar_t* get_wtext();
+       const wchr_t* get_wtext();
        BC_TextBox* get_textbox();
        int update(const char *value);
        int update(int64_t value);
@@ -450,7 +449,8 @@ public:
        void set_tooltip(const char *text);
 
        friend class BC_TumbleTextBoxText;
-       friend class BC_TumbleTextBoxTumble;
+       friend class BC_FTextTumbler;
+       friend class BC_ITextTumbler;
 
 private:
        int x, y, text_w;
@@ -476,6 +476,36 @@ public:
        BC_TumbleTextBox *popup;
 };
 
+class BC_FTextTumbler : public BC_FTumbler
+{
+public:
+       BC_FTextTumbler(BC_TumbleTextBox *tumble_text,
+                       float min_f, float max_f, int x, int y)
+        : BC_FTumbler(tumble_text->textbox, min_f, max_f, x, y) {
+               this->tumble_text = tumble_text;
+       }
+       ~BC_FTextTumbler() {}
+       int handle_up_event() { return tumble_text->handle_up_event(); }
+       int handle_down_event() { return tumble_text->handle_down_event(); }
+
+       BC_TumbleTextBox *tumble_text;
+};
+
+class BC_ITextTumbler : public BC_ITumbler
+{
+public:
+       BC_ITextTumbler(BC_TumbleTextBox *tumble_text,
+                       int64_t min, int64_t max, int x, int y)
+        : BC_ITumbler(tumble_text->textbox, min, max, x, y) {
+               this->tumble_text = tumble_text;
+       }
+       ~BC_ITextTumbler() {}
+       int handle_up_event() { return tumble_text->handle_up_event(); }
+       int handle_down_event() { return tumble_text->handle_down_event(); }
+
+       BC_TumbleTextBox *tumble_text;
+};
+
 
 class BC_TextMenu : public BC_PopupMenu
 {