Page Swapping

Does anybody have an idea of how to do swapping of a number of pages. These
pages can be of type: wxDiagram and associated wxShapeCanvas, wxTextCtrl and
wxStyledTextCtrl. I tried creating a Panel to hold all of them, but that was
not successful. Another Idea I have is to create a wxBoxSizer and swop the
page in and out of it. And finally (might not work..not too familiar with
it), to use the wxWindow as a container for the pages.

I know that this is not strictly a bug, but I will appreciate any input I can
get.

Thanks in advance

Bilal A.R. Jagot
CeTAS
University of the Witwaterrand
Johannesburg
+27 11 717 7226
+27 83 556 3927

Does anybody have an idea of how to do swapping of a number of pages. These
pages can be of type: wxDiagram and associated wxShapeCanvas, wxTextCtrl and
wxStyledTextCtrl. I tried creating a Panel to hold all of them, but that was
not successful. Another Idea I have is to create a wxBoxSizer and swop the
page in and out of it. And finally (might not work..not too familiar with
it), to use the wxWindow as a container for the pages.

I know that this is not strictly a bug, but I will appreciate any input I can
get.

Thanks in advance

Bilal A.R. Jagot

Bilal, have you tried using a tab notebook?
According to the docs, you don't have to use the tabs
(though I've not tried that yet). You should be able
to use a separate control (menu items, scrolling list,
tree) to select which page to display in the notebook.
Each notebook panel can contain one of your pages.
Or, each notebook panel can contain on of your page
*types*, and your command can display and populate
the appropriate panel.

Let us know what you end up with.

- Sam
- - - - - - - - - - - - - - - - - - - - - - - - - -
I'm currently looking for a new position/contract.
Resume at http://spinwardstars.com/vitae/
- - - - - - - - - - - - - - - - - - - - - - - - - -

···

_____________________________________________
Samuel Reynolds sam@spinwardstars.com
Spinward Stars: http://www.spinwardstars.com/

>Does anybody have an idea of how to do swapping of a number of pages.

These

>pages can be of type: wxDiagram and associated wxShapeCanvas, wxTextCtrl

and

>wxStyledTextCtrl. I tried creating a Panel to hold all of them, but that

was

>not successful. Another Idea I have is to create a wxBoxSizer and swop the
>page in and out of it. And finally (might not work..not too familiar with
>it), to use the wxWindow as a container for the pages.
>
>I know that this is not strictly a bug, but I will appreciate any input I

can

>get.
>
>Thanks in advance
>
>Bilal A.R. Jagot

Bilal, have you tried using a tab notebook?
According to the docs, you don't have to use the tabs
(though I've not tried that yet). You should be able
to use a separate control (menu items, scrolling list,
tree) to select which page to display in the notebook.
Each notebook panel can contain one of your pages.
Or, each notebook panel can contain on of your page
*types*, and your command can display and populate
the appropriate panel.

Let us know what you end up with.

- Sam
- - - - - - - - - - - - - - - - - - - - - - - - - -
I'm currently looking for a new position/contract.
Resume at Spinwardstars.com
- - - - - - - - - - - - - - - - - - - - - - - - - -
_____________________________________________
Samuel Reynolds sam@spinwardstars.com
Spinward Stars: http://www.spinwardstars.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-
unsubscribe@lists.wxwindows.org For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org

That might work, except that the pages that we need to switch are going
to be in a Notebook. I have succeeded with switching a number of pages of a
particular type under one tab of a wxNoteBook instance. It was the
wxShapeCanvas. Done by assigning and unassigning a wxDiagram to the
wxShapeCanvas.

I am gonna go back to it as soon as I finish with this XML editor.

Thanks

Hi Jag,

Does anybody have an idea of how to do swapping of a number of pages. These
pages can be of type: wxDiagram and associated wxShapeCanvas, wxTextCtrl and
wxStyledTextCtrl. I tried creating a Panel to hold all of them, but that was
not successful. Another Idea I have is to create a wxBoxSizer and swop the
page in and out of it. And finally (might not work..not too familiar with
it), to use the wxWindow as a container for the pages.

I know that this is not strictly a bug, but I will appreciate any input I can
get.

I don't know if I understand your problem correctly, but if I do - the
solution is pretty simple. Just go ahead and create your pages, then
Hide() all of them except the one you want to see, that's it.
Recently I "reinvented the wheel" and coded a class with the
functionality of wxWizard (basically because I needed some other stuff
then a bitmap on the left side of the dialog). The whole thing is
actually nothing else then a "page-swapper". I've got a subclass (that
subclasses wxPanel) that's responsible for the content of a page (and
some page-switching logic etc.). I created a method (say addContent())
that recieves a sizer as an argument, that allows to dinamically add and
remove pages content... Anyway, switching the pages is pretty simple: I
just hide the current page and unhide the previous (or next). That's it.

HTH,
Igor

···

On Sam, 2002-12-21 at 14:47, Jag wrote:

Thanks for the tip..I was using the Show method and was able to swap
wxDiagrams into and out of a wxShape. I used the Show() method.
Unfortunately, it does not work very well for the Textctrl. I would love to
see that code you have that does the swapping. I would appreciate it if you
could email it to me.

Another thing!! If I have code I wanna share with ppl, is there a central
repository where I can dump it?

Thanks
Jag

Hi Jag,

> Does anybody have an idea of how to do swapping of a number of pages.

These

> pages can be of type: wxDiagram and associated wxShapeCanvas, wxTextCtrl

and

> wxStyledTextCtrl. I tried creating a Panel to hold all of them, but that

was

> not successful. Another Idea I have is to create a wxBoxSizer and swop

the

> page in and out of it. And finally (might not work..not too familiar with
> it), to use the wxWindow as a container for the pages.
>
> I know that this is not strictly a bug, but I will appreciate any input I

can

> get.

I don't know if I understand your problem correctly, but if I do -
the solution is pretty simple. Just go ahead and create your pages, then
Hide() all of them except the one you want to see, that's it.
Recently I "reinvented the wheel" and coded a class with the
functionality of wxWizard (basically because I needed some other
stuff then a bitmap on the left side of the dialog). The whole thing
is actually nothing else then a "page-swapper". I've got a subclass (that
subclasses wxPanel) that's responsible for the content of a page (and
some page-switching logic etc.). I created a method (say addContent()
) that recieves a sizer as an argument, that allows to dinamically
add and remove pages content... Anyway, switching the pages is
pretty simple: I just hide the current page and unhide the previous
(or next). That's it.

HTH,
Igor

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-
unsubscribe@lists.wxwindows.org For additional commands, e-mail:
wxPython-users-help@lists.wxwindows.org

Bilal A.R. Jagot
CeTAS
University of the Witwaterrand
Johannesburg
+27 11 717 7226
+27 83 556 3927

···

On Sam, 2002-12-21 at 14:47, Jag wrote: