I am using expand with a dialog to let iup calculate the size of a dialog,
issuing a show and setting the minsize from the dialog size, how ever the
size I am getting back is not the same as the actual size on the screen.
The size (on my screen is returned as 640x217, but if I screen grab the
window it's 960x527 (on Windows 7 x64)
I have posted the whole function and caller below.
Am I going about this the wrong way or should this be possible?
--
Jane.
Jane Taubman | www.rjt.org.uk | www.taubman.org.uk |www.fhug.org.uk
--Creates a simple dialog.
----------------------------------------------------- Start Search Replace
Prompt
function srPrompt(txtType,strFrom,strTo,bConfirm)
local btn_ok = iup.button { title="Ok",padding = '5x5',size='50'}
local btn_skip = iup.button { title="Skip",padding = '5x5',size='50'}
local btn_cancel = iup.button { title="Cancel",padding = '5x5',size='50'}
local inp_from_string = iup.text{expand="HORIZONTAL",minsize='200'}
local inp_to_string = iup.text{expand="HORIZONTAL"}
local inp_confirm = iup.toggle {'1'}
if txtType == "M" then
inp_from_string.multiline = 'YES'
inp_from_string.size = '0x80'
inp_from_string.wordwrap = 'YES'
inp_to_string.multiline = 'YES'
inp_to_string.size = '0x80'
inp_to_string.wordwrap = 'YES'
end
local bSkip = false
local bQuit = false
local vbox = iup.vbox {
iup.label {title="Original"},
inp_from_string,
iup.label {title="Replacement"},
inp_to_string,
iup.hbox {
iup.label {title="Confirm All Replacements"},
inp_confirm},
iup.hbox{
btn_ok,btn_skip,btn_cancel,expandchildren = 'YES', expand="YES"},
expandchildren = 'YES', alignment = 'ACENTER', gap = '10', margin =
'10x10',expand="YES"
}
local dlg = iup.dialog{vbox;expandchildren = 'YES', title="Search and
Replace",size="HALF", startfocus=btn_ok}
function btn_ok:action(dlg)
return iup.CLOSE
end
function btn_skip:action(dlg)
bSkip = true
return iup.CLOSE
end
function btn_cancel:action(dlg)
bQuit = true
return iup.CLOSE
end
inp_from_string.value = strFrom
inp_to_string.value = strTo
if bConfirm then
inp_confirm.value = 'ON'
else
inp_confirm.value = 'OFF'
end
dlg:show()
print (dlg.size)
dlg.minsize = dlg.size
iup.MainLoop()
strFrom = inp_from_string.value
strTo = inp_to_string.value
bConfirm = (inp_confirm.value == 'ON')
dlg:destroy()
return strFrom,strTo,bConfirm,bSkip,bQuit
end
----------------------------------------------------- End Search Replace
Prompt
bSkip = false
bQuit = false
bConfirm = true
frmString,toString,bConfirm,bSkip,bQuit =
srPrompt('M',frmString,toString,bConfirm)
print(frmString,toString,bSkip,bQuit,bConfirm)
------------------------------------------------------------------------------
Got Input? Slashdot Needs You.
Take our quick survey online. Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users