Skip to content

Commit

Permalink
close option in menu/file
Browse files Browse the repository at this point in the history
  • Loading branch information
aoterodelaroza committed Nov 25, 2024
1 parent 1617a67 commit c020f82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.348
1.2.349
12 changes: 10 additions & 2 deletions src/gui/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,9 @@ subroutine show_main_menu()
! File
str1 = "File" // c_null_char
if (igBeginMenu(c_loc(str1),.true._c_bool)) then
! The operations in this menu apply to the tree selected system
isys = win(iwin_tree)%tree_selected
isysok = ok_system(isys,sys_init)

! File -> New
launch(d_new) = launch(d_new) .or. iw_menuitem("New...",BIND_NEW)
Expand All @@ -869,12 +872,15 @@ subroutine show_main_menu()
launch(d_open) = launch(d_open) .or. iw_menuitem("Open...",BIND_OPEN)
call iw_tooltip("Read molecular or crystal structures from external file(s)",ttshown)

! File -> Close
if (iw_menuitem("Close",enabled=isysok)) &
win(iwin_tree)%forceremove = (/isys/)
call iw_tooltip("Close the current system",ttshown)

! File -> Separator
call igSeparator()

! File -> Load Field
isys = win(iwin_tree)%tree_selected
isysok = ok_system(isys,sys_init)
if (iw_menuitem("Load Field...",enabled=isysok)) &
idum = stack_create_window(wintype_load_field,.true.,isys=isys,orraise=-1)
call iw_tooltip("Load a scalar field for the current system",ttshown)
Expand Down Expand Up @@ -950,8 +956,10 @@ subroutine show_main_menu()
! Windows
str1 = "Tools" // c_null_char
if (igBeginMenu(c_loc(str1),.true._c_bool)) then
! The operations in this menu apply to the view selected system
isys = win(iwin_view)%view_selected
isysok = ok_system(isys,sys_init)

launch(d_geometry) = launch(d_geometry) .or. &
iw_menuitem("View/Edit Geometry...",BIND_GEOMETRY,enabled=isysok)
call iw_tooltip("View and edit the atomic positions, bonds, etc.",ttshown)
Expand Down

0 comments on commit c020f82

Please sign in to comment.