Skip to content

Commit

Permalink
started tools menu
Browse files Browse the repository at this point in the history
  • Loading branch information
aoterodelaroza committed Nov 24, 2024
1 parent 5afefa4 commit addfeda
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.335
1.2.336
29 changes: 23 additions & 6 deletions src/gui/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ subroutine show_main_menu()
iwin_console_output, iwin_about, stack_create_window, wintype_dialog,&
wpurp_dialog_openfiles, wintype_new_struct, wintype_new_struct_library,&
wintype_preferences, wintype_view, wpurp_view_alternate,&
wintype_about
wintype_about, wintype_geometry
use utils, only: igIsItemHovered_delayed, iw_tooltip, iw_text, iw_calcwidth
use keybindings, only: BIND_QUIT, BIND_OPEN, BIND_NEW, get_bind_keyname, is_bind_event
use interfaces_glfw, only: GLFW_TRUE, glfwSetWindowShouldClose
Expand All @@ -827,7 +827,8 @@ subroutine show_main_menu()
character(kind=c_char,len=:), allocatable, target :: str1, str2
integer(c_int) :: idum
logical :: launchquit, launch(4)
integer :: iaux
logical(c_bool) :: system_ok
integer :: isys

logical, save :: ttshown = .false. ! tooltip flag

Expand Down Expand Up @@ -882,7 +883,7 @@ subroutine show_main_menu()
! Edit -> Preferences...
str1 = "Preferences..." // c_null_char
if (igMenuItem_Bool(c_loc(str1),c_null_ptr,.false._c_bool,.true._c_bool)) &
iaux = stack_create_window(wintype_preferences,.true.,orraise=-1)
idum = stack_create_window(wintype_preferences,.true.,orraise=-1)
call iw_tooltip("Change the user interface settings and key bindings",ttshown)

call igEndMenu()
Expand Down Expand Up @@ -931,6 +932,22 @@ subroutine show_main_menu()
ttshown = .false.
end if

! Windows
str1 = "Tools" // c_null_char
if (igBeginMenu(c_loc(str1),.true._c_bool)) then
str2 = "View/Edit Geometry..." // c_null_char
isys = win(iwin_tree)%table_selected
system_ok = (isys > 0 .and. isys <= nsys)
if (system_ok) system_ok = (sysc(isys)%status == sys_init)
if (igMenuItem_Bool(c_loc(str2),c_null_ptr,.false._c_bool,system_ok)) &
idum = stack_create_window(wintype_geometry,.true.,isys=isys,orraise=-1)
call iw_tooltip("View and edit the atomic positions, bonds, etc.",ttshown)

call igEndMenu()
else
ttshown = .false.
end if

! Help
str1 = "Help" // c_null_char
if (igBeginMenu(c_loc(str1),.true._c_bool)) then
Expand Down Expand Up @@ -965,11 +982,11 @@ subroutine show_main_menu()

! process launches
if (launch(d_new)) &
iaux = stack_create_window(wintype_new_struct,.true.,orraise=-1)
idum = stack_create_window(wintype_new_struct,.true.,orraise=-1)
if (launch(d_newlib)) &
iaux = stack_create_window(wintype_new_struct_library,.true.,orraise=-1)
idum = stack_create_window(wintype_new_struct_library,.true.,orraise=-1)
if (launch(d_open)) &
iaux = stack_create_window(wintype_dialog,.true.,wpurp_dialog_openfiles,orraise=-1)
idum = stack_create_window(wintype_dialog,.true.,wpurp_dialog_openfiles,orraise=-1)
if (launchquit) then
if (are_threads_running()) &
call kill_initialization_thread()
Expand Down
2 changes: 1 addition & 1 deletion src/gui/scenes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module scenes
real(c_float), allocatable :: rgb(:,:) ! color (3,ntype)
real(c_float), allocatable :: rad(:) ! radius (ntype)
real(c_float) :: border_size = 0._c_float ! border size
real(c_float) :: rgbborder(3) ! border color
real(c_float) :: rgbborder(3) ! border color
end type draw_style_atom
public :: draw_style_atom

Expand Down
2 changes: 1 addition & 1 deletion src/gui/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ subroutine write_maybe_selectable(isys,tooltipstr)
strpop = "System" // c_null_char
if (igBeginMenu(c_loc(strpop),.true._c_bool)) then
! Geometry
strpop = "Geometry" // c_null_char
strpop = "View/Edit Geometry" // c_null_char
if (igMenuItem_Bool(c_loc(strpop),c_null_ptr,.false._c_bool,enabled)) &
idgeometry = stack_create_window(wintype_geometry,.true.,isys=isys,orraise=-1)
call iw_tooltip("View and edit the atomic positions, bonds, etc.",ttshown)
Expand Down

0 comments on commit addfeda

Please sign in to comment.