textbox: make the flag of textbox an enum
refactor textbox try 2