historyeditbox.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef __HISTORYEDITBOX_H
  2. #define __HISTORYEDITBOX_H
  3. #include <api/skin/widgets/combobox.h>
  4. #include <bfc/ptrlist.h>
  5. #include <bfc/string/StringW.h>
  6. #define HISTORYEDITBOX_PARENT ComboBox
  7. class HistoryEditBox : public HISTORYEDITBOX_PARENT {
  8. public:
  9. HistoryEditBox();
  10. virtual ~HistoryEditBox();
  11. virtual const wchar_t *dropdownlist_getMainGroupId() { return L"wasabi.historyeditbox.main.group"; }
  12. virtual const wchar_t *dropdownlist_getListGroupId() { return L"wasabi.historyeditbox.list.group"; }
  13. virtual const wchar_t *dropdownlist_getButtonId() { return L"historyeditbox.button"; }
  14. virtual const wchar_t *dropdownlist_getListId() { return L"historyeditbox.list"; }
  15. virtual const wchar_t *combobox_getEditId() { return L"historyeditbox.edit"; }
  16. void onEditKeyDown(int vk);
  17. void onEditEnter(const wchar_t *txt);
  18. virtual int wantAutoSort() { return 0; }
  19. virtual int wantDownOpenList() { return history_pos == 0; }
  20. virtual void dropdownlist_onCloseList();
  21. virtual void onPreOpenList();
  22. virtual int onInit();
  23. virtual void addHistory(const wchar_t *txt);
  24. virtual int onAction(const wchar_t *action, const wchar_t *param=NULL, int x=-1, int y=-1, intptr_t p1=0, intptr_t p2=0, void *data=NULL, size_t datalen=0, ifc_window *source=NULL);
  25. void history_back();
  26. void history_forward();
  27. enum {
  28. HISTORYEDITBOX_SETNAVBUTTONS=0,
  29. };
  30. protected:
  31. /*static */void CreateXMLParameters(int master_handle);
  32. private:
  33. static XMLParamPair params[];
  34. #ifdef WASABI_COMPILE_CONFIG
  35. void saveHistory();
  36. void loadHistory(int refill=1);
  37. #endif
  38. PtrList<StringW> history;
  39. int history_pos;
  40. int xuihandle;
  41. };
  42. #endif