| 60 uic_init_global_context(); |
60 uic_init_global_context(); |
| 61 uic_menu_init(); |
61 uic_menu_init(); |
| 62 uic_toolbar_init(); |
62 uic_toolbar_init(); |
| 63 uic_load_app_properties(); |
63 uic_load_app_properties(); |
| 64 |
64 |
| 65 ui_window_init(); |
|
| 66 |
|
| 67 INITCOMMONCONTROLSEX icex = { |
65 INITCOMMONCONTROLSEX icex = { |
| 68 sizeof(icex), |
66 sizeof(icex), |
| 69 ICC_WIN95_CLASSES | ICC_LISTVIEW_CLASSES | ICC_TREEVIEW_CLASSES | ICC_BAR_CLASSES | ICC_TAB_CLASSES |
67 ICC_WIN95_CLASSES | ICC_LISTVIEW_CLASSES | ICC_TREEVIEW_CLASSES | ICC_BAR_CLASSES | ICC_TAB_CLASSES |
| 70 }; |
68 }; |
| 71 InitCommonControlsEx(&icex); |
69 InitCommonControlsEx(&icex); |
| 73 SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); |
71 SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); |
| 74 |
72 |
| 75 NONCLIENTMETRICS ncm = { sizeof(ncm) }; |
73 NONCLIENTMETRICS ncm = { sizeof(ncm) }; |
| 76 SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE); |
74 SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE); |
| 77 ui_font = CreateFontIndirect(&ncm.lfMessageFont); |
75 ui_font = CreateFontIndirect(&ncm.lfMessageFont); |
| |
76 |
| |
77 ui_window_init(); |
| 78 } |
78 } |
| 79 |
79 |
| 80 HFONT ui_win32_get_font(void) { |
80 HFONT ui_win32_get_font(void) { |
| 81 return ui_font; |
81 return ui_font; |
| 82 } |
82 } |
| 127 void ui_show(UiObject *obj) { |
127 void ui_show(UiObject *obj) { |
| 128 ui_set_visible(obj->widget, TRUE); |
128 ui_set_visible(obj->widget, TRUE); |
| 129 } |
129 } |
| 130 |
130 |
| 131 LRESULT CALLBACK ui_default_eventproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { |
131 LRESULT CALLBACK ui_default_eventproc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { |
| |
132 printf("default event proc: %d, %d\n", (int)hwnd, (int)uMsg); |
| |
133 fflush(stdout); |
| 132 W32Widget *widget = (W32Widget*)GetWindowLongPtr(hwnd, GWLP_USERDATA); |
134 W32Widget *widget = (W32Widget*)GetWindowLongPtr(hwnd, GWLP_USERDATA); |
| 133 if (widget && widget->wclass->eventproc) { |
135 if (widget && widget->wclass->eventproc) { |
| 134 widget->wclass->eventproc(widget, hwnd, uMsg, wParam, lParam); |
136 widget->wclass->eventproc(widget, hwnd, uMsg, wParam, lParam); |
| 135 } |
137 } |
| 136 switch(uMsg) { |
138 switch(uMsg) { |