Author Topic: wxSmith - tutorial  (Read 71547 times)

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
wxSmith - tutorial
« on: November 05, 2005, 12:18:33 am »
Hi everyone. I've created small tutorial explaining basics of wxSmith. It can be found here:

http://wiki.codeblocks.org/index.php/WxSmith_Tutorial_%26_Pointers

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: wxSmith - tutorial
« Reply #1 on: November 05, 2005, 01:22:27 pm »
Nice :)
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: wxSmith - tutorial
« Reply #2 on: November 05, 2005, 09:50:07 pm »
Cool!  :D

You know... I have just started to use wxSmith and I was just about asking for a tutorial. As if you had known my thoughts... Thanks!

Morten.
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

Muffin

  • Guest
Re: wxSmith - tutorial
« Reply #3 on: November 09, 2005, 09:15:00 pm »
I am really impressed. RAD as easy that even a Delphi user like me can use it. :) Good work, keep it up!

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #4 on: November 09, 2005, 09:57:52 pm »
Try to do my best :) and I'm glad You like it :)

The Falcon

  • Guest
Re: wxSmith - tutorial
« Reply #5 on: November 14, 2005, 09:34:45 am »
To BYO,

you're a legend. I downloaded the latest CVS of Code::Blocks (after playing around with R1C2 for a while) and the whole team deserves mountains of credit for their efforts. However I am absolutely smitten with wxSmith. I love the new interface and the relocation (and nice icons for placement ops) to the bottom of the editor window. Sensational. I've really looked around at the other open source offerings in the IDE genre and Code::Blocks totally rocks the opposition. Keep up the great work. I can see from recent posts that you have really attempted to implement suggested enhancements in a logical and user friendly way. So in this spirit I'll make a small suggestion, though I am positive you will have it already on your TODO list. The ability to define further controls (and eventually custom controls) would be really nice. I guess this would be best after you've got things to a really stable state and you are happy with wxSmith in it's current form. Keep rockin, and when I've played with it more extensively I'll get back with further feedback.

The Falcon.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: wxSmith - tutorial
« Reply #6 on: November 14, 2005, 11:08:40 am »
Hello,

Thank you very much for the tutorial. Very useful. I have already played a bit with wxSmith, but without too much success.

Best wishes,
Michael

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #7 on: November 14, 2005, 02:28:52 pm »
To BYO,

you're a legend. I downloaded the latest CVS of Code::Blocks (after playing around with R1C2 for a while) and the whole team deserves mountains of credit for their efforts. However I am absolutely smitten with wxSmith. I love the new interface and the relocation (and nice icons for placement ops) to the bottom of the editor window. Sensational. I've really looked around at the other open source offerings in the IDE genre and Code::Blocks totally rocks the opposition. Keep up the great work. I can see from recent posts that you have really attempted to implement suggested enhancements in a logical and user friendly way. So in this spirit I'll make a small suggestion, though I am positive you will have it already on your TODO list. The ability to define further controls (and eventually custom controls) would be really nice. I guess this would be best after you've got things to a really stable state and you are happy with wxSmith in it's current form. Keep rockin, and when I've played with it more extensively I'll get back with further feedback.

The Falcon.


 :o wow, I'd never think that anyone would like my plugin so much  :D.
And totally pluggable architecture is on the way (and custom controlls also) - it's just a matter of time :). But now we have to focus on 1.0 release so many features had to be delayed.

Waiting For Your suggestions and bug reports :)

takeshimiya

  • Guest
Re: wxSmith - tutorial
« Reply #8 on: November 14, 2005, 03:48:04 pm »
It is very good indead! Of course, it haves a long road to become more stable, but it's good!

My suggestion would be to try to implement most of the DialogBlocks functionality.

And to fix the redraw bug in which all the screen becomes black :P

Offline squizzz

  • Almost regular
  • **
  • Posts: 132
Re: wxSmith - tutorial
« Reply #9 on: November 15, 2005, 01:56:09 am »
I've just seen quite latest wxSmith (thanks to binaries provided by therion), and I just cannot left what I've seen uncommented... 

...
...
...
please note that I might have not much to say, because seriously I'm pretty speechless ATM... man, IT TOTALLY ROCKS! :) there should be warnings* and stuff! :lol:
...
...
...
...
...

* applies to CB as well :)


Quote from: byo
Waiting For Your suggestions and bug reports
a suggestion: maybe it would be a good idea to consider, to make wxSmith also available via separate package on C::B SF's project page, with its own, independent release cycle? The amount of changes being made to this plugin... you know... it just stuns. :P


BTW. thanks for tutorial. A perfect moment to start journey with wxWidgets. :)
« Last Edit: November 15, 2005, 01:59:52 am by squizzz »
this space is for rent

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: wxSmith - tutorial
« Reply #10 on: November 15, 2005, 02:44:00 am »
Well, the problem is that the SDK is constantly changing, and new versions of wxSmith are updated to use the CVS SDK so they're often not compatible with the latest release of C::B.

This will be specially true when we start working on C::B version 2.

takeshimiya

  • Guest
Re: wxSmith - tutorial
« Reply #11 on: November 15, 2005, 03:39:08 am »
Nightly builds would solve this...

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #12 on: November 15, 2005, 04:10:10 pm »
I've just seen quite latest wxSmith (thanks to binaries provided by therion), and I just cannot left what I've seen uncommented... 

O, guys, easy, easy. If You're so impressed now, it would be really big challenge to surprise You later ;)

I thought about providing some binaries... but maybe it's not z good idea. wxSmith is somehow a part of Code::Blocks and always will be. And dates, releases etc. are set up mainly by mandrav ( I guess ;) ). Waiting for release makes product more popular (like it was in case of C::B RC2, in my opinion of course) ;).

Nightly build - it would be nice :)

Takeshi Miya: Can You describe Black screen more precisely (the most important thing is when it does occur). I noticed this behaviour but have too few informations about that. Maybe some bug report ;)

OK, I have to go back to my thesis...

BTW. Can anyone help me with Linux version ? I really have no Idea why it don't want to load :( And Squizz: I've divided by zero and still have exceptions ;)

takeshimiya

  • Guest
Re: wxSmith - tutorial
« Reply #13 on: November 15, 2005, 04:17:53 pm »
byo: it occurs (almost) all the time when you drag a component

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #14 on: November 15, 2005, 04:32:57 pm »
byo: it occurs (almost) all the time when you drag a component

Can You provide any screenshoot ? And try to increase "Preview fetch delay" option in wxSmith Settings (Advanced tab) - maybe it wil fix the problem. And I suggest moving thuis discussion here: http://forums.codeblocks.org/index.php/topic,1220.0.html :)

Offline cyberkoa

  • Plugin developer
  • Almost regular
  • ****
  • Posts: 145
    • http://
Re: wxSmith - tutorial
« Reply #15 on: November 15, 2005, 05:54:43 pm »
Quote

Takeshi Miya: Can You describe Black screen more precisely (the most important thing is when it does occur). I noticed this behaviour but have too few informations about that. Maybe some bug report ;)
I found one very obvious black background screen problem in wxNotebook when I do the style update , I hv tried to debug but it seems like quite complicated to me.

Steps to reproduce
1. You can take the wxSmith setting dialog (with wxNotebook)
2. Click on the first tab , click the 2nd tab -> the background turns black.
3. At this moment , if you click on one of the widgets in that panel , the dialog disappear , left the whole windowseditor with black background.

WinXP Pro SP2
wxwidgets2.6.2

Quote
BTW. Can anyone help me with Linux version ? I really have no Idea why it don't want to load :( And Squizz: I've divided by zero and still have exceptions ;)
I have the same problem in Ubuntu 5.10 breezy, the profiler plugins also does not loaded properly.
I notice that there is a corresponding .la file for each plugins library , this should be generated by the autotools. I just wonder , is there anyway to integrate the existing wxSmith code into the automake process just like how the other plugins is built .


I am working on a bug in wxSmith which related to Unicode (I guest), it seems like the resourcedata cannot handle Unicode for Asian Languange, there is data lost during the Adding/Transferring process. 

EDIT: By the way, byo , update for the Styles is completed, I do not only refer to WX_DIR\src\xrc , I also refer to the HELP file because the code in WX_DIR\src\xrc seems like only contain code for WXMSW, missing out some style in WXGTK,WXPALM,WXMAC,WXWINCE .

And the new pallete look for wxSmith is great !:) , just only the the quick position/alignment pallete seems like disappear.
« Last Edit: November 15, 2005, 06:33:05 pm by cyberkoa »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: wxSmith - tutorial
« Reply #16 on: November 16, 2005, 11:21:48 pm »
question : what do the top 3 buttons on the right hand side do (tested with snapshot build of CB of 16 november 2005) ? Would be nice if there are also tooltips for those buttons.

Thanks,
Lieven

takeshimiya

  • Guest
Re: wxSmith - tutorial
« Reply #17 on: November 16, 2005, 11:35:18 pm »
I was going to ask that, but then I realized that probably that those panels will be managed by wxDockIt

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #18 on: November 17, 2005, 12:24:47 am »
question : what do the top 3 buttons on the right hand side do (tested with snapshot build of CB of 16 november 2005) ? Would be nice if there are also tooltips for those buttons.

Thanks,
Lieven

These should be "insertion type" buttons - from top - insert into, insert before, insert after.
Currently selected (the one with red tick) says where new widgets should be added (relatively to current selection).

Tips are on the way, I just forgot to add them ;)

takeshimiya

  • Guest
Re: wxSmith - tutorial
« Reply #19 on: November 17, 2005, 12:31:08 am »
and the panels are going to be managed by wxDockIt?

The Falcon

  • Guest
Re: wxSmith - tutorial
« Reply #20 on: November 17, 2005, 04:30:59 am »
To BYO:

    I posted a couple of days ago (my appreciation for the recent wxSmith work) and now I'm back, as promised, with further feedback, observations and possible minor glitches. I've got to say that on the whole my play around with wxSmith has been a really enjoyable experience and I have yet to encounter anything which seems a major bug. Please advise, for future reference, whether posting this type of stuff here is appropriate or is formal bug reporting the more desired option?  OK, well I have not by any means been extensive in my testing/playing but I've done a little bit which has led to the obsrvations outlined below. I hope these help in your quest to get wxSmith to a satisfactory stable state. For reference I am using C::B downloaded from CVS about three days ago, with the bundled RC2 MinGW and wxWidgets-2.6.2 on a Win2000 platform. Well let's get to it:

1. When using the preview facility after only defining a panel and a sizer the minimal preview dialog is displayed. The normal 'x' close button doesn't seem to respond. You can still close if you right click on the header and select 'close', so it's a minor annoyance but I suppose the 'x' close button should really work.

2. The hotkey/accelerator key assignments are not displayed in the preview. i.e. No underlines etc. This seems a bit weird as you can happily play with a combo box and buttons etc. in preview but the first time I saw the buttons I thought I'd forgotten to do the old '&' insertion. I hadn't, it just wasn't reflected in the preview.

3. Subsequent to the already identified 'Black Screen Issue' I noticed that this also occurs when you use the border size spin control in the size options panel. It doesn't do it for ever click, just after a few, and it isn't persistent as it usually returns to normal on clicking up or down to the next value.

4. Another one that may be related to the above (but it's really minor) and may help to lead to the source of the problem is that the size anchor tabs (the little black size tabs around the selected control/widget) flicker madly when you have something selected in wxSmith and use the C::B main menu. It doesn't happen for all menus and I struggled to get a consistent respnse but it does happen if you activate a menu then sweep across the menu titles.

5. When using the properties/events pane to define an event handler you are presented with a small dialog to define the event name. If you choose cancel here, instead of defining a name and pressing OK, the event pane does not re-paint correctly. It will re-paint if you go to the properties tab and then return, but I guess that's not really what you intend.

6. I have a more interesting issue with hidden controls/widgets and their usage with wxSmith but I'm not sure if it's a wxSmith issue. It may be related to wxWidgets, and how they work with sizers (I am reasonably new to both wxWidgets and C::B but ancient as far as C++ and RAD GUI interfaces go) so maybe I just need to be pointed at some documentation on how to manipulate hidden widgets in relation to sizers etc. I notice with interest that when you use the properties window to set the HIDDEN property in wxSmith the selected widget is moved to the top of the display and the container/sizer is resized. Also, when hidden, the widget still appears in the preview facility as if it was still visible. Hmmm. this might be a tad confusing to some. Anyway I tried shifting the widget->hide() code around in the source (and re-compile) and did get it to appear in locations other than at the top of the dialog but as yet I have'nt been able to get it to work properly. Most likely it's a product of my relative inexperience with wxWidgets but any light you can shed on this would be helpful, or is it something I should forward to the wxWidgets forum? Have you experienced any difficulties with this issue in the wxSmith implementation?

Anyway that's it for now, hope some of this helps, and keep up the great work,,,,

Kind Regards,
    The Falcon.  :D

PS: Love the widget multi-select property setting. Sort of didn't ecpect it at this stage but there it is, well done.

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #21 on: November 17, 2005, 12:40:29 pm »
and the panels are going to be managed by wxDockIt?

I don't plan it currently because there was discussion about switching to wxIFM. And I'll wait till there's a final dedcission about that :)

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #22 on: November 17, 2005, 01:17:58 pm »
Please advise, for future reference, whether posting this type of stuff here is appropriate or is formal bug reporting the more desired option?

I advise using SF bug reporting system - Ii will be easy to manage them and hard to forget ;)

Quote
1. When using the preview facility after only defining a panel and a sizer the minimal preview dialog is displayed. The normal 'x' close button doesn't seem to respond. You can still close if you right click on the header and select 'close', so it's a minor annoyance but I suppose the 'x' close button should really work.

This seems to be wxWidgets bug or even more - Windows one. I'll se what can be done but now it will be delayed.

Quote
2. The hotkey/accelerator key assignments are not displayed in the preview. i.e. No underlines etc. This seems a bit weird as you can happily play with a combo box and buttons etc. in preview but the first time I saw the buttons I thought I'd forgotten to do the old '&' insertion. I hadn't, it just wasn't reflected in the preview.

I'll have to take a closer look at this. Sometimes I see underline and sometimes i don't :? Really weird ;)

Quote
3. Subsequent to the already identified 'Black Screen Issue' I noticed that this also occurs when you use the border size spin control in the size options panel. It doesn't do it for ever click, just after a few, and it isn't persistent as it usually returns to normal on clicking up or down to the next value.

This bug seems to be a bigger one :( I have some idea but it will require some time

Quote
4. Another one that may be related to the above (but it's really minor) and may help to lead to the source of the problem is that the size anchor tabs (the little black size tabs around the selected control/widget) flicker madly when you have something selected in wxSmith and use the C::B main menu. It doesn't happen for all menus and I struggled to get a consistent respnse but it does happen if you activate a menu then sweep across the menu titles.

Somehow connected with the previous one. I guess it will have biggest proprity assigned ;)

Quote
5. When using the properties/events pane to define an event handler you are presented with a small dialog to define the event name. If you choose cancel here, instead of defining a name and pressing OK, the event pane does not re-paint correctly. It will re-paint if you go to the properties tab and then return, but I guess that's not really what you intend.

That should be easy. I know that there are more situations like this. If You notice any, please notice me :)

Quote
6. I have a more interesting issue with hidden controls/widgets and their usage with wxSmith but I'm not sure if it's a wxSmith issue. It may be related to wxWidgets, and how they work with sizers (I am reasonably new to both wxWidgets and C::B but ancient as far as C++ and RAD GUI interfaces go) so maybe I just need to be pointed at some documentation on how to manipulate hidden widgets in relation to sizers etc. I notice with interest that when you use the properties window to set the HIDDEN property in wxSmith the selected widget is moved to the top of the display and the container/sizer is resized. Also, when hidden, the widget still appears in the preview facility as if it was still visible. Hmmm. this might be a tad confusing to some. Anyway I tried shifting the widget->hide() code around in the source (and re-compile) and did get it to appear in locations other than at the top of the dialog but as yet I have'nt been able to get it to work properly. Most likely it's a product of my relative inexperience with wxWidgets but any light you can shed on this would be helpful, or is it something I should forward to the wxWidgets forum? Have you experienced any difficulties with this issue in the wxSmith implementation?

Nice catch. But this confusing behaviour seems to be wxWidgets one. Other thing is that wxSmith does not do anything to make it less confusing ;). I'v noticed that sizers check what widgets are hidden inside it and when whole row / column of widgets is hidden, it won't be displayed at all and no place will be reserved for them...
I see only one difference in my case - hidden widgets are not moved to the top of the window but they're placed somewhere betwen it's neighbours. Can You post some screenshoot ?

Quote
Anyway that's it for now, hope some of this helps, and keep up the great work,,,,

Thx for Your work :)

Quote
PS: Love the widget multi-select property setting. Sort of didn't ecpect it at this stage but there it is, well done.

Hmm, can You check again ? You have surprised me too  :D But I'll think about it.


The Falcon

  • Guest
Re: wxSmith - tutorial
« Reply #23 on: November 17, 2005, 04:36:58 pm »
Thanks for the response BYO,

    first off regarding my previous PS: about the multi-select property setting, woops  :? I think I got carried away. I re-checked as advised and I was mistaken. This is a very useful feature though, i.e. being able to select multiple (alike) widgets and setting properties (such as font, or foreground colour) that are common to each widget. I can understand though that it would not be a priority in the short term. Perhaps one for the future enhancements basket.
    OK now to the requested info on the hidden widgets issue. This little test was simply an extension of your excellent little tutorial with a few small features changed to allow me to become more familiar with things. I'll outline what I did so you can get a better idea of the real issue.

1. I created a dialog and inserted a box sizer with vertical orientation.
2. I inserted a wxStaticText label followed by a wxComboBox filled with ten items.
3. I then placed another wxStaticText label below this.
4. To be a little more adventurous I placed a wxStaticBox below at the bottom with horizontal orientation, in this I placed two buttons with a spacer in between, just for kicks.

This is how it looks:



as you can see the object is to select from the wxComboBox and see the selection reflected in the wxStaticText widget. This works nicely until you get a bit fancier and try hiding the wxStaticText widget and displaying it only after a selection has been made from the combo. If you hide it directly from wxSmith->Properties-HIDDEN the widget disappears and some outlined tabs are visible in the design area, at the top of the dialog. It looks like this in wxSmith:



Here's what it looks like when compiled and displayed after first combo selection.



If I move the hide instruction (inserted by wxSmith after property setting) down to the bottom of TestDialog::TestDialog which is my constructor in testdialog.cpp then it comples like this:




The code seems to perform all the right functionality but it's just the weird positioning that causes the problem. I think you are most probably on the mark with thinking it may be a wxWidgets problem, but I hope this all makes it a bit clearer for you. I might poke around the wxWidgets site and see what I can find. If I resolve it I'll get back to you.

Incidentaly, do you want me to post this and perhaps the other points I mentioned last time to the SF bug system? Either way I'll try to do it that way from now on. Thanks for your time.

Regards,
    The Falcon.  :D

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #24 on: November 17, 2005, 06:10:39 pm »
Ok, now I see what's here.

Because sizers position this hidden text, it's place is not set when it's hidden flag is set. I'll have to think on really easy way of representing such widgets in wxSmith cause current representation can be really confusing :)

And the second problem - on runtime You have to call Layout() after hiding / unhiding text.

The Falcon

  • Guest
Re: wxSmith - tutorial
« Reply #25 on: November 18, 2005, 03:49:24 am »
BYO,

    Yep, you're spot on with the wxSizer->Layout() suggestion. If I add this call after the wxSmith block of code (in constructor) and also in the event handler that updates the text value, then everything works as expected. Incidentally calling the Show() method on the wsSizer followed by Layout() also works. I'll leave it in your capable hands as to how you implement this in wxSmith at a later stage.
    One other thing did crop up when I was experimenting with this issue. I have a habit (picked up in VB years ago) of renaming the default widget names e.g. BoxSizer1 becomes MainBoxSizer or whatever. I had at one stage added the following inside the wxSmith comment markers; BoxSizer1->Show(stSelected, false, false), followed by BoxSizer1->Layout(). When I changed the name property afterwords in the property dialog (to MainBoxSizer) all the wxSmith generated code was appropriately renamed, however the two calls I had added were gone, deleted, non-existent :o. Ok, well I guess the general rule, at least for the moment, is stay out of wxSmith's code block.  :lol: It's no great drama, it just caught me by surprise. I mean I can't expect wxSmith to go looking everywhere to check if I have used this (changed) name elsewhere. Of course I have to take responsibility for fixing the references/calls in the combo event handler. The point here I guess is that it was the delete that surprised, if it had simply been left alone (or even miraculously renamed as well) there would have been no surprise, but there you go, life is full of surprises. All the best with your development of wxSmith and other endeavours and thanks for your patient assistance with the issues I raised.  :D

Regards
    The Falcon.

Offline RJP Computing

  • Almost regular
  • **
  • Posts: 135
    • RJP Computing
Re: wxSmith - tutorial
« Reply #26 on: January 16, 2006, 04:55:10 am »
What happened to the tutorial. I can't find it. It doesn't appear in the wiki any more.
- Ryan

Ubuntu/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, ATI Radeon 9600XT 256MB

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: wxSmith - tutorial
« Reply #27 on: January 16, 2006, 08:34:02 am »
What happened to the tutorial. I can't find it. It doesn't appear in the wiki any more.

http://wiki.codeblocks.org/index.php?title=WxSmith_Tutorial_%26_Pointers
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: wxSmith - tutorial
« Reply #28 on: January 16, 2006, 02:39:52 pm »
I can't find it. It doesn't appear in the wiki any more.
Main page -> "Developing for Code::Blocks" (in table of contents) -> "wxSmith Tutorial & Pointers"
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 RJP Computing

  • Almost regular
  • **
  • Posts: 135
    • RJP Computing
Re: wxSmith - tutorial
« Reply #29 on: January 16, 2006, 03:13:12 pm »
Found it.  :oops: Sorry.
- Ryan

Ubuntu/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, ATI Radeon 9600XT 256MB

wxSchmidt

  • Guest
Re: wxSmith - tutorial
« Reply #30 on: November 05, 2007, 06:59:18 pm »
Hi, im new to wxsmith, but it seems to be a powerful GUI-creation-tool.
Are there any other tutorials than "HELLO WORLD" available? :D 8)

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #31 on: November 05, 2007, 10:38:06 pm »
Hi, im new to wxsmith, but it seems to be a powerful GUI-creation-tool.
Are there any other tutorials than "HELLO WORLD" available? :D 8)

Currently AFAIK there are no other tutorials, I could write some but don't have enough time :(. Maybe you could add something there if you figure out how wxSmith works :) I could help in case of problems :)

Regards
  BYO

Offline Adam01

  • Single posting newcomer
  • *
  • Posts: 9
Re: wxSmith - tutorial
« Reply #32 on: August 24, 2008, 12:57:50 am »
Does anyone know how to make a function, called when a button is clicked?
The tutorial uses  frame::OnButtonClick(wxCommandEvent& event){}, but the function prototype needs to the declared first, I did that in the frame class, but still nothing happened.
Does anyone know anything about button events?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: wxSmith - tutorial
« Reply #33 on: August 24, 2008, 09:58:19 am »
Does anyone know how to make a function, called when a button is clicked?
The tutorial uses  frame::OnButtonClick(wxCommandEvent& event){}, but the function prototype needs to the declared first, I did that in the frame class, but still nothing happened.
Does anyone know anything about button events?

If you chose the button in the wxs-tab you see the propertygrid in the resources-tab in the manager.
Between the resouces-tree of your project(s) and the propertygrid belonging to the active element, there are two buttons/icons.
One is activated (the one that looks like a list).
Click on the one with the two curly braces and you can assign an event to the button by chosing "Add new Handler" from the dropdownlist on the right.

Offline Adam01

  • Single posting newcomer
  • *
  • Posts: 9
Re: wxSmith - tutorial
« Reply #34 on: August 24, 2008, 11:11:18 am »
Thanks, I worked that out just after I posted that question.
Does wx have its own threading system?, so I could multi-thread gauges and other animations.

Offline Adam01

  • Single posting newcomer
  • *
  • Posts: 9
Re: wxSmith - tutorial
« Reply #35 on: August 25, 2008, 01:43:30 am »
Also, using wxFileSelector, how can I use ofstream to open the return value?
It is a wxString, but is there anyway to convert it to a char?

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #36 on: September 03, 2008, 10:24:38 pm »
You can use such scheme to convert wxString into const char*:

Code
wxString someString;
const char* chars = someString.mb_str(wxConvLocal);

This may work in many cases but will probably cause big problems when some local characters are used in the path due to different character encodings.

Did you try to use wxFileStream class instead? I'm not familiar with it so I can not tell whether it works like standard iostreams.

Regards
   BYO

Offline Master

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: wxSmith - tutorial
« Reply #37 on: October 04, 2008, 10:28:15 am »
hello , and sorry i just figured it out that i shouldnt have posted here ! ,

many tanx MortenMacFly
 
« Last Edit: October 04, 2008, 06:23:07 pm by Master »
a man's dream is an index to his greatness...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: wxSmith - tutorial
« Reply #38 on: October 04, 2008, 03:50:50 pm »
hello, i got some questions!:
Sorry to interrupt here, but these question go far beyond the scope of our forums. Thus in fact they violate our forum rules. I suggest you ask in a programming and/or wx related forum.
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 Master

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: wxSmith - tutorial
« Reply #39 on: October 04, 2008, 06:25:27 pm »
hello, i got some questions!:
Sorry to interrupt here, but these question go far beyond the scope of our forums. Thus in fact they violate our forum rules. I suggest you ask in a programming and/or wx related forum.
tanx, edited .
a man's dream is an index to his greatness...

Offline Grom

  • Almost regular
  • **
  • Posts: 206
Re: wxSmith - tutorial
« Reply #40 on: October 05, 2008, 01:35:07 am »
hello, i got some questions!:
Sorry to interrupt here, but these question go far beyond the scope of our forums. Thus in fact they violate our forum rules. I suggest you ask in a programming and/or wx related forum.

Edit: [REMOVED NON ENGLISH CONTENT] :lol: :lol: :lol:
« Last Edit: October 05, 2008, 01:58:06 pm by MortenMacFly »
gcc+winXP+suse.

Fex

  • Guest
Re: wxSmith - tutorial
« Reply #41 on: November 02, 2008, 03:14:29 am »
I'm working my way through the wxsmith tutorials. They are really good  :)

I have not worked with wxwidgets before but I do have a fair bit of programming experiance. I have a question about tutorial 4

http://wiki.codeblocks.org/index.php?title=WxSmith_tutorial:_Working_with_multiple_resources

The code says
Code
void Tutorial_4Frame::OnButton3Click(wxCommandEvent& event)
{
    FirstFrame* frm = new FirstFrame(this);
    frm->Show();
}

Shouldn't there be a

Code
delete frm;

in there somewhere to ensure no memory leaks? Or does it automatically handle them somehow?

Fex.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: wxSmith - tutorial
« Reply #42 on: November 02, 2008, 03:05:59 pm »
I learned the hard way, that if you delete a control/frame/window that is owned by wxWidgets, wxWidets will have a stroke and die.

When a wxWidgets owned frame is destroyed by wxWidgets, all its children will be destoyed automatically.

The objects you need to delete are the ones you created outside the wxWidgets knowledge, such as "myvartype* myvar = new (myOwnArray)" etc. wxWidgets doesn't know about these.

There was a good post about this by Thomas on the forum some time back(Here), but the links became obsolete. I think they were these:

http://docs.wxwidgets.org/2.8.6/wx_windowdeletionoverview.html
http://wiki.wxwidgets.org/Avoiding_Memory_Leaks

Key words: wxWidgets ownership responsibility deleting avoiding memory leaks deletion overview
« Last Edit: November 02, 2008, 04:15:59 pm by Pecan »

Fex

  • Guest
Re: wxSmith - tutorial
« Reply #43 on: November 04, 2008, 10:58:45 pm »
Thanks Pecan  :D

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: wxSmith - tutorial
« Reply #44 on: December 26, 2008, 05:28:35 pm »
I learned the hard way, that if you delete a control/frame/window that is owned by wxWidgets, wxWidets will have a stroke and die.

When a wxWidgets owned frame is destroyed by wxWidgets, all its children will be destoyed automatically.

The objects you need to delete are the ones you created outside the wxWidgets knowledge, such as "myvartype* myvar = new (myOwnArray)" etc. wxWidgets doesn't know about these.

There was a good post about this by Thomas on the forum some time back(Here), but the links became obsolete. I think they were these:

http://docs.wxwidgets.org/2.8.6/wx_windowdeletionoverview.html
http://wiki.wxwidgets.org/Avoiding_Memory_Leaks

Key words: wxWidgets ownership responsibility deleting avoiding memory leaks deletion overview

This is a good tutorials on wxWidgets creation and destroying! thanks for your explanation.
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 xuedi

  • Single posting newcomer
  • *
  • Posts: 8
  • www.BeijingLUG.org
    • xuedi’s Carpe Diem LOG
Re: wxSmith - tutorial
« Reply #45 on: January 13, 2009, 08:33:49 am »
Hey there byo!
Thanks a lot lot lot for that great plug in, i just tried SVN_r5382 and i am fascinated of the easy way to use C++ in CodeBlocks plus wxSmith, that combination is amazing, never will do QT nor GTK+ again!!
I hope if CodeBlocks is out at the next release it will start a real cross platform development revolution!!

Thanks and best wishes from Beijing
xuedi

xuedi@beijingcode.org

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith - tutorial
« Reply #46 on: January 21, 2009, 10:56:57 pm »
Great to hear that :) Thanks :)

BYO

jpotter747

  • Guest
Re: wxSmith - tutorial
« Reply #47 on: September 18, 2009, 05:18:57 pm »
I'm just getting started with CodeBlocks and wxSmith.  So far wonderful experience.  However, I'm trying to get scroll bars on a panel to work and am lost.  Is there any tutorial around showing a simple implementation of getting the scroll bars to work?