diff --git a/dearpygui/_dearpygui.pyi b/dearpygui/_dearpygui.pyi index 79ce5dbdd..f10ed2de2 100644 --- a/dearpygui/_dearpygui.pyi +++ b/dearpygui/_dearpygui.pyi @@ -614,7 +614,7 @@ def add_vline_series(x : Union[List[float], Tuple[float, ...]], *, label: str =' """Adds an infinite vertical line series to a plot.""" ... -def add_window(*, label: str ='', user_data: Any ='', use_internal_label: bool ='', tag: Union[int, str] ='', width: int ='', height: int ='', indent: int ='', show: bool ='', pos: Union[List[int], Tuple[int, ...]] ='', delay_search: bool ='', min_size: Union[List[int], Tuple[int, ...]] ='', max_size: Union[List[int], Tuple[int, ...]] ='', menubar: bool ='', collapsed: bool ='', autosize: bool ='', no_resize: bool ='', no_title_bar: bool ='', no_move: bool ='', no_scrollbar: bool ='', no_collapse: bool ='', horizontal_scrollbar: bool ='', no_focus_on_appearing: bool ='', no_bring_to_front_on_focus: bool ='', no_close: bool ='', no_background: bool ='', modal: bool ='', popup: bool ='', no_saved_settings: bool ='', no_open_over_existing_popup: bool ='', on_close: Callable ='') -> Union[int, str]: +def add_window(*, label: str ='', user_data: Any ='', use_internal_label: bool ='', tag: Union[int, str] ='', width: int ='', height: int ='', indent: int ='', show: bool ='', pos: Union[List[int], Tuple[int, ...]] ='', delay_search: bool ='', min_size: Union[List[int], Tuple[int, ...]] ='', max_size: Union[List[int], Tuple[int, ...]] ='', menubar: bool ='', collapsed: bool ='', autosize: bool ='', no_resize: bool ='', no_title_bar: bool ='', no_move: bool ='', no_scrollbar: bool ='', no_collapse: bool ='', horizontal_scrollbar: bool ='', no_focus_on_appearing: bool ='', no_bring_to_front_on_focus: bool ='', no_close: bool ='', no_background: bool ='', modal: bool ='', popup: bool ='', no_saved_settings: bool ='', no_open_over_existing_popup: bool ='', no_scroll_with_mouse: bool ='', on_close: Callable ='') -> Union[int, str]: """Creates a new window for following items to be added to.""" ... diff --git a/dearpygui/_dearpygui_RTD.py b/dearpygui/_dearpygui_RTD.py index 032952221..89cd49afc 100644 --- a/dearpygui/_dearpygui_RTD.py +++ b/dearpygui/_dearpygui_RTD.py @@ -2658,6 +2658,7 @@ def window(**kwargs): popup (bool, optional): Fills area behind window according to the theme, removes title bar, collapse and close. Window can be closed by selecting area in the background behind the window. no_saved_settings (bool, optional): Never load/save settings in .ini file. no_open_over_existing_popup (bool, optional): Don't open if there's already a popup + no_scroll_with_mouse (bool, optional): Disable user vertically scrolling with mouse wheel. on_close (Callable, optional): Callback ran when window is closed. id (Union[int, str], optional): (deprecated) Yields: @@ -6607,6 +6608,7 @@ def add_window(**kwargs): popup (bool, optional): Fills area behind window according to the theme, removes title bar, collapse and close. Window can be closed by selecting area in the background behind the window. no_saved_settings (bool, optional): Never load/save settings in .ini file. no_open_over_existing_popup (bool, optional): Don't open if there's already a popup + no_scroll_with_mouse (bool, optional): Disable user vertically scrolling with mouse wheel. on_close (Callable, optional): Callback ran when window is closed. id (Union[int, str], optional): (deprecated) Returns: diff --git a/dearpygui/dearpygui.py b/dearpygui/dearpygui.py index 057b7753f..0429e2d37 100644 --- a/dearpygui/dearpygui.py +++ b/dearpygui/dearpygui.py @@ -1455,6 +1455,7 @@ def child(**kwargs): no_scrollbar (bool, optional): Disable scrollbars (window can still scroll with mouse or programmatically). horizontal_scrollbar (bool, optional): Allow horizontal scrollbar to appear (off by default). menubar (bool, optional): Shows/Hides the menubar at the top. + no_scroll_with_mouse (bool, optional): Disable user vertically scrolling with mouse wheel. Yields: Union[int, str] """ @@ -1485,7 +1486,7 @@ def set_start_callback(callback): @contextmanager -def child_window(*, label: str =None, user_data: Any =None, use_internal_label: bool =True, tag: Union[int, str] =0, width: int =0, height: int =0, indent: int =-1, parent: Union[int, str] =0, before: Union[int, str] =0, payload_type: str ='$$DPG_PAYLOAD', drop_callback: Callable =None, show: bool =True, pos: Union[List[int], Tuple[int, ...]] =[], filter_key: str ='', delay_search: bool =False, tracked: bool =False, track_offset: float =0.5, border: bool =True, autosize_x: bool =False, autosize_y: bool =False, no_scrollbar: bool =False, horizontal_scrollbar: bool =False, menubar: bool =False, **kwargs) -> Union[int, str]: +def child_window(*, label: str =None, user_data: Any =None, use_internal_label: bool =True, tag: Union[int, str] =0, width: int =0, height: int =0, indent: int =-1, parent: Union[int, str] =0, before: Union[int, str] =0, payload_type: str ='$$DPG_PAYLOAD', drop_callback: Callable =None, show: bool =True, pos: Union[List[int], Tuple[int, ...]] =[], filter_key: str ='', delay_search: bool =False, tracked: bool =False, track_offset: float =0.5, border: bool =True, autosize_x: bool =False, autosize_y: bool =False, no_scrollbar: bool =False, horizontal_scrollbar: bool =False, menubar: bool =False, no_scroll_with_mouse: bool=False, **kwargs) -> Union[int, str]: """ Adds an embedded child window. Will show scrollbars when items do not fit. Args: @@ -1512,6 +1513,7 @@ def child_window(*, label: str =None, user_data: Any =None, use_internal_label: no_scrollbar (bool, optional): Disable scrollbars (window can still scroll with mouse or programmatically). horizontal_scrollbar (bool, optional): Allow horizontal scrollbar to appear (off by default). menubar (bool, optional): Shows/Hides the menubar at the top. + no_scroll_with_mouse (bool, optional): Disable user vertically scrolling with mouse wheel. id (Union[int, str], optional): (deprecated) Yields: Union[int, str] @@ -1521,7 +1523,7 @@ def child_window(*, label: str =None, user_data: Any =None, use_internal_label: if 'id' in kwargs.keys(): warnings.warn('id keyword renamed to tag', DeprecationWarning, 2) tag=kwargs['id'] - widget = internal_dpg.add_child_window(label=label, user_data=user_data, use_internal_label=use_internal_label, tag=tag, width=width, height=height, indent=indent, parent=parent, before=before, payload_type=payload_type, drop_callback=drop_callback, show=show, pos=pos, filter_key=filter_key, delay_search=delay_search, tracked=tracked, track_offset=track_offset, border=border, autosize_x=autosize_x, autosize_y=autosize_y, no_scrollbar=no_scrollbar, horizontal_scrollbar=horizontal_scrollbar, menubar=menubar, **kwargs) + widget = internal_dpg.add_child_window(label=label, user_data=user_data, use_internal_label=use_internal_label, tag=tag, width=width, height=height, indent=indent, parent=parent, before=before, payload_type=payload_type, drop_callback=drop_callback, show=show, pos=pos, filter_key=filter_key, delay_search=delay_search, tracked=tracked, track_offset=track_offset, border=border, autosize_x=autosize_x, autosize_y=autosize_y, no_scrollbar=no_scrollbar, horizontal_scrollbar=horizontal_scrollbar, menubar=menubar, no_scroll_with_mouse=no_scroll_with_mouse, **kwargs) internal_dpg.push_container_stack(widget) yield widget finally: @@ -2791,7 +2793,7 @@ def viewport_menu_bar(*, label: str =None, user_data: Any =None, use_internal_la internal_dpg.pop_container_stack() @contextmanager -def window(*, label: str =None, user_data: Any =None, use_internal_label: bool =True, tag: Union[int, str] =0, width: int =0, height: int =0, indent: int =-1, show: bool =True, pos: Union[List[int], Tuple[int, ...]] =[], delay_search: bool =False, min_size: Union[List[int], Tuple[int, ...]] =[100, 100], max_size: Union[List[int], Tuple[int, ...]] =[30000, 30000], menubar: bool =False, collapsed: bool =False, autosize: bool =False, no_resize: bool =False, no_title_bar: bool =False, no_move: bool =False, no_scrollbar: bool =False, no_collapse: bool =False, horizontal_scrollbar: bool =False, no_focus_on_appearing: bool =False, no_bring_to_front_on_focus: bool =False, no_close: bool =False, no_background: bool =False, modal: bool =False, popup: bool =False, no_saved_settings: bool =False, no_open_over_existing_popup: bool =True, on_close: Callable =None, **kwargs) -> Union[int, str]: +def window(*, label: str =None, user_data: Any =None, use_internal_label: bool =True, tag: Union[int, str] =0, width: int =0, height: int =0, indent: int =-1, show: bool =True, pos: Union[List[int], Tuple[int, ...]] =[], delay_search: bool =False, min_size: Union[List[int], Tuple[int, ...]] =[100, 100], max_size: Union[List[int], Tuple[int, ...]] =[30000, 30000], menubar: bool =False, collapsed: bool =False, autosize: bool =False, no_resize: bool =False, no_title_bar: bool =False, no_move: bool =False, no_scrollbar: bool =False, no_collapse: bool =False, horizontal_scrollbar: bool =False, no_focus_on_appearing: bool =False, no_bring_to_front_on_focus: bool =False, no_close: bool =False, no_background: bool =False, modal: bool =False, popup: bool =False, no_saved_settings: bool =False, no_open_over_existing_popup: bool =True, no_scroll_with_mouse: bool =False, on_close: Callable =None, **kwargs) -> Union[int, str]: """ Creates a new window for following items to be added to. Args: @@ -2824,8 +2826,9 @@ def window(*, label: str =None, user_data: Any =None, use_internal_label: bool = popup (bool, optional): Fills area behind window according to the theme, removes title bar, collapse and close. Window can be closed by selecting area in the background behind the window. no_saved_settings (bool, optional): Never load/save settings in .ini file. no_open_over_existing_popup (bool, optional): Don't open if there's already a popup + no_scroll_with_mouse (bool, optional): Disable user vertically scrolling with mouse wheel. on_close (Callable, optional): Callback ran when window is closed. - id (Union[int, str], optional): (deprecated) + id (Union[int, str], optional): (deprecated) Yields: Union[int, str] """ @@ -2834,7 +2837,7 @@ def window(*, label: str =None, user_data: Any =None, use_internal_label: bool = if 'id' in kwargs.keys(): warnings.warn('id keyword renamed to tag', DeprecationWarning, 2) tag=kwargs['id'] - widget = internal_dpg.add_window(label=label, user_data=user_data, use_internal_label=use_internal_label, tag=tag, width=width, height=height, indent=indent, show=show, pos=pos, delay_search=delay_search, min_size=min_size, max_size=max_size, menubar=menubar, collapsed=collapsed, autosize=autosize, no_resize=no_resize, no_title_bar=no_title_bar, no_move=no_move, no_scrollbar=no_scrollbar, no_collapse=no_collapse, horizontal_scrollbar=horizontal_scrollbar, no_focus_on_appearing=no_focus_on_appearing, no_bring_to_front_on_focus=no_bring_to_front_on_focus, no_close=no_close, no_background=no_background, modal=modal, popup=popup, no_saved_settings=no_saved_settings, no_open_over_existing_popup=no_open_over_existing_popup, on_close=on_close, **kwargs) + widget = internal_dpg.add_window(label=label, user_data=user_data, use_internal_label=use_internal_label, tag=tag, width=width, height=height, indent=indent, show=show, pos=pos, delay_search=delay_search, min_size=min_size, max_size=max_size, menubar=menubar, collapsed=collapsed, autosize=autosize, no_resize=no_resize, no_title_bar=no_title_bar, no_move=no_move, no_scrollbar=no_scrollbar, no_collapse=no_collapse, horizontal_scrollbar=horizontal_scrollbar, no_focus_on_appearing=no_focus_on_appearing, no_bring_to_front_on_focus=no_bring_to_front_on_focus, no_close=no_close, no_background=no_background, modal=modal, popup=popup, no_saved_settings=no_saved_settings, no_open_over_existing_popup=no_open_over_existing_popup, no_scroll_with_mouse=no_scroll_with_mouse, on_close=on_close, **kwargs) internal_dpg.push_container_stack(widget) yield widget finally: @@ -3133,7 +3136,7 @@ def add_checkbox(*, label: str =None, user_data: Any =None, use_internal_label: return internal_dpg.add_checkbox(label=label, user_data=user_data, use_internal_label=use_internal_label, tag=tag, indent=indent, parent=parent, before=before, source=source, payload_type=payload_type, callback=callback, drag_callback=drag_callback, drop_callback=drop_callback, show=show, enabled=enabled, pos=pos, filter_key=filter_key, tracked=tracked, track_offset=track_offset, default_value=default_value, **kwargs) -def add_child_window(*, label: str =None, user_data: Any =None, use_internal_label: bool =True, tag: Union[int, str] =0, width: int =0, height: int =0, indent: int =-1, parent: Union[int, str] =0, before: Union[int, str] =0, payload_type: str ='$$DPG_PAYLOAD', drop_callback: Callable =None, show: bool =True, pos: Union[List[int], Tuple[int, ...]] =[], filter_key: str ='', delay_search: bool =False, tracked: bool =False, track_offset: float =0.5, border: bool =True, autosize_x: bool =False, autosize_y: bool =False, no_scrollbar: bool =False, horizontal_scrollbar: bool =False, menubar: bool =False, **kwargs) -> Union[int, str]: +def add_child_window(*, label: str =None, user_data: Any =None, use_internal_label: bool =True, tag: Union[int, str] =0, width: int =0, height: int =0, indent: int =-1, parent: Union[int, str] =0, before: Union[int, str] =0, payload_type: str ='$$DPG_PAYLOAD', drop_callback: Callable =None, show: bool =True, pos: Union[List[int], Tuple[int, ...]] =[], filter_key: str ='', delay_search: bool =False, tracked: bool =False, track_offset: float =0.5, border: bool =True, autosize_x: bool =False, autosize_y: bool =False, no_scrollbar: bool =False, horizontal_scrollbar: bool =False, menubar: bool =False, no_scroll_with_mouse: bool =False, **kwargs) -> Union[int, str]: """ Adds an embedded child window. Will show scrollbars when items do not fit. Args: @@ -3160,6 +3163,7 @@ def add_child_window(*, label: str =None, user_data: Any =None, use_internal_lab no_scrollbar (bool, optional): Disable scrollbars (window can still scroll with mouse or programmatically). horizontal_scrollbar (bool, optional): Allow horizontal scrollbar to appear (off by default). menubar (bool, optional): Shows/Hides the menubar at the top. + no_scroll_with_mouse (bool, optional): Disable user vertically scrolling with mouse wheel. id (Union[int, str], optional): (deprecated) Returns: Union[int, str] @@ -7380,7 +7384,7 @@ def add_vline_series(x : Union[List[float], Tuple[float, ...]], *, label: str =N return internal_dpg.add_vline_series(x, label=label, user_data=user_data, use_internal_label=use_internal_label, tag=tag, parent=parent, before=before, source=source, show=show, **kwargs) -def add_window(*, label: str =None, user_data: Any =None, use_internal_label: bool =True, tag: Union[int, str] =0, width: int =0, height: int =0, indent: int =-1, show: bool =True, pos: Union[List[int], Tuple[int, ...]] =[], delay_search: bool =False, min_size: Union[List[int], Tuple[int, ...]] =[100, 100], max_size: Union[List[int], Tuple[int, ...]] =[30000, 30000], menubar: bool =False, collapsed: bool =False, autosize: bool =False, no_resize: bool =False, no_title_bar: bool =False, no_move: bool =False, no_scrollbar: bool =False, no_collapse: bool =False, horizontal_scrollbar: bool =False, no_focus_on_appearing: bool =False, no_bring_to_front_on_focus: bool =False, no_close: bool =False, no_background: bool =False, modal: bool =False, popup: bool =False, no_saved_settings: bool =False, no_open_over_existing_popup: bool =True, on_close: Callable =None, **kwargs) -> Union[int, str]: +def add_window(*, label: str =None, user_data: Any =None, use_internal_label: bool =True, tag: Union[int, str] =0, width: int =0, height: int =0, indent: int =-1, show: bool =True, pos: Union[List[int], Tuple[int, ...]] =[], delay_search: bool =False, min_size: Union[List[int], Tuple[int, ...]] =[100, 100], max_size: Union[List[int], Tuple[int, ...]] =[30000, 30000], menubar: bool =False, collapsed: bool =False, autosize: bool =False, no_resize: bool =False, no_title_bar: bool =False, no_move: bool =False, no_scrollbar: bool =False, no_collapse: bool =False, horizontal_scrollbar: bool =False, no_focus_on_appearing: bool =False, no_bring_to_front_on_focus: bool =False, no_close: bool =False, no_background: bool =False, modal: bool =False, popup: bool =False, no_saved_settings: bool =False, no_open_over_existing_popup: bool =True, no_scroll_with_mouse: bool =False, on_close: Callable =None, **kwargs) -> Union[int, str]: """ Creates a new window for following items to be added to. Args: @@ -7413,6 +7417,7 @@ def add_window(*, label: str =None, user_data: Any =None, use_internal_label: bo popup (bool, optional): Fills area behind window according to the theme, removes title bar, collapse and close. Window can be closed by selecting area in the background behind the window. no_saved_settings (bool, optional): Never load/save settings in .ini file. no_open_over_existing_popup (bool, optional): Don't open if there's already a popup + no_scroll_with_mouse (bool, optional): Disable user vertically scrolling with mouse wheel. on_close (Callable, optional): Callback ran when window is closed. id (Union[int, str], optional): (deprecated) Returns: @@ -7423,7 +7428,7 @@ def add_window(*, label: str =None, user_data: Any =None, use_internal_label: bo warnings.warn('id keyword renamed to tag', DeprecationWarning, 2) tag=kwargs['id'] - return internal_dpg.add_window(label=label, user_data=user_data, use_internal_label=use_internal_label, tag=tag, width=width, height=height, indent=indent, show=show, pos=pos, delay_search=delay_search, min_size=min_size, max_size=max_size, menubar=menubar, collapsed=collapsed, autosize=autosize, no_resize=no_resize, no_title_bar=no_title_bar, no_move=no_move, no_scrollbar=no_scrollbar, no_collapse=no_collapse, horizontal_scrollbar=horizontal_scrollbar, no_focus_on_appearing=no_focus_on_appearing, no_bring_to_front_on_focus=no_bring_to_front_on_focus, no_close=no_close, no_background=no_background, modal=modal, popup=popup, no_saved_settings=no_saved_settings, no_open_over_existing_popup=no_open_over_existing_popup, on_close=on_close, **kwargs) + return internal_dpg.add_window(label=label, user_data=user_data, use_internal_label=use_internal_label, tag=tag, width=width, height=height, indent=indent, show=show, pos=pos, delay_search=delay_search, min_size=min_size, max_size=max_size, menubar=menubar, collapsed=collapsed, autosize=autosize, no_resize=no_resize, no_title_bar=no_title_bar, no_move=no_move, no_scrollbar=no_scrollbar, no_collapse=no_collapse, horizontal_scrollbar=horizontal_scrollbar, no_focus_on_appearing=no_focus_on_appearing, no_bring_to_front_on_focus=no_bring_to_front_on_focus, no_close=no_close, no_background=no_background, modal=modal, popup=popup, no_saved_settings=no_saved_settings, no_open_over_existing_popup=no_open_over_existing_popup, no_scroll_with_mouse=no_scroll_with_mouse, on_close=on_close, **kwargs) def apply_transform(item : Union[int, str], transform : Any, **kwargs) -> None: """ New in 1.1. Applies a transformation matrix to a layer. diff --git a/src/mvAppItem.cpp b/src/mvAppItem.cpp index 4cf240e85..dc262c44a 100644 --- a/src/mvAppItem.cpp +++ b/src/mvAppItem.cpp @@ -2082,6 +2082,7 @@ DearPyGui::GetEntityParser(mvAppItemType type) args.push_back({ mvPyDataType::Bool, "no_scrollbar", mvArgType::KEYWORD_ARG, "False", " Disable scrollbars (window can still scroll with mouse or programmatically)." }); args.push_back({ mvPyDataType::Bool, "horizontal_scrollbar", mvArgType::KEYWORD_ARG, "False", "Allow horizontal scrollbar to appear (off by default)." }); args.push_back({ mvPyDataType::Bool, "menubar", mvArgType::KEYWORD_ARG, "False", "Shows/Hides the menubar at the top." }); + args.push_back({ mvPyDataType::Bool, "no_scroll_with_mouse", mvArgType::KEYWORD_ARG, "False", "Disable user vertically scrolling with mouse wheel." }); setup.about = "Adds an embedded child window. Will show scrollbars when items do not fit."; setup.category = { "Containers", "Widgets" }; @@ -2770,6 +2771,7 @@ DearPyGui::GetEntityParser(mvAppItemType type) args.push_back({ mvPyDataType::Bool, "popup", mvArgType::KEYWORD_ARG, "False", "Fills area behind window according to the theme, removes title bar, collapse and close. Window can be closed by selecting area in the background behind the window." }); args.push_back({ mvPyDataType::Bool, "no_saved_settings", mvArgType::KEYWORD_ARG, "False", "Never load/save settings in .ini file." }); args.push_back({ mvPyDataType::Bool, "no_open_over_existing_popup", mvArgType::KEYWORD_ARG, "True", "Don't open if there's already a popup" }); + args.push_back({ mvPyDataType::Bool, "no_scroll_with_mouse", mvArgType::KEYWORD_ARG, "False", "Disable user vertically scrolling with mouse wheel." }); args.push_back({ mvPyDataType::Callable, "on_close", mvArgType::KEYWORD_ARG, "None", "Callback ran when window is closed." }); diff --git a/src/mvContainers.cpp b/src/mvContainers.cpp index f9185ad17..5a8d0d571 100644 --- a/src/mvContainers.cpp +++ b/src/mvContainers.cpp @@ -68,6 +68,7 @@ DearPyGui::fill_configuration_dict(const mvChildWindowConfig& inConfig, PyObject checkbitset("no_scrollbar", ImGuiWindowFlags_NoScrollbar, inConfig.windowflags); checkbitset("horizontal_scrollbar", ImGuiWindowFlags_HorizontalScrollbar, inConfig.windowflags); checkbitset("menubar", ImGuiWindowFlags_MenuBar, inConfig.windowflags); + checkbitset("no_scroll_with_mouse", ImGuiWindowFlags_NoScrollWithMouse, inConfig.windowflags); } void @@ -202,6 +203,7 @@ DearPyGui::fill_configuration_dict(const mvWindowAppItemConfig& inConfig, PyObje checkbitset("menubar", ImGuiWindowFlags_MenuBar, inConfig.windowflags); checkbitset("no_background", ImGuiWindowFlags_NoBackground, inConfig.windowflags); checkbitset("no_saved_settings", ImGuiWindowFlags_NoSavedSettings, inConfig.windowflags); + checkbitset("no_scroll_with_mouse", ImGuiWindowFlags_NoScrollWithMouse, inConfig.windowflags); } //----------------------------------------------------------------------------- @@ -271,6 +273,7 @@ DearPyGui::set_configuration(PyObject* inDict, mvChildWindowConfig& outConfig) flagop("no_scrollbar", ImGuiWindowFlags_NoScrollbar, outConfig.windowflags); flagop("horizontal_scrollbar", ImGuiWindowFlags_HorizontalScrollbar, outConfig.windowflags); flagop("menubar", ImGuiWindowFlags_MenuBar, outConfig.windowflags); + flagop("no_scroll_with_mouse", ImGuiWindowFlags_NoScrollWithMouse, outConfig.windowflags); } @@ -445,6 +448,7 @@ DearPyGui::set_configuration(PyObject* inDict, mvAppItem& itemc, mvWindowAppItem flagop("menubar", ImGuiWindowFlags_MenuBar, outConfig.windowflags); flagop("no_background", ImGuiWindowFlags_NoBackground, outConfig.windowflags); flagop("no_saved_settings", ImGuiWindowFlags_NoSavedSettings, outConfig.windowflags); + flagop("no_scroll_with_mouse", ImGuiWindowFlags_NoScrollWithMouse, outConfig.windowflags); outConfig._oldxpos = itemc.state.pos.x; outConfig._oldypos = itemc.state.pos.y;