通过GetParm回调触发OK。

我正在使用IUP.GetParm对话框来执行搜索和替换提示。该对话框支持3个按钮,前两个按钮“确定”和“取消”关闭提示并返回到主程序流程。

第三个按钮可以在parm_action函数中跟踪,我想要做的是使用第三个按钮跳过该项并关闭对话框,但我无法确定这是否可行。

我已在IUP邮件列表上询问,但尚未得到回复。

function param_action(dialog,index)
   if index == -4 then
    bSkip = true
    return 1
   end
end
    bSkip = false
    bConfirm,strFromString,strToString,bSkip =
    iup.GetParam("Search and Replace",
    param_action,
    fhGetTag(ptrRecord)..'-'..fhGetTag(ptr)..
    ' '..fhGetDisplayText(ptrRecord).." %t\n"..
    "Replace: "..strBoxType.."\n"..
    "With: "..strBoxType.."\n"..
    "btn: %u[Ok,Cancel,Skip] \n"
    , strFromString,strToString)
    if bConfirm  and not(bSkip) then
       --  replace string
    end

要使此函数当前,您必须按“跳过”按钮,然后按“确定”按钮。

原文链接 https://stackoverflow.com/questions/6832895

点赞
stackoverflow用户1898478
stackoverflow用户1898478

将 IUP 邮件列表中的答案转发到这里:

在回调函数中,当第三个按钮被按下时,将对话框属性“status”设置为“1”,然后调用函数 iup.ExitLoop()。

2012-12-17 17:36:15