开发者

Triggering OK from the call back on GetParm

I am using the IUP.GetParm dialog t开发者_如何学运维o do a search and replace prompt. The dialog supports 3 buttons, the first two OK and Cancel close the prompt and return to the main program flow.

The third button can be tracked in the parm_action function, what I want to do is use the third button to skip the item and close the dialog, but I can't work out if this is possible.

I have asked this on the IUP mailing list but have not yet had a response.

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

To make this function currently you have to press the Skip button and then the Ok button.


Just re-posting the answer from the IUP mailing list here:

Inside the call-back, when the 3rd button is pressed, set the dialog attribute "status" to "1" and call the function iup.ExitLoop().

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜