one panel creation with different parent

View: New views
2 Messages — Rating Filter:   Alert me  

one panel creation with different parent

by Gajera Tejas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi all,

I have code is like...

obj1 = new same_class(parent1);   // create a new panel on parent 1 using same_class
obj2 = new same_class(parent2);  // create a new panel on parent 2 using same_class

both objects has same GUI stuff based on only one class called same_class.
Now, I want to make automatic changes in obj2 if I make change in obj1 or I want to make automatic changes in obj1 if I make change in obj2.

How can I make change in other object, if any one of them is changed.

Thanks,
Tejas

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Foxgui-announce mailing list
Foxgui-announce@...
https://lists.sourceforge.net/lists/listinfo/foxgui-announce

Re: one panel creation with different parent

by Jeroen van der Zijp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 24 September 2008, Gajera Tejas wrote:

> hi all,
>
> I have code is like...
>
> obj1 = new same_class(parent1);   // create a new panel on parent 1 using
> same_class
> obj2 = new same_class(parent2);  // create a new panel on parent 2 using
> same_class
>
> both objects has same GUI stuff based on only one class called same_class.
> Now, I want to make automatic changes in obj2 if I make change in obj1 or I
> want to make automatic changes in obj1 if I make change in obj2.
>
> How can I make change in other object, if any one of them is changed.

You might take a look at FXDataTarget and its "datatarget.cpp" sample program.

For instance, if a textfield in panel1 would be connected to a data target D1;
and the corresponding textfield in panel2 would also be connected to D1, then
a value entered into the former textfield would automatically be reflected in
the latter textfield, and vice-versa.

The datatarget sample program shows how this is done.

But please note that the datatarget mechanism works best for "simple data", such
as numbers, strings, colors, etc.  Complex widgets like FXTable and FXText are
not usually handled with FXDataTarget's.


                        - Jeroen


--
+----------------------------------------------------------------------------+
| Copyright (C) 19:10 09/24/2008 Jeroen van der Zijp.   All Rights Reserved. |
+----------------------------------------------------------------------------+

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Foxgui-announce mailing list
Foxgui-announce@...
https://lists.sourceforge.net/lists/listinfo/foxgui-announce