Author Topic: Import wxsmith file  (Read 4299 times)

Offline koen

  • Multiple posting newcomer
  • *
  • Posts: 13
Import wxsmith file
« on: June 28, 2007, 11:10:07 am »
I have been looking for this for a while, but I haven't been able to find a solution. Suppose I have created a frame with wxsmith in one project, and I like to use it in another one later one. How do I transfer the layout from the first project to the second one? I'm OK with manually copying the accompanying code, but I do not like to recreate the full layout in wxsmith.

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: Import wxsmith file
« Reply #1 on: June 28, 2007, 12:04:54 pm »
What do you exactly mean?
Do you want to have two different applications with same window (or it's part) ? Or do you want to use other designer to edit one window?

If it's the second one, you should create your window with XRC file which may be edited in external designer.

Regards
   BYO

Offline koen

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Import wxsmith file
« Reply #2 on: June 29, 2007, 09:38:22 am »
I have one project in which I created a frame. Now, I would like to use that frame in another project. What is the best way to do this?

One of the problems I'm seeing is that if I simply add the wxs file to my new project, it is somehow not associated with wxSmith. I can see the XML code, but I cannot convince wxSmith to load it so I can edit it. I guess I have to copy other resource files, source files or header files as well, but I'm not sure...

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: Import wxsmith file
« Reply #3 on: June 29, 2007, 12:23:22 pm »
One of the problems I'm seeing is that if I simply add the wxs file to my new project, it is somehow not associated with wxSmith. I can see the XML code, but I cannot convince wxSmith to load it so I can edit it. I guess I have to copy other resource files, source files or header files as well, but I'm not sure...

First thing you should do before copying is to create frame with same name in second project. Than you can overwrite wxs files and wxSmith will use the new one.

You can also try to copy&paste - it should work quite well when you have sizer-based resources. You select top-most sizer, copy it and paste into new empty frame.

Regards
   BYO

Offline koen

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Import wxsmith file
« Reply #4 on: June 29, 2007, 03:04:25 pm »
Ah, I see. The creating and overwriting looks like a workaround. I would expect that adding a wxs file to the project would take care of that. Anyway, I'll try the workaround. Thanks!