Skip to content

Commit

Permalink
idcaller -> idparent
Browse files Browse the repository at this point in the history
  • Loading branch information
aoterodelaroza committed Nov 25, 2024
1 parent 23fcbf8 commit 17eb6fe
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.341
1.2.342
4 changes: 2 additions & 2 deletions src/gui/scenes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,9 @@ recursive module subroutine scene_copy_cam(s,si,idx)
type(scene), intent(in), target, optional :: si
integer, intent(in), optional :: idx
end subroutine scene_copy_cam
module function representation_menu(s,idcaller) result(changed)
module function representation_menu(s,idparent) result(changed)
class(scene), intent(inout), target :: s
integer(c_int), intent(in) :: idcaller
integer(c_int), intent(in) :: idparent
logical :: changed
end function representation_menu
module function get_new_representation_id(s) result(id)
Expand Down
8 changes: 4 additions & 4 deletions src/gui/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -824,15 +824,15 @@ end subroutine scene_copy_cam

!> Show the representation menu (called from view). Return .true.
!> if the scene needs to be rendered again.
module function representation_menu(s,idcaller) result(changed)
module function representation_menu(s,idparent) result(changed)
use interfaces_cimgui
use utils, only: iw_text, iw_tooltip, iw_button, iw_checkbox
use windows, only: stack_create_window, wintype_editrep, update_window_id
use gui_main, only: ColorDangerButton, g
use tools_io, only: string
use tools, only: mergesort
class(scene), intent(inout), target :: s
integer(c_int), intent(in) :: idcaller
integer(c_int), intent(in) :: idparent
logical :: changed

integer :: i, ii, id, ll, idum
Expand Down Expand Up @@ -901,7 +901,7 @@ module function representation_menu(s,idcaller) result(changed)
! edit
str2 = "Edit" // c_null_char
if (igMenuItem_Bool(c_loc(str2),c_null_ptr,.false._c_bool,.true._c_bool)) then
idum = stack_create_window(wintype_editrep,.true.,isys=s%id,irep=i,idcaller=idcaller,&
idum = stack_create_window(wintype_editrep,.true.,isys=s%id,irep=i,idparent=idparent,&
orraise=-1)
end if
call iw_tooltip("Edit this object",ttshown)
Expand Down Expand Up @@ -971,7 +971,7 @@ module function representation_menu(s,idcaller) result(changed)
! edit button
if (igTableSetColumnIndex(ic_editbutton)) then
if (iw_button("Edit##2ic_editbutton" // string(ic_editbutton) // "," // string(i))) then
idum = stack_create_window(wintype_editrep,.true.,isys=s%id,irep=i,idcaller=idcaller,&
idum = stack_create_window(wintype_editrep,.true.,isys=s%id,irep=i,idparent=idparent,&
orraise=-1)
end if
end if
Expand Down
8 changes: 4 additions & 4 deletions src/gui/windows.f90
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ module subroutine command_end(c)
end subroutine command_end
module subroutine stack_realloc_maybe()
end subroutine stack_realloc_maybe
module function stack_create_window(type,isopen,purpose,isys,irep,idcaller,itoken,permanent,orraise)
module function stack_create_window(type,isopen,purpose,isys,irep,idparent,itoken,permanent,orraise)
integer, intent(in) :: type
logical, intent(in) :: isopen
integer, intent(in), optional :: purpose
integer, intent(in), optional :: isys
integer, intent(in), optional :: irep
integer, intent(in), optional :: idcaller
integer, intent(in), optional :: idparent
integer, intent(in), optional :: itoken
logical, intent(in), optional :: permanent
integer, intent(in), optional :: orraise
Expand All @@ -293,15 +293,15 @@ module subroutine update_window_id(id,changed)
end subroutine update_window_id
module subroutine regenerate_window_pointers()
end subroutine regenerate_window_pointers
module subroutine window_init(w,type,isopen,id,purpose,isys,irep,idcaller,itoken)
module subroutine window_init(w,type,isopen,id,purpose,isys,irep,idparent,itoken)
class(window), intent(inout), target :: w
integer, intent(in) :: type
logical, intent(in) :: isopen
integer, intent(in) :: id
integer, intent(in), optional :: purpose
integer, intent(in), optional :: isys
integer, intent(in), optional :: irep
integer, intent(in), optional :: idcaller
integer, intent(in), optional :: idparent
integer, intent(in), optional :: itoken
end subroutine window_init
module subroutine window_end(w)
Expand Down
2 changes: 1 addition & 1 deletion src/gui/windows@new_struct.f90
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ module subroutine draw_new_struct_from_library(w)
call iw_text("Source",highlight=.true.)
if (iw_button("Library file")) then
idum = stack_create_window(wintype_dialog,.true.,wpurp_dialog_openlibraryfile,&
idcaller=w%id,orraise=-1)
idparent=w%id,orraise=-1)
end if
call iw_tooltip("Library file from where the structures are read",ttshown)
call iw_text(w%okfile,sameline=.true.)
Expand Down
34 changes: 17 additions & 17 deletions src/gui/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -282,20 +282,20 @@ end subroutine stack_realloc_maybe
!> Create a window in the window stack with the given type. Returns
!> the window ID. If isopen, initialize the window as open. purpose =
!> for dialogs, purpose of the dialog. isys = associated system.
!> irep = associated representation. idcaller = window ID of the
!> irep = associated representation. idparent = window ID of the
!> caller. permanent = do not kill the window when closed.
!> orraise = if this is a valid window ID, raise the window instead
!> of creating a new one; if orraise < 0, raise the first window
!> from the stack with the same type as type.
module function stack_create_window(type,isopen,purpose,isys,irep,idcaller,itoken,permanent,orraise)
module function stack_create_window(type,isopen,purpose,isys,irep,idparent,itoken,permanent,orraise)
use tools_io, only: ferror, faterr
use windows, only: window, nwin, win
integer, intent(in) :: type
logical, intent(in) :: isopen
integer, intent(in), optional :: purpose
integer, intent(in), optional :: isys
integer, intent(in), optional :: irep
integer, intent(in), optional :: idcaller
integer, intent(in), optional :: idparent
integer, intent(in), optional :: itoken
logical, intent(in), optional :: permanent
integer, intent(in), optional :: orraise
Expand All @@ -314,8 +314,8 @@ module function stack_create_window(type,isopen,purpose,isys,irep,idcaller,itoke
ok = win(i)%type == type .and. win(i)%isopen
! specific tests according to type
if (ok.and.type == wintype_dialog.and.present(purpose)) ok = (win(i)%dialog_data%purpose == purpose)
if (ok.and.type == wintype_editrep.and.present(isys).and.present(irep).and.present(idcaller)) then
ok = (win(i)%isys == isys .and. win(i)%irep == irep .and. win(i)%idparent == idcaller)
if (ok.and.type == wintype_editrep.and.present(isys).and.present(irep).and.present(idparent)) then
ok = (win(i)%isys == isys .and. win(i)%irep == irep .and. win(i)%idparent == idparent)
if (ok.and.present(itoken)) &
ok = (win(i)%itoken == itoken)
end if
Expand All @@ -334,7 +334,7 @@ module function stack_create_window(type,isopen,purpose,isys,irep,idcaller,itoke
stack_create_window = raiseid
if (present(isys)) win(raiseid)%isys = isys
if (present(irep)) win(raiseid)%irep = irep
if (present(idcaller)) win(raiseid)%idparent = idcaller
if (present(idparent)) win(raiseid)%idparent = idparent
if (present(itoken)) win(raiseid)%itoken = itoken
call igSetWindowFocus_Str(c_loc(win(raiseid)%name))
return
Expand All @@ -361,7 +361,7 @@ module function stack_create_window(type,isopen,purpose,isys,irep,idcaller,itoke
call ferror('stack_create_window','too many windows',faterr)

! initialize the new window
call win(id)%init(type,isopen,id,purpose,isys,irep,idcaller,itoken)
call win(id)%init(type,isopen,id,purpose,isys,irep,idparent,itoken)
if (present(permanent)) then
win(id)%permanent = permanent
else
Expand Down Expand Up @@ -415,7 +415,7 @@ end subroutine regenerate_window_pointers

!> Initialize a window of the given type. If isiopen, initialize it
!> as open.
module subroutine window_init(w,type,isopen,id,purpose,isys,irep,idcaller,itoken)
module subroutine window_init(w,type,isopen,id,purpose,isys,irep,idparent,itoken)
use interfaces_opengl3
use gui_main, only: ColorDialogDir, ColorDialogFile
use tools_io, only: ferror, faterr
Expand All @@ -427,7 +427,7 @@ module subroutine window_init(w,type,isopen,id,purpose,isys,irep,idcaller,itoken
integer, intent(in), optional :: purpose
integer, intent(in), optional :: isys
integer, intent(in), optional :: irep
integer, intent(in), optional :: idcaller
integer, intent(in), optional :: idparent
integer, intent(in), optional :: itoken

character(kind=c_char,len=:), allocatable, target :: str1
Expand Down Expand Up @@ -468,7 +468,7 @@ module subroutine window_init(w,type,isopen,id,purpose,isys,irep,idcaller,itoken
w%plotn = 0
if (present(isys)) w%isys = isys
if (present(irep)) w%irep = irep
if (present(idcaller)) w%idparent = idcaller
if (present(idparent)) w%idparent = idparent
if (present(itoken)) w%itoken = itoken
if (present(purpose)) w%dialog_purpose = purpose

Expand Down Expand Up @@ -496,17 +496,17 @@ module subroutine window_init(w,type,isopen,id,purpose,isys,irep,idcaller,itoken
call ferror('window_init','editrep requires isys',faterr)
if (.not.present(irep)) &
call ferror('window_init','editrep requires irep',faterr)
if (.not.present(idcaller)) &
call ferror('window_init','editrep requires idcaller',faterr)
w%rep => win(idcaller)%sc%rep(irep)
if (.not.present(idparent)) &
call ferror('window_init','editrep requires idparent',faterr)
w%rep => win(idparent)%sc%rep(irep)
elseif (type == wintype_exportimage) then
! export image window
if (.not.present(idcaller)) &
call ferror('window_init','exportimage requires idcaller',faterr)
if (.not.present(idparent)) &
call ferror('window_init','exportimage requires idparent',faterr)
elseif (type == wintype_exportimage) then
! vibrations window
if (.not.present(idcaller)) &
call ferror('window_init','vibrations requires idcaller',faterr)
if (.not.present(idparent)) &
call ferror('window_init','vibrations requires idparent',faterr)
elseif (type == wintype_view) then
! view window
if (.not.present(purpose)) &
Expand Down
12 changes: 6 additions & 6 deletions src/gui/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ module subroutine draw_tree(w)
! button: plot
str = "Plot" // c_null_char
if (igMenuItem_Bool(c_loc(str),c_null_ptr,.false._c_bool,.true._c_bool)) &
iaux = stack_create_window(wintype_treeplot,.true.,idcaller=w%id,orraise=-1)
iaux = stack_create_window(wintype_treeplot,.true.,idparent=w%id,orraise=-1)
call iw_tooltip("Plot the tree data",ttshown)
call igSeparator()

Expand Down Expand Up @@ -1917,7 +1917,7 @@ module subroutine draw_load_field(w)
call iw_text("Source",highlight=.true.)
if (iw_button("File",danger=(file1_format==0))) then
iaux = stack_create_window(wintype_dialog,.true.,wpurp_dialog_openfieldfile,&
idcaller=w%id,itoken=itoken_file1)
idparent=w%id,itoken=itoken_file1)
end if
call iw_tooltip("File from where the field is read",ttshown)
if (len(file1) > 0) then
Expand Down Expand Up @@ -2046,7 +2046,7 @@ module subroutine draw_load_field(w)
case(ifformat_wien)
if (iw_button("File (.struct)",danger=.not.file2_set,disabled=disabled)) then
iaux = stack_create_window(wintype_dialog,.true.,wpurp_dialog_openonefilemodal,&
idcaller=w%id,itoken=itoken_file2)
idparent=w%id,itoken=itoken_file2)
end if
call iw_tooltip("WIEN2k structure file (.struct) used to interpret the clmsum-style file",ttshown)
if (len(file2) > 0) then
Expand All @@ -2057,7 +2057,7 @@ module subroutine draw_load_field(w)
case(ifformat_elk)
if (iw_button("File (GEOMETRY.OUT)",danger=.not.file2_set,disabled=disabled)) then
iaux = stack_create_window(wintype_dialog,.true.,wpurp_dialog_openonefilemodal,&
idcaller=w%id,itoken=itoken_file2)
idparent=w%id,itoken=itoken_file2)
end if
call iw_tooltip("GEOMETRY.OUT structure file used to interpret the STATE.OUT",ttshown)
if (len(file2) > 0) then
Expand All @@ -2068,7 +2068,7 @@ module subroutine draw_load_field(w)
case(ifformat_dftb)
if (iw_button("File (.bin)",danger=.not.file2_set,disabled=disabled)) then
iaux = stack_create_window(wintype_dialog,.true.,wpurp_dialog_openonefilemodal,&
idcaller=w%id,itoken=itoken_file2)
idparent=w%id,itoken=itoken_file2)
end if
call iw_tooltip("eigenvec.bin file for reading the DFTB+ wavefunction",ttshown)
if (len(file2) > 0) then
Expand All @@ -2079,7 +2079,7 @@ module subroutine draw_load_field(w)

if (iw_button("File (.hsd)",danger=.not.file3_set,disabled=disabled)) then
iaux = stack_create_window(wintype_dialog,.true.,wpurp_dialog_openonefilemodal,&
idcaller=w%id,itoken=itoken_file3)
idparent=w%id,itoken=itoken_file3)
end if
call iw_tooltip("hsd file for reading the DFTB+ wavefunction",ttshown)
if (len(file3) > 0) then
Expand Down
6 changes: 3 additions & 3 deletions src/gui/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -601,13 +601,13 @@ module subroutine draw_view(w)
str2 = "Export to Image..." // c_null_char
enabled = associated(w%sc)
if (igMenuItem_Bool(c_loc(str2),c_null_ptr,.false._c_bool,enabled)) then
iaux = stack_create_window(wintype_exportimage,.true.,idcaller=w%id,orraise=-1)
iaux = stack_create_window(wintype_exportimage,.true.,idparent=w%id,orraise=-1)
end if
call iw_tooltip("Export the current view to an image file (png)",ttshown)

str2 = "Vibrations..." // c_null_char
if (igMenuItem_Bool(c_loc(str2),c_null_ptr,.false._c_bool,enabled)) then
iaux = stack_create_window(wintype_vibrations,.true.,idcaller=w%id,orraise=-1)
iaux = stack_create_window(wintype_vibrations,.true.,idparent=w%id,orraise=-1)
end if
call iw_tooltip("Display an animation showing the atomic vibrations for this system",ttshown)
call igEndPopup()
Expand Down Expand Up @@ -2648,7 +2648,7 @@ module subroutine draw_exportimage(w)
! Image file button
call iw_text("Image File",highlight=.true.)
if (iw_button("File",danger=.true.)) &
iaux = stack_create_window(wintype_dialog,.true.,wpurp_dialog_saveimagefile,idcaller=w%id,orraise=-1)
iaux = stack_create_window(wintype_dialog,.true.,wpurp_dialog_saveimagefile,idparent=w%id,orraise=-1)
call iw_tooltip("Choose the file to save the image to",ttshown)
call iw_text(w%okfile,sameline=.true.)

Expand Down

0 comments on commit 17eb6fe

Please sign in to comment.