[Gambas-user] Problem switching forms on embedded application

M0E Lnx m0e.lnx at ...626...
Mon Jun 9 13:44:44 CEST 2008


The idea behind this design for this application is that future
developers may contribute modules. I'm trying to eliminate the need
for them to modify the general GUI wrapper to implemente their
modules. If written successfully as planned, they will only need to
write their module and the GUI wrapper will bring it in and implement
it.


If I understand correctly, it's been said that what I'm trying to do
cannot be done (using multiple forms in one of these module
applications).

As a workaround in a testing environment, I've managed to handle tasks
that require more than one step using a wizard object.

I would have still been nice to be able to use multiple forms ;)

Thanks for the help guys

On Thu, Jun 5, 2008 at 4:54 PM, Ron Onstenk <ronstk at ...239...> wrote:
> On Thursday 05 June 2008, M0E Lnx wrote:
>> Ron is exactly right...
>> Checkout the application itself at http://vasmcc.googlecode.com
>>
>> it all works right, when the child application (the one embedded into
>> the main gui) consists of only one form
>>
>>
>>
>> On Thu, Jun 5, 2008 at 9:42 AM, Ron Onstenk <ronstk at ...239...> wrote:
>> > On Wednesday 04 June 2008, Benoit Minisini wrote:
>> >> On mercredi 04 juin 2008, M0E Lnx wrote:
>> >> > After more testing, I have another problem here...
>> >> >
>> >> > The switching works now when reparenting forms into a host form via a
>> >> > panel container
>> >> > But when this form that hosts the other forms is embedded into another
>> >> > program using am embedder object, it doesnt work
>> >> >
>> >>
>> >> Please be more explicit, or, better, send a project that shows the bad
>> >> behaviour.
>> >>
>> >> Regards,
>> >>
>> >
>> > When I understand correct it is something like the mandrake control center.
>> >
>> > MCC opens also other forms inside the main application and you _quit_
>> > the (sub)form to go back to the main form (window).
>> >
>> > The extra for MOE Lnx is one of the main selections does the job with
>> > 2 forms instead of one and he need a way to switch between the two (sub)forms.
>> >
>> > Ron the I'st :)
>> >
>
>
> OK
> My idea to it is to make a module that opens the main form.
> Using the embeder two times, one with the first and the the other with the second vPanel.
> Switching the visibility by calling a function in the main module from the vPanels each
> for this special case and use .Visible/.Show on the vPanel1 for the others.
>
> The handling for the both panels must be done from outside the vPanels
>
> module mainmod:
> public alldone as boolean = false
> public bPanel1 as boolean = false
> public bPanel2 as boolean = false
>
> public vPanel1 as form
> public vPanel2 as form
> public frmMain as form
>
> vPanel1 = new form1
> vpanel1 = new form2
>
>
> while not alldone
>  vPanel1.Hide  ' the right reference to the vPanels or embedder object in your code :)
>  vPanel2.Hide  ' if you need this
>
>  if bPanel1 then
>    frmMain.reparent(vPanel1)
>    vpanel1.embeded = true
>    vPanel1.show
>  end if
>
>  if bPanel2 then
>    frmMain.reparent(vPanel2)
>    vpanel2.embeded = true
>    vPanel2.show
>  endif
>
> wend
>
>
> in the vPanel forms:
>
> Public embeded as boolean = false
> public sub Form_Activate()
>
> end sub
>
> public sub Button1_Click()
> ' check if open is done in frmMain or as standalone
>  if embeded then
>    mainmod.bPanel1 = false
>    mainmod.bPanel2 = true
>  endif
> end sub
>
> public sub ButtonDone_Click()
>  mianmod.alldone = true
> end sub
>
> vPanel1 set mainmod.bPanel1 to false on start and mainmod.bPanel2 to true with the button_click
> Same but oposite numbers for the other panel, now you can switch between these.
>
> If all stuff is done set somewhere mainmod.alldone = true and all go back to
> initial state, as the while loop ends by this.
>
> I do not know what .reparent does exactly atm but my feeling tels me the reparent
> lines must be 'vPanel1.reparent(frmMain)' as setting the frmMain as parent for vPanel.
> As I read it (the example code) now it say do set vPanel as parent for frmMain.
>
> The main point is you should switching the panels/forms from outside those panels/forms
> using a global main module/class or inside the code of the frmMain and not try to do
> from inside the vPanels/subforms.
>
>
> Hope this will help a bit.
>
> Ron the I'st
>
>
>
>
>
>
>
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list