Advertisement
DimkaM

Описание элементов

Jun 22nd, 2021
883
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.32 KB | None | 0 0
  1. enum EVENT_TYPES{
  2.     EVENT_TYPE_LBM_CLICK    = 1, //Left button mouse
  3.     EVENT_TYPE_RBM_CLICK    = 2, //Right button mouse
  4.     EVENT_TYPE_LBM_DOWN     = 6, //Down left button mouse
  5.     EVENT_TYPE_FOC_LOST     = 8,  //Focus lost
  6.     EVENT_TYPE_DCLICK       = 9,  //Double click
  7.     EVENT_TYPE_ESC          = 10  //Escape
  8. };
  9.  
  10. typedef struct TIMER{
  11.     u8 timer;
  12.     struct TIMER *  next;
  13.     void    (*proc)(void *);
  14. }TIMER;
  15.  
  16. typedef struct EVENT_PROC{
  17.     enum EVENT_TYPES    type;
  18.     struct EVENT_PROC * next;
  19.     void    (*proc)(void *);
  20. }EVENT_PROC;
  21.  
  22.  
  23. typedef struct W_TEXT{
  24.     struct W_TEXT * next;
  25.     u8      color;
  26.     u8      x;
  27.     u8      y;
  28.     u8      w;
  29.     u8      h;
  30.     u8 *    caption;
  31.     EVENT_PROC * events;
  32.     struct W_TEXT * childs;
  33.     void *  ext;
  34. }W_TEXT;
  35.  
  36. //Окно создать иконку
  37.     // Region
  38. EVENT_PROC win_add_ico_exit_event = {EVENT_TYPE_LBM_CLICK, NULL_PTR, win_add_ico_exit_proc};
  39. EVENT_PROC win_add_ico_esc_event = {EVENT_TYPE_ESC, NULL_PTR, win_add_ico_exit_proc};
  40. EVENT_PROC ico_inp_path_event = {EVENT_TYPE_LBM_CLICK, NULL_PTR, set_active_text_input};
  41. EVENT_PROC ico_inp_ico_event = {EVENT_TYPE_LBM_CLICK, NULL_PTR, set_active_text_input};
  42. EVENT_PROC ico_color_event = {EVENT_TYPE_LBM_CLICK, NULL_PTR, color_add_ico_proc};
  43.  
  44. W_TEXT cnt_add_ico_ico2 = {NULL_PTR, PAPER_BLUE | INK_RED,
  45.     1, 5, 5, 1, "└───┘", &ico_inp_ico_event, NULL_PTR};
  46. W_TEXT cnt_add_ico_ico1 = {&cnt_add_ico_ico2, PAPER_BLUE | INK_RED,
  47.     1, 4, 5, 1, "│   │", &ico_inp_ico_event, NULL_PTR};
  48. W_TEXT cnt_add_ico_ico0 = {&cnt_add_ico_ico1, PAPER_BLUE | INK_RED,
  49.     1, 3, 5, 1, "┌───┐", &ico_inp_ico_event, NULL_PTR};
  50. W_TEXT cnt_add_ico_path = {&cnt_add_ico_ico0, PAPER_BLACK | INK_WHITE,
  51.     0, 1, 32, 1, null_str, &ico_inp_path_event, NULL_PTR};
  52. W_TEXT cnt_add_ico_cancel = {&cnt_add_ico_path, PAPER_GREEN | INK_BLACK,
  53.     24, 5, 6, 1, "Cancel", &win_add_ico_exit_event, NULL_PTR};
  54. W_TEXT cnt_add_ico_save = {&cnt_add_ico_cancel, PAPER_GREEN | INK_BLACK,
  55.     24, 3, 6, 1, "< OK >", &win_add_ico_exit_event, NULL_PTR};
  56. W_TEXT cnt_add_ico_ink = {&cnt_add_ico_save, PAPER_GREEN | INK_BLACK,
  57.     9, 3, 5, 1, " Ink ", &ico_color_event, NULL_PTR};
  58. W_TEXT cnt_add_ico_paper = {&cnt_add_ico_ink, PAPER_GREEN | INK_BLACK,
  59.     9, 5, 5, 1, "Paper", &ico_color_event, NULL_PTR};
  60. W_TEXT win_add_ico = {NULL_PTR, PAPER_RED | INK_BLACK,
  61.     23, 7, 32, 7,
  62.     "path:\n\nIcon:", &win_add_ico_esc_event, &cnt_add_ico_paper};
  63.     // End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement