paul.coshott Posted July 1, 2019 Share Posted July 1, 2019 Hi All, As I'm new to uniGUI, I wrote my first web app using just pascal. Now i have the app hosted, it's easy to see where the interface needs speeding up. So I need to replace some pascal event handlers with JS code. Other than asking on these forums what JS code is needed to replace the pascal code, is there anywhere else I can learn the JS calls I can use in uniGUI? For today though, I have 2 panels that allow the user to choose between AM and PM. When they click the panel, it changes color to the selected color, and changes the other panel's color to the unselected color. How and where do I do the following in JS? procedure TfTimeEditor.pAMClick(Sender: TObject); begin panelAM.Color := $0048B9F7; panelAM.Tag := 1; panelPM.Color := $00F1F0F0; panelPM.Tag := 0; end; Thanks for any help, Paul Delphi 10.2 Pro, uniGUI 1.9.0.1502 Complete Professional, Windows 10 Pro Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 1, 2019 Share Posted July 1, 2019 Hi, For your case, you can try to use the following JS code. 5 hours ago, paul.coshott said: When they click the panel, it changes color to the selected color, and changes the other panel's color to the unselected color. How and where do I do the following in JS? UniPanel2.ClientEvents.ExtEvents -> function click(sender, eOpts) function click(sender, eOpts) { sender.setBodyProp("background-color","#008000"); MainForm.UniPanel1.setBodyProp("background-color","red"); } Quote Link to comment Share on other sites More sharing options...
paul.coshott Posted July 2, 2019 Author Share Posted July 2, 2019 Perfect. Thanks Sherzod. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.