How can I configure Popup propmpt for push button in PG2?
What is the requirement is if I click on push button one popup prompt should appear, and there will be 'Ok' and 'Cancel' button to execute the proper operation as required.
In VB graphics it is possible to write code for the popup prompt using 'MsgBox'.
But in PG2 graphics I am not abale to create such confirmation popup window.
Whether it is possible in PG2?
Voted best answer
Can't attach file in comment so I post it as a new answer:
You do not need to specify value for the push button in this case. Keep value property is "empty".
Instead you need specify that value in the property writer that must be called from Item1Name (OK).
Example: suppose the target name is "Your_Target" and it's boolean type.
Add two propery writers for your graphic display: right-click in the item root and select Add Element Item Hosted Input Item -> Property Writer.
By clicking "OK" from popup menue we want to write to the target TRUE if initial value is FALSE and vise versa.
Also, we need avoid writing if target is read-only. Then change the properties of property writer as follow:
Enabled = Your_Target#IsWritable
Event = OnDemand
Name = PW_OK
Target = Your_Target
Value = !Your_Target
Ok. Now switch to the popup menu and set up Item1Name and Item2Name as follow:
Entry1Name = ItemEntry("PW_OK", "OK", True)
Entry2Name = ItemEntry("anything", "Cancel", True)
See example in the attached afw (for 800xA 5.1).
P.S. This is just an example to let your know how to call popup mene and write a value.
I'm sure I had miss something and you must debug and improve very well before put into operation.