Author Topic: wxSmith Tutorials Extended  (Read 8488 times)

Offline Grouch

  • Multiple posting newcomer
  • *
  • Posts: 40
wxSmith Tutorials Extended
« on: February 27, 2012, 09:39:33 pm »
For my own use and that of associates, I have extended and slightly revised BYO's tutorials on using wxSmith and would be happy to share the result. The extensions cover techniques I needed to make practical use of wxSmith and, indeed, of wxWidgets. They include:
    Creating main menu items and responding to clicks on them
    Drawing graphs, displaying them on the screen and saving them as .png, .jpg or similar files.
    "Rescuing" printf by creating printg which works exactly like printf but sends output to a wxTextCtrl.
    Initializing variables on creation of a form
    Use of the Event Table
    Making and using a wxComboBox for user input.
    Converting between several types of strings,

Revisions cover removal of some obsolete material, clarification of some matters and touching up the English here and there for the comfort of native speakers.

Some of the techniques covered can be easily learned from the wxWidgets book by Smart and Hock, but many required hours of frustrating experiments to convert to workable code the hints given there and in the wxWidgets samples.

The revised document is available as a .odt file for LibreOffice or OpenOffice Writer and as a .pdf.

How can I best (a) get BYO to have a look at it and (b) share it with other users and would-be users of Code::Blocks and wxSmith?

stefanos_

  • Guest
Re: wxSmith Tutorials Extended
« Reply #1 on: February 27, 2012, 10:44:16 pm »
As far as I am aware of, Byo has other responsibilities right now (he got married therefore you know the "consequences") and if I am remembering correctly, he stopped maintaining himself.

He has passed the development to CodeBlocks's team, therefore ask them and they will gladly going to help you.

Cheers.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: wxSmith Tutorials Extended
« Reply #2 on: February 28, 2012, 07:35:48 am »
The revised document is available as a .odt file for LibreOffice or OpenOffice Writer and as a .pdf.
[...]
How can I best (a) get BYO to have a look at it and (b) share it with other users and would-be users of Code::Blocks and wxSmith?
Well you could start post it here (zipped).

Alternatively feel free to enhance the appropriate section(s) in the WiKi and/or (if you know LaTeX) you can enhance the documentation available (as source via SVN) here:
http://svn.berlios.de/svnroot/repos/codeblocks/docs
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Grouch

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: wxSmith Tutorials Extended
« Reply #3 on: February 29, 2012, 06:04:19 am »
Thanks for these suggestions.

By posting it "here" I presumed you meant to add it as an attachment to a post. I zipped it up and tried to attach it, but the site would accept no files larger than 192 kilobytes, while mine was 792. But did you perhaps have something else in mind?

I then turned to editing the Wiki and made it through the Introduction, which had no image files. But in Tutorial 1, I encountered a number of image files, some of which need to be changed. In the source file, the references to the images look like this:
[[Image:wxs_tut01_004.png]]
I understand that this is a reference to an image somewhere, but where and how do I get my images into that place? I search the help files but without finding anything. Any help would be appreciated.

Also, I found that I was being logged out while editing a tutorial. Then when I went to Save, I could not do so, and -- worse still-- could not get back to work I had done. Any advice?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: wxSmith Tutorials Extended
« Reply #4 on: February 29, 2012, 07:03:01 am »
By posting it "here" I presumed you meant to add it as an attachment to a post. I zipped it up and tried to attach it, but the site would accept no files larger than 192 kilobytes, while mine was 792. But did you perhaps have something else in mind?
You can and should use a file sharing service for that purpose.

I understand that this is a reference to an image somewhere, but where and how do I get my images into that place?
On the left side (if you are logged in) you see a toolbox like this:
Toolbox

    What links here
    Related changes
    Upload file
    Special pages

Notice the "Upload file" button - which is thee to upload resources like images., Please don't overdue it, the images should have a "normal" size, thee is no need to put extra-large and huge images (both: in file size and pixel) there.

Also, I found that I was being logged out while editing a tutorial.
This shouldn't happen. There is an automatic log-out after a while when not being active (for security reasons), maybe that's what happened. Just save more often, you can also mark the page as "under re-construction" for others to see you are working on. Additionally, make sure you copied the content which you had just changed to the clipboard before you click "save". Then you can easily restore it after successful re-login.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: wxSmith Tutorials Extended
« Reply #5 on: February 29, 2012, 11:38:52 pm »
I then turned to editing the Wiki and made it through the Introduction, which had no image files. But in Tutorial 1, I encountered a number of image files, some of which need to be changed. In the source file, the references to the images look like this:
[[Image:wxs_tut01_004.png]]
I understand that this is a reference to an image somewhere, but where and how do I get my images into that place? I search the help files but without finding anything. Any help would be appreciated.
Also, if your image is simply an updated version of a pre-existing image, you can click the image in question, then select "Upload a new version of this file".  (By the way, I generally use tools like OptiPNG or PNGOUT on images before uploading them.)

Also, I found that I was being logged out while editing a tutorial.
This shouldn't happen. There is an automatic log-out after a while when not being active (for security reasons), maybe that's what happened. Just save more often, you can also mark the page as "under re-construction" for others to see you are working on. Additionally, make sure you copied the content which you had just changed to the clipboard before you click "save". Then you can easily restore it after successful re-login.
I make frequent use of the "Show preview" button to prevent my session from timing out.

Offline Grouch

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: wxSmith Tutorials Extended
« Reply #6 on: March 04, 2012, 04:27:59 am »
Thanks. All of this information has been very helpful, and I have succeeded in revising the Introduction to the tutorials and Tutorial 1.  Please have a look at them at your convenience.

The next step is to create two new tutorials. I have already written them but cannot find a way to create a new page in the Code::Blocks wiki. It is easy in Wikipedia, but the device used there does not seem to exist in the Code::Blocks wiki.

By clicking on the "Special pages" item  in the left margin, I can find the source files for the existing tutorials, but cannot find out how to add one. "Upload file" seems to work only for graphics. What am I missing?

 

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6025
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: wxSmith Tutorials Extended
« Reply #7 on: March 04, 2012, 04:39:30 am »
The next step is to create two new tutorials. I have already written them but cannot find a way to create a new page in the Code::Blocks wiki. It is easy in Wikipedia, but the device used there does not seem to exist in the Code::Blocks wiki.

To create a new wiki page, I always do below: create a stub link like [[The title of the page you want to create]] in one existing wiki page, then this will show in red color, you click on the stub link, and the wiki system will prompt that this page does not exist, and you can create it. :)

Quote
By clicking on the "Special pages" item  in the left margin, I can find the source files for the existing tutorials, but cannot find out how to add one. "Upload file" seems to work only for graphics. What am I missing?
You should click the "edit" table of the existing tutorial wiki page, and see it source then.

Besides Images, what do you want to upload??
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 Grouch

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: wxSmith Tutorials Extended
« Reply #8 on: March 04, 2012, 07:08:19 am »
Thanks ollydbg; that worked splendidly. I would never have guessed that method. It should be documented in the tutorial pages on editing.

You ask what else I wanted to upload. I had prepared the whole of the tutorial on my own computer and thought that it might be possible to upload that file. Instead, I used your method to get a blank page, then copied the text I had prepared to the clipboard, opened the blank page of the Code::Blocks site, and pasted my text into it. It is there now as Tutorial 8. Tutorial 9 should come tomorrow.

Thanks again.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6025
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: wxSmith Tutorials Extended
« Reply #9 on: March 04, 2012, 07:21:49 am »
Thanks ollydbg; that worked splendidly. I would never have guessed that method. It should be documented in the tutorial pages on editing.

You ask what else I wanted to upload. I had prepared the whole of the tutorial on my own computer and thought that it might be possible to upload that file. Instead, I used your method to get a blank page, then copied the text I had prepared to the clipboard, opened the blank page of the Code::Blocks site, and pasted my text into it. It is there now as Tutorial 8. Tutorial 9 should come tomorrow.

Thanks again.
Aha, you contribution is great!!! Keep the good work. BTW: I think "copy and paste text to wiki page" is the only way to write the wiki page.  :)
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 Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: wxSmith Tutorials Extended
« Reply #10 on: March 05, 2012, 03:13:21 am »
Good job on your additions.

I had a chance to skim through them - have you by any chance increased the font/display size on your computer?  The screenshots you added to the first tutorial are a bit larger than I may have expected.

One other idea to consider is to use <source lang="cpp"></source> to give syntax highlighting to the larger code snippets used in the last two tutorials.  With this, you could also use line numbers to cue the reader as to where to find the line(s) in question (see Creating a new project for an example of how I tried this - although, I think I may have gone a bit overboard with the formatting on that page).  However, highlighting versus none is just a matter of preference - you decide which you prefer.

Offline Grouch

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: wxSmith Tutorials Extended
« Reply #11 on: March 07, 2012, 06:51:33 am »
Thanks for your kind words. I think it is a great idea to do syntax highlighting on the long pieces of code.  Give me a couple of days, or surprise me by finding it done!

In Tutorial 2, I added a section on using the main menu, a topic byo did not touch on.

Tonight, I worked on Tutorial 3. I had nothing to add, but I think I clarified it here and there and simplified some of the grammar. And of course supplied several hundred a's, an's and the's that don't exist in Polish.  I intend to do the same for Tutorials 4 and 6.

These tutorials are by far the best introduction I have found to wxWidgets. They are  fun, clear, and sufficiently comprehensive to get one up and running. That's why it is worthwhile to give the English in them a professional quality in keeping with the quality of the wxSmith programing and the conceptual plan of the tutorials.