Page 1 of 1
TrvActionParaBorder
Posted: Fri Aug 04, 2023 3:53 pm
by standay
Hi Sergey,
OnShowingDialog seems to work OK.
However, in my code to do what I'm after, I need to know when the dialog created by TrvActionParaBorder returns mrOK or mrCancel. I can not find a way to get that information.
Do you have any ideas on how to do that?
Thanks Sergey
Stan
Re: TrvActionParaBorder
Posted: Sat Aug 05, 2023 10:45 am
by standay
Hi Sergey,
I came up with a workaround.
In my menu item onclick, I store the current state of my rve modified, then set the rve modified to false, then show the dialog using the OnShowingDialog event of TrvActionParaBorder to preset my colors. If the dialog OK button is clicked, then the rve modified goes true and I run some additional code and keep the color and border settings from the dialog. If the dialog is cancelled, the rve modified remains false and I don't run additional code, and then I set the modified state back to the previously stored state. Hacky, but it works.
Stan
Re: TrvActionParaBorder
Posted: Sat Aug 05, 2023 11:53 am
by Sergey Tkachenko
Yes, this solution is ok.
Alternatively, you can check for OnChange event call.
Re: TrvActionParaBorder
Posted: Sat Aug 05, 2023 3:40 pm
by standay
Hi Sergey,
I created a private boolean var and set that to true in rve.OnChange. In my menu item OnClick I set that var to false and then call the para border dialog. If the var is still false after that, I exit. If it's true I run my code. So yes, that works as well plus it's simpler code and I'm not messing with my rve's modified property.
Thanks for the idea!
Stan