[Gambas-user] a form within a form and Resize event

Denis Crowther denisc at exemail.com.au
Fri Mar 10 13:06:30 CET 2023


On 3/10/23 21:26, Bruce Steers wrote:
> 
> 
> On Fri, 10 Mar 2023 at 07:52, Fabien Bodard <gambas.fr at gmail.com 
> <mailto:gambas.fr at gmail.com>> wrote:
> 
> 
> 
>     Le jeu. 9 mars 2023 à 19:58, T Lee Davidson
>     <t.lee.davidson at gmail.com <mailto:t.lee.davidson at gmail.com>> a écrit :
> 
>         On 3/9/23 10:32, Bruce Steers wrote:
>          > I have a form
>          >
>          > Inside this form are some objects that are other forms.
>          >
>          > If i resize the top form and the inner forms also resize
>         themselves they do not fire their own resize events.
>          >
>          > I think they should, as they are actually being resized.
>          >
>          > Respects
>          > BruceS
> 
>         Are you creating the Child forms with an EventName, or just
>         expecting the Parent to catch the event?
> 
>     As Saying Lee I'm quite sure you have redirected involuntary the
>     event handler.
> 
>     If you create a dynamic form
>     As
>     HForm = new MychildForm(hContainer) as "MyForm"
> 
> 
>     All the  events of the child (usually named Form_event) are
>     redirected to MyForm_event in the parent form class.
> 
>     So you have two solution:
>     - remove the as "MyForm" sentence so the event is not attached to
>     the parent anymore
> 
>     - If you need to manage some events form the parent you can also do
>     a direct call to the child procedure
> 
>     HForm.Form_resize
> 
>     But note that the LAST value will be the parent form .. not the child.
> 
> 
> 
>     The best way I think will be the first one .
> 
>     And then put some public function to the parent to allow the child
>     to communicate with.
> 
> 
>     Don't forget that Gambas is not VB and the need of using _Resize
>     event is Rare. You have all the bunch of object properties that
>     allow to manage your content positionning automagiquely.
> 
>     But sometime... it is not enouth.
> 
> 
> Yes this time seemed not enough.
> 
> the problem i have is with objects inside a splitter.
> If one side gets too small it pumps out pango warnings.
> I used the Splitter_Resize() event to detect this and limit the size 
> reduction of the left hand panel.
> That works fine when using the splitter bar.
> But then resizing the whole window has left me a mystery as to where a 
> resize event is triggered.
> I tried to make a small test app to show the problem but I found it 
> worked :-/ !!
> 
> So i will study this mail and investigate and see if i can find the 
> resize trigger, or like you say handle it in FMain.
> 
> Thank you :)
> BruceS
> 
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----

It would only be a problem when the form is embedded wouldn't it?. So 
wouldn't storing and tracking the splitter size from the splitter & 
fmain resizes be the solution?

Would you mind posting the solution please, I think this will be a 
situation for me in the very near future as well. :-)

-- 
Regards
Denis



More information about the User mailing list