Author Topic: What's editor for CB's xrc resource?  (Read 6454 times)

Offline Loaden

  • Lives here!
  • ****
  • Posts: 1014
What's editor for CB's xrc resource?
« on: March 19, 2010, 10:17:35 am »
Hello everyone, I want to know what is the CB's xrc file editor? is wxFormBuilder? Or other editor?
Thanks!

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: What's editor for CB's xrc resource?
« Reply #1 on: March 19, 2010, 06:04:28 pm »
Hello everyone, I want to know what is the CB's xrc file editor? is wxFormBuilder? Or other editor?
Thanks!
For me it's either Code::Blocks (as it is a XML file) or xrced from the wxPython package. The latter is really cool but requires Python and wxPython, of course.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline JGM

  • Lives here!
  • ****
  • Posts: 518
  • Got to practice :)
Re: What's editor for CB's xrc resource?
« Reply #2 on: March 21, 2010, 09:50:17 am »
If I remember well I used wsmith to edit wxwidget resource files and worked really nice

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5226
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: What's editor for CB's xrc resource?
« Reply #3 on: August 26, 2012, 04:49:20 pm »
Hi, morten, are there any recomanded xrc editor to edit the xrc files in the CB source?
When I edit it under wxsmith, it change too many things(see Re: EOL issue, the EOL should be automatically detected, and make consistent). So, the only way is to edit the raw xml file?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: What's editor for CB's xrc resource?
« Reply #4 on: August 26, 2012, 05:18:15 pm »
So, the only way is to edit the raw xml file?
For me, its still the same: Either wxSmith (I don' see such issues you described) or xrced from wxPython.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5226
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: What's editor for CB's xrc resource?
« Reply #5 on: August 26, 2012, 05:28:11 pm »
So, the only way is to edit the raw xml file?
I don' see such issues you described
That was strange, wxsmith did mess up my xrc files here.

I have tried install "wxForm builder" or "wxGlade", these tools even can NOT import the xrc file.( they will report some errors, either missing some wx classes or other things :( )

I will going to try xrced, it looks like this tool does not update for several years, I'm not sure its installer have bundled everything it needed. (wxGlade has bundled some wxpython dlls as I can see)

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: What's editor for CB's xrc resource?
« Reply #6 on: August 26, 2012, 05:44:46 pm »
I will going to try xrced, it looks like this tool does not update for several years, I'm not sure its installer have bundled everything it needed.
It is constantly updated. But not as a stabd-alone tool anymore, but as part of wxPython (as I've said). so you'll need Python, and then wxPython 2.9.x..
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12031
    • Travis build status
Re: What's editor for CB's xrc resource?
« Reply #7 on: August 26, 2012, 06:38:14 pm »
ollydbg: wxsmith was the best tool I've tried 6 months ago, I doubt the situation have changed.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5226
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: What's editor for CB's xrc resource?
« Reply #8 on: August 27, 2012, 05:58:32 am »
I will going to try xrced, it looks like this tool does not update for several years, I'm not sure its installer have bundled everything it needed.
It is constantly updated. But not as a stabd-alone tool anymore, but as part of wxPython (as I've said). so you'll need Python, and then wxPython 2.9.x..
Thank, I have installed python+wxPython, now to run the xrced, I have to double click the "python273\Scripts\xrced.bat". The xrced looks nice, it report a warning that wxScrollDialog does not recognized, but it can still open the xrc file, and edit them. I see it only changed a little(but it will change other part what I do not want). Generally it was OK.

ollydbg: wxsmith was the best tool I've tried 6 months ago, I doubt the situation have changed.
I test the wxsmith again. I found what the issue is:
Under Windows, wxsmith works quite nicely with the xrc file which has CR LF  EOL format, but wxsmith works badly in the xrc file have LF format(it will add many extra changes to xrc file as I posted Re: EOL issue, the EOL should be automatically detected, and make consistent). So, This should be a bug. Can any body confirm this.

To reproduce this, you can just convert the original xrc to LF EOL format under Windows, then change the UI under wxsmtih, then compared the result with the original one.
 
« Last Edit: August 27, 2012, 06:29:18 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12031
    • Travis build status
Re: What's editor for CB's xrc resource?
« Reply #9 on: August 27, 2012, 09:27:03 am »
To reproduce this, you can just convert the original xrc to LF EOL format under Windows, then change the UI under wxsmtih, then compared the result with the original one.
If you see LF or LF/CR LF files then they are broken and should be fixed.

See this: http://magic.aladdin.cs.cmu.edu/2006/03/01/end-of-line-conversion-in-subversion/
See this for a how-to about fixing broken files: http://stackoverflow.com/questions/8024740/whats-the-best-way-to-have-svneol-style-native-for-text-files-by-defaultsvn
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5226
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: What's editor for CB's xrc resource?
« Reply #10 on: August 27, 2012, 10:39:51 am »
Under Windows, wxsmith works quite nicely with the xrc file which has CR LF  EOL format...
The only issue here is that the original xrc file such as "src/sdk/resources/editor_configuration.xrc" use 4 spaces as indentation, after editing by wxsmith, the indentation was changed to use "tab". Any comments about this? I think "tab" are normally good for xml files, see, our codeblocks.cbp file use "tab" for indentation. When create a new wx sample project from the wizard, the wxs file also use "tab" as indentation.

To reproduce this, you can just convert the original xrc to LF EOL format under Windows, then change the UI under wxsmtih, then compared the result with the original one.
If you see LF or LF/CR LF files then they are broken and should be fixed.

See this: http://magic.aladdin.cs.cmu.edu/2006/03/01/end-of-line-conversion-in-subversion/
See this for a how-to about fixing broken files: http://stackoverflow.com/questions/8024740/whats-the-best-way-to-have-svneol-style-native-for-text-files-by-defaultsvn
Thanks, my issue is that I'm using git, and I clone the c::b git, but I does not enabled the auto LF to CRLF conversion under MsysGit, so I'm dealing with the LF sources(h/cpp), and LF xrc files in the git local copy.

If I'm under SVN(TortoiseSVN), I don't have the EOL issue, because I have CRLF sources and xrc files.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: What's editor for CB's xrc resource?
« Reply #11 on: August 27, 2012, 10:52:48 am »
The only issue here is that the original xrc file such as "src/sdk/resources/editor_configuration.xrc" use 4 spaces as indentation, after editing by wxsmith, the indentation was changed to use "tab". Any comments about this?
I think its OK to respect the editor settings for (text based) resource, files, too. That's how its implemented. So when editing a resource  file with wxSmith and having "spaces" as editor option this is the expected result. If this works differently, it is a bug (as you mentioned in the other thread, probably...) For patches, IMHO you have an opton to ignore white-space changes... at least I have. :) That solves the issue with having too many changes on XRC files.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ