andyhill Posted September 4, 2020 Posted September 4, 2020 We need the provision for a Desktop UniPageControl Event to advise the program of a user ChangePage Request with the option in code to prevent/cancel the page change (not show the specified TabSheet). The only event that is fired (none of the Uni/Ext Events fire) is 'tabchange' but as you can see it is after the event, also there is no way to prevent the change. Please advise - thanks Quote
Sherzod Posted September 4, 2020 Posted September 4, 2020 14 minutes ago, andyhill said: We need the provision for a Desktop UniPageControl Event to advise the program of a user ChangePage Request with the option in code to prevent/cancel the page change (not show the specified TabSheet). The only event that is fired (none of the Uni/Ext Events fire) is 'tabchange' but as you can see it is after the event, also there is no way to prevent the change. Please advise - thanks \FMSoft\Framework\uniGUI\Demos\Desktop\PageControl - BeforeActivate ? Quote
andyhill Posted September 4, 2020 Author Posted September 4, 2020 Thanks Sherzod, I was viewing the problem from a DevExpress point of view. Quote
andyhill Posted September 4, 2020 Author Posted September 4, 2020 My work around is still messy (lots of flag switching and re-activating). The problem for me is you have a Sheet Activate Event that expects either a True / False result (BeforeActivate(Sender: TObject; var AllowActivate: Boolean);) which is not ideal if one needs to carry out some dynamic interaction with the user before allowing:- 1) Catch the Activating Request 2) Solicit Password from user 3) If valid password then Activate Sheet else deny Quote
Hayri ASLAN Posted September 6, 2020 Posted September 6, 2020 On 9/4/2020 at 7:18 PM, andyhill said: My work around is still messy (lots of flag switching and re-activating). The problem for me is you have a Sheet Activate Event that expects either a True / False result (BeforeActivate(Sender: TObject; var AllowActivate: Boolean);) which is not ideal if one needs to carry out some dynamic interaction with the user before allowing:- 1) Catch the Activating Request 2) Solicit Password from user 3) If valid password then Activate Sheet else deny Do you need OnChanging(Accept:Boolean) event? Quote
andyhill Posted September 6, 2020 Author Posted September 6, 2020 I need intent to change, then Prompt for Password, validate password and if correct then change to Sheet else not change (as stated 1, 2, 3 above). Quote
Sherzod Posted September 6, 2020 Posted September 6, 2020 3 hours ago, andyhill said: I need intent to change, then Prompt for Password, validate password and if correct then change to Sheet else not change (as stated 1, 2, 3 above). The first option for your case is using MainModule.EnableSynchronousOperations = True For example: procedure TMainForm.UniTabSheet3BeforeActivate(Sender: TObject; var AllowActivate: Boolean); begin if UniForm3.ShowModal = mrOk then AllowActivate := True else AllowActivate := False; if not AllowActivate then ShowMessage('You can not see this TabSheet!'); end; Quote
andyhill Posted September 6, 2020 Author Posted September 6, 2020 I appreciate your help Sherzod but my understanding is that the BeforeActivate event is lost once I prompt the user for a password, as mentioned before I have managed a work around. Ideally the BeforeActivate should have a CallBack so I can further interact with user, then if happy with the challenge response continue with the event allowing activation or denying. Quote
Sherzod Posted September 6, 2020 Posted September 6, 2020 6 hours ago, Sherzod said: MainModule.EnableSynchronousOperations = True Are you using it? Quote
andyhill Posted September 6, 2020 Author Posted September 6, 2020 Yes, I am away for a week, will touch base on return. Quote
andyhill Posted September 6, 2020 Author Posted September 6, 2020 What I do need desperately is the Desktop PopUpMenu Y Overflow (cater for hundreds of items) that I have raised a ticket for plus of course the Mobile DBListGrid DoubleTap (also ticketed a long time ago), hopefully when I am back they will be resolved. Quote
Sherzod Posted September 6, 2020 Posted September 6, 2020 12 minutes ago, andyhill said: What I do need desperately is the Desktop PopUpMenu Y Overflow (cater for hundreds of items) that I have raised a ticket for plus of course the Mobile DBListGrid DoubleTap (also ticketed a long time ago), hopefully when I am back they will be resolved. Remind us again please, we'll check. But, preferably, always attach test cases so we can reproduce and see the problem. Quote
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.