When opening VisuDialogs.Numpad with VU.FbOpenDialogExtended everything appears to work as expected except for the OK button. The button, if pressed, seems to do nothing - even though the input action for the button on VisuDialogs.Numpad is to close the dialogue.
I'm assuming that because there are checks to be made on the limits of the number entered the OK button can't simply exit, but highlights the min/max labels as red without closing the dialogue if the entered number is out of bounds, just like in the normal use of Numpad when a button is pressed.
The reason I'm looking at this is to be able to open a numpad from a table cell selection for editing the cell value.
Last edit: sean-barton 2022-08-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am getting close to a solution, but with a problem updating the dialogue for feedback.
Using the dialogue manager, I grab the interface to the dialogue and I can then update the dialogue visualization structure and set this update back on the dialogue. The trouble is, I can see the values are copied to the dialogue interface but they are quickly overwritten back to the previous values. How do I make the values of the updated dialogue structure "stick" to the dialogue?
I mainly want to update the dialogue flags to show if a value entered is within set bounds.
Apart from this problem, the dialogue updates the cell value properly and if the value entered is out of bounds, pressing the OK button does nothing. It just doesn't provide feedback as to the fact that the value is out of bounds.
Last edit: sean-barton 2022-08-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Alright! I now have a fully functional VisuDialogs.Numpad with feedback using the VU.FbOpenDialogExtended. The solution to the above problem was to update the dialogue using the dialogue manager (instead of the dialogue interface) with an intermediate structure for type conversions from the dialogue interface - because the interface uses STRING instead of WSTRING (which the dialogue manager expects.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am new to Codesys/Twincat and i have a similar kind of problem.
Created my own visualization object and (use Visualization) chnaged it to NUMPAD type. I have to do this to change the Font on the NUMPAD to make it better visible. Everything works like the Visudialog.Numpad except the limit check that changes the min/max labels to red color when an input variable boundary check fails. Can you please guide me what went wrong with my chnage.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What I did was to test if the entered value was in range of the min/max for the numpad I created, updating the flags variable of a temporary structure for the numpad. I then wrote this temporary structure back to the numpad through the dialogue manager using the SetDialogInterfaceValues method.
I also interrupted the closing of the numpad if the value was outside this min/max range by sending the ENUM of "None" (VisuElems.VisuElemBase.Visu_DialogResult.None) to the dialogue interface reference using it's SetResult method, so the updated red text (as updated by the numpad visu based on the flags) could be seen.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The Numpad object closing was interupted like the normal VisuDialog.Numpad and stays where it is. Only the text changing to RED is missing due to flags value which was lost. can you please provide me the example "dialogue manager using the SetDialogInterfaceValues method".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I try to log the changes in Numpad (upon Ok button pressed) that an Element name/Element text variable is changed from so to so.
How to get the Element name (or text fields Text Variable) from where the Numpad is called? Numpad is Invoked from Inputconfiguration->onMouseDown->Write a variable.
Thanks
Last edit: hemuv 2024-11-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When opening VisuDialogs.Numpad with VU.FbOpenDialogExtended everything appears to work as expected except for the OK button. The button, if pressed, seems to do nothing - even though the input action for the button on VisuDialogs.Numpad is to close the dialogue.
I'm assuming that because there are checks to be made on the limits of the number entered the OK button can't simply exit, but highlights the min/max labels as red without closing the dialogue if the entered number is out of bounds, just like in the normal use of Numpad when a button is pressed.
The reason I'm looking at this is to be able to open a numpad from a table cell selection for editing the cell value.
Last edit: sean-barton 2022-08-17
I am getting close to a solution, but with a problem updating the dialogue for feedback.
Using the dialogue manager, I grab the interface to the dialogue and I can then update the dialogue visualization structure and set this update back on the dialogue. The trouble is, I can see the values are copied to the dialogue interface but they are quickly overwritten back to the previous values. How do I make the values of the updated dialogue structure "stick" to the dialogue?
I mainly want to update the dialogue flags to show if a value entered is within set bounds.
Apart from this problem, the dialogue updates the cell value properly and if the value entered is out of bounds, pressing the OK button does nothing. It just doesn't provide feedback as to the fact that the value is out of bounds.
Last edit: sean-barton 2022-08-22
Alright! I now have a fully functional VisuDialogs.Numpad with feedback using the VU.FbOpenDialogExtended. The solution to the above problem was to update the dialogue using the dialogue manager (instead of the dialogue interface) with an intermediate structure for type conversions from the dialogue interface - because the interface uses STRING instead of WSTRING (which the dialogue manager expects.)
Please publish code snippet for this case.
Hi Barton,
I am new to Codesys/Twincat and i have a similar kind of problem.
Created my own visualization object and (use Visualization) chnaged it to NUMPAD type. I have to do this to change the Font on the NUMPAD to make it better visible. Everything works like the Visudialog.Numpad except the limit check that changes the min/max labels to red color when an input variable boundary check fails. Can you please guide me what went wrong with my chnage.
What I did was to test if the entered value was in range of the min/max for the numpad I created, updating the flags variable of a temporary structure for the numpad. I then wrote this temporary structure back to the numpad through the dialogue manager using the SetDialogInterfaceValues method.
I also interrupted the closing of the numpad if the value was outside this min/max range by sending the ENUM of "None" (VisuElems.VisuElemBase.Visu_DialogResult.None) to the dialogue interface reference using it's SetResult method, so the updated red text (as updated by the numpad visu based on the flags) could be seen.
Hello Barton,
Thank you for the quick responce.
The Numpad object closing was interupted like the normal VisuDialog.Numpad and stays where it is. Only the text changing to RED is missing due to flags value which was lost. can you please provide me the example "dialogue manager using the SetDialogInterfaceValues method".
Attached is an example that works for me.
Hello Barton,
I try to log the changes in Numpad (upon Ok button pressed) that an Element name/Element text variable is changed from so to so.
How to get the Element name (or text fields Text Variable) from where the Numpad is called? Numpad is Invoked from Inputconfiguration->onMouseDown->Write a variable.
Thanks
Last edit: hemuv 2024-11-07