2

I am using the IUP.GetParm dialog to 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.

Jane T
  • 2,081
  • 2
  • 17
  • 23

1 Answers1

0

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().

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
Antonio Scuri
  • 1,046
  • 6
  • 10
  • 1
    Welcome to Stack Overflow! Please do not use signatures/taglines in your posts. Your user box counts as your signature, and you can use your profile to post any information about yourself you like. [FAQ on signatures/taglines](http://stackoverflow.com/faq#signatures) – Andrew Barber Dec 17 '12 at 17:36
  • Sorry, new user here. Just noticed that you fixed other posts I did too. Thanks. – Antonio Scuri Dec 17 '12 at 19:24