@@ -85,6 +85,7 @@ struct top_menu_widget : autoconfig_window_t<top_menu_widget> {
85
85
virtual void draw_foreground () override ;
86
86
virtual void ui_draw_foreground () override {}
87
87
virtual int get_tooltip_text () override { return 0 ; }
88
+ virtual int ui_handle_mouse (const mouse *m) override ;
88
89
virtual void init () override ;
89
90
90
91
virtual void load (archive arch, pcstr section) override {
@@ -126,6 +127,9 @@ static generic_button orientation_buttons_ph[] = {
126
127
};
127
128
128
129
void top_menu_widget::init () {
130
+ ui[" date" ].onrclick ([] {
131
+ window_message_dialog_show (MESSAGE_DIALOG_TOP_DATE, -1 , window_city_draw_all);
132
+ });
129
133
}
130
134
131
135
void top_menu_widget::menu_item_update (pcstr header, int item, pcstr text) {
@@ -817,27 +821,27 @@ static bool handle_right_click(int type) {
817
821
window_message_dialog_show (MESSAGE_DIALOG_TOP_FUNDS, -1 , window_city_draw_all);
818
822
} else if (type == INFO_POPULATION) {
819
823
window_message_dialog_show (MESSAGE_DIALOG_TOP_POPULATION, -1 , window_city_draw_all);
820
- } else if (type == INFO_DATE) {
821
- window_message_dialog_show (MESSAGE_DIALOG_TOP_DATE, -1 , window_city_draw_all);
822
- }
824
+ }
823
825
824
826
return true ;
825
827
}
826
828
827
- static bool widget_top_menu_handle_mouse_menu (const mouse* m) {
828
- auto & data = g_top_menu;
829
+ int top_menu_widget::ui_handle_mouse (const mouse *m) {
830
+ autoconfig_window::ui_handle_mouse (m);
831
+
832
+ auto &data = g_top_menu;
829
833
xstring menu_id = top_menu_bar_handle_mouse (m);
830
834
if (!!menu_id && m->left .went_up ) {
831
835
data.open_sub_menu = menu_id;
832
836
widget_sub_menu_show ();
833
- return true ;
837
+ return 0 ;
834
838
}
835
839
836
840
if (m->right .went_up ) {
837
841
return handle_right_click (get_info_id (*m));
838
842
}
839
843
840
- return false ;
844
+ return 0 ;
841
845
}
842
846
843
847
void widget_top_menu_handle_input (const mouse* m, const hotkeys* h) {
@@ -861,7 +865,7 @@ void widget_top_menu_handle_input(const mouse* m, const hotkeys* h) {
861
865
else if (!!data.open_sub_menu )
862
866
widget_top_menu_handle_input_submenu (m, h);
863
867
else
864
- widget_top_menu_handle_mouse_menu (m);
868
+ g_top_menu. ui_handle_mouse (m);
865
869
}
866
870
}
867
871
0 commit comments