[Gambas-user] a form within a form and Resize event
Bruce Steers
bsteers4 at gmail.com
Fri Mar 10 11:26:44 CET 2023
On Fri, 10 Mar 2023 at 07:52, Fabien Bodard <gambas.fr at gmail.com> wrote:
>
>
> Le jeu. 9 mars 2023 à 19:58, T Lee Davidson <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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230310/8f9adf7a/attachment.htm>
More information about the User
mailing list