Skip to content

Commit

Permalink
added clear buttons to load field dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
aoterodelaroza committed Nov 25, 2024
1 parent c440068 commit cf0f7f4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.339
1.2.340
2 changes: 1 addition & 1 deletion src/gui/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ module subroutine window_draw(w)
elseif (w%type == wintype_load_field) then
w%name = "Load Field##" // string(w%id) // c_null_char
w%flags = ImGuiWindowFlags_None
inisize%x = 60 * fontsize%x
inisize%x = 65 * fontsize%x
inisize%y = 16 * fontsize%y
call igSetNextWindowSize(inisize,ImGuiCond_FirstUseEver)
elseif (w%type == wintype_scfplot) then
Expand Down
28 changes: 28 additions & 0 deletions src/gui/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,18 @@ module subroutine draw_load_field(w)
idcaller=w%id,itoken=itoken_file1)
end if
call iw_tooltip("File from where the field is read",ttshown)
if (len(file1) > 0) then
if (iw_button("Clear##clearfile1",sameline=.true.,danger=.true.)) then
file1_format = 0
file1 = ""
file1_set = .false.
file1_fmtstr = ""
file2 = ""
file2_set = .false.
file3 = ""
file3_set = .false.
end if
end if
call iw_text(file1,sameline=.true.)

isgrid = .false.
Expand Down Expand Up @@ -2037,27 +2049,43 @@ module subroutine draw_load_field(w)
idcaller=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
if (iw_button("Clear##clearfile2",sameline=.true.,danger=.true.)) &
file2 = ""
end if
call iw_text(file2,sameline=.true.)
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)
end if
call iw_tooltip("GEOMETRY.OUT structure file used to interpret the STATE.OUT",ttshown)
if (len(file2) > 0) then
if (iw_button("Clear##clearfile3",sameline=.true.,danger=.true.)) &
file2 = ""
end if
call iw_text(file2,sameline=.true.)
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)
end if
call iw_tooltip("eigenvec.bin file for reading the DFTB+ wavefunction",ttshown)
if (len(file2) > 0) then
if (iw_button("Clear##clearfile4",sameline=.true.,danger=.true.)) &
file2 = ""
end if
call iw_text(file2,sameline=.true.)

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)
end if
call iw_tooltip("hsd file for reading the DFTB+ wavefunction",ttshown)
if (len(file3) > 0) then
if (iw_button("Clear##clearfile5",sameline=.true.,danger=.true.)) &
file3 = ""
end if
call iw_text(file3,sameline=.true.)
end select

Expand Down

0 comments on commit cf0f7f4

Please sign in to comment.